/* The back office (login, account, users, edit seats, the Gabbai's pages), the members portal and
   the seating chart: the app shell, then the page layouts. Components (buttons, fields, cards,
   tables) are in /ui.css, linked before this file. Colors, fonts, sizes, radii and shadows are the
   tokens in /css/tokens.css (src/design/tokens.js), which every page loads first. */

/* app shell: the frame around the back office's and the members portal's pages (body.app), whose
   markup is in each page and filled by public/lib/session.js (see its header comment):
   - .shell: the back office. .sidebar (brand, nav.nav with its .nav-group > .nav-label + ul, .me
     at its foot) beside .main > .content, which holds the page's .page-head (from /ui.css:
     .page-title with an optional nav.breadcrumb and the h1, .page-actions, then #status and
     #notice) and the page itself. At 900px and narrower .topbar shows (its .menu-button and the
     brand) and the sidebar is a drawer under it (.open, with .drawer-backdrop).
   - .shell.top: the members site. header.topnav (brand, .menu-button, nav.topnav-links) above
     .main; under 640px its links fold behind the menu button (.topnav.open). */
body:has(> .shell) { padding: 0; }
.shell { display: grid; grid-template-columns: 240px minmax(0, 1fr); min-height: 100vh; }
.shell.top { display: block; }
.shell .brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.shell .brand img { display: block; height: auto; mix-blend-mode: multiply; }
.shell .wordmark { font-family: var(--font-serif); font-size: var(--text-xl); font-weight: var(--weight-medium); line-height: 1.1; white-space: nowrap; }
.shell .wordmark small { display: block; margin-top: 3px; font-family: var(--font-ui); font-size: var(--text-ui-xs); font-weight: var(--weight-regular); color: var(--muted); }
.shell .brand:focus-visible { outline: none; border-radius: var(--radius-control); box-shadow: var(--shadow-ring), 0 0 0 1px var(--ink); }

/* The sidebar: brand, the grouped menu, the account at its foot. */
.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: var(--space-5) 14px var(--space-4);
  border-right: 1px solid var(--border);
  background: var(--paper);
}
.sidebar .brand { flex-direction: column; align-items: flex-start; padding: var(--space-1) 10px 18px; }
.sidebar .brand img { width: 168px; }
.sidebar .nav { flex: 1; min-height: 0; overflow-y: auto; }
.nav-group + .nav-group { margin-top: 18px; }
.nav-label { padding: 0 10px 6px; color: var(--muted); font-size: var(--text-ui-xxs); font-weight: var(--weight-strong); letter-spacing: 0.07em; text-transform: uppercase; }
.sidebar .nav ul { margin: 0; padding: 0; list-style: none; }
.sidebar .nav a { display: flex; align-items: center; gap: 10px; height: 32px; padding: 0 10px; border-radius: var(--radius-control); color: var(--nav-ink); font-size: var(--text-ui-base); text-decoration: none; }
.sidebar .nav a svg.icon { color: var(--muted); }
.sidebar .nav a:hover { background: var(--tint); color: var(--ink); }
.sidebar .nav a[aria-current="page"] { background: var(--tint-strong); color: var(--ink); font-weight: var(--weight-strong); }
.sidebar .nav a[aria-current="page"] svg.icon { color: var(--ink); }
.shell :is(.nav, .topnav-links, .me-links) :is(a, .link-button):focus-visible { outline: none; box-shadow: var(--shadow-ring), inset 0 0 0 1px var(--ink); }
/* The account: initials, name, Your account · Log out. Its height is kept while /api/me answers. */
.sidebar .me { display: flex; align-items: center; gap: 10px; min-height: 45px; margin-top: var(--space-3); padding: var(--space-3) var(--space-2) 0; border-top: 1px solid var(--border); }
.me .avatar { display: grid; flex: none; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--ink); color: var(--on-ink); font-size: var(--text-ui-xs); font-weight: var(--weight-semibold); letter-spacing: 0.02em; }
.me .me-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.me .me-name { overflow: hidden; font-size: var(--text-ui-sm); font-weight: var(--weight-strong); text-overflow: ellipsis; white-space: nowrap; }
.me .me-links { color: var(--muted); font-size: var(--text-ui-xs); }
.me .me-links a { color: inherit; text-decoration: none; }
.me .me-links a[aria-current="page"] { color: var(--ink); }
/* "Log out": a button that reads as a link. */
.shell .link-button { display: inline; height: auto; padding: 0; border: 0; border-radius: var(--radius-xs); background: none; box-shadow: none; color: inherit; font: inherit; line-height: inherit; cursor: pointer; }
.me .me-links :is(a, .link-button):hover { background: none; color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }

/* The page beside it (or under the top bar), with room under it for "Powered by SCHWAI" (/ui.css),
   which at this width spans this column only, leaving the sidebar's account in view. */
.shell .main { min-width: 0; padding: 28px var(--space-9) calc(96px + var(--powered-by-height)); }
.shell:not(.top) .powered-by { left: 240px; }
.shell .content { max-width: 1200px; margin: 0 auto; }
/* A page's own main column (860px until its phase restyles it) starts under the title. */
.shell .content > main { margin-right: 0; margin-left: 0; }
.shell .page-head { row-gap: 0; margin-top: 0; }
.shell .page-title { min-width: 0; }
.shell .page-actions { margin-top: var(--space-3); }
.shell .page-actions:empty { display: none; }
.shell .page-head > :is(#status, #notice) { flex-basis: 100%; min-height: 0; margin: 0; }
.shell .page-head > :is(#status, #notice):not(:empty) { margin-top: var(--space-3); }

/* The seating chart keeps its serif inside the app's Inter pages (/admin, /portal/seats): its names are sized for it. */
body.app #chart { font-family: var(--font-serif); }

/* The phone's top bar and the drawer: hidden on a wide screen. */
/* The menu button (only an icon), whatever the page's own button rules say. */
.shell .menu-button { width: var(--size-button); height: var(--size-button); padding: 0; border: 1px solid transparent; border-radius: var(--radius-control); background: transparent; box-shadow: none; color: var(--ink); }
.shell .menu-button:hover { border-color: transparent; background: var(--tint); color: var(--ink); }
.shell .menu-button:focus-visible { outline: none; border-color: var(--ink); box-shadow: var(--shadow-ring); }
.shell .menu-button svg.icon { width: 20px; height: 20px; }
.shell .topbar, .drawer-backdrop { display: none; }

/* The members' top bar: brand, then Portal, Seats, Your account, Log out. */
.topnav { display: flex; align-items: center; gap: var(--space-6); min-height: 60px; padding: 0 max(var(--space-9), (100% - 1200px) / 2); border-bottom: 1px solid var(--border); background: var(--paper); } /* its ends line up with .content */
.topnav[hidden] { display: none; }
.topnav .brand { margin-right: auto; }
.topnav .brand img, .topbar .brand img { width: auto; height: 28px; }
.topnav .menu-button { display: none; }
.topnav-links { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); }
.topnav-links :is(a, .link-button) { display: flex; align-items: center; justify-content: flex-start; height: 32px; padding: 0 10px; border-radius: var(--radius-control); color: var(--nav-ink); font-size: var(--text-ui-base); text-decoration: none; }
.topnav-links :is(a, .link-button):hover { background: var(--tint); color: var(--ink); }
.topnav-links a[aria-current="page"] { background: var(--tint-strong); color: var(--ink); font-weight: var(--weight-strong); }

@media (max-width: 900px) {
  .shell { display: block; }
  .shell .topbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: var(--space-2); height: 56px; padding: 0 var(--space-3); border-bottom: 1px solid var(--border); background: var(--paper); }
  .sidebar {
    position: fixed;
    top: 56px;
    bottom: 0;
    left: 0;
    z-index: 50;
    width: 280px;
    max-width: calc(100vw - var(--space-9));
    height: auto;
    visibility: hidden;
    padding-top: var(--space-4);
    box-shadow: var(--shadow-popover);
    transform: translateX(-100%);
    transition: transform var(--motion-base) var(--motion-ease), visibility 0s linear var(--motion-base);
  }
  .sidebar.open { visibility: visible; transform: none; transition: transform var(--motion-base) var(--motion-ease); }
  .sidebar .brand { display: none; }
  .drawer-backdrop.open { position: fixed; inset: 56px 0 0; z-index: 40; display: block; background: var(--backdrop); }
  html.drawer-open { overflow: hidden; }
  .shell .main { padding: var(--space-6) var(--space-4) calc(var(--space-9) + var(--powered-by-height)); }
  .shell:not(.top) .powered-by { left: 0; }
  .topnav { padding: 0 var(--space-4); }
}
@media (max-width: 640px) {
  .topnav { position: relative; gap: var(--space-2); }
  .topnav .menu-button { display: inline-flex; }
  .topnav-links { position: absolute; top: 100%; right: 0; left: 0; z-index: 20; display: none; flex-direction: column; align-items: stretch; padding: var(--space-2) var(--space-4) var(--space-3); border-bottom: 1px solid var(--border); background: var(--paper); box-shadow: var(--shadow-popover); }
  .topnav.open .topnav-links { display: flex; }
}
@media print {
  .shell { display: block; }
  .shell :is(.sidebar, .topbar, .topnav, .drawer-backdrop) { display: none; }
  .shell .main { padding: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .sidebar, .sidebar.open { transition: none; }
}

/* The seating chart's measures (print sizes below). */
:root {
  --seat-col: minmax(40px, 1fr);
  --edge-col: 22px;
  --track: 11px;
  --name-size: var(--text-seat-name);
  --id-size: var(--text-seat-id);
  --open-fill: var(--seat-open);
  --open-border: var(--seat-open-line);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 0 var(--space-4) var(--space-6);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: var(--text-base);
  line-height: 1.45;
}
a { color: var(--ink); }

header p { margin: 4px 0; }
#status { color: var(--error); min-height: 1.2em; }

/* The seating chart, on a white card. */
#chart-scroll { overflow-x: auto; max-width: 1240px; margin: 14px auto 0; padding: 18px; border: 1px solid var(--rule); border-radius: var(--radius-lg); background: var(--card); }
#chart {
  display: grid;
  column-gap: 2px;
  min-width: 1000px;
  max-width: 1200px;
  margin: 0 auto;
}

.feature {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: var(--name-size);
  font-weight: bold;
  overflow: hidden;
}
.feature.fixture { background: var(--fixture); border: 1px solid var(--field); color: var(--muted); }
.feature.edge { font-size: var(--id-size); }
.feature.vertical { writing-mode: vertical-rl; }
.feature.wall { background: var(--wall); }
.feature.wall.vertical { justify-self: center; width: 25%; }
.feature.wall:not(.vertical) { align-self: center; height: max(3px, 25%); }
.feature.room { background: repeating-linear-gradient(45deg, var(--card) 0 4px, var(--room-hatch) 4px 6px); border: 1px solid var(--seat-line); }

.seat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 1px;
  border: 1px solid var(--seat-line);
  background: var(--card);
  font: inherit;
  color: inherit;
  text-align: center;
  overflow: hidden;
}
/* Light divider at each seat boundary inside a box that covers several seats. */
.seat.taken {
  background-image: linear-gradient(to right, transparent calc(100% - 1px), var(--seat-divider) calc(100% - 1px));
  background-size: calc(100% / var(--seats, 1)) 100%;
  background-repeat: repeat-x;
}
.seat.taken .seat-id { display: none; }
body.admin .seat.taken .seat-id { display: inline; }
/* On the admin page, seats are buttons only for an account that can edit them. */
button.seat { cursor: pointer; }
button.seat.taken:hover, button.seat.taken:focus-visible { outline: 2px solid var(--seat-line); }
.seat-id { font-size: var(--id-size); color: var(--muted); line-height: 1; }
.seat-name { font-size: calc(var(--name-size) * var(--fit, 1)); font-weight: bold; line-height: 1.05; overflow-wrap: anywhere; }
.seat.open { background: var(--open-fill); border: 1px dashed var(--open-border); }
button.seat.open:hover, button.seat.open:focus-visible { background: var(--fixture); outline: 2px solid var(--seat-line); }
/* The members' seat picker (/portal/seats): the household's own seats stand out, and every seat shows its id. */
.seat.mine { background-color: var(--attention); border: 2px solid var(--attention-line); }
/* The seat editor (/admin): a seat a member household picked on the members site. */
.seat.member { background-color: var(--success-soft); border-color: var(--success-line); }
body.member-seats .seat.taken .seat-id { display: inline; }

@media print {
  :root {
    --seat-col: 1fr;
    --edge-col: 13pt;
    --track: 5.6pt;
    --name-size: var(--print-text-seat-name);
    --id-size: var(--print-text-seat-id);
    --open-fill: var(--card);
    --open-border: var(--seat-open-line-print);
  }
  body { -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  .screen-only { display: none; }
  #chart-scroll { overflow: visible; }
  #chart { min-width: 0; max-width: none; width: 100%; column-gap: 1pt; }
  .feature.fixture { background: var(--fixture-print); }
}

/* Form helpers some pages still use (the Gabbai's question label, choices, a ticked line, the time grid's long field). */
.input-long { width: 28em; }
.label { margin: 8px 0 4px; }
.choices { border: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; }
.check { display: block; margin: 4px 0; }

/* The Remove buttons of the saved-card list. */
.saved-card-list button { padding: 3px 10px; font-size: var(--text-xs); border-color: var(--field); color: var(--muted); }
.saved-card-list button:hover { border-color: var(--ink); background: var(--ink); color: var(--on-ink); }

/* auth (/login, /signup, /forgot-password, /reset-password: body.auth; public/lib/auth-page.js):
   at 900px and wider a split screen, the brand panel (.auth-brand: the logo and the shul's name
   with which site this is, the page's own lines, the Hebrew name at its foot) beside the form's
   card (.auth-card; .wide for sign-up); narrower, the brand is a header above the card. A card
   shows one .auth-view at a time: its form, or a state (.auth-state: "Check your inbox") with
   its icon. */
body:has(> .auth-layout) { margin: 0; padding: 0; }
.auth-layout { display: grid; grid-template-columns: minmax(380px, 5fr) minmax(0, 7fr); min-height: 100vh; }
.auth-brand {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  height: 100vh;
  padding: var(--space-9) var(--space-9) calc(var(--space-8) + var(--powered-by-height));
  border-right: 1px solid var(--border);
  background: var(--tint);
}
.auth-brand .brand { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-6); align-self: flex-start; color: var(--ink); text-decoration: none; }
.auth-brand .brand img { display: block; width: 240px; height: auto; mix-blend-mode: multiply; }
.auth-brand .brand:focus-visible { outline: none; border-radius: var(--radius-control); box-shadow: var(--shadow-ring), 0 0 0 1px var(--ink); }
.auth-brand .wordmark { font-family: var(--font-serif); font-size: var(--text-4xl); font-weight: var(--weight-medium); letter-spacing: -0.012em; line-height: 1.1; }
.auth-brand .wordmark small { display: block; margin-top: 10px; color: var(--muted); font-family: var(--font-ui); font-size: var(--text-ui-xxs); font-weight: var(--weight-strong); letter-spacing: 0.07em; line-height: 1; text-transform: uppercase; }
.auth-brand-body { margin-top: auto; padding-top: var(--space-9); }
.auth-brand-body + .auth-hebrew { margin-top: var(--space-7); }
.auth-tagline { max-width: 24em; margin: 0; color: var(--nav-ink); font-family: var(--font-serif); font-size: var(--text-2xl); line-height: 1.45; }
.auth-hebrew { margin: auto 0 0; padding-top: var(--space-5); border-top: 1px solid var(--border); color: var(--muted); font-family: var(--font-serif); font-size: var(--text-md); text-align: left; }

/* Sign-up's three steps in the brand panel (and in one line above its form under 900px). */
.auth-steps-title { margin: 0 0 var(--space-5); color: var(--muted); font-size: var(--text-ui-xxs); font-weight: var(--weight-strong); letter-spacing: 0.07em; text-transform: uppercase; }
.auth-steps { display: flex; flex-direction: column; gap: var(--space-5); margin: 0; padding: 0; list-style: none; counter-reset: step; }
.auth-steps li { position: relative; padding-left: 44px; counter-increment: step; }
.auth-steps li::before {
  content: counter(step);
  position: absolute;
  top: -3px;
  left: 0;
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--border-strong);
  border-radius: 50%;
  background: var(--card);
  font-size: var(--text-ui-sm);
  font-weight: var(--weight-strong);
  font-variant-numeric: tabular-nums;
}
.auth-steps strong { display: block; font-family: var(--font-serif); font-size: var(--text-xl); font-weight: var(--weight-medium); line-height: 1.25; }
.auth-steps span { display: block; margin-top: 2px; color: var(--muted); }
.auth-steps-inline { display: none; }

/* The card and its forms. */
.auth-main { display: flex; flex-direction: column; align-items: center; justify-content: center; min-width: 0; padding: var(--space-8) var(--space-7) calc(var(--space-8) + var(--powered-by-height)); }
.auth-card { width: 100%; max-width: 420px; padding: var(--space-8); }
.auth-card.wide { max-width: 600px; padding: var(--space-7) var(--space-8); }
.auth-card h1 { margin: 0; font-size: var(--text-4xl); }
.auth-card h1:focus { outline: none; }
.auth-lead { margin: var(--space-2) 0 0; color: var(--muted); }
.auth-form { display: flex; flex-direction: column; gap: var(--space-4); margin: var(--space-6) 0 0; }
.auth-form .field { align-items: stretch; }
.auth-form .field > :is(input, .password-field) { width: 100%; }
.auth-form fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.auth-form fieldset.field { display: block; }
.auth-form fieldset.field > legend { margin: 0 0 6px; padding: 0; }
.auth-form fieldset.field > .field-error { margin-top: 6px; }
.auth-form .segmented { display: flex; }
.auth-form .segmented label { flex: 1; justify-content: center; }
.auth-form .segmented.invalid { border-color: var(--error); box-shadow: var(--shadow-danger-ring); }
.auth-form .field-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.auth-form .form-error:empty { display: none; }
/* A field's error replaces its hint while it shows. */
.auth-form .field:has(> .field-error:not(:empty)) > .hint { display: none; }
.auth-form > button { width: 100%; height: var(--size-field); }
/* "or" between Log in and Email me a login link. */
.auth-or { display: flex; align-items: center; gap: var(--space-3); margin: -4px 0; color: var(--muted); font-size: var(--text-ui-xs); }
.auth-or::before, .auth-or::after { content: ""; flex: 1; border-top: 1px solid var(--border); }

/* A password with its show / hide button inside the field (here and on /account). */
.password-field { position: relative; max-width: 100%; }
.password-field input { width: 100%; padding-right: 44px; }
.password-field .password-toggle { position: absolute; top: 4px; right: 4px; color: var(--muted); }
.password-field .password-toggle:hover:not(:disabled) { color: var(--ink); }
.password-field .password-toggle[aria-pressed="true"] { color: var(--ink); }

/* Sign-up's home field and its suggestions (public/signup.js), a list floating under the field. */
.combo { position: relative; }
.auth-form .field > .combo > input { width: 100%; }
.suggestions {
  position: absolute;
  z-index: 2;
  top: calc(100% + var(--space-1));
  right: 0;
  left: 0;
  max-height: 320px;
  margin: 0;
  padding: var(--space-1);
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-inset);
  background: var(--card);
  box-shadow: var(--shadow-popover);
  list-style: none;
}
.suggestions li { padding: var(--space-2) var(--space-3); border-radius: var(--radius-md); cursor: pointer; }
.suggestions li:hover { background: var(--tint); }
.suggestions li[aria-selected="true"] { background: var(--tint-strong); }

/* A state instead of the form: "Check your inbox", "Your password is changed". */
.auth-state > * { margin: 0; }
.auth-state > * + * { margin-top: var(--space-3); }
.auth-state > h1 { margin-top: var(--space-5); }
.auth-state-icon { display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--border); border-radius: 50%; background: var(--tint); color: var(--ink); }
.auth-state-icon.success { border-color: var(--success-line); background: var(--success-soft); color: var(--success); }
.auth-state-icon svg.icon { width: 20px; height: 20px; }
.auth-state strong { font-weight: var(--weight-strong); overflow-wrap: anywhere; }
body .auth-state > .hint { margin-top: var(--space-3); font-size: var(--text-ui-sm); } /* ui.css's .hint has no margin */
.auth-state > .button { width: 100%; height: var(--size-field); margin-top: var(--space-6); }
.auth-next { padding: 14px var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-inset); background: var(--tint); }
.auth-next > p { margin: 0; color: var(--muted); font-size: var(--text-ui-label); font-weight: var(--weight-medium); }
.auth-next ol { margin: var(--space-2) 0 0; padding-left: 1.3em; }
.auth-next li + li { margin-top: var(--space-1); }
/* "Use a different email": a button that reads as a link. */
.auth-card .link-button { display: inline; height: auto; padding: 0; border: 0; border-radius: var(--radius-xs); background: none; box-shadow: none; color: var(--ink); font: inherit; font-weight: var(--weight-strong); line-height: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; cursor: pointer; }
.auth-card .link-button:hover:not(:disabled) { border: 0; background: none; text-decoration-color: currentColor; }
.auth-card .notice { margin: var(--space-5) 0 0; }
.auth-card .notice a { color: inherit; font-weight: var(--weight-strong); }

/* The links under the card. */
.auth-foot { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--space-2) var(--space-6); margin: var(--space-5) 0 0; color: var(--muted); font-size: var(--text-ui-sm); }
.auth-foot a { color: inherit; text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.auth-foot a:hover { color: var(--ink); text-decoration-color: currentColor; }

@media (max-width: 900px) {
  .auth-layout { display: block; }
  .auth-brand { position: static; height: auto; padding: var(--space-3) var(--space-4); border-right: 0; border-bottom: 1px solid var(--border); background: var(--paper); }
  .auth-brand .brand { flex-direction: row; align-items: center; gap: 10px; }
  .auth-brand .brand img { width: auto; height: 28px; }
  .auth-brand .wordmark { font-size: var(--text-xl); }
  .auth-brand .wordmark small { margin-top: 3px; }
  .auth-brand-body, .auth-hebrew { display: none; }
  .auth-main { justify-content: flex-start; padding: var(--space-7) var(--space-4) calc(var(--space-9) + var(--powered-by-height)); }
  .auth-steps-inline { display: block; }
}
@media (max-width: 560px) {
  .auth-card, .auth-card.wide { padding: var(--space-6) var(--space-5); }
  .auth-form .segmented label { padding: 0 var(--space-2); white-space: nowrap; }
  .auth-card h1 { font-size: var(--text-3xl); }
  .auth-form .field-pair { grid-template-columns: minmax(0, 1fr); }
}

/* account (/account: body.app, in the back office's sidebar or the members' top bar;
   public/account.js): the must-change notice, then the profile and the password form, two cards
   side by side on a wide screen. */
.account { max-width: 960px; }
.account-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); align-items: start; }
.account .card { padding: 0; }
.account .card > h2 { margin: 0; padding: var(--space-5) var(--space-6) 0; font-size: var(--text-xl); }
.account .card-body { padding: var(--space-4) var(--space-6) var(--space-6); }
.account .card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-3) var(--space-4); padding: var(--space-3) var(--space-6); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-card) var(--radius-card); background: var(--tint); }
.account .card-foot > p { margin-right: auto; }
.account .card-foot > p:empty { display: none; }
.account-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 14px var(--space-6); margin: 0; }
.account-facts dt { color: var(--muted); font-size: var(--text-ui-label); font-weight: var(--weight-medium); line-height: 22px; }
.account-facts dd { margin: 0; overflow-wrap: anywhere; }
.account-facts .roles { display: flex; flex-wrap: wrap; gap: 6px; }
.account form .field { align-items: stretch; }
.account form .field + .field { margin-top: var(--space-4); }
.account .notice .link-button { margin-left: auto; color: inherit; font-weight: var(--weight-strong); text-decoration: underline; text-underline-offset: 3px; }
.account-loading .skeleton.block { height: 240px; margin: 0; }
@media (max-width: 760px) {
  .account-grid { grid-template-columns: minmax(0, 1fr); }
}

/* hebrew keyboard (public/lib/hebrew-keyboard.js), on every body.app page: the "א" key sits
   inside its field, at the end the text grows toward (the left of a right-to-left field, else the
   right), and the keyboard opens under the field, in the page's flow, never over it. The wrapper
   (.hebrew-field) is as wide as its field; a page whose field fills its column makes the wrapper
   fill it (display: flex; width: 100%) and the field grow in it, as the people rows do. These
   rules weigh one class, so a page's own .page .hebrew-field wins. The keyboard's right margin
   fills the rest of the line, so it always wraps under the field, whatever the field's flex. */
:where(body.app) .hebrew-field { position: relative; display: inline-flex; flex-wrap: wrap; align-items: flex-start; gap: 0; max-width: 100%; vertical-align: top; }
:where(body.app) .hebrew-field > :is(input, textarea) { min-width: 0; padding-right: 40px; }
:where(body.app) .hebrew-field > [dir="rtl"] { padding-right: var(--space-3); padding-left: 38px; }
:where(body.app) .hebrew-toggle { position: absolute; top: 6px; right: 6px; z-index: 1; width: 26px; height: 26px; padding: 0; border-radius: var(--radius-md); background: var(--paper); box-shadow: none; font-family: var(--font-serif); font-size: var(--text-ui); font-weight: var(--weight-regular); }
:where(body.app) .hebrew-field:has(> [dir="rtl"]) > .hebrew-toggle { right: auto; left: 6px; }
:where(body.app) .hebrew-keyboard { position: relative; z-index: 2; display: flex; flex-basis: 100%; flex-direction: column; gap: var(--space-1); min-width: min(26em, calc(100vw - 64px)); max-width: 26em; margin-top: 6px; margin-right: calc(100% - 26em); padding: var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-inset); background: var(--paper); box-shadow: var(--shadow-popover); direction: ltr; }
:where(body.app) .hebrew-row { display: flex; gap: var(--space-1); }
:where(body.app) .hebrew-keyboard button { flex: 1 1 0; min-width: 0; height: 34px; padding: 0; font-family: var(--font-serif); font-size: var(--text-md); font-weight: var(--weight-regular); }

/* people rows (public/lib/people-editor.js's rows: /household's Family section, the directory's
   home dialog; any page whose rows sit under .people-rows): one row of fields per person, the
   column names once above each group (.people-head), labelled fields two to a line when the
   group is too narrow (a container query on .people-block). An adult's row starts with the
   "Head" radio (a child's with an empty cell of its width, so the names line up); the Hebrew
   name pair (.pf-pair, dir="rtl") is one cell: the Hebrew name on the right, בן / בת in the
   middle, the father's Hebrew name on the left, each field's label above it (.head-pair is its
   column names). */
:is(.household, .people-rows) .people-block { container: people / inline-size; }
:is(.household, .people-rows) .people-head, :is(.household, .people-rows) .person { display: grid; column-gap: var(--space-2); align-items: end; padding: 0; border-bottom: 0; }
/* Fields keep to the top of their row when a Hebrew keyboard opens under one of them. */
:is(.household, .people-rows) .person { align-items: start; }
:is(.household, .people-rows) :is(.people-head.adults, .adults > .person) { grid-template-columns: 44px minmax(0, 120px) minmax(0, 100px) minmax(0, 336px) minmax(0, 1fr) minmax(0, 136px) 132px; }
:is(.household, .people-rows) :is(.people-head.children, .children > .person) { grid-template-columns: 44px minmax(0, 120px) minmax(0, 100px) minmax(0, 156px) 16px minmax(0, 64px) minmax(0, 336px) 132px; }
:is(.household, .people-rows) .person .pf-head { flex-direction: row; align-items: center; justify-content: center; gap: var(--space-2); height: var(--size-field); }
:is(.household, .people-rows) .person .head-pick { width: 16px; height: 16px; }
/* The pair: two columns of fields with the word between, labels in the first row, fields in the second. */
:is(.household, .people-rows) :is(.pf-pair, .head-pair) { display: grid; grid-template-columns: minmax(0, 1fr) 40px minmax(0, 1fr); column-gap: var(--space-2); min-width: 0; }
:is(.household, .people-rows) .pf-pair { grid-template-rows: auto auto; align-items: start; }
:is(.household, .people-rows) .pf-pair > .pf { display: contents; }
:is(.household, .people-rows) .pf-pair .pf-label { grid-row: 1; align-self: end; margin-bottom: 6px; direction: ltr; }
:is(.household, .people-rows) .pf-pair .hebrew-field { grid-row: 2; direction: ltr; }
:is(.household, .people-rows) .pf-pair > .pf:first-child > * { grid-column: 1; }
:is(.household, .people-rows) .pf-pair > .pf:last-child > * { grid-column: 3; }
:is(.household, .people-rows) .ben-word { display: flex; grid-row: 2; grid-column: 2; align-items: center; justify-content: center; height: var(--size-field); color: var(--muted); font-family: var(--font-serif); font-size: var(--text-md); white-space: nowrap; }
:is(.household, .people-rows) .head-pair > span { direction: ltr; }
/* The Hebrew name's keyboard lines up with the field's right edge (the father's, as every other, with its left edge), so neither runs off a phone's screen. */
:is(.household, .people-rows) .pf-pair > .pf:first-child .hebrew-keyboard { margin-right: 0; margin-left: calc(100% - min(26em, calc(100vw - 64px))); }
:is(.household, .people-rows) .people-head { margin-bottom: 6px; color: var(--muted); font-size: var(--text-ui-label); font-weight: var(--weight-medium); line-height: 1.3; }
:is(.household, .people-rows) .people { display: flex; flex-direction: column; gap: var(--space-2); }
:is(.household, .people-rows) .pf { display: flex; flex-direction: column; gap: 6px; min-width: 0; margin: 0; }
:is(.household, .people-rows) .pf-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:is(.household, .people-rows) .person :is(input, select) { width: 100%; min-width: 0; }
:is(.household, .people-rows) .pf-or { display: flex; align-items: center; justify-content: center; height: var(--size-field); color: var(--muted); font-size: var(--text-ui-sm); }
:is(.household, .people-rows) .person-actions { display: flex; align-items: center; justify-content: flex-start; gap: var(--space-1); min-height: var(--size-field); }
:is(.household, .people-rows) .login-tag { display: inline-flex; align-items: center; gap: 5px; padding: 0 var(--space-1); color: var(--muted); font-size: var(--text-ui-xs); white-space: nowrap; }
:is(.household, .people-rows) .login-tag svg.icon { width: 13px; height: 13px; }
:is(.household, .people-rows) .remove-line { color: var(--muted); }
:is(.household, .people-rows) .remove-line:hover:not(:disabled) { color: var(--ink); }
:is(.household, .people-rows) .email-problem { display: flex; flex-wrap: wrap; grid-column: 1 / -1; align-items: center; gap: 6px; margin: 2px 0 var(--space-1); color: var(--error); font-size: var(--text-ui-xs); }
:is(.household, .people-rows) .email-problem svg.icon { width: 14px; height: 14px; }
:is(.household, .people-rows) .add-row { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-left: calc(-1 * var(--space-3)); }
/* A Hebrew name fills its column (the keyboard's key inside it: see "hebrew keyboard"); the keyboard opens under the row. */
:is(.household, .people-rows) .person .hebrew-field { display: flex; width: 100%; }
:is(.household, .people-rows) .person .hebrew-field > input { flex: 1 1 100%; }
/* Too narrow for one row per person: each person's fields wrap, labelled, two to a line on a phone. */
@container people (max-width: 900px) {
  :is(.household, .people-rows) .people-head { display: none; }
  :is(.household, .people-rows) :is(.adults, .children) > .person { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: var(--space-3) var(--space-2); align-items: end; padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
  :is(.household, .people-rows) .pf-label { position: static; width: auto; height: auto; overflow: visible; clip: auto; color: var(--muted); font-size: var(--text-ui-label); font-weight: var(--weight-medium); }
  :is(.household, .people-rows) :is(.pf-or, .pf-head-space) { display: none; }
  :is(.household, .people-rows) .person .pf-head { justify-content: flex-start; }
  :is(.household, .people-rows) .pf-pair { grid-column: 1 / -1; justify-self: start; width: min(100%, 480px); }
  :is(.household, .people-rows) .person-actions { grid-column: 1 / -1; justify-content: flex-end; }
  /* A child's Age stays level with the birth date, whose age line under it would push Age down. */
  :is(.household, .people-rows) .children > .person { align-items: start; }
  /* iPhone Safari draws a date field wider than its column unless its native look is off. */
  :is(.household, .people-rows) .person input[type="date"] { -webkit-appearance: none; appearance: none; }
  :is(.household, .people-rows) .person input[type="date"]::-webkit-date-and-time-value { text-align: left; }
}
@container people (max-width: 420px) {
  :is(.household, .people-rows) :is(.adults, .children) > .person { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  :is(.household, .people-rows) .person label.adult-only { grid-column: 1 / -1; }
}

/* Households: the list, membership types, one household (/household) */
.list-search { display: flex; flex-wrap: wrap; gap: var(--space-2); align-items: center; margin-bottom: var(--space-2); }
/* Paying by card (/portal, /household): Banquest's card fields sit in their own iframe. */
.card-part { margin-top: var(--space-4); }
.card-part form > label { display: inline-flex; flex-direction: column; gap: 2px; margin-top: var(--space-2); }
.card-fields { max-width: 26em; min-height: 120px; margin: var(--space-2) 0; }
/* "Save this card for next time" is hidden where the card is always saved (automatic payment, a monthly donation); .check would show it. */
.card-part .check[hidden] { display: none; }
/* Card logos (public/cards/, /lib/card-brands.js): the accepted cards above the card fields, the
   saved cards (the pay form's picker and the "Saved cards" list) and a card in the histories. */
img.card-brand { vertical-align: middle; }
.card-with-logo img.card-brand { margin-right: var(--space-1); }
.card-brands { display: flex; flex-wrap: wrap; gap: var(--space-1); margin-top: var(--space-2); }
.saved-cards { border: none; margin: var(--space-2) 0; padding: 0; }
.saved-cards legend { padding: 0; color: var(--muted); font-size: var(--text-ui); }
.saved-card, .saved-card-list li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); }
.saved-card { margin: var(--space-1) 0; }
.saved-card-list { list-style: none; margin: 0; padding: 0; }
.saved-card-list li { padding: var(--space-1) 0; border-bottom: 1px solid var(--rule); }
.saved-card.expired, .saved-card-list li.expired { color: var(--muted); }
.saved-card.expired img.card-brand, .saved-card-list li.expired img.card-brand { opacity: 0.5; }
.card-expiry { color: var(--muted); font-size: var(--text-sm); }
.card-tag { color: var(--muted); font-size: var(--text-xs); border: 1px solid var(--rule); border-radius: var(--radius-sm); padding: 0 var(--space-1); }
/* The monthly donations (/portal, /household; /lib/donations.js): each with its facts and its buttons. */
.pledge-list { list-style: none; margin: 0; padding: 0; }
.pledge-list > li { padding: var(--space-2) 0; border-bottom: 1px solid var(--rule); }
.pledge-list p { margin: 0 0 var(--space-1); }
.pledge-sums { color: var(--muted); font-size: var(--text-ui); }
.pledge.cancelled .pledge-head strong { color: var(--muted); }
.pledge-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
/* Donations (/portal, /household; /lib/donations.js): once or every month, and what only a monthly one asks. Monthly donations are listed like pledges. */
.donate-how { margin-top: var(--space-2); }
.donate-monthly { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-3); margin-top: var(--space-2); }
.donate-monthly[hidden] { display: none; }
.donate-monthly label { display: flex; flex-direction: column; gap: 2px; }


/* email (/email; public/email.js) and a send's progress wherever it shows (/lib/send-progress.js,
   /lib/sheet-email.js on /gabbai and /gabbai/fast): the loading placeholders; the announcement form
   beside the subscribers and the addresses we no longer email (stacked under 1000px); the sent
   history (.data-table, the failures in a row under their send); the progress bar ("312 of 400
   sent…"); the "already sent" warning in the confirm dialog. */
.email-loading { display: flex; flex-direction: column; gap: var(--space-5); }
.email-loading .skeleton.block { margin: 0; }
.email-loading .skeleton.block.tall { height: 420px; }
.email:where(main) { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
.email-top { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: var(--space-6); align-items: start; }
.email:where(main) h2 { margin: 0 0 var(--space-2); }
.email:where(main) h2 .count { margin-left: 6px; color: var(--muted); font-family: var(--font-ui); font-size: var(--text-ui-base); font-weight: var(--weight-regular); }
.email:where(main) .card > .hint { margin: 0 0 var(--space-4); }
.email-write form { display: flex; flex-direction: column; gap: var(--space-4); }
.email-write .field > input, .email-write .field > .hebrew-field { width: 100%; max-width: 640px; }
.email-write .field > textarea, .email-write .field > .hebrew-field:has(textarea) { width: 100%; max-width: none; }
.email-write .hebrew-field { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-1); }
.email-write .hebrew-field > :is(input, textarea) { flex: 1 1 0; min-width: 0; }
.email-write textarea { min-height: 240px; }
.email-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-3); margin: var(--space-2) calc(-1 * var(--space-6)) calc(-1 * var(--space-6)); padding: var(--space-3) var(--space-6); border-top: 1px solid var(--border); border-radius: 0 0 var(--radius-card) var(--radius-card); background: var(--tint); }
.email-outcome { display: flex; flex: 1 1 240px; flex-wrap: wrap; gap: var(--space-1) var(--space-4); min-width: 0; }
.email-outcome > p:empty { display: none; }
.email-side { display: flex; flex-direction: column; gap: var(--space-5); }
.email-side .card { padding: var(--space-5); }
.list-counts { display: grid; gap: 1px; margin: 0 0 var(--space-4); overflow: hidden; border: 1px solid var(--border); border-radius: var(--radius-inset); background: var(--border); }
:where(.list-counts) > .list-count { margin: 0; padding: var(--space-3) var(--space-4); background: var(--card); }
:where(.list-counts) > .list-count dt { color: var(--muted); font-size: var(--text-ui-label); font-weight: var(--weight-medium); }
:where(.list-counts) > .list-count dd { margin: var(--space-1) 0 0; font-size: var(--text-2xl); font-weight: var(--weight-strong); letter-spacing: -0.02em; line-height: 1.2; font-variant-numeric: tabular-nums; }
.email-side .card > .hint:last-child { margin: 0; }
.email-none { margin: 0; color: var(--muted); }
.problem-list { margin: 0; padding: 0; list-style: none; }
.problem-list li { display: flex; flex-direction: column; gap: 6px; padding: 10px 0; border-top: 1px solid var(--border); }
.problem-list li:first-child { border-top: 0; padding-top: 0; }
.problem-email { overflow-wrap: anywhere; font-weight: var(--weight-medium); }
.problem-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); font-size: var(--text-ui-sm); }
.email-head { margin-bottom: var(--space-4); }
.email-head h2 { margin: 0; }
.sends-table .send-what { min-width: 260px; }
.sends-table .send-what .chip { margin-right: var(--space-2); }
.sends-table .send-what .chip::before { display: none; }
.sends-table td.failed { color: var(--error); font-weight: var(--weight-strong); }
.sends-table td.num .quiet { height: var(--size-button-sm); margin-left: var(--space-1); padding: 0 var(--space-2); font-weight: var(--weight-medium); }
.sends-table tr.failures-row td { padding-top: 0; background: var(--paper); }
.sends-table tr.failures-row:hover td { background: var(--paper); }
.sends-table tr:has(+ tr.failures-row) td { border-bottom: 0; }
.send-failures { margin: 0; padding: 0; list-style: none; color: var(--error); font-size: var(--text-ui-sm); text-align: left; }
.send-failures li { padding: 2px 0; overflow-wrap: anywhere; }
.send-failures strong { font-weight: var(--weight-medium); }
/* The progress: a slim bar and its words. */
.send-line { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; color: var(--muted); font-size: var(--text-ui-sm); font-variant-numeric: tabular-nums; white-space: nowrap; }
.send-bar { width: 120px; height: 6px; overflow: hidden; border: 0; border-radius: var(--radius-pill); background: var(--tint-strong); appearance: none; -webkit-appearance: none; }
.send-bar::-webkit-progress-bar { border-radius: var(--radius-pill); background: var(--tint-strong); }
.send-bar::-webkit-progress-value { border-radius: var(--radius-pill); background: var(--ink); transition: width var(--motion-base) var(--motion-ease); }
.send-bar::-moz-progress-bar { border-radius: var(--radius-pill); background: var(--ink); }
.send-line.has-failures .send-text { color: var(--error); }
/* Under the sheets' email buttons (/gabbai, /gabbai/fast): the subject, the bar, the failures. */
.send-progress { display: flex; flex-basis: 100%; flex-direction: column; align-items: center; gap: var(--space-1); }
.send-progress:empty { display: none; }
.send-progress p { margin: 0; }
.send-progress .send-subject { font-size: var(--text-ui-sm); font-weight: var(--weight-medium); }
.send-progress .send-bar { width: 200px; }
/* The confirm dialog's "already sent" warning. */
body.app dialog .send-warning { margin: var(--space-4) 0 0; }
body.app dialog .send-warning span { display: block; color: inherit; }
body.app dialog .send-warning span + span { margin-top: 6px; }
@media (max-width: 1000px) {
  .email-top { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .email:where(main) { gap: var(--space-7); }
  .email-write { padding: var(--space-5) var(--space-4); }
  .email-foot { margin: var(--space-2) calc(-1 * var(--space-4)) calc(-1 * var(--space-5)); padding: var(--space-3) var(--space-4); }
  .email-foot button { flex: 1 1 auto; }
  .email-write textarea { min-height: 160px; }
  .email-side .card { padding: var(--space-4); }
}

/* dashboard (/dashboard; public/dashboard.js): the date and week under the title, the loading
   placeholders, "Needs attention" (or the all-clear line), then sections each with a head (h2 and
   a link to their page), .stats tiles, small tables (.dash-grid of .dash-panel) and the recent
   changes as a feed (.feed: avatar, sentence, time). */
#today > span + span::before { content: "·"; margin-right: 10px; color: var(--border-strong); }
#today .skeleton { width: 280px; margin: 0; }
#status .notice { align-items: center; }
#status .notice > p { flex: 1; }
.dash-loading { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-5); }
.dash-loading .card .skeleton.title { width: 30%; margin-top: 0; }
.dashboard { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
.dashboard h3 { margin: var(--space-6) 0 var(--space-3); font-size: var(--text-ui-sm); font-weight: var(--weight-semibold); }
.dash-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); margin-bottom: var(--space-4); }
.dash-head h2 { margin: 0; }
.dash-head a, .attention-link, .feed-link { color: var(--muted); font-size: var(--text-ui-sm); text-decoration: none; white-space: nowrap; }
.dash-head a:hover, .attention-link:hover, .feed-link:hover { color: var(--ink); text-decoration: underline; text-underline-offset: 2px; }
.dash-note { margin: calc(-1 * var(--space-2)) 0 var(--space-4); color: var(--muted); font-size: var(--text-ui-sm); }
.dashboard .data-table a { text-underline-offset: 2px; text-decoration-color: var(--border-strong); }
.dashboard .data-table a:hover { text-decoration-color: currentColor; }
.dashboard .data-table td.num a { font-weight: var(--weight-strong); }
/* Names stay on one line; on a phone the table scrolls inside its frame instead. */
.dashboard :is(.blocks-table, .gabbai-table) td:first-child { white-space: nowrap; }
.dashboard .gabbai-table td:nth-child(2) { min-width: 14em; }
.dashboard .failed { color: var(--error); font-weight: var(--weight-strong); }
.dashboard .stat-meta .status-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.dash-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: var(--space-5); align-items: start; }
.dash-grid h3 { margin-top: var(--space-6); }

/* Needs attention: one line per thing, its icon tinted by how urgent it is. */
.attention { padding: var(--space-5) var(--space-6) var(--space-2); }
.attention h2 { display: flex; align-items: center; gap: 10px; margin: 0 0 var(--space-2); }
.attention h2 .chip { font-family: var(--font-ui); }
.attention h2 .chip::before { display: none; }
.attention-list { margin: 0; padding: 0; list-style: none; }
.attention-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) auto; align-items: center; gap: var(--space-4); padding: 14px 0; }
.attention-item + .attention-item { border-top: 1px solid var(--border); }
.attention-icon { display: grid; place-items: center; width: 32px; height: 32px; border-radius: var(--radius-control); }
.attention-item.danger .attention-icon { background: var(--danger-soft); color: var(--error); }
.attention-item.warning .attention-icon { background: var(--warning-soft); color: var(--warning); }
.attention-text { display: flex; flex-wrap: wrap; column-gap: 10px; min-width: 0; }
.attention-text strong { font-weight: var(--weight-strong); }
.attention-detail { color: var(--muted); }
.attention-link { display: inline-flex; align-items: center; gap: var(--space-1); color: var(--ink); font-weight: var(--weight-medium); }
.all-clear { display: flex; align-items: center; gap: var(--space-2); margin: 0; padding: var(--space-4) var(--space-5); border: 1px solid var(--success-line); border-radius: var(--radius-card); background: var(--success-soft); color: var(--success); font-weight: var(--weight-medium); }
.dash-loading[hidden], .dashboard[hidden], .all-clear[hidden] { display: none; }

/* Recent changes */
.feed-card { padding: var(--space-2) var(--space-6); }
.feed { margin: 0; padding: 0; list-style: none; }
.feed li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; align-items: start; gap: var(--space-3); padding: var(--space-3) 0; }
.feed li + li { border-top: 1px solid var(--border); }
.avatar { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--tint-strong); color: var(--ink); font-size: var(--text-ui-xxs); font-weight: var(--weight-semibold); letter-spacing: 0.02em; }
.avatar.system { background: var(--tint); color: var(--muted); }
.feed-text { margin: 4px 0 0; }
.feed-text strong { font-weight: var(--weight-strong); }
.feed-link { margin-left: var(--space-1); }
.feed-time { margin-top: 4px; color: var(--muted); font-size: var(--text-ui-sm); white-space: nowrap; font-variant-numeric: tabular-nums; }
.feed-empty { margin: var(--space-4) 0; color: var(--muted); }
.feed-more { padding: var(--space-2) 0 var(--space-3); border-top: 1px solid var(--border); }

@media (max-width: 640px) {
  .dashboard { gap: var(--space-7); }
  #today > span + span::before { display: none; }
  .dashboard .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard .stats > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .dashboard .stat { padding: 14px var(--space-4) var(--space-4); }
  .attention { padding: var(--space-4) var(--space-4) var(--space-1); }
  .attention-item { grid-template-columns: 32px minmax(0, 1fr); row-gap: var(--space-2); }
  .attention-link { grid-column: 2; }
  .feed-card { padding: var(--space-1) var(--space-4); }
  .feed li { grid-template-columns: 28px minmax(0, 1fr); row-gap: var(--space-1); }
  .feed-time { grid-column: 2; margin-top: 0; }
  .dash-grid { grid-template-columns: minmax(0, 1fr); }
}

/* seat editor (/admin; public/admin.js): the legend and the "Saved G7" line above the chart, the
   chart's own card (#chart-scroll, scrolling sideways inside it on a narrow screen, a grey block
   until the seats load), and the edit dialog (Free seat at the left of its footer). The legend's
   swatches are the chart's own .seat.open / .seat.taken / .seat.member. A member's seat's dialog
   opens with a notice naming the family (#edit-member). */
.seat-editor .seat-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-6); min-height: var(--size-button); margin-bottom: var(--space-3); }
.seat-legend { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: var(--text-ui-sm); }
.seat-legend li { display: inline-flex; align-items: center; gap: var(--space-2); }
.seat-legend .seat { display: inline-block; width: 28px; height: 18px; padding: 0; }
.seat-editor #saved:empty { display: none; }
.seat-editor #chart-scroll { 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); }
/* A little narrower than the public chart's seats, so the whole room fits beside the menu at 1440px. */
@media screen { .seat-editor #chart { --seat-col: minmax(37px, 1fr); } }
.seat-editor #chart > .skeleton.block { grid-column: 1 / -1; height: 520px; margin: 0; }
.seat-dialog form { margin-top: var(--space-4); }
.seat-dialog #edit-member { margin: var(--space-4) 0 0; }
.seat-dialog .field > input { width: 100%; }
.seat-dialog .form-error:empty { display: none; }
/* Printed (the Print button): one Letter landscape page (the @page rule is in admin.html) of the
   logo and title, the chart as the public one prints it (names only: no seat ids on named seats,
   no member's-seat color) and the note on asking for a seat. */
.seat-editor .print-head, .seat-editor .print-note { display: none; }
@media print {
  body.admin { background: var(--card); }
  body.admin .page-head, .seat-editor .seat-toolbar { display: none; }
  body.admin .content { max-width: none; }
  .seat-editor .print-head { display: flex; align-items: center; gap: 10pt; margin-bottom: 6pt; }
  .seat-editor .print-head img { width: auto; height: 0.35in; mix-blend-mode: multiply; }
  .seat-editor .print-head h2 { margin: 0; font-family: var(--font-serif); font-size: var(--print-text-2xl); font-weight: 700; }
  .seat-editor #chart-scroll { padding: 0; border: 0; border-radius: 0; box-shadow: none; }
  body.admin .seat.taken .seat-id { display: none; }
  .seat-editor .seat.member { background-color: var(--card); border-color: var(--seat-line); }
  .seat-editor .print-note { display: block; margin: 6pt 0 0; font-family: var(--font-serif); font-size: var(--print-text-2xs); line-height: 1.35; }
}
.seat-dialog .form-error { margin-top: var(--space-3); }
.seat-dialog .dialog-actions #edit-free { margin-right: auto; }
@media (max-width: 640px) {
  .seat-editor #chart-scroll { padding: var(--space-3); }
}

/* donations (/donations; public/donations.js): the loading placeholders, the card payments that
   need you (the dashboard's .attention card, its Charged / Not charged buttons at the right), the
   figures (.stats), the gifts (a tall .data-table with its search and sortable Date and Amount),
   then the open pledges (with a total row) and the monthly donations (the list /lib/donations.js
   makes) side by side. A cell's second line (.sub) is muted. */
.donations-loading { display: flex; flex-direction: column; gap: var(--space-5); }
.donations-loading .skeleton.block { margin: 0; }
.donations-loading .skeleton.block.tall { height: 420px; }
.donations { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-8); }
.donations .attention > .hint { margin: 0 0 var(--space-1); }
.donations .attention h2 .chip[hidden] { display: none; }
.donations .row-actions { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-1); }
.donations-outcome { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); }
.donations-outcome:not(:has(> p:not(:empty))) { display: none; }
.donations-outcome > p:empty { display: none; }
.donations .attention .donations-outcome { padding: var(--space-3) 0 var(--space-4); border-top: 1px solid var(--border); }
.donations-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-4); margin-bottom: var(--space-4); }
.donations-head h2 { margin: 0; }
.donations-head h2 .count { margin-left: 6px; color: var(--muted); font-family: var(--font-ui); font-size: var(--text-ui-base); font-weight: var(--weight-regular); }
.donations-search input { width: 300px; }
.donations .data-table td { vertical-align: top; }
.donations .data-table .sub { display: block; margin-top: 2px; color: var(--muted); font-size: var(--text-ui-sm); }
.donations .data-table .money { font-weight: var(--weight-medium); }
.donations .data-table td.num .chip { margin-right: var(--space-1); vertical-align: 1px; }
.donations .data-table td.num .chip::before { display: none; }
.donations .data-table a { text-underline-offset: 2px; text-decoration-color: var(--border-strong); }
.donations .data-table a:hover { text-decoration-color: currentColor; }
.donations .gifts-table .gift-for { min-width: 200px; }
.donations .gifts-table td:nth-child(2) { min-width: 180px; }
.donations .pledges-table td:nth-child(-n+2) { min-width: 150px; }
.donations .pledges-table td:first-child a { white-space: nowrap; }
.donations .method { display: inline-flex; align-items: center; gap: 7px; }
.donations .method svg.icon { width: 14px; height: 14px; color: var(--muted); }
.donations .data-table tfoot td:first-child { color: var(--muted); }
.donations .data-table tfoot .num { color: var(--ink); font-weight: var(--weight-medium); }
.donations-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--space-6); align-items: start; }
.donations .monthly-card { padding: var(--space-2) var(--space-5) var(--space-1); }
.donations .monthly-card > .hint { padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.donations .monthly-empty { margin: 0; padding: var(--space-6) 0; color: var(--muted); text-align: center; }
.donations .monthly-list { margin: 0; padding: 0; list-style: none; }
.donations .monthly-list > li { padding: 14px 0; border-bottom: 1px solid var(--border); }
.donations .monthly-list > li:last-child { border-bottom: 0; }
.donations .monthly-list p { margin: 0 0 var(--space-1); }
.donations .monthly-list .pledge-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.donations .monthly-list .pledge-sums { color: var(--muted); font-size: var(--text-ui-sm); }
.donations .monthly-who .sub { margin-left: var(--space-2); color: var(--muted); font-size: var(--text-ui-sm); }
.donations .monthly-list .pledge-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }
.donations .monthly-card .donations-outcome { padding: var(--space-3) 0; border-top: 1px solid var(--border); }
@media (max-width: 1100px) {
  .donations-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .donations { gap: var(--space-7); }
  .donations .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .donations .stat { padding: 14px var(--space-4) var(--space-4); }
  .donations .stat-value { font-size: var(--text-2xl); }
  .donations-search, .donations-search input { width: 100%; }
  .donations .attention-item { grid-template-columns: 32px minmax(0, 1fr); row-gap: var(--space-2); }
  .donations .attention-item > :last-child { grid-column: 2; justify-content: flex-start; }
  .donations .monthly-card { padding: var(--space-1) var(--space-4) 0; }
}

/* card forms: paying by card on /household (and /portal: public/lib/card-widget.js, card-fields.js,
   pledges.js, donations.js): the card fields and their loading stand-in, the saved-card picker
   and list, a card as a small chip (logo and last 4), the accepted brands. */
/* Banquest's card number, MM / YY and CVV in one framed field (its iframe draws borderless inputs,
   /lib/card-widget.js); two rows (number, then expiry and CVV) when the frame is narrow. */
body.app { --card-field-height: var(--size-field); }
body.app .card-fields {
  box-sizing: border-box;
  max-width: 440px;
  height: var(--card-field-height);
  min-height: 0;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--card);
  box-shadow: var(--shadow-field);
  font-family: var(--font-ui);
  font-size: var(--text-ui-base);
  transition: border-color var(--motion-fast) var(--motion-ease), box-shadow var(--motion-fast) var(--motion-ease);
}
body.app .card-fields.two-rows { height: calc(2 * var(--card-field-height) - 1px); }
body.app .card-fields[hidden] { display: none; }
body.app .card-fields:hover:not(:focus-within) { border-color: var(--border-strong); }
body.app .card-fields:focus-within { border-color: var(--ink); box-shadow: var(--shadow-ring); }
body.app .card-fields-loading { display: flex; flex-direction: column; gap: var(--space-2); max-width: 440px; }
body.app .card-fields-loading[hidden] { display: none; }
body.app .card-fields-loading .skeleton { height: var(--card-field-height); margin: 0; }
body.app .card-fields-loading .hint { margin: 0; }
body.app .card-brands { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
body.app .card-brands img.card-brand { width: 34px; height: 22px; border-radius: var(--radius-xs); }
body.app .card-new { display: flex; flex-direction: column; gap: var(--space-3); }
body.app .card-new[hidden] { display: none; }
body.app .card-new .check { align-self: flex-start; }
body.app .card-new .check[hidden] { display: none; }
body.app .card-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: var(--size-chip);
  padding: 0 7px 0 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--card);
  font-size: var(--text-ui-xs);
  font-variant-numeric: tabular-nums;
  line-height: 1;
  white-space: nowrap;
  vertical-align: middle;
}
body.app .card-chip img.card-brand { display: block; width: 26px; height: 16px; border-radius: var(--radius-xs); }
/* The saved-card picker: one framed row per card, the picked one outlined. */
body.app .saved-cards { display: flex; flex-direction: column; gap: 6px; max-width: 440px; margin: 0; padding: 0; border: 0; }
body.app .saved-cards[hidden] { display: none; }
body.app .saved-cards legend { margin: 0 0 6px; padding: 0; color: var(--muted); font-size: var(--text-ui-label); font-weight: var(--weight-medium); }
body.app label.saved-card {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin: 0;
  padding: 10px var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-control);
  background: var(--card);
  font-size: var(--text-ui-base);
}
body.app label.saved-card:hover { border-color: var(--border-strong); }
body.app label.saved-card:has(input:checked) { border-color: var(--ink); box-shadow: var(--shadow-ring); }
body.app label.saved-card.expired { color: var(--muted); cursor: not-allowed; }
body.app :is(label.saved-card, .saved-card-list li).expired img.card-brand { opacity: 0.5; }
body.app .card-name { font-weight: var(--weight-strong); }
body.app .card-expiry { color: var(--muted); font-size: var(--text-ui-sm); }
body.app .card-tag.chip { height: 20px; }
/* The "Saved cards" list: logo, name, expiry, what uses it; Remove at the end. */
body.app .saved-card-list { margin: 0; padding: 0; list-style: none; }
body.app .saved-card-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 10px 0; border-bottom: 1px solid var(--border); }
body.app .saved-card-list li:last-child { border-bottom: 0; }
body.app .saved-card-list .card-line { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }

/* household (/household; public/household.js): the page head, the summary strip, the sticky
   section menu, the folding sections (ui.css .section) and what is inside them: the people rows,
   the membership form, automatic payment's inset, the card panels, the inline "Record a payment"
   forms, the tables and the danger zone. */
.household .subtitle > span + span::before { content: "\00b7"; margin-right: 10px; color: var(--border-strong); }
.household .subtitle .skeleton { width: 280px; margin: 0; }
.household #status.info { color: var(--muted); }
.household #status.load-error { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.household-loading { display: flex; flex-direction: column; gap: var(--space-3); }
.household-loading .skeleton.block { margin: 0; }
.household-loading .skeleton.block.tall { height: 360px; }
.household fieldset:not(.segmented) { min-width: 0; margin: 0; padding: 0; border: 0; }
.household fieldset.field { display: block; }
.household fieldset.field > legend { margin: 0 0 6px; padding: 0; }
.household fieldset.segmented { margin: 0; }
.household fieldset.choices label { margin-right: var(--space-4); }

/* The summary strip. */
.household .stat-value .of { color: var(--muted); font-weight: var(--weight-regular); }
.household .seat-meter { display: flex; gap: var(--space-1); margin-top: 10px; }
.household .seat-meter i { flex: 1; max-width: 36px; height: 4px; border-radius: 2px; background: var(--tint-strong); }
.household .seat-meter i.on { background: var(--ink); }

/* The section menu: stays at the top while the page scrolls; the section in view is underlined. */
.household .section-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  gap: var(--space-1);
  margin: var(--space-7) 0 var(--space-5);
  overflow-x: auto;
  border-bottom: 1px solid var(--border);
  background: var(--paper);
  scrollbar-width: none;
}
.household .section-nav a { position: relative; display: flex; flex: none; align-items: center; height: 44px; padding: 0 var(--space-3); color: var(--muted); font-size: var(--text-ui-base); text-decoration: none; white-space: nowrap; }
.household .section-nav a:hover { color: var(--ink); }
.household .section-nav a:focus-visible { outline: none; border-radius: var(--radius-control); box-shadow: inset 0 0 0 1px var(--ink); }
.household .section-nav a[aria-current="true"] { color: var(--ink); font-weight: var(--weight-strong); }
.household .section-nav a[aria-current="true"]::after { content: ""; position: absolute; right: var(--space-3); bottom: 0; left: var(--space-3); height: 2px; border-radius: 1px; background: var(--ink); }
.household .section-nav a.danger { margin-left: auto; color: var(--error); }
.household .section { scroll-margin-top: 56px; }
.household .section > summary .summary-note b { color: var(--ink); font-weight: var(--weight-strong); }
.household .section > form { margin: 0; }

/* Inside a section. */
.household .section-body > * + * { margin-top: var(--space-5); }
.household .section-body > .block + .block, .household .section-body > .add-row + .block { margin-top: var(--space-7); }
.household .section-body > .add-row { margin-top: var(--space-3); }
.household .block > * + * { margin-top: 10px; }
.household .block.field > * + * { margin-top: 0; }
.household .block > p:empty { display: none; }
.household .sub-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); margin: 0; }
.household .sub-head h3, .household h3.sub-head { margin: 0; }
.household h3.sub-head { display: block; }
.household h3 .count { margin-left: 6px; color: var(--muted); font-weight: var(--weight-regular); }
.household .form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-4); }
.household .form-status { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); }
.household .form-status:not(:has(> p:not(:empty))) { display: none; }
.household :is(.form-status, .card-foot, .section-foot, .inset-text) > p:empty { display: none; }
.household .hint { margin: 0; }
.household .w-name { width: 260px; }
.household .w-type { width: 340px; }
.household .w-home { width: 320px; }
.household .w-date { width: 160px; }
.household .w-money { width: 120px; }
.household .w-note { width: 240px; }
.household .w-long { width: 320px; }
.household :is(.w-name, .w-type, .w-home, .w-date, .w-money, .w-note, .w-long) { max-width: 100%; }
.household .notes-field textarea { width: 620px; max-width: 100%; }

/* The people rows and their Hebrew names: see "people rows" and "hebrew keyboard" above. */

/* Membership: the status line, the form, automatic payment, the card panels and the tables. */
.household .membership-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin: 0; }
.household .membership-status .hint { flex-basis: 100%; }
.household .inset { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) 14px; padding: 14px var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-inset); background: var(--paper); }
.household .inset-text { flex: 1 1 200px; min-width: 0; font-size: var(--text-ui-sm); line-height: 1.5; }
.household .inset-text p { margin: 0; }
.household .inset-text strong { font-weight: var(--weight-strong); }
.household .inset-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-left: auto; }
.household .autopay-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); box-shadow: 0 0 0 4px var(--tint-strong); }
.household .autopay-inset:has([data-state="active"]) .autopay-dot { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.household .autopay-inset:has([data-state="setting_up"], [data-state="unresolved"]) .autopay-dot { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.household .autopay-inset:has([data-state="failed"]) .autopay-dot { background: var(--error); box-shadow: 0 0 0 4px var(--danger-soft); }
.household .card-part > * + * { margin-top: var(--space-4); }
.household .card-panel { padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-inset); background: var(--paper); }
.household .card-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.household .card-panel-head h3 { margin: 0; }
.household .card-panel form > * + * { margin-top: var(--space-4); }
.household .card-what { max-width: 640px; }
.household .card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-3) var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.household .card-foot > p { margin: 0; }
.household .inline-form { padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-inset); background: var(--paper); }
.household .inline-form h4 { margin: 0 0 var(--space-3); font-size: var(--text-ui-sm); font-weight: var(--weight-semibold); }
.household .inline-form-foot { display: flex; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-4); }
.household .data-table .money { font-weight: var(--weight-medium); }
.household .data-table td.note { min-width: 140px; color: var(--muted); }
.household .data-table tfoot td:first-child { color: var(--muted); }
.household .data-table tfoot .num { color: var(--ink); font-weight: var(--weight-medium); }
.household .data-table tr.cancelled td { color: var(--muted); }
.household .data-table .reference { color: var(--muted); font-size: var(--text-ui-sm); }
.household .data-table .seat-id { font-weight: var(--weight-strong); }
.household .data-table .actions-cell { text-align: right; }
.household .receipt-note { display: block; color: var(--muted); font-size: var(--text-ui-xs); }
.household .method { display: inline-flex; align-items: center; gap: 7px; }
.household .method svg.icon { width: 14px; height: 14px; color: var(--muted); }
.household .row-actions { display: inline-flex; flex-wrap: wrap; justify-content: flex-end; gap: var(--space-1); }
.household .card-result { min-width: 180px; }
.household .card-result .row-actions { display: flex; justify-content: flex-start; margin-top: 6px; }
.household .pledge-for { min-width: 160px; }
.household .pledge-for .chip { margin-left: var(--space-1); }

/* Monthly donations (the list /lib/donations.js makes). */
.household .monthly-list { margin: 0; padding: 0; list-style: none; }
.household .monthly-list > li { padding: 14px 0; border-bottom: 1px solid var(--border); }
.household .monthly-list > li:last-child { border-bottom: 0; }
.household .monthly-list p { margin: 0 0 var(--space-1); }
.household .monthly-list .pledge-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.household .monthly-list .pledge-sums { color: var(--muted); font-size: var(--text-ui-sm); }
.household .monthly-list .pledge-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }

/* The danger zone. */
.household .danger-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-6); padding: var(--space-4) 0; }
.household .danger-row:not([hidden]) ~ .danger-row { border-top: 1px solid var(--border); }
.household .section-body > .danger-row { margin-top: 0; }
.household .danger-text { flex: 1 1 320px; min-width: 0; }
.household .danger-text strong { display: block; font-weight: var(--weight-strong); }
.household .danger-text span { color: var(--muted); font-size: var(--text-ui-sm); }

@media (max-width: 900px) {
  .household .section-nav { top: 56px; margin-right: calc(-1 * var(--space-4)); margin-left: calc(-1 * var(--space-4)); padding: 0 var(--space-2); }
  .household .section { scroll-margin-top: 112px; }
}
@media (max-width: 640px) {
  .household .subtitle { flex-direction: column; align-items: flex-start; gap: 2px; }
  .household .subtitle > span + span::before { content: none; }
  .household .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .household .stat { padding: 14px var(--space-4) var(--space-4); }
  .household .stat-value { font-size: var(--text-2xl); }
  .household .section > summary { flex-wrap: wrap; row-gap: 2px; padding-right: var(--space-4); padding-left: var(--space-3); }
  .household .section > summary .summary-note { flex-basis: 100%; margin-left: 27px; text-align: left; }
  .household .section-body { padding: var(--space-1) var(--space-4) var(--space-5); }
  .household .section-foot { padding: var(--space-3) var(--space-4); }
  .household :is(.card-panel, .inline-form) { padding: var(--space-4); }
}

/* sortable headers (public/lib/table-sort.js; /households, /directory): the arrow after a
   sortable column's name, faint until the table is sorted by it. */
body.app .data-table th > button[data-sort] { gap: 6px; }
body.app .data-table th > button[data-sort] svg.icon { width: 12px; height: 12px; }
body.app .data-table th:not([aria-sort]) > button[data-sort] svg.icon { opacity: 0.4; }
body.app .data-table th:not([aria-sort]) > button[data-sort]:hover svg.icon { opacity: 0.8; }

/* households (/households; public/households.js): the loading stand-in, the list's tools (status
   filter chips and the search), the households table, the membership types and the seat limit
   side by side (.settings-grid of .section.panel cards), the import (a closed .section) and the
   "Add a household" dialog. */
.households .subtitle .skeleton { width: 180px; margin: 0; }
.households #status .notice { align-items: center; margin: 0; }
.households #status .notice > p { flex: 1; }
.households-loading { display: flex; flex-direction: column; gap: var(--space-4); }
.households-loading .list-tools .skeleton { width: 440px; max-width: 100%; height: 32px; margin: 0; border-radius: var(--radius-pill); }
.households-loading .list-tools .skeleton + .skeleton { width: 300px; border-radius: var(--radius-control); }
.households-loading .skeleton.block { margin: 0; }
.households-loading .skeleton.block.tall { height: 380px; }
.households main { display: flex; flex-direction: column; gap: var(--space-8); }

/* The filter chips and the search, on one row above the table. */
.households .list-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-4); margin-bottom: var(--space-4); }
.households .filter-chips { display: flex; flex-wrap: wrap; gap: 6px; }
body.app .filter-chip { gap: 7px; height: 32px; padding: 0 var(--space-3); border-radius: var(--radius-pill); color: var(--nav-ink); font-weight: var(--weight-medium); }
body.app .filter-chip .count { color: var(--muted); font-weight: var(--weight-regular); font-variant-numeric: tabular-nums; }
body.app .filter-chip[aria-pressed="true"], body.app .filter-chip[aria-pressed="true"]:hover:not(:disabled) { border-color: var(--ink); background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-button-filled); }
body.app .filter-chip[aria-pressed="true"] .count { color: var(--on-ink); opacity: 0.7; }
.filter-chip .dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--border-strong); }
.filter-chip .dot.success { background: var(--success); }
.filter-chip .dot.warning { background: var(--warning); }
.filter-chip .dot.danger { background: var(--error); }
.filter-chip[aria-pressed="true"] .dot { box-shadow: 0 0 0 1.5px var(--on-ink); }
.search-field { position: relative; width: 300px; max-width: 100%; }
/* The search box's icon stays by the field when a Hebrew keyboard opens under it. */
.search-field > svg.icon { position: absolute; top: calc(var(--size-field) / 2); left: var(--space-3); z-index: 1; color: var(--muted); transform: translateY(-50%); pointer-events: none; }
body.app .search-field > input { width: 100%; padding-left: 36px; }

/* The list. */
.households-table td.family { font-weight: var(--weight-strong); }
.households-table td.family a, .households .dry-run td.family { color: var(--ink); text-decoration: none; }
.households-table td.family a:hover { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: var(--border-strong); }
.households-table td:nth-child(2) { min-width: 200px; }
.households-table td:nth-child(3) { white-space: nowrap; }
.households .table-count { margin: 10px 2px 0; color: var(--muted); font-size: var(--text-ui-sm); }

/* Membership types and the seat limit: cards side by side, each with its own Save and status. */
.households .settings-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--space-5); align-items: start; }
.households .panel { margin: 0; overflow: hidden; }
.households .panel-head { padding: var(--space-5) var(--space-6) var(--space-4); }
.households .panel-head h2 { margin: 0 0 6px; font-size: var(--text-xl); }
.households .panel .section-body { padding-top: 0; }
.households .panel-table { overflow-x: auto; border-top: 1px solid var(--border); }
.households .type-table td { padding-top: var(--space-2); padding-bottom: var(--space-2); }
.households .type-table td.offered { text-align: center; }
.households .type-table th:nth-child(4) { text-align: center; }
.households .type-table .row-actions { display: flex; justify-content: flex-end; gap: var(--space-1); white-space: nowrap; }
.households .type-table tbody tr:last-child td { border-bottom: 1px solid var(--border); }
.households .w-type-name { width: 180px; }
body.app.households .w-money { width: 112px; text-align: right; }
.households .w-count { width: 96px; }
.households .type-new { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); padding: var(--space-4) var(--space-6) var(--space-5); }
.households .type-new h3 { flex-basis: 100%; margin: 0; }
.households .section-foot > p:empty { display: none; }
.households .section-foot:not(:has(> button:not([hidden]))):not(:has(> p:not(:empty))) { display: none; }
.households .panel > .section-foot { justify-content: flex-start; }

/* The import. */
.households #import > summary .summary-note { white-space: nowrap; }
.households .import-grid { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 1fr); gap: var(--space-5) var(--space-8); align-items: start; }
.households .import-help { margin: 0; padding-left: 1.1em; color: var(--muted); font-size: var(--text-ui-sm); line-height: 1.55; }
.households .import-help li + li { margin-top: 6px; }
.households .import-help strong { color: var(--ink); font-weight: var(--weight-strong); }
.households .import-form { display: flex; flex-direction: column; align-items: flex-start; gap: var(--space-4); padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-inset); background: var(--paper); }
.households .import-form .template-link { margin-left: calc(-1 * var(--space-2)); }
.households .import-form .form-error:empty { display: none; }
.households input[type="file"] { max-width: 100%; color: var(--muted); font: inherit; font-size: var(--text-ui-sm); }
.households input[type="file"]::file-selector-button { height: var(--size-button-sm); margin-right: var(--space-3); padding: 0 var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--card); color: var(--ink); font: inherit; font-weight: var(--weight-strong); cursor: pointer; }
.households input[type="file"]::file-selector-button:hover { border-color: var(--border-strong); background: var(--tint); }
.households .dry-run { margin-top: var(--space-6); padding-top: var(--space-5); border-top: 1px solid var(--border); }
.households .dry-run > * + * { margin-top: var(--space-3); }
.households .dry-run h3 { margin: 0; }
.households .dry-run #dry-summary { margin-top: 6px; color: var(--muted); }
.households #dry-errors p { margin: 0; }
.households #dry-errors ul { margin: var(--space-2) 0 0; padding-left: 1.1em; }

/* The "Add a household" dialog. */
.households .add-dialog { width: 520px; }
.households .dialog-lead { margin: 0 0 var(--space-5); color: var(--muted); }
.households .add-dialog form, .households .add-part { display: flex; flex-direction: column; gap: var(--space-4); }
.households .add-dialog fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.households .add-dialog fieldset.field { display: block; }
.households .add-dialog fieldset > legend { margin: 0 0 6px; padding: 0; }
.households .add-dialog label { margin: 0; }
.households .add-dialog .field > :is(input, select) { width: 100%; }
.households .add-dialog .segmented label { display: flex; }
.households .add-dialog .form-error:empty { display: none; }

@media (max-width: 1100px) {
  .households .settings-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  .households .import-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .households main { gap: var(--space-7); }
  .households .list-tools { flex-direction: column; align-items: stretch; }
  .households .search-field { width: 100%; }
  .households .panel-head { padding: var(--space-4) var(--space-4) var(--space-3); }
  .households .panel .section-body { padding: 0 var(--space-4) var(--space-4); }
  .households .panel .section-foot { padding: var(--space-3) var(--space-4); }
  .households .type-new { padding: var(--space-4); }
  .households .type-new .field { flex: 1 1 120px; }
  .households .type-new .field:first-of-type { flex-basis: 100%; }
  .households .type-new .field > input { width: 100%; }
  .households #import > summary { flex-wrap: wrap; row-gap: 2px; }
  .households #import > summary .summary-note { flex-basis: 100%; margin-left: 27px; text-align: left; }
  .households #import .section-body { padding: var(--space-1) var(--space-4) var(--space-5); }
  .households .import-form { padding: var(--space-4); }
}

/* gabbai (/gabbai, /gabbai/fast, /gabbai/master: body.app.gabbai; public/gabbai.js,
   public/gabbai/fast.js and master.js, the time grid of public/lib/override-grid.js): the week,
   fast or season picked in the page head (.head-controls, .week-nav), the cards of the week's
   text two to a row (.sheet-form > .sheet-card, .full for a whole row), the time grid
   (.grid-editor > fieldset.grid-block > .grid-row > .grid-label + .grid-values > .cell-item), the
   sticky bar with Save, its status, Preview, Download PDF and the email buttons (.sheet-bar), the
   folding sections under it (sponsors, Every week), and the season master's framed preview. */
.gabbai fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.gabbai .subtitle > span + span::before { content: "\00b7"; margin-right: 10px; color: var(--border-strong); }
.gabbai .subtitle .skeleton { width: 280px; margin: 0; }
.gabbai .subtitle :lang(he) { color: var(--ink); font-size: var(--text-lg); line-height: 1.2; }
.gabbai #status.load-error { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); color: var(--error); }
.gabbai #status.info { color: var(--muted); }
.gabbai .notice .notice-body { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-4); }
.gabbai .notice .notice-body p { margin: 0; }
.gabbai .empty-note { margin: 0; color: var(--muted); font-size: var(--text-ui-sm); }

/* The picker in the head: ‹ Prev · the date · Next ›, or the fast's and the season's fields. */
.gabbai .week-nav { display: flex; align-items: center; gap: var(--space-2); }
.gabbai .week-nav input { width: 168px; }
.gabbai .week-nav button { padding: 0 var(--space-3); }
.gabbai .head-controls { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); }

/* Loading */
.gabbai-loading { display: flex; flex-direction: column; gap: var(--space-4); }
.gabbai-loading .skeleton.block { margin: 0; }
.gabbai-loading .skeleton.block.tall { height: 380px; }
.gabbai-loading-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }

/* The cards: two to a row on a wide screen, the same height across a row. */
.gabbai .sheet-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); align-items: stretch; margin: 0; }
.gabbai .sheet-card { display: flex; flex-direction: column; align-items: stretch; gap: var(--space-4); min-width: 0; padding: var(--space-5) var(--space-6) var(--space-6); }
.gabbai .sheet-card.full { grid-column: 1 / -1; }
/* A fast: its times on the left, Kiddush Levana and the extra lines beside them. */
.gabbai .fast-form { align-items: start; }
.gabbai .fast-times { grid-row: span 2; }
.gabbai .sheet-card > .notice { margin: 0; }
.gabbai .card-head h2 { margin: 0; font-size: var(--text-xl); }
.gabbai .card-head h2 :lang(he) { margin-left: var(--space-2); color: var(--muted); font-size: var(--text-lg); }
.gabbai .card-head .hint { margin-top: var(--space-1); }
.gabbai .card-stack { display: flex; flex-direction: column; gap: var(--space-4); }
.gabbai .field-line { display: flex; flex-wrap: wrap; align-items: flex-start; gap: var(--space-4); }
.gabbai .field.grow { flex: 1 1 240px; min-width: 0; }
.gabbai .field > .label { color: var(--muted); font-size: var(--text-ui-label); font-weight: var(--weight-medium); }
.gabbai .w-time { width: 120px; }
.gabbai .w-short { width: 220px; }
.gabbai .w-date { width: 170px; }
.gabbai :is(.w-fill, .sheet-card textarea, .calc-notice textarea, .settings-grid textarea) { width: 100%; }
.gabbai .w-fast { width: 480px; }
.gabbai .w-season { width: 130px; }
.gabbai :is(.w-time, .w-short, .w-date, .w-fast, .w-season) { max-width: 100%; }
.gabbai .choices { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
.gabbai .choices.stacked { flex-direction: column; gap: var(--space-2); }
.gabbai label.check { display: inline-flex; margin: 0; }
.gabbai .sheet-card > label.check, .gabbai .inline-form > label.check { align-self: flex-start; }
/* A Hebrew field (lib/hebrew-keyboard.js wraps it) takes the field's width; the keyboard opens under it. */
.gabbai .hebrew-field { display: flex; width: 100%; }
.gabbai .hebrew-field > :is(input, textarea) { flex: 1 1 auto; width: auto; }

/* Repeating lines (Mazel Tov, Welcome, …): the line's fields on one row, Remove at its end. */
.gabbai .repeat { display: flex; flex-direction: column; }
.gabbai .repeat:empty { display: none; }
.gabbai .repeat .line { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: var(--space-2) var(--space-3); padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
.gabbai .repeat .line:first-child { padding-top: 0; }
.gabbai #mazel-tov .line { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 2fr) auto; }
.gabbai #welcome .line { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto; }
.gabbai #farewell .line { grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr) auto; }
.gabbai :is(.line > label, .line-field) { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.gabbai .line-label { color: var(--muted); font-size: var(--text-ui-label); font-weight: var(--weight-medium); line-height: 1.5; }
/* Remove sits level with the fields, under their labels. */
.gabbai .line > .remove-line { margin-top: calc(var(--text-ui-label) * 1.5 + 6px + (var(--size-field) - var(--size-button-sm)) / 2); color: var(--muted); }
.gabbai .remove-line:hover:not(:disabled) { color: var(--ink); }
.gabbai .add-line { align-self: flex-start; margin-left: calc(-1 * var(--space-3)); }
.gabbai .field > .add-line { margin-top: var(--space-1); }

/* The time grid: a framed block per column of the printed sheet, a row per time, the calculated
   time in each field, a changed one in the sheet's red with "calculated: …" under it and Reset. */
.gabbai .grid-editor { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); align-items: start; gap: var(--space-4); }
.gabbai .grid-editor > .hint { grid-column: 1 / -1; }
.gabbai .grid-block { min-width: 0; padding: 0 0 var(--space-2); border: 1px solid var(--border); border-radius: var(--radius-inset); background: var(--card); }
.gabbai .grid-block > legend { float: left; width: 100%; padding: 10px var(--space-4); border-bottom: 1px solid var(--border); border-radius: var(--radius-inset) var(--radius-inset) 0 0; background: var(--tint); color: var(--muted); font-size: var(--text-ui-xxs); font-weight: var(--weight-strong); letter-spacing: 0.07em; text-transform: uppercase; }
.gabbai .grid-block > legend + * { clear: both; }
.gabbai .grid-block:has(.input-long) { grid-column: 1 / -1; }
.gabbai .grid-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: var(--space-3); padding: var(--space-2) var(--space-4); }
.gabbai .grid-row + .grid-row { border-top: 1px solid var(--border); }
.gabbai .grid-label { padding-top: 9px; font-size: var(--text-ui-sm); font-weight: var(--weight-medium); line-height: 1.35; }
.gabbai .grid-he { display: block; text-align: left; color: var(--muted); font-size: var(--text-ui-base); font-weight: var(--weight-regular); }
.gabbai .grid-values { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-1); min-width: 0; }
/* The time on its own line; under it "calculated: …" and Reset (or Confirm), so the times stay in line. */
.gabbai .cell-item { display: grid; grid-template-columns: repeat(3, auto); justify-content: end; align-items: center; gap: var(--space-1) var(--space-1); }
.gabbai .cell-item input { grid-column: 1 / -1; justify-self: end; width: 92px; }
.gabbai .cell-item .was { order: -1; grid-row: 2; color: var(--muted); font-size: var(--text-ui-xs); text-align: right; }
.gabbai .cell-item .was:empty { display: none; }
.gabbai .cell-item > button { grid-row: 2; justify-self: end; }
.gabbai .cell-item > button.quiet { height: 22px; padding: 0 6px; color: var(--muted); font-size: var(--text-ui-xs); }
.gabbai .cell-item > button.quiet:hover:not(:disabled) { color: var(--ink); }
.gabbai .cell-item.overridden input { border-color: var(--changed); color: var(--changed); font-weight: var(--weight-strong); box-shadow: var(--shadow-changed); }
.gabbai .cell-item.needs-confirm input { border-color: var(--warning-line); background: var(--warning-soft); }
/* Weekdays: long lines of times, the field as wide as the block. */
.gabbai .grid-block:has(.input-long) .grid-row { grid-template-columns: minmax(120px, 200px) minmax(0, 1fr); }
.gabbai .grid-block:has(.input-long) .grid-values { align-items: stretch; }
.gabbai .grid-block:has(.input-long) .cell-item { grid-template-columns: minmax(0, 1fr) auto auto; }
.gabbai .cell-item input.input-long { justify-self: stretch; width: 100%; }
.gabbai .cell-item:has(.input-long) .was { justify-self: end; }
.gabbai .plag-switches { display: flex; flex-direction: column; gap: var(--space-2); margin-top: var(--space-1); padding: var(--space-3) var(--space-4) var(--space-1); border-top: 1px solid var(--border); font-size: var(--text-ui-sm); }
.gabbai .plag-switches label.check { align-items: flex-start; }
.gabbai .plag-switches input { margin-top: 2px; }
.gabbai .plag-switches small { display: block; color: var(--muted); font-size: var(--text-ui-xs); }

/* Calculated notices, and a fast's Mincha ב' to confirm. */
.gabbai #calc-notices { display: flex; flex-direction: column; gap: var(--space-4); }
.gabbai .calc-notice { display: flex; flex-direction: column; gap: var(--space-3); }
.gabbai .calc-notice + .calc-notice { padding-top: var(--space-4); border-top: 1px solid var(--border); }
.gabbai .calc-notice h3 { margin: 0; }
.gabbai .calc-notice > label.check { align-self: flex-start; }
.gabbai .notice:has(label.check) { flex-direction: column; gap: var(--space-2); margin: 0; }
.gabbai .notice label.check { color: var(--ink); font-weight: var(--weight-medium); }

/* The bar under the week: Save and its status, then Preview, Download PDF and the emails. It
   stays at the foot of the window, above "Powered by SCHWAI", while the week's cards scroll by. */
.gabbai .sheet-bar { position: sticky; bottom: calc(var(--space-4) + var(--powered-by-height)); z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) var(--space-4); margin: var(--space-6) 0 var(--space-8); padding: var(--space-3) var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-card); background: var(--card); box-shadow: var(--shadow-popover); }
.gabbai .bar-status { flex: 1 1 160px; min-width: 0; margin: 0; color: var(--muted); font-size: var(--text-ui-sm); }
.gabbai :is(.bar-status, .status-line).unsaved { display: inline-flex; align-items: center; gap: var(--space-2); color: var(--warning); }
.gabbai :is(.bar-status, .status-line).unsaved::before { content: ""; flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--warning); }
.gabbai .status-line { margin: 0; color: var(--muted); font-size: var(--text-ui-sm); }
.gabbai .status-line:empty { display: none; }
.gabbai .bar-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin-left: auto; }
.gabbai .email-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1); margin-left: var(--space-2); padding-left: var(--space-3); border-left: 1px solid var(--border); }
.gabbai .email-actions:empty { display: none; }
.gabbai .email-actions > button { padding: 0 var(--space-3); border-color: transparent; background: transparent; box-shadow: none; }
.gabbai .email-actions > button:hover:not(:disabled) { border-color: transparent; background: var(--tint); }
.gabbai .email-actions .send-progress { flex-basis: 100%; color: var(--muted); font-size: var(--text-ui-sm); text-align: right; }

/* The folding sections under the bar. */
.gabbai .section-body > * + * { margin-top: var(--space-4); }
.gabbai .add-row { margin-left: calc(-1 * var(--space-3)); }
.gabbai .sponsor-table .when { font-weight: var(--weight-strong); }
.gabbai .sponsor-table .chip { margin-left: var(--space-2); }
.gabbai .sponsor-table .actions-cell { text-align: right; white-space: nowrap; }
.gabbai .row-actions { display: inline-flex; gap: var(--space-1); }
.gabbai .inline-form { display: flex; flex-direction: column; gap: var(--space-4); padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-inset); background: var(--paper); }
.gabbai .inline-form h3 { margin: 0; font-size: var(--text-ui-sm); font-weight: var(--weight-semibold); }
.gabbai .inline-form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); }
.gabbai .inline-form-foot .form-error { margin-right: auto; }
.gabbai .inline-form-foot .form-error:empty { display: none; }
.gabbai .settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-5) var(--space-6); }
.gabbai .settings-grid .field.wide { grid-column: 1 / -1; }
.gabbai .section-foot .status-line { margin-right: auto; }

/* The season master: its preview in a framed card, its height kept while it loads. */
.gabbai .master-hint { margin: 0 0 var(--space-4); }
.gabbai .frame-card { position: relative; overflow: hidden; padding: 0; background: var(--desk); }
.gabbai .sheet-frame { display: block; width: 100%; height: 8.6in; border: 0; }
.gabbai .frame-card .frame-loading { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: var(--space-3); color: var(--muted); font-size: var(--text-ui-sm); }

@media (max-width: 1100px) {
  .gabbai .sheet-form { grid-template-columns: minmax(0, 1fr); }
  .gabbai .fast-times { grid-row: auto; }
}
@media (max-width: 900px) {
  .gabbai .settings-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .gabbai .subtitle { flex-direction: column; align-items: flex-start; gap: 2px; }
  .gabbai .subtitle > span + span::before { content: none; }
  .gabbai .page-actions, .gabbai .week-nav, .gabbai .head-controls { width: 100%; }
  .gabbai .week-nav input { flex: 1 1 auto; width: auto; min-width: 0; }
  .gabbai .head-controls .field { flex: 1 1 140px; }
  .gabbai .head-controls .field:has(.w-fast) { flex-basis: 100%; }
  .gabbai .head-controls :is(select, input) { width: 100%; }
  .gabbai-loading-pair { grid-template-columns: minmax(0, 1fr); }
  .gabbai .sheet-card { padding: var(--space-4); }
  .gabbai .repeat .line, .gabbai :is(#mazel-tov, #welcome, #farewell) .line { grid-template-columns: minmax(0, 1fr); }
  .gabbai .line > .remove-line { justify-self: end; margin-top: 0; }
  .gabbai .grid-block:has(.input-long) .grid-row { grid-template-columns: minmax(0, 1fr); }
  .gabbai .grid-block:has(.input-long) .grid-label { padding-top: 0; }
  .gabbai .sheet-bar { bottom: var(--space-2); gap: var(--space-2); padding: var(--space-2) var(--space-3); }
  /* Save, Preview and Download PDF on one line, the emails under them, the status last. */
  .gabbai .bar-actions { display: contents; }
  .gabbai .bar-status { order: 5; flex-basis: 100%; }
  .gabbai .bar-status:empty { display: none; }
  .gabbai .bar-actions > :is(a.button, button) { height: var(--size-button-sm); padding: 0 var(--space-3); }
  .gabbai .sheet-bar svg.icon { display: none; }
  .gabbai .email-actions { width: 100%; margin-left: calc(-1 * var(--space-3)); padding-left: 0; border-left: 0; }
  .gabbai .email-actions > button { height: var(--size-button-sm); }
  .gabbai .section > summary { flex-wrap: wrap; row-gap: 2px; padding-right: var(--space-4); padding-left: var(--space-3); }
  .gabbai .section > summary .summary-note { flex-basis: 100%; margin-left: 27px; text-align: left; }
  .gabbai .section-body { padding: var(--space-1) var(--space-4) var(--space-5); }
  .gabbai .section-foot { padding: var(--space-3) var(--space-4); }
  .gabbai .inline-form { padding: var(--space-4); }
}

/* Choice pills (/households' Add a household, /directory's home dialog, /requests): radio buttons drawn as pills, the picked one
   filled; the radio itself is visually hidden inside its label. */
:is(.households, .directory, .requests) .choice-pills { display: flex; flex-wrap: wrap; gap: var(--space-2); }
:is(.households, .directory, .requests) .choice-pills label { position: relative; display: inline-flex; align-items: center; height: 34px; margin: 0; padding: 0 14px; border: 1px solid var(--border); border-radius: var(--radius-pill); background: var(--card); box-shadow: var(--shadow-button); color: var(--nav-ink); font-size: var(--text-ui-sm); font-weight: var(--weight-medium); white-space: nowrap; cursor: pointer; transition: background-color var(--motion-fast) var(--motion-ease), border-color var(--motion-fast) var(--motion-ease); }
:is(.households, .directory, .requests) .choice-pills label:hover { border-color: var(--border-strong); }
:is(.households, .directory, .requests) .choice-pills label:has(input:checked) { border-color: var(--ink); background: var(--ink); color: var(--on-ink); box-shadow: var(--shadow-button-filled); }
:is(.households, .directory, .requests) .choice-pills label:has(input:focus-visible) { border-color: var(--ink); box-shadow: var(--shadow-ring); }

/* directory (/directory; public/directory.js): the filters in the page head, the block's name and
   counts, the homes table, and the home dialog (.home-dialog: its head, a scrolling body with the
   status pills, the household and its people rows (see "people rows"), "Move household" and
   "Block", then a footer that stays in view). */
.directory #status .notice { align-items: center; margin: 0; }
.directory #status .notice > p { flex: 1; }
.directory-filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3); }
.directory-filters .field { gap: 5px; }
.directory-filters select { width: 160px; }
.directory-filters #block { width: 220px; }
.directory-loading { display: flex; flex-direction: column; gap: var(--space-4); }
.directory-loading .skeleton { margin: 0; }
.directory-loading .skeleton.title { width: 320px; max-width: 70%; }
.directory-loading .skeleton.block.tall { height: 440px; }
.directory main { display: flex; flex-direction: column; gap: var(--space-4); }
.directory main > .notice { margin: 0; }
.directory .block-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--space-2) var(--space-4); margin-bottom: var(--space-4); }
.directory .block-head h2 { margin: 0; }
.directory .block-counts { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) 10px; margin: 0; color: var(--muted); font-size: var(--text-ui-sm); }
.directory .block-counts > span:not(.chip) + span:not(.chip)::before { content: "\00b7"; margin-right: 10px; color: var(--border-strong); }
.home-table td.address { font-weight: var(--weight-strong); white-space: nowrap; }
.home-table .due { display: inline-flex; align-items: center; gap: var(--space-2); }
.home-table td.open { width: 1%; padding-top: 0; padding-bottom: 0; text-align: right; white-space: nowrap; }
body.app .home-table td.open button { color: var(--muted); }
body.app .home-table tr:hover td.open button { color: var(--ink); }
body.app .home-table td.open button svg.icon { width: 14px; height: 14px; margin-right: -2px; }
.directory .table-count { margin: 10px 2px 0; color: var(--muted); font-size: var(--text-ui-sm); }
.directory footer.source-note { margin: 0; color: var(--muted); font-size: var(--text-ui-xs); line-height: 1.35; }

/* The home dialog. */
.directory .home-dialog { width: min(1080px, calc(100vw - var(--space-7))); padding: 0; }
.directory .home-dialog[open] { display: flex; flex-direction: column; }
.directory .home-dialog .dialog-head { padding: var(--space-6) var(--space-6) var(--space-4); border-bottom: 1px solid var(--border); }
.directory .home-dialog .dialog-head h2 { margin: 0 0 6px; }
.directory .dialog-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) 10px; margin: 0; color: var(--muted); font-size: var(--text-ui-sm); }
.directory .dialog-meta > span { display: inline-flex; align-items: center; gap: var(--space-2); }
.directory .dialog-meta > span + span::before { content: "\00b7"; margin-right: 2px; color: var(--border-strong); }
.directory .dialog-body { flex: 1 1 auto; min-height: 0; overflow-y: auto; padding: var(--space-5) var(--space-6) var(--space-6); }
body.app.directory .home-dialog > .dialog-actions { flex-wrap: wrap; align-items: center; margin: 0; padding: 14px var(--space-6); }
.directory .home-dialog > .dialog-actions .form-error { flex: 1 1 160px; text-align: right; }
.directory #home-form { display: flex; flex-direction: column; gap: var(--space-5); }
.directory #home-form > .notice { margin: 0; }
.directory .home-dialog fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.directory .home-dialog fieldset.field { display: block; }
.directory .home-dialog fieldset > legend { margin: 0 0 var(--space-2); padding: 0; }
.directory .home-dialog .field > label { margin: 0; }
.directory .household-fields { display: flex; flex-direction: column; gap: var(--space-6); }
.directory .form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-4) var(--space-7); }
.directory .w-name { width: 260px; max-width: 100%; }
.directory .people-rows { display: flex; flex-direction: column; gap: var(--space-5); }
.directory .people-rows .sub-head { margin: 0 0 10px; }
.directory .notes-field textarea { width: 620px; max-width: 100%; }
.directory .dialog-extras { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); margin-top: var(--space-6); }
.directory .dialog-extras:not(:has(> .extra:not([hidden]))) { display: none; }
.directory .extra { padding: var(--space-4) var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-inset); background: var(--paper); }
.directory .extra h3 { margin: 0 0 var(--space-1); }
.directory .extra .hint { margin: 0 0 var(--space-3); }
.directory .extra-row { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.directory .extra-row select { flex: 1 1 200px; min-width: 0; }

@media (max-width: 640px) {
  .directory .page-actions, .directory-filters { width: 100%; }
  .directory-filters .field { flex: 1 1 140px; }
  .directory-filters :is(select, #block) { width: 100%; }
  .directory .home-dialog { width: calc(100vw - var(--space-4)); max-height: calc(100vh - var(--space-4)); }
  .directory .home-dialog .dialog-head { padding: var(--space-5) var(--space-4) var(--space-3); }
  .directory .dialog-body { padding: var(--space-4); }
  body.app.directory .home-dialog > .dialog-actions { padding: var(--space-3) var(--space-4); }
  .directory .home-dialog > .dialog-actions .form-error { flex-basis: 100%; order: -1; text-align: left; }
  .directory .home-dialog > .dialog-actions .form-error:empty { display: none; }
  .directory .home-dialog > .dialog-actions #verify { flex-basis: 100%; }
  .directory .dialog-extras { grid-template-columns: minmax(0, 1fr); }
  .directory .dialog-meta { flex-direction: column; align-items: flex-start; gap: 2px; }
  .directory .dialog-meta > span + span::before { content: none; }
}

/* users (/users; public/users.js): the users table, then its two dialogs (.user-form-dialog):
   "Add a user", and one user's Roles, Password and Account (.edit-part), each with its own
   button and status (.part-foot). Roles are cards (.role-card: checkbox, name, what it may do). */
.users #status .notice { align-items: center; margin: 0; }
.users #status .notice > p { flex: 1; }
.users-loading .skeleton.block { height: 320px; margin: 0; }
.users main { display: flex; flex-direction: column; gap: var(--space-4); }
.users main > .notice { margin: 0; }
.user-list td.user-name { font-weight: var(--weight-strong); white-space: nowrap; }
.user-list tr.banned :is(td.user-name, td.user-email) { color: var(--muted); }
.user-list .role-chips { display: flex; flex-wrap: wrap; gap: var(--space-1); }
body.app.users .role-chip { padding: 0 var(--space-2); background: var(--card); color: var(--nav-ink); }
body.app.users .role-chip::before { content: none; }
.user-list td.user-edit { width: 1%; padding-top: 0; padding-bottom: 0; text-align: right; white-space: nowrap; }

/* The dialogs. */
.users .user-form-dialog { width: 680px; }
.users .dialog-lead { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); margin: 0 0 var(--space-5); color: var(--muted); }
.users .user-form-dialog form { display: flex; flex-direction: column; gap: var(--space-4); }
.users .user-form-dialog fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.users .user-form-dialog fieldset.field { display: block; }
.users .user-form-dialog fieldset > legend { margin: 0 0 var(--space-2); padding: 0; }
.users .user-form-dialog label { margin: 0; }
.users .user-form-dialog .field { align-items: stretch; }
.users .user-form-dialog .field > input { width: 100%; }
.users .user-form-dialog .form-error:empty { display: none; }
.users #create-form .form-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-3); }
.users .password-row { display: flex; gap: var(--space-2); }
body.app.users .password-row input { flex: 1 1 auto; width: auto; min-width: 0; letter-spacing: 0.02em; }
.users .role-cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
body.app.users .role-card { display: flex; align-items: flex-start; gap: 10px; padding: 10px var(--space-3); border: 1px solid var(--border); border-radius: var(--radius-control); background: var(--card); cursor: pointer; transition: border-color var(--motion-fast) var(--motion-ease), box-shadow var(--motion-fast) var(--motion-ease); }
body.app.users .role-card:hover { border-color: var(--border-strong); }
body.app.users .role-card:has(input:checked) { border-color: var(--ink); box-shadow: var(--shadow-ring); }
body.app.users .role-card:has(input:disabled) { opacity: 0.6; cursor: not-allowed; }
body.app.users .role-card input { flex: none; margin-top: 2px; }
.users .role-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.users .role-text strong { font-size: var(--text-ui-sm); font-weight: var(--weight-strong); }
.users .role-text span { color: var(--muted); font-size: var(--text-ui-xs); line-height: 1.4; }
.users .block-checks { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-5); }
body.app.users .block-checks label { display: inline-flex; }

/* One user: the head, then Roles, Password and Account, each saved on its own. */
.users .user-head h2 { margin: 0 0 6px; }
.users .user-head .dialog-lead { margin: 0; }
.users #dialog-self { margin: var(--space-4) 0 0; }
.users .edit-part { margin-top: var(--space-5); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.users .edit-part form { gap: var(--space-3); }
.users .edit-part h3 { margin: 0 0 var(--space-3); }
.users .part-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2) var(--space-4); }
.users .part-foot > p:empty { display: none; }
.users .part-foot:not(:has(> button)):not(:has(> p:not(:empty))) { display: none; }
.users .edit-part .part-foot:not(:has(> button)) { justify-content: flex-start; }
.users .part-foot .form-error, .users .part-foot .form-done { flex: 1 1 200px; }
.users .account-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-3) var(--space-4); }
.users .account-text { flex: 1 1 260px; min-width: 0; }
.users .account-text h3 { margin: 0 0 var(--space-1); }
.users .account-text p { margin: 0; color: var(--muted); font-size: var(--text-ui-sm); }
.users #account-part .part-foot { margin-top: var(--space-2); }

@media (max-width: 640px) {
  .users #create-form .form-row, .users .role-cards { grid-template-columns: minmax(0, 1fr); }
  .users .password-row { flex-wrap: wrap; }
  body.app.users .password-row input { flex-basis: 100%; }
}

/* requests (/requests; public/requests.js): one card per waiting sign-up (.request-card): who
   they are on the left (.request-who), the decision on the right (.request-decide: the main way
   with its primary button, "Find another household" and "The X family moved out" each opening a
   .find-panel, Decline at the right); a decided card
   shows its outcome, then folds away (.leaving). The empty state when nobody is waiting. */
.requests #status .notice { align-items: center; margin: 0; }
.requests #status .notice > p { flex: 1; }
.requests-loading { display: flex; flex-direction: column; gap: var(--space-4); }
.requests-loading .skeleton.block { height: 190px; margin: 0; }
.requests .list-title { display: flex; align-items: center; gap: 10px; margin: 0 0 var(--space-4); }
.requests .list-title .count { color: var(--muted); font-family: var(--font-ui); font-size: var(--text-ui-base); font-weight: var(--weight-regular); }
.request-list { margin: 0; padding: 0; list-style: none; }
.request-card {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(0, 1.7fr);
  margin: 0 0 var(--space-4);
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  background: var(--card);
  box-shadow: var(--shadow-card);
  transition: height calc(2 * var(--motion-base)) var(--motion-ease), margin calc(2 * var(--motion-base)) var(--motion-ease), opacity var(--motion-base) var(--motion-ease);
}
.request-card.leaving { margin-bottom: 0; border-color: transparent; opacity: 0; }
.request-who { min-width: 0; padding: var(--space-6); border-right: 1px solid var(--border); background: var(--paper); }
.request-who h3 { margin: 0 0 2px; font-family: var(--font-serif); font-size: var(--text-xl); font-weight: var(--weight-medium); }
.request-email { margin: 0 0 var(--space-4); color: var(--muted); overflow-wrap: anywhere; }
.request-facts { display: flex; flex-direction: column; gap: var(--space-2); margin: 0; padding: 0; color: var(--nav-ink); font-size: var(--text-ui-sm); list-style: none; }
.request-facts li { display: flex; align-items: flex-start; gap: var(--space-2); }
.request-facts svg.icon { margin-top: 1px; color: var(--muted); }
.request-decide { display: flex; flex-direction: column; gap: var(--space-4); min-width: 0; padding: var(--space-6); }
.request-decide > .notice { margin: 0; }
.request-decide > .notice .small { margin-left: auto; }
.request-decide > .form-error:empty { display: none; }
.requests .decide-main { display: flex; flex-direction: column; gap: var(--space-3); }
.requests .decide-lead { margin: 0; color: var(--muted); font-size: var(--text-ui-sm); }
.requests .decide-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-3) var(--space-6); }
.requests .decide-row .field > input { width: 240px; max-width: 100%; }
.requests .request-decide fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.requests .request-decide fieldset.field { display: block; }
.requests .request-decide fieldset > legend { margin: 0 0 var(--space-2); padding: 0; }
.requests .decide-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.requests .subtitle { max-width: 760px; }
.requests .decide-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); margin-bottom: calc(-1 * var(--space-2)); padding-top: var(--space-3); border-top: 1px solid var(--border); }
.requests .decide-foot > button:first-child { margin-left: calc(-1 * var(--space-3)); }
.requests .decide-foot > button:last-child { margin-right: calc(-1 * var(--space-3)); margin-left: auto; }
.requests .decide-foot > :only-child { margin-left: auto; }
.requests .find-panel { display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-inset); background: var(--paper); }
.requests .find-panel > .form-error:empty { display: none; }
.requests .find-row { display: flex; gap: var(--space-2); }
.requests .find-row .search-field { flex: 1 1 auto; width: auto; }
.requests .find-results { margin: 0; padding: 0; list-style: none; }
.requests .find-results:empty { display: none; }
.requests .find-results li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 10px 0; border-top: 1px solid var(--border); }
.requests .find-results li:first-child { border-top: 0; }
.requests .find-family { display: flex; flex-direction: column; min-width: 0; font-size: var(--text-ui-sm); }
.requests .find-family strong { font-weight: var(--weight-strong); }
.requests .empty-state { display: flex; flex-direction: column; align-items: center; gap: var(--space-1); padding: var(--space-9) var(--space-6); border: 1px dashed var(--border-strong); border-radius: var(--radius-card); text-align: center; }
.requests .empty-state p { margin: 0; }
.requests .empty-state strong { font-weight: var(--weight-strong); }
.requests .empty-icon { display: grid; place-items: center; width: 40px; height: 40px; margin-bottom: var(--space-2); border-radius: 50%; background: var(--success-soft); color: var(--success); }
.requests .empty-icon svg.icon { width: 20px; height: 20px; }

@media (max-width: 760px) {
  .request-card { grid-template-columns: minmax(0, 1fr); }
  .request-who { padding: var(--space-4); border-right: 0; border-bottom: 1px solid var(--border); }
  .request-decide { padding: var(--space-4); }
  .requests .decide-row .field { flex: 1 1 100%; }
  .requests .decide-row .field > input { width: 100%; }
}

/* seat requests (/requests: #seat-requests, under the sign-ups, only while any wait): families
   asking for a seat in their name, each a .request-card as a sign-up's. */
.requests .seat-requests { margin-top: var(--space-8); }

/* names (/names; public/names.js): the search box (the Hebrew keyboard's key inside it, the
   keyboard opening under it) and Search, then the results: family, name, the Hebrew line (right
   to left, in the serif) and a Copy button that says "Copied". */
.names main { display: flex; flex-direction: column; gap: var(--space-4); max-width: 900px; }
.names .name-search { display: flex; align-items: flex-start; gap: var(--space-2); }
.names .search-field { flex: 0 1 460px; width: auto; }
.names .search-field .hebrew-field { display: flex; width: 100%; }
body.app.names .search-field .hebrew-field > input { flex: 1 1 auto; width: 100%; padding-left: 36px; }
.names .search-status { margin: 0; color: var(--muted); font-size: var(--text-ui-sm); }
.names .search-status:empty { display: none; }
.names .search-status.form-error { color: var(--error); }
.names-table td.family { font-weight: var(--weight-strong); }
.names-table :is(th, td):nth-child(3) { text-align: right; }
.names-table td.hebrew-line { font-family: var(--font-serif); font-size: var(--text-lg); }
.names-table td.copy-cell { width: 1%; padding-top: 0; padding-bottom: 0; text-align: right; white-space: nowrap; }
.names .copied { margin-right: 6px; color: var(--success); font-size: var(--text-ui-xs); }
.names .copied:empty { display: none; }

@media (max-width: 640px) {
  .names .name-search { flex-wrap: wrap; }
  .names .search-field { flex: 1 1 100%; }
}

/* portal (/portal: body.app.portal; public/portal.js): the subtitle (family · address), the calm
   notice that stands in for the page (a sign-up waiting or declined, no household yet), the
   loading stand-in, the summary strip, then the sections (ui.css .section) on a grid that uses the
   width: Your family across the page, Membership & payments beside the saved cards and Emails,
   then Giving across the page (its Give panel, then the pledges and monthly donations beside the
   giving history); one column under 1100px. Inside: the people rows (see "people rows"),
   automatic payment's inset, the card panels, the inline pledge form and the tables. */
.portal .subtitle > span + span::before { content: "\00b7"; margin-right: 10px; color: var(--border-strong); }
.portal .subtitle .skeleton { width: 280px; margin: 0; }
.portal #status.load-error { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.portal-state { max-width: 760px; line-height: 1.6; }
.portal-state a { color: inherit; text-underline-offset: 2px; }
.portal-state strong { font-weight: var(--weight-strong); }
.portal-loading { display: flex; flex-direction: column; gap: var(--space-5); }
.portal-loading .skeleton.block { margin: 0; }
.portal-loading .skeleton.stats-block { height: 118px; }
.portal-loading .skeleton.tall { height: 320px; }
#portal { display: flex; flex-direction: column; gap: var(--space-5); }
.portal .section { margin: 0; }
.portal-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--space-5); align-items: start; }
.portal-side { display: flex; flex-direction: column; gap: var(--space-5); min-width: 0; }
.portal fieldset { min-width: 0; margin: 0; padding: 0; border: 0; }
.portal fieldset.field > legend { margin: 0 0 6px; padding: 0; }

/* The summary strip. */
.portal .stat-value .of { color: var(--muted); font-weight: var(--weight-regular); }
.portal .seat-meter { display: flex; gap: var(--space-1); margin-top: 10px; }
.portal .seat-meter i { flex: 1; max-width: 36px; height: 4px; border-radius: 2px; background: var(--tint-strong); }
.portal .seat-meter i.on { background: var(--ink); }
.portal .stat-meta a { color: inherit; text-underline-offset: 2px; text-decoration-color: var(--border-strong); }
.portal .stat-meta a:hover { color: var(--ink); text-decoration-color: currentColor; }

/* Inside a section. */
.portal .section-body > * + * { margin-top: var(--space-5); }
.portal .section-body > .block + .block { margin-top: var(--space-7); }
.portal .section-body > .add-row { margin-top: var(--space-3); }
.portal .block > * + * { margin-top: 10px; }
.portal .block > p:empty { display: none; }
.portal .sub-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); margin: 0; }
.portal .sub-head h3, .portal h3.sub-head { margin: 0; }
.portal h3.sub-head { display: block; }
.portal h3 .count { margin-left: 6px; color: var(--muted); font-weight: var(--weight-regular); }
.portal .hint { margin: 0; }
.portal .form-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: var(--space-4); }
.portal .form-status { display: flex; flex-wrap: wrap; gap: var(--space-1) var(--space-4); }
.portal .form-status:not(:has(> p:not(:empty))) { display: none; }
.portal :is(.form-status, .card-foot, .section-foot, .inset-text, .inline-form-foot) > p:empty { display: none; }
.portal .w-money { width: 120px; }
.portal .w-date { width: 160px; }
.portal :is(.w-long, .w-full) { width: 100%; }
.portal .field.grow { flex: 1 1 240px; }
.portal .field:has(> :is(.w-long, .w-full)) { align-items: stretch; }

/* Your family: Save at the right of the foot; "These details are current" and its reason at the left. */
.portal .moved { margin-top: var(--space-5); }
.portal .moved a { color: inherit; text-underline-offset: 2px; }
.portal .confirm-part { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2) var(--space-3); margin-right: auto; }
.portal .confirm-part .hint { font-size: var(--text-ui-sm); }

/* Membership & payments. */
.portal .membership-status { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-2); margin: 0; }
.portal .card-part > * + * { margin-top: var(--space-4); }
.portal .card-part > .notice { margin-bottom: 0; }
.portal .inset { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-3) 14px; padding: 14px var(--space-4); border: 1px solid var(--border); border-radius: var(--radius-inset); background: var(--paper); }
.portal .inset-text { flex: 1 1 200px; min-width: 0; font-size: var(--text-ui-sm); line-height: 1.5; }
.portal .inset-text p { margin: 0; }
.portal .inset-text strong { font-weight: var(--weight-strong); }
.portal .inset-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-left: auto; }
.portal .inset-actions:not(:has(> :not([hidden]))) { display: none; }
.portal .autopay-dot { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--border-strong); box-shadow: 0 0 0 4px var(--tint-strong); }
.portal .autopay-inset:has([data-state="active"]) .autopay-dot { background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); }
.portal .autopay-inset:has([data-state="setting_up"], [data-state="unresolved"]) .autopay-dot { background: var(--warning); box-shadow: 0 0 0 4px var(--warning-soft); }
.portal .autopay-inset:has([data-state="failed"]) .autopay-dot { background: var(--error); box-shadow: 0 0 0 4px var(--danger-soft); }
.portal .card-panel { padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-inset); background: var(--paper); }
.portal .card-panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); margin-bottom: var(--space-4); }
.portal .card-panel-head h3 { margin: 0; }
.portal :is(.card-panel, .give-part) form > * + * { margin-top: var(--space-4); }
.portal .card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-3) var(--space-4); padding-top: var(--space-4); border-top: 1px solid var(--border); }
.portal .card-foot > p { margin: 0; }
.portal .data-table .money { font-weight: var(--weight-medium); }
.portal .data-table tr.cancelled td { color: var(--muted); }
.portal .data-table .actions-cell { text-align: right; }
.portal .row-actions { display: inline-flex; justify-content: flex-end; gap: var(--space-1); white-space: nowrap; }

/* Saved cards and Emails, in the side column. */
.portal #cards .section-body > * + * { margin-top: var(--space-3); }
.portal .email-choices { display: flex; flex-direction: column; gap: var(--space-3); }
.portal .email-choices label { align-items: flex-start; }
.portal .email-choices input { margin-top: 2px; }
.portal #emails-problem { margin: 0; font-size: var(--text-ui-sm); }
.portal #emails-problem a { color: inherit; }

/* Pledges: what it is for, who added it and its payments in the first cell; the inline form. */
.portal .pledge-for { width: 40%; min-width: 220px; }
.portal .pledge-for .pledge-purpose { font-weight: var(--weight-medium); }
.portal .pledge-for .chip { margin-left: var(--space-1); }
.portal .data-table .sub { display: block; margin-top: 2px; color: var(--muted); font-size: var(--text-ui-sm); }
.portal .data-table .sub a { color: inherit; text-underline-offset: 2px; }
.portal .pledge-table td { vertical-align: top; }
.portal .pledge-table .row-actions { display: flex; flex-direction: column; align-items: flex-end; gap: var(--space-2); }
.portal .pledge-gifts { display: flex; flex-direction: column; gap: 4px; margin: var(--space-2) 0 0; padding: 0; color: var(--muted); font-size: var(--text-ui-sm); font-variant-numeric: tabular-nums; list-style: none; }
.portal .pledge-gifts .card-chip { margin-left: 2px; }
.portal .inline-form { padding: var(--space-5); border: 1px solid var(--border); border-radius: var(--radius-inset); background: var(--paper); }
.portal .inline-form h4 { margin: 0 0 var(--space-3); font-size: var(--text-ui-sm); font-weight: var(--weight-semibold); }
.portal .inline-form-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: var(--space-2); margin-top: var(--space-4); }
.portal .inline-form-foot .form-error { margin-right: auto; }

/* Giving: its head (the hint, then Add a pledge and Give at the right), the Give panel ("What is
   this for?" and the pledge picker, then the donate or pledge pay part, each without a frame of its
   own), and the pledges and monthly donations beside the giving history. */
.portal .giving-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-4); }
.portal .giving-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); }
.portal .give-for { margin-bottom: var(--space-4); }
.portal .give-for select { max-width: 360px; }
.portal .give-part-title { margin: 0 0 var(--space-3); font-size: var(--text-ui-sm); font-weight: var(--weight-semibold); }
.portal .giving-grid { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.portal .giving-grid .portal-side { gap: var(--space-7); }
.portal .history-for { min-width: 140px; }

/* Monthly donations (the list /lib/donations.js makes). */
.portal .monthly-list { margin: 0; padding: 0; list-style: none; }
.portal .monthly-list > li { padding: 14px 0; border-bottom: 1px solid var(--border); }
.portal .monthly-list > li:first-child { padding-top: var(--space-1); }
.portal .monthly-list > li:last-child { border-bottom: 0; }
.portal .monthly-list p { margin: 0 0 var(--space-1); }
.portal .monthly-list .pledge-head { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2); }
.portal .monthly-list .pledge-sums { color: var(--muted); font-size: var(--text-ui-sm); }
.portal .monthly-list .pledge-actions { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-2); }

@media (max-width: 1100px) {
  .portal-grid, .portal .giving-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .portal .subtitle { flex-direction: column; align-items: flex-start; gap: 2px; }
  .portal .subtitle > span + span::before { content: none; }
  .portal .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .portal .stat { padding: 14px var(--space-4) var(--space-4); }
  .portal .stat-value { font-size: var(--text-2xl); }
  .portal .section > summary { flex-wrap: wrap; row-gap: 2px; padding-right: var(--space-4); padding-left: var(--space-3); }
  .portal .section > summary .summary-note { flex-basis: 100%; margin-left: 27px; text-align: left; }
  .portal .section-body { padding: var(--space-1) var(--space-4) var(--space-5); }
  .portal .section-foot { padding: var(--space-3) var(--space-4); }
  .portal :is(.card-panel, .inline-form) { padding: var(--space-4); }
  .portal .confirm-part { flex-basis: 100%; }
}

/* member seats (/portal/seats: body.app.member-seats; public/portal/seats.js): the membership
   notice, the toolbar (the legend from the chart's own .seat classes, what a tap does, and the last
   claim's or release's outcome), the move-in-progress notice, the chart on its card (scrolling
   sideways inside it on a narrow screen, a grey block until the seats load), and the seat dialog
   (Release at the left of its footer). */
.member-seats .notice { margin: 0 0 var(--space-4); }
.member-seats #state { max-width: 760px; }
.member-seats .notice a { color: inherit; }
.member-seats #moving { align-items: center; }
.member-seats #moving > p { flex: 1 1 auto; }
.member-seats .seat-toolbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-6); min-height: var(--size-button); margin-bottom: var(--space-3); }
.member-seats .seat-help { margin: 0; color: var(--muted); font-size: var(--text-ui-sm); }
.member-seats .seat-outcome { flex-basis: 100%; }
.member-seats .seat-outcome:not(:has(> p:not(:empty))) { display: none; }
.member-seats .seat-outcome > p:empty { display: none; }
.member-seats #chart-scroll { 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); }
@media screen { .member-seats #chart { --seat-col: minmax(37px, 1fr); } }
.member-seats #chart > .skeleton.block { grid-column: 1 / -1; height: 520px; margin: 0; }
.member-seat-dialog .seat-dialog-text { margin: 0; color: var(--muted); }
.member-seat-dialog form { margin-top: var(--space-4); }
.member-seat-dialog .field > select { width: 100%; }
.member-seat-dialog .form-error:empty { display: none; }
.member-seat-dialog .form-error { margin-top: var(--space-3); }
.member-seat-dialog .dialog-actions #release { margin-right: auto; }
@media (max-width: 640px) {
  .member-seats #chart-scroll { padding: var(--space-3); }
  .member-seats #moving { flex-wrap: wrap; }
}

/* family seats (/portal/seats: #family-seats, above the chart): the seats named for the family
   from before the members site, each with "These are ours" or the "Asked" chip at its right. */
.member-seats .family-seats { max-width: 760px; margin: 0 0 var(--space-4); padding: var(--space-4) var(--space-5); }
.member-seats .family-seats h2 { margin: 0 0 var(--space-1); font-size: var(--text-lg); }
.member-seats .family-seats-help { margin: 0 0 var(--space-2); color: var(--muted); font-size: var(--text-ui-sm); }
.member-seats .family-seat-list { margin: 0; padding: 0; list-style: none; }
.member-seats .family-seat-list li { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2) var(--space-3); padding: var(--space-2) 0; border-top: 1px solid var(--border); }
.member-seats .family-seat-list li:first-child { border-top: 0; }
.member-seats .family-seat-name { flex: 1 1 12em; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-seats .family-seat-name strong { font-weight: var(--weight-strong); }

/* banquest link (/household's Membership; public/household.js): the Banquest customers linked to
   the household with Unlink, and the "Link a Banquest customer" dialog: the search and its results
   (each a full-width row button), then the customer picked, its cards and its running schedules,
   each with what it becomes here. */
.household .banquest-list { margin: 0; padding: 0; list-style: none; }
.household .banquest-list li { display: flex; align-items: center; justify-content: space-between; gap: var(--space-3); padding: 10px 0; border-bottom: 1px solid var(--border); }
.household .banquest-list li:last-child { border-bottom: 0; }
.household .banquest-who { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px var(--space-2); min-width: 0; }
.household .banquest-who strong { font-weight: var(--weight-strong); }
.household .link-dialog { width: 600px; }
.household .link-dialog h3 { margin: var(--space-5) 0 var(--space-2); font-size: var(--text-ui-sm); font-weight: var(--weight-semibold); }
.household .link-dialog .hint:empty, .household .link-dialog .form-error:empty { display: none; }
.household .link-dialog > .form-error { margin-top: var(--space-3); }
.household .link-results, .household .link-cards { margin: var(--space-3) 0 0; padding: 0; list-style: none; }
.household .link-results li + li { margin-top: var(--space-1); }
.household .link-results .link-result { flex-direction: column; align-items: flex-start; gap: 2px; width: 100%; height: auto; padding: var(--space-2) var(--space-3); font-weight: var(--weight-regular); text-align: left; white-space: normal; }
.household .link-result strong { font-weight: var(--weight-strong); }
.household .link-who { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--space-2); }
.household .link-who p { margin: 0; }
.household .link-cards li { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-1) var(--space-3); padding: 6px 0; }
.household .link-cards li.expired { color: var(--muted); }
.household .link-cards li.expired img.card-brand { opacity: 0.5; }
.household fieldset.link-schedule { padding: var(--space-3) 0; border-top: 1px solid var(--border); }
.household fieldset.link-schedule > legend { float: left; width: 100%; margin-bottom: var(--space-2); color: var(--ink); }
.household fieldset.link-schedule > label { margin-top: var(--space-1); }
