/* Zionfold — "Call and Response"
   ---------------------------------------------------------------------------
   Visual system from Grok's direction; the fixed four-beat ordering from
   Codex's; the touch-target corrections from Gemini's. No build step: this file
   is the file that runs.

   THE LAW, stated once, because breaking it is how this design dies:
     · Gold is NEVER a word on ivory (2.03:1) and ivory is NEVER a word on gold
       (2.27:1). Gold is a FIELD you put wine-black on, or a stripe trapped
       between wine. Bronze is gold when it has to be a word on paper.
     · Wine is the cloth. Ivory is the paper. One cloth, both themes.
     · Body text is never grey. --ink-2 is a wine, and it is still a word.

   Every pair below was measured with ~/.claude/tools/contrast.py, not guessed.
   Floors: 4.5:1 for anything read, 3:1 for borders and UI edges.            */

:root {
  /* ⚠️ `light dark` lets the BROWSER choose, from the device setting — which is
     wrong the moment somebody picks a theme in the app. On a laptop set to
     light, choosing dark left every native control behind: the Choose File
     button on the import page, date and time pickers, scrollbars and the
     dropdown a <select> opens all stayed white on a dark page.
     So the default below follows the device as before, and each of the three
     theme blocks states its own, which is the only part that fixes it. */
  color-scheme: light;

  /* --- Light: Sunday morning ------------------------------------------- */
  --bg: #F6EBE4;          /* page — wine-ivory, not clinic cream */
  --bg-deep: #E8D0C8;     /* deeper cloth at the edges */
  --surface: #FFF9F4;     /* ivory paper — forms and books */
  --surface-2: #F3DDD4;   /* light wine wash — hover, zebra */
  --ink: #2A1216;         /* wine-black body */
  --ink-2: #5C3338;       /* second voice, still a wine */
  --line: #8A6058;        /* 5.16:1 on surface — a border you can see in glare */

  --cloth: #8B1E3F;       /* pulpit wine — banner, call panel, sash */
  --cloth-ink: #FFF9F4;   /* 8.54:1 on cloth */
  /* The same wine, but used as a MARK on the page rather than as a panel:
     a border, a focus ring, a tick, a chart bar, a dot. A panel can stay
     wine in the dark because it carries its own pale ink; a mark cannot,
     because there is nothing behind it but the dark hall. See the dark
     blocks below, where this — and only this — becomes the rose. */
  --cloth-mark: #8B1E3F;  /* 8.54:1 on surface, 7.61:1 on the page */
  --gold: #D4A017;        /* the response — a FIELD, never a word on paper */
  --gold-ink: #2A1216;    /* 7.39:1 on gold */

  --primary: #8B1E3F;
  --primary-hover: #6E152F;
  --primary-ink: #FFF9F4;
  --primary-soft: #F8DCD6;

  --accent: #7A4200;      /* bronze — gold when it must be a WORD (7.71:1) */
  --emerald: #0E5C42;     /* the reserved third series (7.65:1 on surface) */
  --emerald-ink: #FFF9F4;

  --danger: #B42318;
  --danger-soft: #FDECEC;
  --success: #145C30;
  --success-soft: #DCEFDE;

  --radius: 4px;          /* not a 14px bubble, not a brutalist brick */
  --radius-sm: 3px;
  --shadow: 0 1px 2px rgba(42, 18, 22, .10);
  --shadow-lg: 0 2px 6px rgba(42, 18, 22, .14);

  --sash: 20px;

  /* Convention-banner type, not cathedral type. No font file: a webfont that
     arrives late is a layout jump in a doorway queue. */
  --font-display: "Segoe UI Variable Display", "Arial Narrow",
    "Helvetica Neue Condensed", "Gill Sans", "Segoe UI",
    ui-sans-serif, system-ui, sans-serif;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI",
    Roboto, "Helvetica Neue", sans-serif;
}

/* --- Dark: praise night ------------------------------------------------
   The lights go down. The cloth stays wine. Gold is what you can still see
   from the back row. Buttons flip to rose-wine because one colour cannot be
   dark enough for ivory-on-fill AND light enough for fill-on-hall.        */

/* Choosing light on a device set to dark has to take the native controls back
   with it, or they stay dark on an ivory page — the same fault the other way. */
:root[data-theme="light"] { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #16080C;
    --bg-deep: #0C0406;
    --surface: #241016;
    --surface-2: #2A141C;
    --ink: #FFF4EA;
    --ink-2: #E8C8B4;        /* warm second voice, not lavender-grey */
    --line: #C49088;         /* 6.63:1 on surface */

    --cloth: #8B1E3F;        /* the cloth does not become pink */
    --cloth-ink: #FFF4EA;
    --cloth-mark: #E38A9A;   /* 7.21:1 on surface — wine here was 2.0:1 */
    --gold: #D4A017;
    --gold-ink: #16080C;

    --primary: #E38A9A;      /* rose-wine, so a link reads on the dark hall */
    --primary-hover: #F0A8B4;
    --primary-ink: #16080C;
    --primary-soft: #3A1820;

    --accent: #F0C14D;       /* gold as a word, on dark only (10.72:1) */
    --emerald: #6FD3A6;      /* 9.95:1 on surface */
    --emerald-ink: #16080C;

    --danger: #FFB4A8;
    --danger-soft: #3A1416;
    --success: #8EE0A8;
    --success-soft: #14331F;

    --shadow: 0 1px 2px rgba(0, 0, 0, .5);
    --shadow-lg: 0 2px 8px rgba(0, 0, 0, .6);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #16080C;
  --bg-deep: #0C0406;
  --surface: #241016;
  --surface-2: #2A141C;
  --ink: #FFF4EA;
  --ink-2: #E8C8B4;
  --line: #C49088;
  --cloth: #8B1E3F;
  --cloth-ink: #FFF4EA;
  --cloth-mark: #E38A9A;
  --gold: #D4A017;
  --gold-ink: #16080C;
  --primary: #E38A9A;
  --primary-hover: #F0A8B4;
  --primary-ink: #16080C;
  --primary-soft: #3A1820;
  --accent: #F0C14D;
  --emerald: #6FD3A6;
  --emerald-ink: #16080C;
  --danger: #FFB4A8;
  --danger-soft: #3A1416;
  --success: #8EE0A8;
  --success-soft: #14331F;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding-left: var(--sash);        /* nothing hides under the rail */
  font-family: var(--font);
  font-size: 1.0625rem;             /* 17px — iPhone will not zoom the page */
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===========================================================================
   THE PROCESSIONAL SASH
   A rail on every screen. Wine outside, gold trapped in the middle — because
   a thin gold stripe on a light page is 2.03:1 and simply is not there.
   In dark the sash inverts to rose/gold/rose: dark wine on a dark hall is
   ~2:1, which would be the same crime.
   =========================================================================== */

body::before {
  content: "";
  position: fixed;
  left: 0; top: 0; bottom: 0;
  width: var(--sash);
  z-index: 50;
  /* --cloth, not --cloth-mark: WINE either side of the gold, in both themes.
     The owner chose this looking at the two side by side — the mark token
     flips to rose for the dark hall, and he wants the wine.
     This is what design/DECISION.md said in the first place ("the sash stays
     #8B1E3F when the lights go down"); the rose was a later reading of it.
     The consequence, stated rather than hidden: on the dark page the wine
     bars are 2.19:1, so at night the sash reads mostly as its gold line with
     the wine barely there. It carries no information, only the signature, so
     that is a look and not a fault. */
  background: linear-gradient(to right,
    var(--cloth) 0 7px, var(--gold) 7px 13px, var(--cloth) 13px 20px);
}

@media (max-width: 360px) {
  :root { --sash: 10px; }
  body::before {
    background: linear-gradient(to right,
      var(--cloth) 0 3px, var(--gold) 3px 7px, var(--cloth) 7px 10px);
  }
}

/* --- Type --------------------------------------------------------------- */

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.08;
  margin: 0 0 .4em;
}
h1 { font-size: clamp(1.9rem, 1.4rem + 2vw, 2.75rem); }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; }
a { color: var(--primary); }

.muted { color: var(--ink-2); }        /* a wine, never a grey */
.small { font-size: .92rem; }

/* ===========================================================================
   Layout
   =========================================================================== */

.shell {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 1.25rem;
  background: var(--bg);
}

.card {
  width: 100%;
  max-width: 560px;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: clamp(1.4rem, 1rem + 2vw, 2.25rem);
}

/* Grok: kill the rounded letter-square. The mark is a fragment of the sash. */
.brand { display: flex; align-items: center; gap: .8rem; margin-bottom: 1.5rem; }

.brand-mark {
  width: 26px; height: 36px; flex: none;
  font-size: 0; color: transparent;      /* the letter is not the mark */
  /* A fragment of the sash, so it takes the sash's token: wine on the dark
     hall was 2.19:1 and the mark all but vanished. */
  background: linear-gradient(to right,
    var(--cloth-mark) 0 9px, var(--gold) 9px 17px, var(--cloth-mark) 17px 26px);
  border-radius: 2px;
}

.brand-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -.02em;
}

/* --- Forms -------------------------------------------------------------- */

.field { margin-bottom: 1.1rem; }

label {
  display: block;
  font-weight: 700;
  font-size: .95rem;
  margin-bottom: .4rem;
  color: var(--ink);
}

.hint { font-size: .9rem; color: var(--ink-2); margin: .35rem 0 0; }

input, select, textarea {
  width: 100%;
  min-height: 52px;                  /* Gemini: standing up, one hand */
  padding: .7rem .85rem;
  font: inherit;
  font-size: 1.0625rem;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color .12s, box-shadow .12s;
}

/* ⚠️ A TICK IS NOT A BOX TO TYPE IN.
   The rule above says `input {width:100%; min-height:52px; padding; border}`,
   which is right for something you type into and absurd for a radio or a
   checkbox — it drew one 616px wide and 52px tall, a white disc floating in
   the middle of the import page's date question.
   Four components had each undone it for themselves (.cap, .chip-pick, .pick,
   .row-tick), so every NEW tick anywhere in the app started out broken and
   waited to be noticed. Undoing it once here is the fix; those four keep their
   own sizes and their accent colour, and nothing else has to remember. */
input[type="checkbox"], input[type="radio"] {
  width: 20px;
  height: 20px;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  accent-color: var(--cloth-mark);
  /* The label beside it is clickable too, which is what carries the touch
     target — a 20px disc on its own would be under the 44px floor. */
  vertical-align: middle;
}


input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--cloth-mark);
  box-shadow: 0 0 0 3px var(--primary-soft);
}

::placeholder { color: var(--ink-2); opacity: 1; }

.row { display: grid; gap: 1rem; grid-template-columns: 1fr 1fr; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }

button, .btn {
  font: inherit;
  font-family: var(--font-display);
  font-weight: 800;
  letter-spacing: -.01em;
  min-height: 52px;
  padding: .8rem 1.4rem;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  background: var(--primary);
  color: var(--primary-ink);
  transition: background .12s;
}

button:hover, .btn:hover { background: var(--primary-hover); }
/* .65 put disabled labels at 3.85:1, and .82 still left a disabled Delete at
   4.26:1 on the page. At .86 the faintest disabled label in either theme is
   4.56:1. A disabled control still has to say what it is; "off" is carried by
   the muted fill and the cursor. */
button:disabled { opacity: .86; cursor: not-allowed; }

/* `.btn.secondary` as well as `button.secondary` — the "Back to dashboard"
   control is an <a>, and a button-only selector left it filled. */
.secondary {
  background: transparent;
  color: var(--primary);
  border-color: var(--line);
}
.secondary:hover { background: var(--surface-2); }

.btn-full { width: 100%; }

/* --- Messages ----------------------------------------------------------- */

.msg {
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.1rem;
  font-size: .96rem;
  border: 2px solid transparent;
}
.msg-error   { background: var(--danger-soft);  color: var(--danger);  border-color: var(--danger); }
.msg-success { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.msg[hidden] { display: none; }

.steps { display: flex; gap: .4rem; margin-bottom: 1.6rem; }
.step { flex: 1; height: 6px; border-radius: 2px; background: var(--surface-2); }
.step.done { background: var(--cloth-mark); }

/* ===========================================================================
   App chrome
   =========================================================================== */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem clamp(1rem, 3vw, 2rem);
  background: var(--surface);
  border-bottom: 2px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 10;
}

.page { padding: clamp(1.25rem, 3vw, 2.25rem); max-width: 1120px; margin: 0 auto; }


/* An empty panel teaches nothing and holds the page open. */
.tile:empty { display: none; }

/* --------------------------------------------------------------------------
   THE WORKBENCH — a list on the left, the work on the right.
   The owner: "there's too much infinite scrolling... it's tiring, it's not
   user-friendly. There should be a sidebar where you select something and
   then you can face it on the main pane on the right."
   He is right. Every page was one long column: open a form and it shoved the
   list off the bottom of the screen, so you scrolled to find someone, scrolled
   back to work on them, and lost your place both ways. That is fine on a phone,
   where one thing at a time is all that fits, and wrong on a laptop with half
   the screen empty.
   So on a wide screen the two halves sit side by side and scroll SEPARATELY.
   Below 980px it falls back to one column, because a phone has no room for two.
   -------------------------------------------------------------------------- */
.workbench { display: grid; gap: 1.25rem; align-items: start; }

@media (min-width: 980px) {
  .workbench {
    /* A LIST is not a BODY and must not be the same width as one. This one
       carries people with their groups and buttons, so it is wide — but still
       a third of the page, never half. */
    grid-template-columns: minmax(300px, 24rem) minmax(0, 1fr);
    /* Each side keeps its own scrollbar and stays put while the other moves.
       6.5rem clears the sticky topbar. */
    align-items: start;
  }
  .wb-list,
  .wb-work {
    position: sticky;
    top: calc(var(--masthead) + 1.25rem);
    max-height: calc(100vh - var(--masthead) - 2.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  /* A hairline so the two halves read as two halves. */
  .wb-work { padding-left: 1.25rem; border-left: 2px solid var(--line); }

  /* THE SEARCH MUST NOT SCROLL AWAY FROM THE LIST IT SEARCHES.
     The controls stay put and only the marked child scrolls — no hand-measured
     offsets, which is what put the Guide's search box on top of its own
     contents list. A column with nothing marked is untouched. */
  .wb-list:has(> .wb-scroll) { display: flex; flex-direction: column; }
  .wb-list > .wb-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}

/* A plain menu — words you choose between, with no detail of their own —
   needs far less room than a list of people. Equal columns would read as two
   bodies of text side by side. */
@media (min-width: 980px) {
  .workbench.menu-left { grid-template-columns: minmax(190px, 15rem) minmax(0, 1fr); }
}

/* Whoever is open on the right is marked on the left, so the two halves are
   visibly about the same person. */
/* The controls belong to the person you have chosen, not to all 23 of them.
   Measured before this: a row was 244px, of which 96px was four buttons that
   could not fit the column and wrapped onto two lines on every single row. */
.row-actions { display: none; gap: .5rem; flex-wrap: wrap; flex: 1 1 100%; }
.person-row.is-open .row-actions { display: flex; }

.person-row.is-open {
  background: var(--primary-soft);
  border-radius: var(--radius);
  box-shadow: inset 3px 0 0 var(--cloth-mark);
}

/* A person's page shown inside the Members workbench: no second banner, no
   second Back button, and no page padding fighting the pane's own. */
.in-pane .topbar { display: none; }
/* The wine-and-gold sash is the edge of the WINDOW. Inside a pane there is
   already a border there, and two stripes side by side read as a mistake. */
html.in-pane body::before { display: none; }
html.in-pane body { padding-left: 0; background: transparent; }
/* The toast clears the sash on a full page. Inside the pane there is no sash,
   so that 20px put every confirmation slightly off where it belongs. */
html.in-pane .toast-host { left: 1rem; }
.in-pane .page { padding: 0; max-width: none; }


/* The frame the person's page sits in. Its own scroll, so the list beside it
   never moves. */
/* `display: block` here would beat the browser's own `[hidden]` rule and leave
   a tall blank frame sitting there before anyone has been picked. */
.wb-frame { width: 100%; border: 0; min-height: 70vh; }
.wb-frame[hidden] { display: none; }

/* The one thing the app asks for. Deliberately quiet — it is a signpost, not
   a telling-off. */
.req { font-weight: 700; font-size: .78em; color: var(--cloth-mark); }

/* A heading that folds. It must LOOK pressable, or nobody presses it — the
   mark turns, the count stays on the line, and nothing is lost by closing. */
.fold-head {
  display: flex;
  align-items: center;
  gap: .5rem;
  width: 100%;
  min-height: 44px;
  padding: .2rem 0;
  background: none;
  border: 0;
  border-radius: var(--radius);
  font: inherit;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
/* ⚠️ THE BACKGROUND RESET IS NOT OPTIONAL.
   `.fold-head { background: none }` (0,1,0) LOSES to `button:hover`
   (0,1,1), so pointing at a fold heading painted wine text on wine fill:
   #8B1E3F on #6E152F = 1.30:1, all but invisible. It has been live on
   Structure since folding was added. Measured in a browser, not guessed. */
.fold-head:hover,
.fold-head:focus-visible { background: none; }
.fold-head:hover { color: var(--primary); }
.fold-mark {
  flex: none;
  width: 0; height: 0;
  border-left: 7px solid currentColor;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  transition: transform .12s ease;
}
.fold-head[aria-expanded="true"] .fold-mark { transform: rotate(90deg); }
@media (prefers-reduced-motion: reduce) { .fold-mark { transition: none; } }

/* How many are inside, so closing one hides nothing you needed to know. */
.count-pill {
  font-family: var(--font);
  font-size: .78rem;
  font-weight: 700;
  padding: .1rem .45rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink-2);          /* 10.13:1 light · 8.11:1 dark */
}

/* A fold that reads as a control, not as a heading that happens to click. */
.roster > summary,
.add-new > summary {
  cursor: pointer;
  font-weight: 700;
  padding: .55rem 0;
  min-height: 44px;
  display: flex;
  align-items: center;
}
.roster > summary:hover,
.add-new > summary:hover { color: var(--primary); }
.add-new { border-top: 1px solid var(--line); padding-top: .4rem; }

/* ===========================================================================
   THE FRAME — a masthead across the top, the menu down the left.

   The owner, on a rail that was made of the app's own paper: "it looks like
   the sidebar is different from the rest of the app... like an afterthought."
   The cause was that the top bar carrying the CHURCH'S NAME began to the right
   of the rail, so the name lived in the content area while the rail's head was
   blank — two slabs, bolted together.

   One wine band now runs across the WHOLE top, so the name sits OVER the
   menu's column instead of beside it and the frame reads as one L.

   Note what the tokens will not allow: a gold hairline under the masthead is
   2.27:1 against --line and 2.03:1 against the page. Gold cannot leave the
   wine. So the masthead's bottom edge is --line, and the gold stays where the
   sash keeps it.
   =========================================================================== */

:root { --masthead: 3.5rem; }

.masthead {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--masthead);
  z-index: 45;
  display: flex;
  align-items: center;
  gap: .6rem;
  padding: 0 clamp(.7rem, 2vw, 1.2rem) 0 calc(var(--sash) + .7rem);
  background: var(--cloth);
  border-bottom: 2px solid var(--line);   /* 4.60:1 light · 7.16:1 dark */
}

/* The mark on an ivory plaque — and the slot a church's own logo drops into
   later, at the size a logo wants, with nothing else moving.
   --cloth-ink, NOT --surface: --surface flips with the theme and in dark is
   #241016, which on this wine is 2.03:1 — the plaque would vanish. */
.mh-mark {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 2px;
  background:
    linear-gradient(to right,
      var(--cloth) 0 7px, var(--gold) 7px 14px, var(--cloth) 14px 21px)
      no-repeat center / 21px 24px,
    var(--cloth-ink);
}
.mh-mark img { width: 100%; height: 100%; object-fit: contain; border-radius: 2px; }

.mh-id { min-width: 0; flex: 1; }

.mh-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.02rem;
  letter-spacing: -.02em;
  line-height: 1.15;
  color: var(--cloth-ink);          /* 8.54:1 light · 8.23:1 dark */
  /* A church's name is its name: one line in the band, never cut mid-word. */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* No second voice on the cloth — no --ink-2, no grey. The quiet line is the
   same ivory one size down, because the smallest print must never be the
   hardest to read. */
.mh-who {
  font-size: .8rem;
  line-height: 1.2;
  color: var(--cloth-ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* .secondary on the cloth would be --primary on wine: 1.00:1 text, 1.65:1
   border. Gone. Ivory outline instead. */
.masthead #navSignOut,
.masthead #navSearch,
.masthead #navTheme {
  flex: none;
  background: transparent;
  color: var(--cloth-ink);          /* 8.54:1 · 8.23:1 */
  border: 2px solid var(--cloth-ink);
}
.masthead #navSearch { display: inline-flex; align-items: center; gap: .35rem; }
.masthead #navSearch svg { flex: none; }
.masthead #navSignOut:hover,
.masthead #navSearch:hover,
.masthead #navTheme:hover { background: rgba(255, 255, 255, .14); }
.masthead #navSignOut:focus-visible,
.masthead #navSearch:focus-visible,
.masthead #navTheme:focus-visible { outline-color: var(--cloth-ink); }

/* THE SEARCH BOX — opens under the band, over the page, on every screen.
   The panel is paper on the page's own tokens, so it reads in both themes;
   the dimmed page behind it says "this is on top, press outside to close". */
.search-panel {
  position: fixed;
  inset: var(--masthead) 0 0 0;
  z-index: 60;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: .75rem 16px;
  background: rgba(22, 8, 12, .45);
}
.search-panel[hidden] { display: none; }
.search-inner {
  width: min(40rem, 100%);
  max-height: calc(100% - .5rem);
  overflow: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: .9rem 1rem 1rem;
}
.search-row { display: flex; gap: .5rem; align-items: center; }
.search-row input { flex: 1; min-width: 0; }
.search-head {
  margin: 1rem 0 .25rem;
  font-size: .82rem;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink);
}
.search-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.search-list a {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .1rem .6rem;
  min-height: 44px;
  padding: .55rem .6rem;
  border-radius: var(--radius-sm);
  color: var(--ink);
  text-decoration: none;
}
.search-list a:hover,
.search-list a:focus-visible {
  background: var(--primary-soft);
  outline: 2px solid var(--primary);
  outline-offset: -2px;
}
.search-label { font-weight: 600; }
.search-detail { font-size: .88rem; color: var(--ink-2); }

/* On a phone the church's name is what matters; "Dark" is a convenience and
   can keep its 44px target without also taking the width of a word. */
@media (max-width: 460px) {
  .masthead #navTheme { padding-left: .5rem; padding-right: .5rem; }
}

/* --- The menu, down the left ------------------------------------------- */

.sidenav {
  position: fixed;
  left: var(--sash);
  top: var(--masthead);
  bottom: 0;
  width: 13rem;
  z-index: 40;
  display: flex;
  flex-direction: column;
  gap: .15rem;
  padding: .8rem .7rem;
  background: var(--surface);
  border-right: 2px solid var(--line);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.sidenav ul { list-style: none; margin: 0; padding: 0; flex: 1; }
.sidenav li { margin: 0; }

.sidenav a {
  /* flex, not block: as a block the box was 44px with the label at its top. */
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: .5rem .7rem;
  border-radius: var(--radius);
  color: var(--ink);                /* 14.98:1 light · 18.04:1 dark */
  text-decoration: none;
  font-size: .95rem;
  line-height: 1.35;
}
.sidenav a:hover { background: var(--surface-2); }

/* Where you are — the wine mark the app already uses for "this one", never
   colour alone: the weight changes too and aria-current carries it for anyone
   not looking at colour. Text 13.54:1 / 14.56:1, mark 6.88:1 / 6.29:1. */
.sidenav a[aria-current="page"] {
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--cloth-mark);
  font-weight: 650;
}

/* The sash starts below the band rather than cutting through it. */
html.has-nav body::before { top: var(--masthead); }

html.has-nav body {
  padding-left: calc(var(--sash) + 13rem);
  padding-top: var(--masthead);
}

/* The masthead carries the church's name now, so every page's own top bar said
   the same thing twice — plus a page label already standing as the <h1>, plus
   a "Back to dashboard" button pointing at the first item in the menu. */
html.has-nav .topbar { display: none; }

@media (min-width: 980px) {
  /* The toast belongs over the work, not centred on a window the menu is no
     longer part of. */
  html.has-nav .toast-host { left: calc(var(--sash) + 13rem + 1rem); }
}

/* A sidebar on a 360px screen IS the screen. Below the workbench breakpoint the
   band stays one row and the menu becomes a strip beneath it, scrolling
   sideways — always visible, never behind a button, because a hidden menu is a
   menu nobody finds. */
@media (max-width: 979px) {
  .masthead { position: sticky; }
  .mh-who { display: none; }         /* no room; the dashboard says it in full */
  .masthead .small-btn { padding: .4rem .6rem; font-size: .86rem; }

  .sidenav {
    position: sticky;
    top: var(--masthead);
    left: auto;
    bottom: auto;
    width: auto;
    flex-direction: row;
    align-items: center;
    gap: .3rem;
    padding: .45rem .6rem;
    border-right: 0;
    border-bottom: 2px solid var(--line);
    overflow-x: auto;
    overscroll-behavior-x: contain;

  }

  .sidenav ul { display: flex; gap: .3rem; flex: 0 0 auto; }
  /* 44px, not 40: the floor the design decision set and the August audit
     flagged. A thumb at a door gets 44. */
  .sidenav a { white-space: nowrap; min-height: 44px; padding: .45rem .7rem; }

  html.has-nav body { padding-left: var(--sash); padding-top: 0; }
  html.has-nav body::before { top: 0; }
  html.has-nav .toast-host { left: calc(var(--sash) + 1rem); }
}

/* On a small phone the church's name needs the room more than the word does:
   the glass alone, still a 44px target, still named "Search" to a screen reader. */
@media (max-width: 479px) {
  .masthead #navSearch .nav-search-word { display: none; }
}

/* Printing a report should print the report. */
@media print {
  .sidenav, .masthead { display: none; }
  html.has-nav body { padding-left: 0; padding-top: 0; }
}

/* "Showing: Everyone" — the one lens, in the same place on every screen. */
.viewfilter {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
}
.viewfilter label {
  margin: 0;
  font-weight: 650;
  font-size: .9rem;
  color: var(--ink-2);
}
.viewfilter select { width: auto; min-width: 13rem; max-width: 100%; }
.viewfilter[hidden] { display: none; }

/* The filter row above a list. Wraps rather than scrolling sideways. */
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  margin-bottom: .7rem;
}
.filters .filter-label {
  font-size: .8rem;
  font-weight: 700;
  color: var(--ink-2);
  margin-right: .15rem;
}

/* What the right-hand side says before you have picked anybody. */
.wb-empty {
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--ink-2);
}
.wb-empty strong { display: block; font-size: 1.05rem; color: var(--ink); margin-bottom: .3rem; }

/* How many are being shown, so a filtered list never looks like a lost one. */
.list-count { font-size: .85rem; color: var(--ink-2); margin: 0 0 .5rem; }

/* --- The wine banner ---------------------------------------------------- */

.banner {
  background: var(--cloth);
  color: var(--cloth-ink);
  padding: .9rem 1.15rem;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.banner .banner-title {
  font-family: var(--font-display); font-weight: 800; font-size: 1.2rem;
  margin: 0;
}

/* ===========================================================================
   THE FOUR BEATS — Codex's contribution.
   Presence · People · Partnership · Care, in that order, on every screen.
   Learn it once and you always know where to look. The colour always carries
   a number and a label; it is information, never decoration.
   =========================================================================== */

.beats {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr 1fr;
  gap: .75rem;
  margin-bottom: 1.5rem;
}
@media (max-width: 900px) { .beats { grid-template-columns: 1fr 1fr; } }
@media (max-width: 480px) { .beats { grid-template-columns: 1fr; } }

.beat {
  background: var(--surface);
  border: 2px solid var(--line);
  border-top: 6px solid var(--line);
  border-radius: var(--radius);
  padding: .9rem 1.05rem;
  min-height: 104px;
}
.beat-label {
  font-size: .74rem;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.beat-value {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 1.5rem + 1.4vw, 2.5rem);
  font-weight: 800;
  letter-spacing: -.03em;
  line-height: 1.1;
}
.beat-note { font-size: .9rem; color: var(--ink-2); }

.beat-presence    { border-top-color: var(--cloth-mark); }
.beat-people      { border-top-color: var(--cloth-mark); }
.beat-people    .beat-value { color: var(--cloth-mark); }
/* Gold on paper is 2.27:1, under the 3:1 floor, and this rail is pure colour
   with no word in it to carry the meaning. --accent is the bronze already kept
   for "gold when it has to be read" (7.71:1 light, 10.72:1 dark) and is what
   the number below it already uses — so Partnership now matches the other three
   beats, where the rail and the number are one colour. */
.beat-partnership { border-top-color: var(--accent); }
.beat-partnership .beat-value { color: var(--accent); }   /* bronze, never gold-as-word */
.beat-care        { border-top-color: var(--emerald); }
.beat-care      .beat-value { color: var(--emerald); }

/* --- The antiphonal tile: call | response, sharing one edge -------------- */

.anti { display: grid; grid-template-columns: 1fr 1fr; min-height: 104px; }

.anti-call, .anti-resp { padding: .9rem 1.05rem; }
.anti-call {
  background: var(--cloth);
  color: var(--cloth-ink);
  border-radius: var(--radius) 0 0 var(--radius);
}
.anti-resp {
  background: var(--gold);
  color: var(--gold-ink);
  border-radius: 0 var(--radius) var(--radius) 0;
}
.anti .beat-label { color: inherit; opacity: .92; }
.anti .beat-value { color: inherit; }

/* The one motion: the response fills left to right, like the answer walking
   down the aisle. 180ms, ease-out. No bounce, no spring, no confetti. */
@keyframes respond { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.anti-resp { animation: respond 180ms ease-out; }
@media (prefers-reduced-motion: reduce) { .anti-resp { animation: none; } }

/* --- Tiles -------------------------------------------------------------- */

.tile-grid { display: grid; gap: .9rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }

.tile {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  padding: 1.05rem 1.15rem;
}

.tile-label { font-size: .9rem; color: var(--ink-2); font-weight: 600; }
.tile-value { font-family: var(--font-display); font-size: 1.8rem; font-weight: 800; letter-spacing: -.02em; }

.pill {
  display: inline-block;
  padding: .25rem .65rem;
  border-radius: 2px;
  font-size: .82rem;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1.5px solid var(--primary);
}

/* Gemini: a bright pill on an inactive tile reads as MORE active, and people
   tap it and think the app is broken. Not-yet-built states are quiet. */
.pill-pending {
  background: transparent;
  color: var(--ink-2);
  border: 1.5px dashed var(--line);
  font-weight: 600;
}
.pill-ready {
  background: var(--success-soft);
  color: var(--success);
  border-color: var(--success);
}

/* Suspended: says what it means in words, not just a colour. */
.pill-off {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
  margin-left: .5rem;
  vertical-align: middle;
}

/* A suspended person still shows all their details — they are just visibly
   set aside. Never fade the text out: it is still text people must read. */
.is-suspended { border-style: dashed; background: var(--surface-2); }

/* ===========================================================================
   Admin
   =========================================================================== */

.section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.25rem;
}
.section-head p { max-width: 64ch; margin: 0; }

/* Gemini: tabs scrolled off-screen with no hint that anything was there.
   A fade on the right edge says "keep going". */
.tabs {
  position: relative;
  display: flex;
  gap: .25rem;
  border-bottom: 3px solid var(--line);
  margin-bottom: 1.6rem;
  overflow-x: auto;

  -webkit-overflow-scrolling: touch;
}
.tabs::after {
  content: "";
  position: sticky;
  right: 0;
  flex: none;
  width: 28px;
  margin-left: -28px;
  background: linear-gradient(to right, transparent, var(--bg));
  pointer-events: none;
}

.tab {
  background: transparent;
  color: var(--ink-2);
  border: none;
  border-bottom: 4px solid transparent;
  border-radius: 0;
  padding: .8rem 1.15rem;
  margin-bottom: -3px;
  min-height: 52px;
  font-family: var(--font);
  font-weight: 700;
  white-space: nowrap;
}
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab.active { color: var(--cloth-mark); border-bottom-color: var(--cloth-mark); }
.small-btn { padding: .5rem 1rem; font-size: .93rem; min-height: 44px; }

.danger-btn {
  background: transparent;
  color: var(--danger);
  border: 2px solid var(--danger);
}
.danger-btn:hover { background: var(--danger-soft); }

/* --- Hats --------------------------------------------------------------- */

/* Compact, because one person can wear several. The owner: "make the cards
   showing roles smaller — some have many roles." Each tag is one short line;
   access is still loud enough (wine on rose, 6.88:1 · 6.29:1 dark). */
.hats { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .7rem; }

.hat {
  display: inline-flex;
  align-items: center;
  gap: .35rem;
  padding: .1rem .1rem .1rem .55rem;
  border-radius: 2px;
  background: var(--primary-soft);
  color: var(--primary);
  border: 1.5px solid var(--primary);
  font-size: .84rem;
  line-height: 1.25;
}

.hat-scope {
  color: var(--ink);
  background: var(--surface);
  border-radius: 2px;
  padding: .05rem .4rem;
  font-size: .78rem;
  font-weight: 600;
}

/* Inside a role tag the × is drawn small, but its ::after reaches 8px past
   every edge, so the place you can press is still 44px. */
.hat .hat-x {
  position: relative;
  min-width: 28px;
  min-height: 28px;
  padding: 0 .3rem;
  font-size: 1rem;
}
.hat .hat-x::after { content: ""; position: absolute; inset: -8px; }
.hat .hat-x.is-armed { font-size: .78rem; padding: 0 .45rem; }

/* Gemini: this was an 18-22px target sitting right beside the label. */
.hat-x {
  min-width: 44px;
  min-height: 44px;
  display: grid;
  place-items: center;
  background: transparent;
  color: var(--primary);
  border: none;
  border-radius: 2px;
  padding: 0 .5rem;
  font-size: 1.25rem;
  font-family: var(--font);
  font-weight: 700;
}
.hat-x:hover { background: var(--danger-soft); color: var(--danger); }
.hat-x.is-armed {
  background: var(--danger-soft);
  color: var(--danger);
  font-size: .86rem;
  font-weight: 700;
  padding: 0 .7rem;
}

.give-form { margin-top: 1rem; padding-top: 1rem; border-top: 2px solid var(--line); }

/* --- Capability tick boxes ---------------------------------------------- */

.cap-group {
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .9rem 1rem 1rem;
  margin: 0 0 .9rem;
}
.cap-group > summary {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
}
.cap-group > summary:hover { color: var(--primary); }
.cap-group[open] > summary { margin-bottom: .5rem; }

/* Gemini: a native 13px checkbox with .4rem padding is unhittable standing up,
   and adjacent rows were close enough to catch the wrong one. */
.cap {
  display: flex;
  align-items: flex-start;
  gap: .8rem;
  padding: .7rem .5rem;
  min-height: 52px;
  font-weight: 400;
  cursor: pointer;
  border-radius: var(--radius-sm);
}
.cap:hover { background: var(--surface-2); }
.cap input {
  width: 24px;
  height: 24px;
  margin: .15rem 0 0;
  flex: none;
  accent-color: var(--cloth-mark);
}
.cap span { display: block; }
.cap strong { display: block; font-weight: 700; font-size: .98rem; }

.log-row { padding: .85rem 0; border-bottom: 2px solid var(--line); }
.log-row:last-child { border-bottom: none; }

/* ===========================================================================
   Members
   =========================================================================== */

.person-row {
  display: flex;
  /* Not `baseline`: these rows begin with a face now, and baseline dropped the
     name ~22px below it. One page had already patched this locally, which is
     always the sign that the shared rule is wrong. */
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  padding: .85rem 0;
  border-bottom: 1px solid var(--line);
}
.person-row:last-child { border-bottom: none; }

/* WHOSE ROW IS THIS? The name has to sit beside the face, not float off to
   the right of it. `space-between` alone spread three children across the
   row, so in the Members list — a 300px column — the avatar sat hard left
   and the name hard right with a hole between them. The block holding the
   name takes the slack instead; the buttons still end up on the right. */
.person-row > :has(> .person-name),
.person-row > :has(> .person-link) {
  flex: 1 1 10rem;
  min-width: 0;
}

.person-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -.02em;
}

.person-meta {
  display: flex;
  align-items: center;
  gap: .3rem;
  flex-wrap: wrap;
  margin-top: .25rem;
  font-size: .9rem;
  color: var(--ink-2);
}

/* The tag.
   Small on purpose. A person may be in five groups and the NAME has to read
   first — if the tags are as loud as the name, the list stops being scannable.
   So: no fill, hairline rule, small tight type, a 5px dot for the eye to catch. */
.chip {
  display: inline-flex;
  align-items: center;
  gap: .28rem;
  padding: .05rem .38rem .07rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: .72rem;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -.005em;
  color: var(--ink-2);
  background: transparent;
  white-space: nowrap;
}
.chip::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 999px;
  background: var(--cloth-mark);
  flex: none;
}
/* The group a person belongs to reads slightly stronger than ones they serve in. */
.chip-home { border-color: var(--cloth-mark); color: var(--ink); }

/* Their job inside the group — quieter still, riding along on the same tag. */
.chip-role {
  font-weight: 500;
  opacity: .8;
  padding-left: .3rem;
  border-left: 1px solid currentColor;
  margin-left: .28rem;
}

.dot-sep { color: var(--line); }

/* Ticking departments on a member — same 24px targets as everywhere else. */
.chip-pick {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem;
}
.chip-pick label {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .5rem .85rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);      /* matches every other surface */
  font-weight: 600;
  font-size: .95rem;
  cursor: pointer;
  min-height: 44px;
  margin: 0;
}
.chip-pick label:hover { background: var(--surface-2); }
.chip-pick input { width: 20px; height: 20px; accent-color: var(--cloth-mark); margin: 0; }
.chip-pick label:has(input:checked) {
  border-color: var(--cloth-mark);
  background: var(--primary-soft);
  color: var(--primary);
}

.searchbar { display: flex; gap: .6rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.searchbar input { flex: 1; min-width: 220px; }

/* ===========================================================================
   Toasts — confirmation that comes to you
   The page must never scroll itself while you are working in it.
   =========================================================================== */

.toast-host {
  position: fixed;
  left: calc(var(--sash) + 1rem);
  right: 1rem;
  bottom: 1rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .5rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  display: flex;
  align-items: flex-start;
  gap: .75rem;
  max-width: 560px;
  padding: .85rem 1rem;
  border-radius: var(--radius);
  border: 2px solid transparent;
  box-shadow: var(--shadow-lg);
  font-size: .98rem;
  font-weight: 600;
  animation: toast-in 140ms ease-out;
}

@keyframes toast-in { from { transform: translateY(8px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .toast { animation: none; } }

.toast-success {
  background: var(--success-soft);
  color: var(--success);
  border-color: var(--success);
}
.toast-error {
  background: var(--danger-soft);
  color: var(--danger);
  border-color: var(--danger);
}

/* An error toast stays until it is dismissed, so this × is the only way out of
   it, and it was a 24px target. Same answer as .chip-x below: the glyph stays
   small so a one-line confirmation is not 70px tall, and the TAP AREA is grown
   to 44×44 with a transparent pad. The only other thing in a toast is the
   sentence itself, which is not clickable. */
.toast-x {
  position: relative;
  background: transparent;
  border: none;
  color: inherit;
  font-size: 1.2rem;
  line-height: 1;
  font-weight: 700;
  min-height: 24px;
  min-width: 24px;
  padding: 0;
  margin-left: auto;
  flex: none;
}
.toast-x::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; }
.toast-x:hover { background: transparent; opacity: .7; }
.bar-col {
  flex: 1;
  min-width: 42px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  gap: .25rem;
}

.timepick-quick { display: flex; flex-wrap: wrap; gap: .4rem; margin-bottom: .7rem; }

/* The time sliders. A thumb big enough to take hold of with a mouse, and the
   chosen number read out beside it — the scroll wheels this replaced could not
   be grabbed at all, which is what a church reported, twice. */
.timepick-slide { margin-top: .6rem; }
.timepick-slide label { display: block; margin: .5rem 0 .15rem; font-weight: 600; }
.slide-row { display: flex; align-items: center; gap: .8rem; }
.slide-row output {
  flex: 0 0 2.6rem;
  font-size: 1.3rem;
  font-weight: 700;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.slide-row input[type="range"] {
  flex: 1 1 auto;
  height: 44px;                 /* the whole row is the target, not just the bar */
  margin: 0;
  background: transparent;
  -webkit-appearance: none;
  appearance: none;
  cursor: grab;
}
.slide-row input[type="range"]:active { cursor: grabbing; }
.slide-row input[type="range"]::-webkit-slider-runnable-track {
  height: 10px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.slide-row input[type="range"]::-moz-range-track {
  height: 10px;
  border-radius: 5px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}
.slide-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 32px;
  height: 32px;
  margin-top: -12px;            /* centres the thumb on the track */
  border-radius: 50%;
  background: var(--cloth-mark);
  border: 3px solid var(--surface);
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3);
}
.slide-row input[type="range"]::-moz-range-thumb {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cloth-mark);
  border: 3px solid var(--surface);
}
.slide-row input[type="range"]:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 8px;
}


.timepick-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .7rem;
  margin-top: .5rem;
  flex-wrap: wrap;
}
.timepick-shown { margin: 0; font-weight: 700; }
.timepick-clear { min-height: 44px; padding: .4rem 1rem; }

/* --- Files attached to a person ----------------------------------------- */

.file-grid {
  display: grid;
  gap: .8rem;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.file-card {
  margin: 0;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}
.file-card img { display: block; width: 100%; height: 120px; object-fit: cover; }

.file-doc {
  display: block;
  padding: 1.5rem 1rem;
  text-align: center;
  font-weight: 700;
  font-size: .9rem;
  word-break: break-word;
}

.file-card figcaption {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .3rem .4rem .6rem;
  border-top: 2px solid var(--line);
  font-size: .85rem;
  color: var(--ink-2);
}
.file-card figcaption span {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* This deletes a photograph. It was shrunk to 32px to keep the caption strip
   thin, which made the most permanent control on the card the hardest to hit:
   the 44px minimum from .hat-x stands, only the glyph is smaller. */
.file-card figcaption .hat-x { font-size: 1rem; }

/* The line of text that says what the file IS. It is typed in place, on every
   screen a file appears on, which is why it is a box and not a label. Same
   colours as any other input — nothing new to check. */
.file-caption {
  flex: 1;
  min-width: 0;
  min-height: 44px;
  font-size: .85rem;
  padding: .35rem .5rem;
}

textarea { resize: vertical; min-height: 96px; }

/* --- Add something from wherever you need to pick it --------------------- */

.chip-add {
  min-height: 44px;
  padding: .5rem .85rem;
  border: 2px dashed var(--line);
  border-radius: var(--radius);
  background: transparent;
  color: var(--primary);
  font-family: var(--font);
  font-weight: 700;
  font-size: .95rem;
}
.chip-add:hover { background: var(--surface-2); border-style: solid; }

.inline-add {
  display: flex;
  gap: .5rem;
  flex-wrap: wrap;
  margin-top: .7rem;
}
.inline-add[hidden] { display: none; }
/* `select` was left out, so a picker took the whole row and pushed its Add
   button onto the next line — on Structure's "add someone already in the
   church" as well as Follow-up's. */
.inline-add input,
.inline-add select { flex: 1; min-width: 200px; }

/* --- Quick create panel -------------------------------------------------- */

/**
 * A small panel attached to the thing it is about — a row, a card, an entry.
 *
 * NOT the same as `.quick-panel`, which is a full-screen modal and needs a
 * `.quick-card` inside it. Using the modal for an attached panel throws its
 * contents across the whole page, which is exactly what happened on the
 * person page's remove box.
 */
.inline-panel {
  margin-top: .6rem;
  padding: .8rem .9rem;
  background: var(--surface-2);
  border: 2px solid var(--line);
  border-left: 4px solid var(--cloth-mark);
  border-radius: var(--radius);
}
.inline-panel label {
  display: block;
  font-weight: 700;
  margin-bottom: .35rem;
}
.inline-panel input,
.inline-panel select { max-width: 420px; }

.quick-panel {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(42, 18, 22, .55);
  display: grid;
  place-items: center;
  padding: 1.25rem;
}

.quick-card {
  width: 100%;
  max-width: 480px;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 1.5rem;
  max-height: 90dvh;
  overflow-y: auto;
}

/* --- What someone does inside a group ----------------------------------- */

.role-rows { display: grid; gap: .5rem; margin-top: .7rem; }
.role-rows:empty { display: none; }

.role-row {
  display: grid;
  grid-template-columns: minmax(110px, 180px) 1fr;
  align-items: center;
  gap: .7rem;
}
.role-row > span { font-weight: 700; font-size: .93rem; }
@media (max-width: 560px) { .role-row { grid-template-columns: 1fr; gap: .3rem; } }

.role-in-group { min-height: 44px; font-size: .95rem; }

.group-people { margin-top: 1rem; padding-top: 1rem; border-top: 2px solid var(--line); }
.people-panel { }

/* ===========================================================================
   Calendar
   =========================================================================== */

.cal-head {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}
.cal-head h2 { flex: 1; min-width: 180px; font-size: 1.5rem; }

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.cal-dayname {
  padding: .5rem .3rem;
  font-size: .8rem;
  font-weight: 800;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
  text-align: center;
}

/* "+2 more" — a day must say what it is not showing. The cell is short on
   purpose so a month fits a screen; silently cutting the third event off is
   what it must not do. */
.cal-more {
  display: block;
  width: 100%;
  margin-top: .15rem;
  padding: .1rem .3rem;
  min-height: 0;
  background: none;
  border: 0;
  font: inherit;
  font-size: .7rem;
  font-weight: 700;
  text-align: left;
  color: var(--accent);            /* 7.71:1 on surface */
  cursor: pointer;
}
.cal-more:hover { text-decoration: underline; }

.cal-cell {
  min-height: 92px;
  padding: .35rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
}
.cal-blank { background: transparent; border-color: transparent; }

.cal-today {
  border: 2px solid var(--cloth-mark);
  background: var(--primary-soft);
}
.cal-date { font-weight: 800; font-size: .9rem; margin-bottom: .2rem; }

.cal-item {
  font-size: .76rem;
  font-weight: 700;
  line-height: 1.25;
  padding: .15rem .3rem;
  margin-bottom: .15rem;
  border-radius: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Birthdays are the gold response; events wear the cloth. */
.cal-birthday { background: var(--gold); color: var(--gold-ink); }
.cal-event { background: var(--cloth); color: var(--cloth-ink); cursor: pointer; }

/* An event chip is the way INTO that event, so in the markup it wants to be a
   <button>, not a div with a click handler — a div cannot be reached by
   keyboard at all. This undoes what the global button rule would otherwise do
   to a chip: 52px tall, condensed display type, a 2px edge. The chip keeps its
   own small height, because three 44px chips will not fit in a day cell; the
   Events list under the grid is the full-size way to the same event. */
button.cal-item {
  display: block;
  width: 100%;
  text-align: left;
  font-family: var(--font);
  letter-spacing: 0;
  min-height: 0;
  border: 0;
  transition: none;
}

.cal-key {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  margin-top: 1rem;
  font-size: .9rem;
  color: var(--ink-2);
}
.cal-key span { display: inline-flex; align-items: center; gap: .4rem; }
/* The swatches have no word in them, and gold on paper is 2.27:1. They are
   OUTLINED rather than recoloured: the fill has to stay exactly the gold and
   wine the grid uses, or the key stops explaining the grid. The outline is
   5.16:1 light / 6.63:1 dark, so the pale swatch has an edge you can see. */
.key-dot {
  width: 12px; height: 12px;
  border: 1px solid var(--line);
  border-radius: 2px;
  display: inline-block;
}
.key-birthday { background: var(--gold); }
.key-event { background: var(--cloth-mark); }

@media (max-width: 640px) {
  .cal-cell { min-height: 68px; padding: .25rem; }
  .cal-item { font-size: .68rem; }
  .cal-date { font-size: .8rem; }
}

/* Why something was done — the part that matters in six months. */
.audit-reason {
  margin-top: .35rem;
  padding: .45rem .7rem;
  background: var(--surface-2);
  border-left: 3px solid var(--cloth-mark);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-size: .94rem;
}

/* --- Officers: who holds which position in a group ---------------------- */

.officers {
  padding: 1rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}

.officer-list { display: grid; gap: .5rem; }

.officer {
  display: flex;
  align-items: center;
  gap: .6rem;
  flex-wrap: wrap;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: .4rem .5rem .4rem .7rem;
}

/* The position leads, because that is what you are looking for. */
.officer-post {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .95rem;
  color: var(--cloth-mark);
}
.officer-who { flex: 1; min-width: 0; font-weight: 600; }
/* Takes somebody out of their position: 44px like every other remove, with a
   slightly smaller glyph. It was 36px. */
.officer .hat-x { font-size: 1.05rem; }

/* Birthday: day, month, and a year only if anyone knows it. */
/* Day · Month · Year. Wraps rather than squeezes: in a half-width column the
   month was left ~60px between fixed Day and Year boxes and showed NOTHING —
   the owner picked January and saw a blank box. Now the year drops to its own
   line whenever the month would be too narrow to read. */
.birthday-picker {
  display: flex;
  flex-wrap: wrap;
  gap: .6rem;
}
.birthday-picker > * { min-width: 0; flex: 1 1 8rem; }
.birthday-picker > select:first-of-type,
.birthday-picker > .sel-btn:first-of-type { flex: 0 0 5.5rem; }
.birthday-picker > input { flex: 1 1 7.5rem; }

/* Someone who can sign in, marked on their own record. */
.chip-signin {
  border-color: var(--success);
  color: var(--success);
}
.chip-signin::before { background: var(--success); }

/* ===========================================================================
   THE DOOR
   Standing up, one hand, sun on the screen, a queue behind. Every rule here
   exists because of that, not because of taste.
   =========================================================================== */

.door-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .8rem 1rem;
  background: var(--cloth);
  color: var(--cloth-ink);
}
.door-bar .secondary {
  background: transparent;
  color: var(--cloth-ink);
  border-color: var(--cloth-ink);
}
.door-bar .secondary:hover { background: rgba(255,255,255,.12); }

.door-title { font-family: var(--font-display); font-weight: 800; font-size: 1.2rem; }
.door-sub { font-size: .9rem; opacity: .95; }

.door-search { padding: .8rem 1rem 0; }
.door-search input { min-height: 56px; font-size: 1.05rem; }

.door-list { padding: .8rem 1rem 6rem; display: grid; gap: .5rem; }

/* One person, one row, 72px. The whole row is the target — no checkbox to hit. */
.door-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 1rem;
  width: 100%;
  min-height: 72px;
  padding: .6rem .8rem;
  text-align: left;
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--line);
  border-radius: var(--radius);
  font-family: var(--font);
  font-weight: 400;
}

.door-name {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.15rem;
  letter-spacing: -.02em;
  overflow: hidden;
  text-overflow: ellipsis;
}

.door-mark {
  min-width: 92px;
  min-height: 52px;
  display: grid;
  place-items: center;
  padding: 0 1rem;
  border-radius: var(--radius-sm);
  background: var(--gold);
  color: var(--gold-ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
}

/* ONLINE. Beside each row, its own button: attended, but not in the room.
   Wine is the cloth in both themes and carries its own pale ink (8.54:1), so
   it reads as clearly answered and never as the gold "in the room". */
.door-line { display: flex; gap: .5rem; align-items: stretch; }
.door-line .door-row { flex: 1 1 auto; min-width: 0; }
.door-online {
  flex: 0 0 auto;
  min-width: 92px;
  min-height: 72px;
  padding: 0 .8rem;
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  border: 2px solid var(--line);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1rem;
}
.door-online:hover { background: var(--primary-soft); color: var(--ink); }
/* The edge stays --line: the wine fill is only 2.03:1 against the dark surface,
   so without it the pressed button would lose its shape in dark mode. */
.door-online.is-on, .door-online.is-on:hover { background: var(--cloth); color: var(--cloth-ink); border-color: var(--line); }

/* Answered: the whole row goes gold, readable from two metres in sun.
   The edge is the row's own ink, not --ink: --ink is near-WHITE in the dark,
   which drew a 2.19:1 outline round the one row you need to pick out. */
.door-row.is-here {
  background: var(--gold);
  border-color: var(--gold-ink);
  color: var(--gold-ink);
}
/* The tick badge on a checked-in row. --ink here is near-WHITE in dark mode
   and --gold on white measures 2.19:1 — the one word confirming you tapped the
   right person was the least readable thing on the screen. The row is already
   gold; the badge just needs to be the row's own ink, reversed. */
.door-row.is-here .door-mark { background: var(--gold-ink); color: var(--gold); }

.door-foot {
  position: fixed;
  left: var(--sash);
  right: 0;
  bottom: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: .7rem 1rem;
  background: var(--cloth);
  color: var(--cloth-ink);
  min-height: 64px;
}
.door-foot .secondary {
  background: transparent;
  color: var(--cloth-ink);
  border-color: var(--cloth-ink);
  min-height: 48px;
}

.door-status { font-weight: 700; font-size: .95rem; }
/* Not sent yet: said in words, not a spinner. A spinner implies it is fine.
   A lighter gold than the fields use — plain --gold on wine is 3.75:1, and this
   is the single most important sentence on the screen. #E8B42B gives 4.67:1. */
.door-waiting { color: #E8B42B; }

/* --- Little attendance bar chart ---------------------------------------- */

.bars {
  display: flex;
  align-items: flex-end;
  gap: .4rem;
  height: 170px;   /* room for the service's name under its date */
  overflow-x: auto;
  padding-bottom: .3rem;
}
.bar-col {
  /* One month on its own should read as a bar, not a wall of colour. */
  max-width: 90px;
  flex: 1;
  min-width: 42px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  height: 100%;
  gap: .25rem;
}
.bar {
  width: 100%;
  min-height: 3px;
  background: var(--cloth-mark);
  border-radius: 2px 2px 0 0;
}
.bar-num { font-weight: 800; font-size: .85rem; }
.bar-label { font-size: .72rem; color: var(--ink-2); white-space: nowrap; }
/* Which service it was, under its date — "08-16" alone did not say. Two lines
   at most, so a long name never pushes the chart taller than its neighbours. */
.bar-name { font-size: .68rem; color: var(--ink-2); text-align: center; line-height: 1.2; max-width: 100%;
            overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
/* The words under a bar keep their size; only the bar gives way, so the
   tallest bar never pushes its own labels out of sight. */
.bar-col > :not(.bar) { flex-shrink: 0; }
.bar-online { font-size: .7rem; color: var(--ink-2); white-space: nowrap; margin-top: -.2rem; }
.beat-online { font-size: .45em; font-weight: 600; letter-spacing: 0; }

/* ===========================================================================
   Reports and printing
   The browser's own PDF engine is better than anything we could bundle, costs
   nothing, and works the same on a phone. So reports print rather than render.
   =========================================================================== */

.report-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .96rem;
}
.report-table th,
.report-table td {
  text-align: left;
  padding: .55rem .6rem;
  border-bottom: 1px solid var(--line);
}
.report-table th {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: .8rem;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.report-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.report-table .total-row td { border-top: 2px solid var(--cloth-mark); border-bottom: none; }

/* Attendance by event and the printable occasion sheet. */
.by-event-controls { display:flex; gap:.7rem; flex-wrap:wrap; align-items:end; }
.by-event-controls .field { flex:1 1 10rem; min-width:0; }
.by-event-controls input { width:100%; min-width:0; }
.event-checks { display:grid; grid-template-columns:repeat(auto-fit,minmax(14rem,1fr)); gap:.35rem .8rem; margin:.8rem 0 1rem; }
.event-checks label { display:flex; gap:.5rem; align-items:center; min-width:0; }
.event-checks input { flex:0 0 auto; }
.table-scroll { overflow-x:auto; max-width:100%; }
/* Who came sits under each recent-attendance bar. The column is wide enough
   for those two words, and the box grows with them, so nothing is cut off
   at 360px. Further dates still scroll sideways inside .bars. */
/* Attendance page: every date a register was taken, newest first. */
.occ-filter { display:flex; flex-wrap:wrap; gap:.5rem; align-items:center; margin-bottom:.6rem; }
.occ-filter select { max-width:100%; }
.occ-month { font-size:.8rem; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--ink-2);
  margin:1rem 0 .25rem; padding-bottom:.2rem; border-bottom:1px solid var(--line); }
.occ-row { display:flex; align-items:center; gap:.75rem; min-height:44px; padding:.55rem .5rem; border-radius:8px;
  color:var(--ink); text-decoration:none; }
.occ-row:hover { background:var(--surface-2); }
.occ-when { flex:0 0 4.6rem; font-weight:700; white-space:nowrap; font-variant-numeric:tabular-nums; }
.occ-what { flex:1; min-width:0; display:flex; flex-direction:column; }
.occ-name { font-weight:600; overflow-wrap:anywhere; }
.occ-nums { font-size:.88rem; color:var(--ink-2); }
.occ-go { color:var(--primary); font-weight:700; white-space:nowrap; }
@media (max-width: 520px) { .occ-when { flex-basis:4rem; } .occ-go-word { position:absolute; width:1px; height:1px; overflow:hidden; clip:rect(0 0 0 0); } .occ-go { font-size:1.3rem; } }
.occasion-figures { grid-template-columns:repeat(4,minmax(0,1fr)) !important; }
.occasion-figures .beat { min-width:0; }
@media (max-width:600px) { .occasion-figures { grid-template-columns:repeat(2,minmax(0,1fr)) !important; } }

.print-head { margin-bottom: 1.5rem; }
.print-head[hidden] { display: none; }

@media print {
  /* Ink is expensive and the sash is decoration. */
  body { padding-left: 0; background: #fff; color: #000; font-size: 11pt; }
  body::before { display: none; }
  .no-print, .topbar, .toast-host, .searchbar, .tabs { display: none !important; }
  .page { padding: 0; max-width: none; }
  .tile {
    border: 1px solid #999;
    box-shadow: none;
    break-inside: avoid;
    page-break-inside: avoid;
    margin-bottom: 1rem;
    background: #fff;
  }
  .beats { grid-template-columns: repeat(3, 1fr) !important; }
  .occasion-figures { grid-template-columns: repeat(4, 1fr) !important; }
  .beat, .anti-call, .anti-resp {
    border: 1px solid #999 !important;
    background: #fff !important;
    color: #000 !important;
  }
  .beat-value { color: #000 !important; }
  .report-table th, .report-table td { border-bottom: 1px solid #ccc; }
  a[href]:after { content: ""; }
  .occasion-sheet .tile { border:0; }
}

/* How much room is left, as a bar anyone can read. */
.meter {
  height: 12px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  margin: .4rem 0;
}
.meter-fill { height: 100%; background: var(--cloth-mark); border-radius: 999px; }
/* The warning fill must be the most readable thing here, not the least.
   Plain --gold is 1.82:1 on this track in light mode; --accent is the token
   already kept for "gold when it must actually be read". */
.meter-warn { background: var(--accent); }

/* Today's gathering, so the eye finds it first at the door. */
.is-today-row { background: var(--primary-soft); border-radius: var(--radius); padding-left: .6rem; padding-right: .6rem; }

.date-chips { display: flex; flex-wrap: wrap; gap: .4rem; }

/* --- Choosing a time without a fight ------------------------------------ */

.timepick { margin-top: .3rem; }

.timepick-quick {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  margin-bottom: .6rem;
}
.timepick-quick button {
  min-height: 44px;
  padding: .4rem .75rem;
  font-family: var(--font);
  font-weight: 700;
  font-size: .95rem;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}
.timepick-quick button:hover { background: var(--surface-2); }
/* A CHOSEN BUTTON MUST LOOK CHOSEN.
   Nine buttons across the door, the calendar, follow-up and events toggled an
   `is-on` class that was only ever styled for two components — so a volunteer
   tapping "Members / Everyone else / All" at the door saw nothing change and
   could not tell which list they were checking people into. */
button.small-btn.is-on,
button.secondary.is-on {
  background: var(--cloth);
  color: var(--cloth-ink);
  border-color: var(--cloth);
  font-weight: 600;
}

.timepick-quick button.is-on {
  background: var(--cloth);
  color: var(--cloth-ink);
  border-color: var(--cloth-mark);
}

.timepick-exact { display: flex; gap: .5rem; flex-wrap: wrap; }
.timepick-exact select { flex: 1; min-width: 110px; max-width: 180px; }
.timepick-exact .timepick-clear { min-height: 52px; }
.timepick-shown { margin-top: .4rem; font-weight: 600; }

/* ===========================================================================
   One person's page
   =========================================================================== */

.person-link { color: inherit; text-decoration: none; }
.person-link:hover { text-decoration: underline; text-decoration-color: var(--cloth-mark); }

.person-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 1.25rem;
  align-items: start;
}
@media (max-width: 900px) { .person-grid { grid-template-columns: 1fr; } }

/* Facts read as pairs, so the eye can scan the labels down one side. */
.factlist {
  display: grid;
  grid-template-columns: minmax(110px, 34%) 1fr;
  gap: .45rem 1rem;
  margin: 0;
}
.factlist dt { font-weight: 700; color: var(--ink-2); font-size: .93rem; }
.factlist dd { margin: 0; }

.factlist-lite { display: grid; gap: .35rem; font-size: .95rem; }

/* A destructive button waiting for a second press — impossible to miss. */
.is-armed {
  background: var(--danger) !important;
  color: var(--surface) !important;
  border-color: var(--danger) !important;
  animation: armed-pulse 1s ease-in-out infinite;
}
@keyframes armed-pulse { 50% { opacity: .86; } }
@media (prefers-reduced-motion: reduce) { .is-armed { animation: none; } }

/* Anything that is working says so, and cannot be pressed again. */
button[data-busy] { opacity: .86; cursor: progress; }

/* Every button should feel like it received the press. */
button:active:not(:disabled), .btn:active { transform: translateY(1px); }
button:focus-visible, .btn:focus-visible, a:focus-visible,
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--cloth-mark);
  outline-offset: 2px;
}

/* --- While the page is still waking up ----------------------------------- */

/* A tap that does nothing reads as a broken app. Dim the page and refuse
   clicks for the moment before the script is listening, so it is obvious the
   page is not ready yet rather than not working. */
/* Fading the whole page to .55 drops body text to 2.86:1 — unreadable for
   exactly as long as the connection is slow. Say it is loading instead of
   making it hard to read. */
.booting main { opacity: .92; pointer-events: none; }
.booting::after {
  content: "Loading…";
  position: fixed;
  left: 50%; top: .9rem;
  transform: translateX(-50%);
  z-index: 60;
  padding: .35rem .9rem;
  border-radius: 999px;
  background: var(--cloth);
  color: var(--cloth-ink);
  font-family: var(--font);
  font-weight: 700;
  font-size: .85rem;
}

/* --- Following people up -------------------------------------------------- */

/* Something that still needs doing. A word, never a bare colour — colour alone
   is invisible to anyone who cannot separate red from the text around it. */
.warn-text { color: var(--danger); font-weight: 700; }

/* Where everyone is up to: a bar per stage, read left to right. */
.meter-row {
  display: grid;
  grid-template-columns: minmax(9rem, 15rem) 1fr auto;
  align-items: center;
  gap: .8rem;
  padding: .3rem 0;
}
.meter-label { font-weight: 700; color: var(--ink); }
/* Scoped to the row. These used to be bare `.meter` / `.meter-fill`, which
   collided with the storage bar on Settings — same names, different component,
   and the one further down the file won both. Scoping keeps each to its own
   place and lets `.meter-warn` work again. */
.meter-row .meter {
  height: 18px;
  border-width: 2px;
}
.meter-row .meter-fill.is-settled { background: var(--ink-2); }
.meter-num { font-family: var(--font-display); font-weight: 800; min-width: 2ch; text-align: right; }

@media (max-width: 560px) {
  .meter-row { grid-template-columns: 1fr auto; }
  .meter { grid-column: 1 / -1; }
}

/* Ticking people off against each other. Rows big enough for a thumb. */
.pick-list {
  max-height: 320px;
  overflow-y: auto;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: .3rem;
}
.pick {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 44px;
  padding: .3rem .5rem;
  border-radius: var(--radius);
  cursor: pointer;
}
.pick:hover { background: var(--surface-2); }
.pick input[type="checkbox"] {
  /* `input {width:100%}` applies to checkboxes too — without this the box
     swallows the row and the name wraps one letter per line. */
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: var(--cloth-mark);
}
.pick > span { flex: 1; min-width: 0; }

/* The journal on a person's page. A spine down the left, entries hung off it. */
.journal { border-left: 3px solid var(--line); margin-left: .5rem; padding-left: 1rem; }
.journal-entry { position: relative; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.journal-entry:last-child { border-bottom: 0; }
.journal-entry::before {
  content: "";
  position: absolute;
  left: calc(-1rem - 8px);
  top: 1.35rem;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--cloth-mark);
  border: 2px solid var(--surface);
}
.journal-when { font-family: var(--font-display); font-weight: 800; color: var(--ink); }
.journal-who { color: var(--ink-2); font-size: .88rem; }
.journal-body { margin: .45rem 0 0; white-space: pre-wrap; color: var(--ink); }

/* Where a person is up to, and who is on them — read across, not down. */
.care-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem;
  align-items: flex-start;
  padding: .9rem 1rem;
  background: var(--surface-2);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}

/* The × that takes a follower off someone. Sits inside the chip.
   One press removes them, so it needs a 44px target — but a 44px BUTTON would
   make the chip 46px tall, and a chip has to stay quiet enough that the name
   reads first. So the × stays 24px and the TAP AREA is grown to 44×44 around
   it with a transparent pad. Nothing beside it is clickable, so the extra
   reach cannot steal a press from another control. */
.chip-x {
  position: relative;
  min-width: 24px;
  min-height: 24px;
  margin-left: .3rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: inherit;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
}
.chip-x::after { content: ""; position: absolute; inset: -10px; border-radius: 50%; }
.chip-x:hover { background: var(--primary-soft); }

/* Someone's face beside their name. */
/* A smaller face for lists, where the name must still read first. */
.avatar-sm { width: 40px; height: 40px; font-size: 1.05rem; }

.avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
  border: 2px solid var(--cloth-ink);
  background: var(--surface-2);
}
.avatar-blank {
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.4rem;
  /* Was --cloth-ink: ivory on an ivory card, 1.00:1, an initial nobody could
     see. It sits on the surface, so it needs the mark colour, not panel ink. */
  color: var(--cloth-mark);
  border-style: dashed;
  border-color: var(--line);
}

/* Picking which photograph is the face. Wraps, so the buttons never spill
   out of a narrow card. */
.file-act {
  display: flex;
  flex-wrap: wrap;
  gap: .4rem;
  align-items: center;
  padding: .3rem .5rem .5rem;
}
.file-act .small-btn { padding: .3rem .6rem; font-size: .8rem; }

/* What was written about somebody. Their words, so give them room to breathe. */
.situation {
  margin-top: .35rem;
  padding: .45rem .7rem;
  border-left: 3px solid var(--cloth-mark);
  background: var(--surface-2);
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink);
  white-space: pre-wrap;
}

/* Title · First name · Surname on one line.
   The generic .row is two columns, which drops the surname onto its own row
   and squeezes the title until its example is unreadable. */
.name-row {
  display: grid;
  grid-template-columns: minmax(7.5rem, 10rem) 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}
@media (max-width: 620px) {
  .name-row { grid-template-columns: 1fr; }
}

/* --- Choosing people, and choosing who follows them ---------------------- */

/* Two ways of looking at the same facts. */
.viewswitch {
  display: flex;
  gap: .4rem;
  margin-bottom: .9rem;
  flex-wrap: wrap;
}
.viewswitch button {
  min-height: 44px;
  padding: .5rem 1rem;
  font-family: var(--font);
  font-weight: 700;
  background: transparent;
  color: var(--primary);
  border: 2px solid var(--line);
  border-radius: var(--radius);
}
.viewswitch button.is-on {
  background: var(--cloth);
  color: var(--cloth-ink);
  border-color: var(--cloth-mark);
}

/* The tick box on a row, big enough for a thumb. */
.row-tick {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  flex: 0 0 auto;
  cursor: pointer;
}
.row-tick input[type="checkbox"] {
  width: 24px;
  height: 24px;
  min-height: 0;
  padding: 0;
  accent-color: var(--cloth-mark);
}
.person-row.is-picked { background: var(--primary-soft); border-radius: var(--radius); }

.pick-all { padding: .2rem .3rem .6rem; border-bottom: 1px solid var(--line); margin-bottom: .5rem; }

/* The bar that follows your selection down the page. */
.selbar {
  position: fixed;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  z-index: 50;
  width: min(680px, calc(100vw - 2rem));
  padding: .8rem 1rem;
  background: var(--cloth);
  color: var(--cloth-ink);
  border-radius: var(--radius);
  box-shadow: 0 8px 28px rgba(0, 0, 0, .3);
  display: flex;
  align-items: center;
  gap: .8rem;
  flex-wrap: wrap;
  font-weight: 700;
}
.selbar-actions { margin-left: auto; display: flex; gap: .5rem; flex-wrap: wrap; }
/* 40px here fought the 44px minimum everywhere else, on a bar that carries
   actions for everybody ticked. */
.selbar .small-btn { min-height: 44px; }
/* On the wine bar the main action has to be the pale one to stand out.
   The word on that ivory fill is --cloth, which is wine in BOTH themes, not
   --cloth-mark, which becomes rose for the dark hall: rose on ivory is 2.32:1.
   Same pairing as .viewswitch button.is-on .tab-n below. */
.selbar .small-btn:not(.secondary) {
  background: var(--cloth-ink);
  color: var(--cloth);
  border: 2px solid var(--cloth-ink);
  font-weight: 800;
}
.selbar .secondary {
  background: transparent;
  color: var(--cloth-ink);
  border-color: var(--cloth-ink);
}

/* The follower list drops out of the bar, so the choice is made in place. */
.selbar-pick {
  flex-basis: 100%;
  margin-top: .6rem;
  padding: .8rem;
  background: var(--surface);
  color: var(--ink);
  border-radius: var(--radius);
  max-height: 46vh;
  overflow-y: auto;
}

@media (max-width: 560px) {
  .selbar { bottom: .5rem; }
  .selbar-actions { margin-left: 0; width: 100%; }
  .selbar-actions button { flex: 1; }
}

/* A count beside a tab, so "how many Others" is answered before you click. */
.tab-n {
  display: inline-block;
  margin-left: .35rem;
  padding: 0 .4rem;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: .8rem;
  font-weight: 800;
}
.viewswitch button.is-on .tab-n { background: var(--cloth-ink); color: var(--cloth); }

/* Editing the names themselves sits apart from choosing between them. */
.tab-manage {
  margin-left: auto;
  border-style: dashed !important;
  font-weight: 600 !important;
}

/* The last question before something cannot be undone. */
.danger-confirm {
  margin-top: .8rem;
  padding: .9rem 1rem;
  background: var(--danger-soft);
  border: 2px solid var(--danger);
  border-radius: var(--radius);
  color: var(--ink);
}
.danger-confirm .small-btn:not(.secondary) {
  background: var(--danger);
  color: var(--surface);
  border: 2px solid var(--danger);
  font-weight: 800;
}

/* A diary entry is its date first. Give it the weight that implies. */
.entry-date {
  padding: .9rem 1rem;
  margin-bottom: 1rem;
  background: var(--primary-soft);
  border: 2px solid var(--cloth-mark);
  border-radius: var(--radius);
}
.entry-date label {
  display: block;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.05rem;
  margin-bottom: .4rem;
}
.entry-date input { max-width: 260px; }

/* The way back, and the way along. Above everything, because this is how you
   leave — and hidden inside a pane, where the list is already beside you. */
.back-bar {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  margin: 0 0 1rem;
  padding-bottom: .8rem;
  border-bottom: 2px solid var(--line);
}
.back-bar .btn { text-decoration: none; }
.in-pane .back-bar { display: none; }

/* A link's own little icon, from the site itself — no third party is told
   which addresses this church keeps. It removes itself if the site has none. */
.link-mark {
  width: 22px;
  height: 22px;
  flex: none;
  margin-top: .15rem;
  object-fit: contain;
  border-radius: 3px;
}

/* A long list gets its own box rather than stretching the page.
   The giving ledger is 500 rows — about 52 screens — and the history 300.
   A grabbable bar does not fix that on its own: over 500 rows a thumb would
   compute to about 9px. The list needs a ceiling as well, so the thumb has
   something to be a proportion OF, and so the page itself stops growing. */
.scrolls {
  max-height: min(70vh, 760px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

/* ===========================================================================
   SCROLLBARS YOU CAN GRAB.

   The owner: "if there's anything that needs scrolling, you should have a
   slider that I can click on, hold on with the mouse and drag to be faster.
   Everywhere in the app."

   macOS hides scrollbars until you are already scrolling, so every box in this
   app looked unscrollable until you guessed. Declaring a ::-webkit-scrollbar
   width is what opts an element OUT of those overlay bars — which the database
   sheet already proved works here, so this generalises what that page learnt.

   Measured, thumb against track, against a 3:1 floor:
     light  --cloth-mark #8B1E3F on --surface-2 #F3DDD4   6.84:1
     dark   --cloth-mark #E38A9A on --surface-2 #2A141C   6.89:1
     hover  --primary-hover                      8.89:1 / 9.02:1
   NEVER --cloth: #8B1E3F on the dark track is 1.94:1 — the same trap this
   file already documents for the sash.
   =========================================================================== */

html,
.wb-list,
.wb-work,
.wb-list > .wb-scroll,
.sidenav,
.tabs,
.quick-card,
.sheet-wrap,
.scrolls {
  scrollbar-gutter: stable;
}

@supports selector(::-webkit-scrollbar) {
  html::-webkit-scrollbar,
  .wb-list::-webkit-scrollbar,
  .wb-work::-webkit-scrollbar,
  .wb-list > .wb-scroll::-webkit-scrollbar,
  .sidenav::-webkit-scrollbar,
  .tabs::-webkit-scrollbar,
  .quick-card::-webkit-scrollbar,
  .sheet-wrap::-webkit-scrollbar,
  .scrolls::-webkit-scrollbar { width: 14px; height: 14px; }

  html::-webkit-scrollbar-track,
  .wb-list::-webkit-scrollbar-track,
  .wb-work::-webkit-scrollbar-track,
  .wb-list > .wb-scroll::-webkit-scrollbar-track,
  .sidenav::-webkit-scrollbar-track,
  .tabs::-webkit-scrollbar-track,
  .quick-card::-webkit-scrollbar-track,
  .sheet-wrap::-webkit-scrollbar-track,
  .scrolls::-webkit-scrollbar-track {
    background: var(--surface-2);
    box-shadow: inset 1px 0 0 var(--line);
  }

  html::-webkit-scrollbar-thumb,
  .wb-list::-webkit-scrollbar-thumb,
  .wb-work::-webkit-scrollbar-thumb,
  .wb-list > .wb-scroll::-webkit-scrollbar-thumb,
  .sidenav::-webkit-scrollbar-thumb,
  .tabs::-webkit-scrollbar-thumb,
  .quick-card::-webkit-scrollbar-thumb,
  .sheet-wrap::-webkit-scrollbar-thumb,
  .scrolls::-webkit-scrollbar-thumb {
    background: var(--cloth-mark);
    border: 2px solid var(--surface-2);
    border-radius: 7px;
    /* A thumb has to be big enough to catch with a mouse or a thumb. */
    min-height: 44px;
    min-width: 44px;
  }

  html::-webkit-scrollbar-thumb:hover,
  .wb-list::-webkit-scrollbar-thumb:hover,
  .wb-work::-webkit-scrollbar-thumb:hover,
  .wb-list > .wb-scroll::-webkit-scrollbar-thumb:hover,
  .sidenav::-webkit-scrollbar-thumb:hover,
  .tabs::-webkit-scrollbar-thumb:hover,
  .quick-card::-webkit-scrollbar-thumb:hover,
  .sheet-wrap::-webkit-scrollbar-thumb:hover,
  .scrolls::-webkit-scrollbar-thumb:hover { background: var(--primary-hover); }
}

/* Firefox has no pseudo-elements. `auto`, not `thin` — thin is the hairline
   that started this. Its own block, because Chrome would otherwise let these
   two properties cancel the 14px above. */
@supports not selector(::-webkit-scrollbar) {
  html,
  .wb-list,
  .wb-work,
  .wb-list > .wb-scroll,
  .sidenav,
  .tabs,
  .quick-card,
  .sheet-wrap,
  .scrolls {
    scrollbar-width: auto;
    scrollbar-color: var(--cloth-mark) var(--surface-2);
  }
}

/* ==========================================================================
   "DO NOT CONTACT" — somebody has asked the church to stop
   --------------------------------------------------------------------------
   The owner, 5 Oct 2026: "In the database, that person's details cannot be the
   same colour as the others." And: "it should be loud everywhere the person's
   details is."

   WHY THIS COLOUR, and not one of the obvious ones. All three were measured,
   not argued about:

     · RED is already saying three different things — destroy (Delete, Remove),
       set aside (.pill-off says "Past" in red), and NOBODY HAS DONE THIS YET
       (.warn-text: "Not contacted yet", "Nobody is on them"). That last one
       lives on the very screens this mark lives on, and it means the opposite:
       a job the church has failed to do, rather than a decision it has made
       and must keep.
     · GREEN is .beat-care on the person's own page and the dot on "Can sign
       in". A green mark beside a name reads as CLEARED to contact. Backwards.
     · BLACK AS A WORD dies in the dark: #2A1216 on #241016 is 1.03:1.

   So black is used as a FIELD that carries its own pale ink, exactly the way
   --cloth is, and in the dark it drops to --bg-deep and takes a --line edge,
   because at 1.12:1 against the surface the block would otherwise have no
   shape at all. Measured: 16.81:1 light, 18.71:1 dark; the dark edge is
   6.63:1 on the surface.

   The details are KEPT and stay readable. The owner settled that: "There is no
   issue about the people who have access to it... Trying to block who sees it
   is just creating another issue that does not exist." What they lose is the
   tel: and mailto: links, so nobody dials by reflex — that is not hiding, it
   is removing the trigger.                                                  */

:root { --stop: #2A1216; --stop-ink: #FFF9F4; --stop-edge: #2A1216; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) { --stop: #0C0406; --stop-ink: #FFF4EA; --stop-edge: #C49088; }
}
:root[data-theme="dark"] { --stop: #0C0406; --stop-ink: #FFF4EA; --stop-edge: #C49088; }

/* The bar in a list. Stretches the full width of the row on purpose — the
   owner picked this over a small badge: "I like the way on the members list
   they do not contact stretches to the end." */
.stop-bar {
  display: block; margin-top: .3rem; padding: .3rem .5rem;
  background: var(--stop); color: var(--stop-ink);
  border: 2px solid var(--stop-edge); border-radius: var(--radius-sm);
  font-size: .8rem; line-height: 1.45;
}
.stop-bar b { font-weight: 800; letter-spacing: .01em; }
.stop-bar .stop-said { display: block; font-weight: 400; opacity: .92; }
.stop-bar .stop-deets {
  display: flex; gap: .9rem; flex-wrap: wrap; margin-top: .25rem;
  padding-top: .25rem; border-top: 1px solid rgba(255, 249, 244, .28);
  font-weight: 600;
}

/* The band on the person's own page, where there is room to say it properly. */
.stop-band {
  background: var(--stop); color: var(--stop-ink);
  border: 2px solid var(--stop-edge); border-radius: var(--radius);
  padding: .85rem .95rem; margin: .8rem 0;
}
.stop-band h3 { margin: 0 0 .35rem; font-size: 1.05rem; font-weight: 800; }
.stop-band p { margin: 0 0 .55rem; font-size: .93rem; line-height: 1.5; }
.stop-band .stop-deets {
  display: flex; gap: 1.2rem; flex-wrap: wrap; font-size: .97rem; font-weight: 600;
  padding-top: .55rem; border-top: 1px solid rgba(255, 249, 244, .3);
}
.stop-band .stop-prov { font-size: .82rem; margin: .55rem 0 0; opacity: .92; }
.stop-band .stop-act { margin-top: .7rem; }
.stop-band .stop-act .small-btn {
  background: var(--stop-ink); color: var(--stop); border-color: var(--stop-ink); font-weight: 700;
}

/* In the sheet. The whole ROW is marked, not just one cell, because in a wide
   table you scroll sideways past the name and would otherwise be looking at a
   bare phone number with nothing to say whose it is. */
/* The sheet uses border-collapse: separate, where a box-shadow on the <tr>
   simply does not paint. The mark goes on the first CELL, which does. */
.sheet tr.is-stopped td:first-child { box-shadow: inset 4px 0 0 var(--stop-edge); }
.sheet td.stop-cell {
  background: var(--stop); color: var(--stop-ink); font-weight: 600;
  border-top: 2px solid var(--stop-edge); border-bottom: 2px solid var(--stop-edge);
}
.sheet td.stop-cell a { color: var(--stop-ink); }
/* Filled, not just bold — in the light theme a black word is the same colour
   as every other word in the sheet, and bold alone is not "cannot be the same
   as the others". A real span, so the words are still the words: a screen
   reader reads them and the browser's own find-on-page still catches them. */
.stop-tag {
  display: inline-block; white-space: nowrap;
  background: var(--stop); color: var(--stop-ink);
  padding: .08rem .42rem; border-radius: var(--radius-sm);
  border: 1px solid var(--stop-edge); font-size: .76rem; font-weight: 800;
}
@media print { .stop-tag { background: #fff !important; color: #000 !important;
  border: 1.5px solid #000 !important; } }

/* Printing drops background colour by default, which would turn every one of
   these into white-on-white. Same trap that already eats .banner on a printed
   person page. */
@media print {
  .stop-bar, .stop-band, .sheet td.stop-cell {
    background: #fff !important; color: #000 !important; border: 2px solid #000 !important;
  }
  .stop-band .stop-deets, .stop-bar .stop-deets { border-top-color: #000 !important; }
  .sheet tr.is-stopped td:first-child { box-shadow: inset 4px 0 0 #000 !important; }
}



/* The walk-in demo, saying so on every page. Loud enough that nobody mistakes
   it for their own church's copy, quiet enough to read past. Gold field with
   wine-black on it — 7.39:1, and the one place gold is allowed to be a field
   carrying words, exactly as the birthday chips do. */
.demo-strip {
  background: var(--gold); color: var(--gold-ink);
  padding: .5rem calc(var(--sash) + .8rem);
  font-size: .86rem; line-height: 1.45;
  border-bottom: 2px solid var(--ink);
}
@media print { .demo-strip { display: none } }

/* A heading inside the side menu. The owner asked for "a section called admin
   for managing everything" — fifteen flat items meant people hunted for the
   three housekeeping screens. --ink-2 on the rail is 8.11:1. */
.sidenav .sidenav-head {
  font-size: .68rem; letter-spacing: .09em; text-transform: uppercase;
  color: var(--ink-2); font-weight: 700;
  padding: .9rem .9rem .25rem; margin-top: .4rem;
  border-top: 1px solid var(--line);
}
/* The Admin heading is a button that folds its items away. Same look as the
   heading it was, with a pressable row the full width of the menu. */
.sidenav .sidenav-head { padding: .5rem .3rem 0; }
.sidenav-toggle {
  display: flex; align-items: center; justify-content: space-between; width: 100%;
  min-height: 40px; padding: .3rem .6rem;
  background: transparent; border: 0; border-radius: var(--radius-sm);
  color: var(--ink-2); font: inherit; font-size: .68rem; font-weight: 700;
  letter-spacing: .09em; text-transform: uppercase; cursor: pointer;
}
.sidenav-toggle:hover { background: var(--primary-soft); color: var(--ink); }
.sidenav-caret { font-size: .9rem; letter-spacing: 0; }

/* ==========================================================================
   THE FIELD PICKER — bringing in a spreadsheet
   --------------------------------------------------------------------------
   The owner, choosing it: "option 2. remember People that have Windows will
   also use this app."

   That is the reason. A native <select> popup is drawn by the operating
   system: it looks and behaves differently on macOS, Windows and Android, it
   cannot carry the grabbable slider he asked for everywhere, and on his Mac it
   covered the row he was reading. This one is the same on every machine.    */

.col-letter {
  display: inline-block; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 3px; padding: 0 .3rem; margin-right: .35rem;
  font-size: .76rem; font-weight: 700; color: var(--ink);
}
/* Gold as a FIELD with wine-black on it — 7.39:1, and the one use of gold the
   design law allows for words. A hidden column is the thing a person most
   needs to notice on this screen. */
.col-hidden {
  display: inline-block; background: var(--gold); color: var(--gold-ink);
  border-radius: 3px; padding: .02rem .35rem; margin-left: .35rem;
  font-size: .72rem; font-weight: 800; white-space: nowrap;
}

.picker { position: relative; }
.picker-btn {
  width: 100%; min-height: 44px; text-align: left; font: inherit; font-size: .9rem;
  padding: .5rem 1.9rem .5rem .6rem; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); color: var(--ink);
  cursor: pointer; position: relative;
}
.picker-btn:hover { background: var(--surface-2); }
.picker-btn::after {
  content: "▾"; position: absolute; right: .6rem; top: 50%;
  transform: translateY(-50%); color: var(--ink-2);
}

/* ⚠️ FIXED, AND ON THE BODY. The mapping table is a scroll box, and anything
   positioned inside it is clipped at its edge — the menu would be cut in half.
   Placed from the button's own rectangle in script instead. */
/* ABOVE EVERYTHING. A list belongs to the control you just pressed, and that
   control may sit in a box (.quick-panel, 300), the search panel or the ticked
   bar — at 60 it opened underneath the "Let … sign in" box. */
.picker-menu {
  position: fixed; z-index: 1000;
  background: var(--surface); border: 2px solid var(--cloth-mark);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.picker-search {
  width: 100%; font: inherit; font-size: .9rem; padding: .55rem .6rem; min-height: 44px;
  border: 0; border-bottom: 1px solid var(--line);
  background: var(--surface-2); color: var(--ink);
}
.picker-list { overflow: auto; }
.picker-list button {
  display: block; width: 100%; text-align: left; font: inherit; font-size: .9rem;
  padding: .55rem .6rem; min-height: 44px; border: 0; background: none;
  color: var(--ink); cursor: pointer;
}
.picker-list button:hover,
.picker-list button.is-marked { background: var(--surface-2); }
.picker-list button[aria-selected="true"] {
  background: var(--cloth); color: var(--cloth-ink); font-weight: 700;
}
.picker-group {
  font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  color: var(--ink-2); font-weight: 700; padding: .65rem .6rem .2rem;
  border-top: 1px solid var(--line); margin-top: .2rem;
}
.picker-none { color: var(--ink-2); font-size: .88rem; padding: .7rem .6rem; margin: 0; }

/* ===========================================================================
   THE IMPORT'S RECONCILING STEP — questions first, then differences, then
   folded lists to check. Every colour is an existing token, so both themes
   follow; the ink pairs are the measured --ink / --ink-2 on --surface pairs.
   =========================================================================== */
.imp-section { margin-top: 1.1rem; }
.imp-h { font-size: 1.05rem; margin: 0 0 .2rem; }
.imp-q {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  padding: .7rem .85rem;
  margin-top: .6rem;
}
.imp-q-head { margin: 0 0 .4rem; }
.imp-choices { border: 0; margin: 0; padding: 0; display: grid; gap: .35rem; }
.imp-choices legend { padding: 0; margin-bottom: .2rem; color: var(--ink-2); }
/* The whole row is the target, so it clears 44px with a finger. */
.imp-choice {
  display: flex; gap: .6rem; align-items: flex-start;
  padding: .5rem .55rem; min-height: 44px;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  cursor: pointer;
}
.imp-choice:has(input:checked) { background: var(--surface-2); border-color: var(--cloth-mark); }
.imp-choice input { margin-top: .15rem; flex: none; }
.imp-q-then { margin-top: .5rem; padding-top: .5rem; border-top: 1px dashed var(--line); }
.imp-fills { margin: .35rem 0 0; }
.imp-diff { width: 100%; border-collapse: collapse; margin-top: .3rem; font-size: .9rem; }
.imp-diff th, .imp-diff td {
  text-align: left; vertical-align: top;
  padding: .35rem .45rem; border-bottom: 1px solid var(--line);
  overflow-wrap: anywhere;
}
.imp-diff th { color: var(--ink-2); font-weight: 700; }
.imp-take { display: inline-flex; gap: .4rem; align-items: center; min-height: 44px; cursor: pointer; }
.imp-fold { margin-top: .8rem; }
.imp-fold > summary {
  cursor: pointer; font-weight: 700; min-height: 44px;
  display: flex; align-items: center;
}
.imp-fold > summary:hover { color: var(--primary); }
.imp-list { max-height: 320px; overflow: auto; }
@media (max-width: 560px) {
  .imp-diff thead { display: none; }
  .imp-diff tr { display: grid; grid-template-columns: 1fr 1fr; border-bottom: 1px solid var(--line); }
  .imp-diff td { border: 0; }
  .imp-diff td:first-child { grid-column: 1 / -1; font-weight: 700; padding-bottom: 0; }
  /* With the headings folded away, each value says whose it is. */
  .imp-diff td[data-label]::before {
    content: attr(data-label);
    display: block; font-size: .75rem; color: var(--ink-2);
  }
}

/* The app's own button for a long dropdown (see common.js, "LONG DROPDOWNS ARE
   OURS"). It has to look exactly like the field it replaces, so it carries the
   same height, border, ink and paper as `input, select`. */
.sel-btn {
  width: 100%;
  min-height: 52px;
  padding: .7rem 2.4rem .7rem .85rem;
  font: inherit;
  font-size: 1.0625rem;
  text-align: left;
  color: var(--ink);
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  position: relative;
  cursor: pointer;
  overflow: hidden;
}
.sel-btn-text { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sel-btn::after {
  content: "▾"; position: absolute; right: .85rem; top: 50%;
  transform: translateY(-50%); color: var(--ink-2);
}
.sel-btn:hover { background: var(--surface-2); color: var(--ink); }
.sel-btn:focus-visible { outline: 3px solid var(--cloth-mark); outline-offset: 2px; }
.sel-btn:disabled { opacity: .86; cursor: not-allowed; }
/* The same places the stylesheet sizes a select, for the button that replaces it. */
.viewfilter .sel-btn { width: auto; min-width: 13rem; max-width: 100%; }
.inline-add .sel-btn { flex: 1; min-width: 200px; }
.inline-panel .sel-btn { max-width: 420px; }
.timepick-exact .sel-btn { flex: 1; min-width: 110px; max-width: 180px; }

/* MEMBERS: THE LIST IS THE PAGE.
   The owner, looking at seven names in a narrow column under four rows of
   filter buttons: "It's actually the focus of this page... it should be
   bigger. It should have more real estate space on this page." So on Members
   the list takes half the width, not a third — wide enough that a person's
   groups and position read in full instead of being cut off and scrolled
   sideways — and Show is one line, so the list starts high and runs to the
   bottom of the screen. Other workbench pages keep their narrower list. */
@media (min-width: 980px) {
  .workbench.people-first { grid-template-columns: minmax(380px, 1fr) minmax(0, 1fr); }
}
.show-line { display: flex; align-items: center; gap: .6rem; flex-wrap: nowrap; }
.show-line select { flex: 1; width: auto; min-width: 0; }
.show-line .filter-label { margin: 0; }
/* …and the page itself may use a wide screen. Every page is held to 1120px,
   which is right for reading and wrong here: on his 1920px screen a third of
   the width sat empty either side of a list squeezed to 370px. */
.page:has(.workbench.people-first) { max-width: 1600px; }

/* --- Pick lists with "Other — type your own" ---------------------------- */
.choice-other { margin-top: .4rem; }

/* --- The Children box: tick them, rather than type them -------------------
   Its own scroll box with a visible edge, so a church with sixty children
   does not push the rest of the form off the page. */
.kid-picker .kid-chosen { margin: 0 0 .4rem; color: var(--ink); }
.kid-list {
  max-height: 14rem;
  overflow-y: auto;
  overscroll-behavior: contain;
  margin-top: .4rem;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: .2rem .4rem;
}
.kid-row {
  display: flex;
  align-items: center;
  gap: .6rem;
  min-height: 44px;
  padding: 0 .3rem;
  margin: 0;
  font-weight: 400;
  color: var(--ink);
  cursor: pointer;
}
.kid-row + .kid-row { border-top: 1px solid var(--bg-deep); }
.kid-row .small { margin-left: auto; color: var(--ink-2); }


/* --- "Powered by The Skills Clinic & Risevance" — every church, every page --
   The owner liked Content Command HQ's version: a small spaced capital label,
   then the names as links on their own line. */
.nav-credit, .page-credit {
  font-size: .82rem;
  line-height: 1.5;
  color: var(--ink-2);
}
.nav-credit {
  margin: .8rem 0 0;
  padding: .7rem .15rem 0;
  border-top: 1px solid var(--bg-deep);
  font-size: .74rem;
  white-space: nowrap;          /* both names on one line, as in Content Command HQ */
}
.credit-label {
  display: block;
  margin-bottom: .15rem;
  font-size: .66rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.nav-credit a, .page-credit a {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.nav-credit a:hover, .page-credit a:hover { color: var(--primary-hover); }
/* Not menu items: the menu's own link style (a 44px flex row) stacked the two
   names on separate lines. */
.sidenav .nav-credit a {
  display: inline; min-height: 0; padding: 0; border-radius: 0;
  font-size: inherit; line-height: inherit; background: none;
}
.page-credit { display: none; margin: 1.5rem 16px 1rem; text-align: center; }
@media (max-width: 979px) {
  .nav-credit { display: none; }
  .page-credit { display: block; }
}

/* Calendar items that open a page: look exactly like the others. */
a.cal-item { display: block; text-decoration: none; }
a.cal-item:hover { filter: brightness(.95); }

/* Family and relations, grouped: Parents · Spouse · Children · … */
.rel-head { margin: .9rem 0 .2rem; font-size: .8rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2); }
.rel-head:first-child { margin-top: .2rem; }

/* Age beside a name in the Members list, when the full date of birth is known. */
.row-age { margin-left: .4rem; font-size: .8rem; font-weight: 400; color: var(--ink-2); white-space: nowrap; }

/* The month bar and grid step aside in List view. (.cal-head is display:flex,
   which otherwise beats the hidden attribute.) */
.cal-head[hidden], #monthPanel[hidden], #listPanel[hidden] { display: none; }

/* HOLDING A ROLE WITHOUT SIGNING IN — on each role card (Accounts & access).
   Quiet, like .chip: the role's NAME still reads first. */
.offices { margin-top: .55rem; }
.office-list { display: flex; flex-wrap: wrap; gap: .3rem .4rem; margin-top: .3rem; }
.office-chip { display: inline-flex; align-items: center; gap: .2rem; padding: .05rem .2rem .05rem .5rem;
               border: 1px solid var(--line); border-radius: 3px; font-size: .85rem; color: var(--ink); }
.office-go { margin-left: .45rem; font-size: .78rem; color: var(--accent); }
.office-add { margin-top: .45rem; max-width: 34rem; }
.office-add select, .office-add .sel-btn { width: 22rem; max-width: 100%; }

/* Import preview: a match that is in the Archive. A word, in the body ink. */
.imp-arch { font-size: .85rem; font-weight: 600; color: var(--ink); }

/* Following up: one leader's people, with the next and previous leader. */
.by-bar { display: flex; flex-wrap: wrap; gap: .5rem 1rem; align-items: center; justify-content: space-between;
          padding: .6rem .8rem; margin-bottom: .8rem; border: 1px solid var(--line); border-radius: var(--radius-sm);
          background: var(--bg); }
.by-bar-do { display: flex; flex-wrap: wrap; gap: .5rem; }

/* The pastor's own journal entries: a small wine label, the cloth carrying its
   own ink (8.54:1), and a wine rule down the side so it is seen at a glance. */
.journal-entry.is-pastor { box-shadow: inset 3px 0 0 var(--cloth); padding-left: .8rem; }
.pastor-note { display: inline-block; margin-bottom: .25rem; padding: .05rem .45rem; border-radius: 3px;
               background: var(--cloth); color: var(--cloth-ink); font-size: .75rem; font-weight: 700; }

/* "What is this entry?" — for the pastor and those acting for them. */
.as-pastor { border: 1px solid var(--line); border-radius: var(--radius-sm); padding: .5rem .8rem .6rem; margin: 0 0 .9rem; }
.as-pastor label { display: block; margin: .25rem 0; }

/* An account that just moved in the list (Accounts & access): a brief ring so
   the eye finds it where it landed. */
.tile.just-moved { box-shadow: 0 0 0 3px var(--cloth); transition: box-shadow .3s; }

/* Your structure: the editable list of positions. */
.pos-row { display: flex; justify-content: space-between; align-items: center; gap: .6rem;
           padding: .35rem 0; border-bottom: 1px solid var(--line); }
.pos-row:last-child { border-bottom: 0; }

/* More than one phone, email or address (Members form). The boxes above stay
   the main ones; each extra is the number, what it is, and Remove. */
.more-row { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
            gap: .25rem .5rem; align-items: center; margin-top: .6rem; }
.more-cap { grid-column: 1 / -1; font-size: .85rem; font-weight: 600; color: var(--ink); }
.more-adds { display: flex; flex-wrap: wrap; gap: .5rem; margin: .6rem 0 1rem; }
@media (max-width: 560px) { .more-row { grid-template-columns: 1fr; } .more-row .small-btn { justify-self: start; } }

/* Import preview: every line exactly as it will be saved. Scrolls sideways in
   its own box, so the page never does; the line number stays in view. */
.imp-all-bar { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-top: .6rem; }
.imp-all-bar input[type="search"] { flex: 1 1 16rem; min-width: 0; }
.imp-all-bar select { flex: 0 1 auto; width: auto; }
.imp-all-wrap { overflow: auto; max-height: 520px; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.imp-all { border-collapse: collapse; font-size: .86rem; min-width: 100%; }
.imp-all th, .imp-all td { padding: .35rem .55rem; border-bottom: 1px solid var(--line); text-align: left;
                            vertical-align: top; white-space: nowrap; color: var(--ink); }
.imp-all td:last-child { white-space: normal; min-width: 16rem; }
.imp-all th { position: sticky; top: 0; background: var(--surface); z-index: 1; }
.imp-all th:first-child, .imp-all td:first-child { position: sticky; left: 0; background: var(--surface); z-index: 2;
                                                   font-variant-numeric: tabular-nums; }
.imp-all th:first-child { z-index: 3; }

/* Today on the calendar: the date on the wine cloth, the word beside it, and a
   heavier edge — obvious at a glance, in both themes (8.5:1 and 6.3:1+). */
.cal-today { border: 3px solid var(--cloth-mark); }
.cal-today-num { display: inline-block; min-width: 1.6em; padding: .05rem .4rem; border-radius: 999px;
                 background: var(--cloth); color: var(--cloth-ink); text-align: center; }
.cal-today-word { font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase;
                  color: var(--cloth-mark); }

/* "You are not the pastor" — a reminder beside the pastor's-note choice. Body
   ink on a cloth-edged panel: noticeable without the red that means "not done". */
.as-pastor-warn { margin: .5rem 0 0; padding: .45rem .65rem; border-left: 4px solid var(--cloth-mark);
                  background: var(--primary-soft); color: var(--ink); font-size: .9rem; }

/* A phone box with its country code in front of it. */
.phone-boxes { display: flex; gap: .4rem; align-items: stretch; }
.phone-boxes select, .phone-boxes .sel-btn { flex: 0 0 10rem; width: 10rem; max-width: 46%; }
.phone-boxes input { flex: 1 1 auto; min-width: 0; }

/* Members: "Also in the Archive: …" under a search, so nobody is out of sight. */
.also-archive { margin: .7rem 0 0; padding: .5rem .7rem; border: 1px dashed var(--line); border-radius: var(--radius-sm);
                font-size: .9rem; color: var(--ink); }
.also-archive a, .also-archive .linkish { color: var(--cloth-mark); text-decoration: underline; font-weight: 700; }
.also-archive .linkish { background: none; border: 0; padding: 0; font: inherit; min-height: 0; cursor: pointer; }

/* Phones: nothing may push the page wider than the screen (owner, 12 Oct).
   A long tag ("Childrens Church · Co-ordinator or Head") folds onto a second
   line instead of running off the edge, and an account's box on Accounts
   shrinks to fit, its "Who is this?" list included. Computers are unchanged. */
@media (max-width: 640px) {
  .chip { white-space: normal; overflow-wrap: anywhere; }
  .tile.person .section-head > div:first-child { min-width: 0; max-width: 100%; }
  .tile.person select { max-width: 100% !important; }
}

/* Erasing a person's details: its own part of the folded Archive/Delete card. */
.erase-part { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 2px solid var(--line); }
.erase-caution { margin: 0 0 .8rem; padding: .6rem .8rem; border-left: 4px solid var(--danger);
                 background: var(--danger-soft); color: var(--ink); max-width: 72ch; }
.erase-note { margin: 0; padding: .6rem .8rem; border-left: 4px solid var(--cloth-mark);
              background: var(--primary-soft); color: var(--ink); max-width: 72ch; }

/* HOW OFTEN: "Every [2] [weeks]" on one line — the number box small, the unit
   taking the rest. Events, the Calendar and Attendance share it. */
.repeat-every-row { display: flex; gap: .6rem; align-items: center; }
.repeat-every-row input { width: 6rem; flex: none; }
.repeat-every-row select { flex: 1; min-width: 0; }
