/* Chapelbook — design system. Mobile-first, 390px-safe. */

/* Chapelbook theme (Sam, Oct 1 2026): light and cheerful - cream + navy,
   with a sparing gold for highlights (new guests, "live"). Semantic colours
   (green = done/OK, rose = danger/overdue, brass/gold = attention) are tuned
   for WCAG AA on cream; tests/unit/contrast.test.ts checks every text pair. */
:root {
  --font-display: "Lora", Georgia, "Times New Roman", serif;
  --font-body: "Nunito Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --paper: #FAF6EC;
  --paper-2: #F3EDDF;
  --surface: #FFFDF8;
  --raised: #FFFFFF;
  --ink: #1B2A4A;              /* navy: text + headings */
  --ink-2: #2E3A55;
  --muted: #5F6A80;
  --faint: #646E87;
  --line: #E4DCCB;
  --line-2: #D5CBB6;

  --navy: #1B2A4A;            /* headings, logo mark */
  --accent: #2F6FB0;          /* friendly blue: primary buttons, links, active tabs, focus, current step */
  --accent-ink: #FFFFFF;
  --accent-2: #285E96;        /* hover */
  --accent-deep: #1F4E7E;
  --accent-soft: #EAF2FB;     /* chips, selected rows */
  --accent-softer: #EEF3FA;   /* pale blue bands / alternating sections */
  --accent-text: #24578C;     /* blue TEXT on blue tints (AA) */
  --gold: #D69A1C;            /* sunny gold: badges, dots, highlights ONLY (never text) */
  --gold-soft: #FBF1DA;
  --gold-ink: #8F6208;        /* small gold TEXT (5:1 on cream) */
  --brass: var(--gold); --brass-soft: var(--gold-soft); --brass-ink: var(--gold-ink);
  --green: #2D6A4C;           /* success / OK */
  --green-soft: #E2EFE7;
  --rose: #A8432F;            /* danger / overdue */
  --rose-soft: #F8E4DD;
  --sky: #2F5F86;
  --sky-soft: #E2ECF4;
  --plum: #66476A;
  --plum-soft: #EFE5EF;

  --r-xs: 6px; --r-sm: 9px; --r: 14px; --r-lg: 20px; --r-pill: 999px;
  --shadow-1: 0 1px 0 rgba(27, 42, 74, .04), 0 1px 2px rgba(27, 42, 74, .07);
  --shadow-2: 0 1px 0 rgba(27, 42, 74, .04), 0 10px 30px -14px rgba(27, 42, 74, .28);
  --shadow-3: 0 24px 60px -20px rgba(17, 28, 51, .40);
  --ring: 0 0 0 3px color-mix(in oklab, var(--accent-2) 35%, transparent);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --side: 248px;
  --tabbar: 72px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0F1524; --paper-2: #131A2C; --surface: #161E32; --raised: #1C253C;
    --ink: #EEF1F7; --ink-2: #CBD3E2; --muted: #9AA5BB; --faint: #8A95AC; --line: #263049; --line-2: #33405C;
    --navy: #DCE5F8; --accent: #8DB8E8; --accent-ink: #0E1730; --accent-2: #A9CAEE; --accent-deep: #C9DDF4; --accent-soft: #1D2D48; --accent-softer: #18243C; --accent-text: #A9CAEE;
    --gold: #E6AC3A; --gold-soft: #2E2715; --gold-ink: #EBC26C;
    --green: #8CCBA9; --green-soft: #17291F; --rose: #EE9F89; --rose-soft: #35201B; --sky: #9DC2E0; --sky-soft: #17242F;
    --plum: #CFADD0; --plum-soft: #2A1F2A;
    --shadow-1: 0 1px 0 rgba(0,0,0,.25); --shadow-2: 0 12px 30px -14px rgba(0,0,0,.7); --shadow-3: 0 24px 60px -20px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0F1524; --paper-2: #131A2C; --surface: #161E32; --raised: #1C253C;
  --ink: #EEF1F7; --ink-2: #CBD3E2; --muted: #9AA5BB; --faint: #8A95AC; --line: #263049; --line-2: #33405C;
  --navy: #DCE5F8; --accent: #8DB8E8; --accent-ink: #0E1730; --accent-2: #A9CAEE; --accent-deep: #C9DDF4; --accent-soft: #1D2D48; --accent-softer: #18243C; --accent-text: #A9CAEE;
  --gold: #E6AC3A; --gold-soft: #2E2715; --gold-ink: #EBC26C;
  --green: #8CCBA9; --green-soft: #17291F; --rose: #EE9F89; --rose-soft: #35201B; --sky: #9DC2E0; --sky-soft: #17242F;
  --plum: #CFADD0; --plum-soft: #2A1F2A;
  --shadow-1: 0 1px 0 rgba(0,0,0,.25); --shadow-2: 0 12px 30px -14px rgba(0,0,0,.7); --shadow-3: 0 24px 60px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.55 var(--font-body); letter-spacing: 0;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
  min-height: 100dvh; overflow-x: hidden;
}
img, svg { display: block; max-width: 100%; }
svg { width: 20px; height: 20px; flex: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { outline: none; box-shadow: var(--ring); border-radius: var(--r-xs); }
::selection { background: color-mix(in oklab, var(--accent) 25%, transparent); }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; letter-spacing: -.005em; margin: 0; color: var(--ink); font-optical-sizing: auto; }
h1 { font-size: clamp(1.75rem, calc(5.6vw * var(--ts, 1)), 2.25rem); line-height: 1.15; }
h2 { font-size: 1.3125rem; line-height: 1.2; }
h3 { font-size: 1.0625rem; line-height: 1.3; }
p { margin: 0 0 .8em; }
small, .small { font-size: 1rem; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-variant-numeric: tabular-nums; }
.eyebrow { font: 600 0.8125rem/1 var(--font-body); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); }
.serif { font-family: var(--font-display); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

/* ---------------------------------------------------------------- shell */
.shell { min-height: 100dvh; }
.sidebar { display: none; }
.topbar {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 10px) 16px 10px; background: var(--paper);   /* solid: scrolled text showed through (QA round 2) */
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px); border-bottom: 1px solid transparent;
  transition: border-color .2s var(--ease);
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar .church { min-width: 0; flex: 1; }
.topbar .church b { display: block; font: 500 1.0625rem/1.2 var(--font-display); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.main { padding: 14px 16px calc(var(--tabbar) + env(safe-area-inset-bottom) + 28px); max-width: 1160px; margin: 0 auto; }
.tabbar {
  position: fixed; inset: auto 0 0 0; z-index: 40; height: calc(var(--tabbar) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom); display: grid; grid-auto-flow: column; grid-auto-columns: 1fr;
  background: color-mix(in oklab, var(--surface) 92%, transparent); backdrop-filter: blur(16px); -webkit-backdrop-filter: blur(16px);
  border-top: 1px solid var(--line);
}
.tabbar a { display: grid; place-items: center; align-content: center; gap: 3px; color: var(--muted); font-size: 0.8125rem; font-weight: 600; letter-spacing: .02em; text-decoration: none; position: relative; }
.tabbar a svg { width: 22px; height: 22px; }
.tabbar a.on { color: var(--accent); }
.tabbar a .dot { position: absolute; top: 9px; left: calc(50% + 7px); }
.dot { min-width: 17px; height: 17px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: #1B2A4A; font-size: 0.8125rem; font-weight: 700; display: inline-grid; place-items: center; line-height: 1; }

@media (min-width: 960px) {
  .shell { display: grid; grid-template-columns: var(--side) 1fr; }
  .sidebar {
    display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh; padding: 22px 14px 18px;
    border-right: 1px solid var(--line); background: var(--paper-2); overflow-y: auto;
  }
  .tabbar { display: none; }
  .topbar { display: none; }
  .main { padding: 34px 40px 60px; width: 100%; }
}
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--navy); color: var(--paper); display: grid; place-items: center; flex: none; box-shadow: inset 0 -2px 0 rgba(0,0,0,.12); }
.brand-mark svg { width: 18px; height: 18px; }
.brand-word { font: italic 600 1.375rem/1 var(--font-display); letter-spacing: -.01em; }
.church-switch { display: block; width: 100%; text-align: left; border: 1px solid var(--line); background: var(--surface); border-radius: var(--r); padding: 10px 12px; margin: 0 0 16px; cursor: pointer; }
.church-switch b { display: block; font: 500 1rem/1.25 var(--font-display); }
.church-switch span { font-size: 1rem; color: var(--muted); text-transform: capitalize; }
.nav { display: grid; gap: 2px; }
.nav .group { margin: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 8px 10px; border-radius: 10px; color: var(--ink-2); font-weight: 500; text-decoration: none; transition: background .15s var(--ease), color .15s var(--ease); }
.nav a svg { width: 19px; height: 19px; color: var(--muted); flex: none; }
.nav a:hover { background: color-mix(in oklab, var(--ink) 5%, transparent); }
.nav a.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.nav a.on svg { color: var(--accent); }
.nav a .dot { margin-left: auto; }
.side-foot { margin-top: auto; padding: 14px 8px 0; display: flex; flex-wrap: wrap; align-items: center; gap: 10px; border-top: 1px solid var(--line); }
.side-foot .who { min-width: 0; flex: 1 1 120px; }   /* too narrow next to "Light / dark"? the button wraps to its own line (Oct 27 2026) */
.side-foot .who b { display: block; font-size: 1rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.side-foot .who span { display: block; font-size: 1rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------------------------------------------------------------- page */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 16px; margin: 4px 0 20px; }
.page-head .t { min-width: 0; }
.page-head .t p { margin: 6px 0 0; color: var(--muted); max-width: 62ch; }
.page-head .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: 1rem; font-weight: 600; margin-bottom: 10px; }
.back svg { width: 16px; height: 16px; }
.section { margin: 26px 0 0; }
.section > .head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin: 0 0 10px; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: 1fr; }
.split { display: grid; gap: 18px; grid-template-columns: minmax(0, 1fr); }
.grid.three, .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 760px) {
  .grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .split { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 22px; align-items: start; }
}

/* ---------------------------------------------------------------- surfaces */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow-1); }
.card.pad { padding: 16px; }
@media (min-width: 760px) { .card.pad { padding: 20px; } }
.card.flat { box-shadow: none; }
.card.link { display: block; color: inherit; text-decoration: none; transition: transform .18s var(--ease), box-shadow .18s var(--ease), border-color .18s var(--ease); }
.card.link:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); border-color: var(--line-2); text-decoration: none; }
.stat { padding: 14px 16px; }
.stat .n { font: 500 1.875rem/1.05 var(--font-display); letter-spacing: -.02em; margin-top: 8px; font-variant-numeric: tabular-nums; }
.stat .n.sm { font-size: 1.5rem; }
.stat .sub { font-size: 1rem; color: var(--muted); margin-top: 3px; }
.stat.warn .n { color: var(--rose); }
.hero {
  position: relative; overflow: hidden; border-radius: var(--r-lg); padding: 22px 20px; margin-bottom: 18px;
  background: radial-gradient(120% 140% at 100% 0%, color-mix(in oklab, var(--brass) 18%, transparent), transparent 55%),
              linear-gradient(160deg, color-mix(in oklab, var(--accent) 10%, var(--surface)), var(--surface));
  border: 1px solid var(--line);
}
.hero h1 { font-size: clamp(1.75rem, calc(6vw * var(--ts, 1)), 2.375rem); }
.hero p { color: var(--ink-2); margin: 8px 0 0; }
.hero .verse { position: absolute; right: 18px; bottom: 12px; font: italic 400 0.8125rem var(--font-display); color: var(--faint); }

.pp-status-in { display: none; margin-top: 4px; }
@media (max-width: 600px) { .pp-status-in { display: block; } .pp-status-out { display: none !important; } }
.list { display: grid; grid-template-columns: minmax(0, 1fr); }   /* one column that never grows past the card (WebKit sized it to the widest row: page side-scrolled, Oct 27 2026) */
.row { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line); color: inherit; text-decoration: none; min-width: 0; }
.row:first-child { border-top: 0; }
a.row:hover { background: color-mix(in oklab, var(--ink) 3%, transparent); text-decoration: none; }
.row .grow { flex: 1; min-width: 0; }
.row .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .sub { font-size: 1rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row .end { flex: none; text-align: right; font-size: 1rem; color: var(--muted); }
.row .chev { width: 16px; height: 16px; color: var(--faint); flex: none; }
/* Phones: a row with its own buttons (Call / Remove / Subscribe link / a color picker) puts them on a second line,
   so the name and details keep the full width instead of being crushed to a letter (Oct 27 2026) */
@media (max-width: 600px) {
  /* a row's title wraps to 2 lines on phones instead of '...' (saved report names, catalog rows) */
  .row .title { white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .row:has(> .btn, > label > input[type=color]) { flex-wrap: wrap; row-gap: 8px; }
  .row:has(> .btn, > label > input[type=color]) > .grow { flex: 1 1 calc(100% - 64px); }
  .row:has(> .btn, > label > input[type=color]) > .grow + .btn, .row:has(> .btn, > label > input[type=color]) > .grow + label { margin-left: auto; }
}

.avatar { width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center; font: 600 0.8438rem var(--font-body); letter-spacing: .02em;
  background: var(--accent-soft); color: var(--accent-text); }
.avatar.lg { width: 64px; height: 64px; font-size: 1.3125rem; font-family: var(--font-display); font-weight: 500; }
.avatar.sm { width: 28px; height: 28px; font-size: 0.8125rem; }
.avatar.c1 { background: var(--brass-soft); color: var(--brass-ink); } .avatar.c2 { background: var(--sky-soft); color: var(--sky); }
.avatar.c3 { background: var(--plum-soft); color: var(--plum); } .avatar.c4 { background: var(--rose-soft); color: var(--rose); }

.pill { display: inline-flex; align-items: center; gap: 5px; height: 23px; padding: 0 9px; border-radius: var(--r-pill); font-size: 0.8125rem; font-weight: 600; white-space: nowrap;
  background: color-mix(in oklab, var(--ink) 6%, transparent); color: var(--ink-2); }
.pill svg { width: 13px; height: 13px; }
.pill.green { background: var(--green-soft); color: var(--green); }
.pill.navy, .pill.blue { background: var(--accent-soft); color: var(--accent-text); }
.pill.gold { background: var(--gold-soft); color: var(--gold-ink); }
.pill.brass { background: var(--brass-soft); color: var(--brass-ink); }
.pill.rose { background: var(--rose-soft); color: var(--rose); }
.pill.sky { background: var(--sky-soft); color: var(--sky); }
.pill.plum { background: var(--plum-soft); color: var(--plum); }

/* ---------------------------------------------------------------- buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 7px; height: 40px; padding: 0 16px; border-radius: 11px; cursor: pointer; white-space: nowrap;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 1rem; text-decoration: none;
  transition: background .15s var(--ease), border-color .15s var(--ease), transform .08s var(--ease), box-shadow .15s var(--ease); -webkit-tap-highlight-color: transparent; }
.btn:hover { border-color: var(--faint); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn svg { width: 17px; height: 17px; }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: inset 0 -2px 0 rgba(0,0,0,.14); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--ink-2); }
.btn.ghost:hover { background: color-mix(in oklab, var(--ink) 6%, transparent); }
.btn.danger { color: var(--rose); border-color: color-mix(in oklab, var(--rose) 40%, var(--line)); }
.btn.danger.solid { background: var(--rose); color: var(--paper); border-color: var(--rose); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 1rem; border-radius: 9px; }
.btn.lg { height: 50px; padding: 0 22px; font-size: 1rem; border-radius: 13px; }
.btn.block { width: 100%; }
.btn.icon { width: 40px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn[disabled], .btn.busy { opacity: .55; pointer-events: none; }
.btn.busy::after { content: ""; width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.btnrow { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------------------------------------------------------- forms */
.field { display: grid; gap: 6px; margin-bottom: 14px; min-width: 0; }
.field > label, .label { font-size: 1rem; font-weight: 600; color: var(--ink-2); }
.field .hint { font-size: 1rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 11px; border: 1px solid var(--line-2); background: var(--raised);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease); font-size: 1rem; /* 16px stops iOS zoom */
}
@media (min-width: 760px) { .input, .select, .textarea { font-size: 1rem; } }
/* Date / time boxes: never wider than their column; on iOS Safari (which ignores width on them and shows an
   empty date as a blank box) drop the native chrome so they size like every other field (Oct 27 2026) */
input[type=date], input[type=time], input[type=datetime-local], input[type=month] { max-width: 100%; min-width: 0; box-sizing: border-box; }
@supports (-webkit-touch-callout: none) {
  input[type=date], input[type=time], input[type=datetime-local], input[type=month] { display: block; width: 100%; -webkit-appearance: none; appearance: none; text-align: left; min-height: 44px; }
  input[type=date]::-webkit-date-and-time-value, input[type=time]::-webkit-date-and-time-value { text-align: left; }
}
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring); }
.textarea { min-height: 96px; resize: vertical; line-height: 1.5; }
.select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
.check { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; cursor: pointer; font-size: 1rem; }
.check input { width: 20px; height: 20px; margin: 1px 0 0; accent-color: var(--accent); flex: none; }
.form-grid { display: grid; gap: 0 14px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } .form-grid .full { grid-column: 1 / -1; } }
.search { position: relative; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); pointer-events: none; }
.search .input { padding-left: 38px; }
.seg { display: inline-flex; background: color-mix(in oklab, var(--ink) 6%, transparent); border-radius: 11px; padding: 3px; gap: 2px; max-width: 100%; overflow-x: auto; }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 12px; border-radius: 9px; font-weight: 600; font-size: 1rem; color: var(--muted); cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--ink); box-shadow: var(--shadow-1); }
.toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 14px; }
.toolbar .search { flex: 1 1 220px; }

/* ---------------------------------------------------------------- tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.t { width: 100%; border-collapse: collapse; font-size: 1rem; }
table.t th { text-align: left; font-size: 0.8125rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 600; padding: 10px 14px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
table.t td.num, table.t th.num { text-align: right; font-variant-numeric: tabular-nums; }
table.t tbody tr:hover { background: color-mix(in oklab, var(--ink) 2.5%, transparent); }
/* Phase 3: table.t.stack turns each row into a labelled block on phones (td[data-label]) */
@media (max-width: 639px) {
  table.t.stack thead { display: none; }
  table.t.stack, table.t.stack tbody, table.t.stack tr, table.t.stack td, table.t.stack tfoot { display: block; width: 100%; }
  table.t.stack tr { padding: 10px 14px; border-bottom: 1px solid var(--line); }
  table.t.stack tbody tr:last-child { border-bottom: 0; }
  table.t.stack td { border: 0; padding: 2px 0; display: flex; justify-content: space-between; gap: 14px; text-align: right !important; overflow-wrap: anywhere; }
  table.t.stack td::before { content: attr(data-label); color: var(--muted); font-size: 0.8125rem; text-align: left; flex: none; max-width: 45%; }
  table.t.stack td:first-child { font-size: 1rem; text-align: left !important; padding-bottom: 4px; }
  table.t.stack td:first-child::before { display: none; }
  table.t.stack tfoot tr { background: var(--paper-2); }
}

/* ---------------------------------------------------------------- overlays */
.toast-host { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + env(safe-area-inset-bottom) + 14px); display: grid; gap: 8px; width: min(440px, calc(100vw - 32px)); }
@media (min-width: 960px) { .toast-host { bottom: 24px; } }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 13px; background: var(--ink); color: var(--paper); box-shadow: var(--shadow-3); font-size: 1rem; animation: toastIn .28s var(--ease); }
.toast.err { background: var(--rose); color: var(--paper); }
.toast .grow { flex: 1; }
.toast button { border: 0; background: transparent; color: inherit; font-weight: 700; cursor: pointer; padding: 4px 6px; border-radius: 6px; text-decoration: underline; text-underline-offset: 3px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(10px) scale(.98); } }
.scrim { position: fixed; inset: 0; z-index: 80; background: rgba(17, 28, 51, .40); backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px); display: grid; align-items: end; animation: fade .2s var(--ease); }
@keyframes fade { from { opacity: 0; } }
.sheet { background: var(--surface); border-radius: 22px 22px 0 0; max-height: 92dvh; overflow: auto; padding: 8px 18px calc(18px + env(safe-area-inset-bottom)); box-shadow: var(--shadow-3); animation: sheetUp .32s var(--ease); width: 100%; }
.sheet::before { content: ""; display: block; width: 38px; height: 4px; border-radius: 4px; background: var(--line-2); margin: 4px auto 12px; }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .4; } }
@media (min-width: 760px) {
  .scrim { align-items: center; justify-items: center; padding: 24px; }
  .sheet { width: min(560px, 100%); border-radius: 20px; padding: 22px 24px 22px; animation: pop .24s var(--ease); }
  .sheet.wide { width: min(820px, 100%); }
  .sheet::before { display: none; }
  @keyframes pop { from { transform: translateY(8px) scale(.985); opacity: 0; } }
}
.sheet-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.sheet-head p { margin: 4px 0 0; color: var(--muted); font-size: 1rem; }
/* Help sheet on a phone: its last row + Close scroll fully above the tab bar / browser toolbar (Oct 27 2026) */
@media (max-width: 759px) { .sheet:has(.help-body) { padding-bottom: calc(18px + var(--tabbar) + env(safe-area-inset-bottom)); } }
/* Settings > Arrival welcome service times: day | starts | ends | Remove; on phones the day gets its own line,
   the two times sit side by side, Remove under them on the right (Oct 27 2026) */
.ar-row { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: center; }
@media (max-width: 600px) {
  .ar-row { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .ar-row > select { grid-column: 1 / -1; }
  .ar-row > button { grid-column: 1 / -1; justify-self: end; }
}
.sheet-foot { display: flex; gap: 8px; justify-content: flex-end; margin-top: 18px; flex-wrap: wrap; }
.sheet-foot .btn { flex: 1 1 auto; }
@media (min-width: 760px) { .sheet-foot .btn { flex: 0 0 auto; } }

/* ---------------------------------------------------------------- states */
.empty { text-align: center; padding: 34px 18px; color: var(--muted); }
.empty .art { width: 54px; height: 54px; margin: 0 auto 12px; border-radius: 16px; display: grid; place-items: center; background: var(--accent-softer); color: var(--accent); }
.empty .art svg { width: 26px; height: 26px; }
.empty h3 { color: var(--ink); margin-bottom: 6px; }
.skel { border-radius: 8px; background: linear-gradient(90deg, color-mix(in oklab, var(--ink) 6%, transparent), color-mix(in oklab, var(--ink) 10%, transparent), color-mix(in oklab, var(--ink) 6%, transparent));
  background-size: 200% 100%; animation: shimmer 1.3s infinite linear; height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }
.banner { display: flex; gap: 12px; align-items: flex-start; padding: 12px 14px; border-radius: var(--r); border: 1px solid color-mix(in oklab, var(--brass) 35%, var(--line)); background: var(--brass-soft); color: var(--ink); font-size: 1rem; margin-bottom: 14px; }
.banner svg { width: 18px; height: 18px; color: var(--brass-ink); flex: none; margin-top: 2px; }
.banner.rose { background: var(--rose-soft); border-color: color-mix(in oklab, var(--rose) 35%, var(--line)); }
.banner.rose svg { color: var(--rose); }
.banner.green { background: var(--green-soft); border-color: color-mix(in oklab, var(--green) 30%, var(--line)); }
.banner.green svg { color: var(--green); }
.banner.navy { background: var(--accent-softer); border-color: color-mix(in oklab, var(--accent) 25%, var(--line)); }
.banner.navy svg { color: var(--accent); }
.banner.plum { background: var(--plum-soft); border-color: color-mix(in oklab, var(--plum) 30%, var(--line)); }
.banner.plum svg { color: var(--plum); }
.kv { display: grid; grid-template-columns: minmax(110px, 34%) 1fr; gap: 8px 14px; font-size: 1rem; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
hr.sep { border: 0; border-top: 1px solid var(--line); margin: 18px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }

/* ---------------------------------------------------------------- workflow */
.board { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(270px, 84vw); gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
@media (min-width: 960px) { .board { grid-auto-columns: minmax(250px, 1fr); margin: 0; padding-left: 0; padding-right: 0; } }
.col { scroll-snap-align: start; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--r); padding: 10px; align-self: start; }
.col-head { display: flex; align-items: center; gap: 8px; padding: 4px 6px 10px; }
.col-head .n { margin-left: auto; font-size: 0.8125rem; font-weight: 700; color: var(--muted); }
.col-head .step-n { width: 22px; height: 22px; border-radius: 50%; background: var(--surface); border: 1px solid var(--line-2); font-size: 0.8125rem; font-weight: 700; display: grid; place-items: center; color: var(--ink-2); }
.wcard { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 8px; color: inherit; text-decoration: none; box-shadow: var(--shadow-1); transition: transform .15s var(--ease), box-shadow .15s var(--ease); }
.wcard:hover { transform: translateY(-1px); box-shadow: var(--shadow-2); text-decoration: none; }
.wcard .who { font-weight: 600; }
.wcard .meta { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 1rem; color: var(--muted); }
.wcard.overdue { border-left: 3px solid var(--rose); }
.steps { display: grid; gap: 0; margin: 4px 0 0; }
.step { display: grid; grid-template-columns: 28px 1fr; gap: 10px; position: relative; padding-bottom: 14px; }
.step::before { content: ""; position: absolute; left: 13px; top: 26px; bottom: 0; width: 2px; background: var(--line); }
.step:last-child::before { display: none; }
.step .b { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font-size: 1rem; font-weight: 700; background: var(--surface); border: 1.5px solid var(--line-2); color: var(--muted); z-index: 1; }
.step.done .b { background: var(--green); border-color: var(--green); color: var(--paper); }
.step.done .b svg { width: 14px; height: 14px; }
.step.now .b { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.step .lbl { font-weight: 600; padding-top: 3px; }
.step.later .lbl { color: var(--muted); font-weight: 500; }
.step .lbl small { display: block; font-weight: 400; color: var(--muted); }
.timeline { display: grid; gap: 0; }
.ev { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 12px 0; border-top: 1px solid var(--line); }
.ev:first-child { border-top: 0; }
.ev .ic { width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; background: color-mix(in oklab, var(--ink) 6%, transparent); color: var(--ink-2); }
.ev .ic svg { width: 16px; height: 16px; }
.ev .ic.green { background: var(--accent-soft); color: var(--accent); } .ev .ic.brass { background: var(--brass-soft); color: var(--brass-ink); }
.ev .ic.rose { background: var(--rose-soft); color: var(--rose); } .ev .ic.sky { background: var(--sky-soft); color: var(--sky); }
.ev .head { font-size: 1rem; } .ev .head b { font-weight: 600; }
.ev .when { font-size: 1rem; color: var(--faint); }
.ev .note { margin-top: 6px; padding: 9px 12px; background: var(--paper); border: 1px solid var(--line); border-radius: 10px; font-size: 1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.ev.undone { opacity: .5; } .ev.undone .head { text-decoration: line-through; }
.actionbar { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.actionbar .btn { height: 48px; }
@media (min-width: 760px) { .actionbar { display: flex; flex-wrap: wrap; } .actionbar .btn { height: 42px; } }

/* ---------------------------------------------------------------- messages */
.chat { display: flex; flex-direction: column; gap: 6px; padding: 8px 0; }
.bubble { max-width: min(78%, 560px); padding: 9px 13px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); font-size: 1rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.bubble.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-color: var(--accent); border-bottom-right-radius: 6px; }
.bubble.them { border-bottom-left-radius: 6px; }
.bubble .by { font-size: 1rem; font-weight: 700; color: var(--accent); margin-bottom: 2px; }
.bubble .at { font-size: 1rem; opacity: .65; margin-top: 3px; }
.composer { position: sticky; bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); display: flex; gap: 8px; align-items: flex-end; padding: 10px 0 4px; background: linear-gradient(to top, var(--paper) 70%, transparent); }
@media (min-width: 960px) { .composer { bottom: 0; } }
.composer .textarea { min-height: 46px; max-height: 160px; }

/* ---------------------------------------------------------------- calendar */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.month .dow { padding: 8px; font-size: 0.8125rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); background: var(--paper-2); }
.month .day { min-height: 104px; padding: 6px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); min-width: 0; }
.month .day.out { background: color-mix(in oklab, var(--paper) 60%, var(--surface)); }
.month .day .d { font-size: 0.8125rem; font-weight: 700; color: var(--muted); margin-bottom: 4px; }
.month .day.today .d { color: var(--accent-ink); background: var(--accent); width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }
.evchip { display: block; width: 100%; text-align: left; border: 0; cursor: pointer; font-size: 0.8125rem; line-height: 1.3; padding: 3px 6px; border-radius: 6px; margin-bottom: 3px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.evchip.members { background: var(--sky-soft); color: var(--sky); } .evchip.staff { background: var(--brass-soft); color: var(--brass-ink); } .evchip.leadership { background: var(--plum-soft); color: var(--plum); }
.agenda .dayhead { font: 500 1rem var(--font-display); margin: 18px 0 8px; display: flex; gap: 8px; align-items: baseline; }
.agenda .dayhead.today::after { content: "Today"; font: 700 0.8125rem var(--font-body); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.vis { display: inline-flex; align-items: center; gap: 6px; font-size: 0.8125rem; font-weight: 600; }
.vis::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }
.vis.members::before { background: var(--sky); } .vis.staff::before { background: var(--brass); } .vis.leadership::before { background: var(--plum); }

/* ---------------------------------------------------------------- lobby */
body.lobby-mode { background: #0E1628; color: #F2F4F9; }
.lobby { min-height: 100dvh; padding: 26px clamp(16px, 3vw, 40px) 30px; color: #F2F4F9;
  background: radial-gradient(90% 70% at 85% -10%, rgba(226,180,81,.18), transparent 60%), radial-gradient(80% 60% at -10% 110%, rgba(169,192,238,.14), transparent 60%), #0E1628; }
.lobby header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 26px; }
.lobby h1 { color: #FFFFFF; font-size: clamp(30px, 4.6vw, 56px); font-weight: 400; }
.lobby .clock { font: 300 clamp(26px, 3.4vw, 44px)/1 var(--font-display); color: #E2B451; font-variant-numeric: tabular-nums; }
.lobby .cols { display: grid; gap: 22px; grid-template-columns: 1fr; }
@media (min-width: 900px) { .lobby .cols { grid-template-columns: 1.15fr 1fr; } }
.lobby h2 { color: #C9D2E3; font-family: var(--font-body); font-size: 0.8125rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 700; margin-bottom: 12px; }
.ltile { display: flex; align-items: center; gap: 16px; width: 100%; text-align: left; cursor: pointer; padding: 18px 20px; border-radius: 18px; margin-bottom: 12px;
  background: rgba(255,255,255,.045); border: 1px solid rgba(255,255,255,.08); color: inherit; transition: transform .2s var(--ease), background .2s var(--ease), border-color .2s; }
.ltile:hover { background: rgba(255,255,255,.07); transform: translateY(-1px); }
.ltile .nm { font: 400 clamp(24px, 2.6vw, 34px)/1.1 var(--font-display); color: #FFFFFF; }
.ltile .st { font-size: 0.9375rem; color: #AEB8CC; margin-top: 4px; }
.ltile .grow { flex: 1; min-width: 0; }
.ltile .claim { flex: none; padding: 10px 16px; border-radius: 12px; font-weight: 700; font-size: 0.9375rem; background: #E2B451; color: #1B2A4A; }
.ltile.mine .claim { background: transparent; color: #E2B451; border: 1px solid rgba(169,192,238,.5); }
.ltile.new { border-color: rgba(226,180,81,.4); background: linear-gradient(90deg, rgba(226,180,81,.12), rgba(255,255,255,.035)); }
.ltile.flash { animation: flash 1.2s var(--ease); }
@keyframes flash { 0% { box-shadow: 0 0 0 0 rgba(226,180,81,.7); } 100% { box-shadow: 0 0 0 18px rgba(226,180,81,0); } }
.lobby .live { display: inline-flex; align-items: center; gap: 8px; font-size: 0.7813rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #E2B451; }
.lobby .live::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: #E2B451; animation: pulse 2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 rgba(169,192,238,.6); } 70% { box-shadow: 0 0 0 10px rgba(169,192,238,0); } 100% { box-shadow: 0 0 0 0 rgba(169,192,238,0); } }

/* ---------------------------------------------------------------- login / public */
.auth-wrap { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(70% 60% at 100% 0%, color-mix(in oklab, var(--brass) 16%, transparent), transparent 60%),
  radial-gradient(70% 60% at 0% 100%, color-mix(in oklab, var(--accent) 14%, transparent), transparent 60%), var(--paper); }
.auth-card { width: min(420px, 100%); }
.auth-card .brand { justify-content: center; padding-bottom: 26px; }
.auth-card .brand-word { font-size: 1.875rem; }
.qr { background: #fff; padding: 12px; border-radius: 14px; display: inline-block; border: 1px solid var(--line); }
.qr svg { width: 176px; height: 176px; }

/* ---------------------------------------------------------------- misc */
.statement { background: #fff; color: #16213A; max-width: 760px; margin: 0 auto; padding: 44px 48px; border-radius: 6px; box-shadow: var(--shadow-2); font-size: 0.875rem; }
.statement h1 { color: #16213A; font-size: 1.625rem; }
.statement table { width: 100%; border-collapse: collapse; margin: 14px 0; }
.statement th, .statement td { padding: 6px 4px; border-bottom: 1px solid #E4DCCB; text-align: left; }
.statement .num { text-align: right; font-variant-numeric: tabular-nums; }
.statement .draft { border: 1px dashed #A8432F; color: #A8432F; padding: 8px 12px; border-radius: 8px; font-size: 0.7813rem; margin-bottom: 16px; }
@media print {
  body { background: #fff; }
  .sidebar, .tabbar, .topbar, .no-print, .toast-host { display: none !important; }
  .shell { display: block; } .main { padding: 0; max-width: none; }
  .statement { box-shadow: none; padding: 0; max-width: none; }
  .statement + .statement { break-before: page; }
}
.fade-in { animation: fadeUp .35s var(--ease) both; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(6px); } }
.meter { height: 10px; border-radius: 99px; background: color-mix(in oklab, var(--ink) 8%, transparent); overflow: hidden; }
.meter > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .4s var(--ease); }
.meter.hot > i { background: var(--rose); }
.drop { border: 2px dashed var(--line-2); border-radius: var(--r); padding: 28px 16px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-softer); }
.code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.8125rem; background: var(--paper-2); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; overflow-x: auto; white-space: pre-wrap; word-break: break-all; }
.bar { height: 8px; border-radius: 8px; background: var(--accent); min-width: 2px; }
.spark { display: flex; align-items: flex-end; gap: 4px; height: 68px; }
.spark i { flex: 1; background: color-mix(in oklab, var(--accent) 70%, transparent); border-radius: 4px 4px 2px 2px; min-height: 3px; }
.spark i:last-child { background: var(--brass); }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .001ms !important; transition-duration: .001ms !important; } }
@media (max-width: 759px) {
  .grid.three > :last-child:nth-child(odd), .grid.four > :last-child:nth-child(odd) { grid-column: 1 / -1; }
}
.desk-only { display: none !important; }
@media (min-width: 960px) { .desk-only { display: inline-flex !important; } }
@media (max-width: 759px) {
  .toolbar { gap: 8px; }
  .seg button { padding: 0 10px; font-size: 1rem; }
  .toolbar > .select { flex: 1 1 100%; }
}
.mobile-only { display: block; }
@media (min-width: 760px) { .mobile-only { display: none !important; } }
@media (max-width: 759px) { .wide-only { display: none !important; } }

/* Chapelbook theme: navy headings, pale-blue bands */
h1, h2, h3, .page-head h1 { color: var(--navy); }
.band { background: var(--accent-softer); }

/* ================================================================ ease of use (docs/EASE-OF-USE.md)
   For older staff on a laptop, or on a phone with reading glasses: bigger words, bigger
   targets, nothing hidden behind hover or sideways scrolling. Every text size above is rem,
   so My account > Larger text (html[data-text]) scales the whole app, and so does the
   browser's own text-size setting. */
:root { --ts: 1; }
:root[data-text="large"] { --ts: 1.2; }
:root[data-text="largest"] { --ts: 1.4; }
html { font-size: calc(100% * var(--ts)); }
body { font-size: 1.0625rem; line-height: 1.6; }                 /* 17px on a laptop */
@media (max-width: 759px) { body { font-size: 1.125rem; } }       /* 18px on a phone */
h2 { font-size: 1.375rem; } h3 { font-size: 1.1875rem; }
.muted, .faint, .row .sub, .row .end, .field .hint, .stat .sub { color: var(--muted); }
p a, .hint a, .banner a, .empty a:not(.btn), .small a { text-decoration: underline; text-underline-offset: 3px; }
:focus-visible { box-shadow: 0 0 0 3px var(--surface), 0 0 0 6px var(--accent); }

/* Buttons: 48px tall on a phone (44 elsewhere). Words may wrap instead of being cut off. */
.btn { height: auto; min-height: 44px; padding: .5em 1.05em; font-size: 1.0625rem; line-height: 1.25; white-space: normal; text-align: center; }
.btn.sm { height: auto; min-height: 44px; padding: .4em .85em; font-size: 1rem; }
.btn.lg { height: auto; min-height: 56px; font-size: 1.125rem; }
.btn.icon, .btn.icon.sm { width: auto; min-width: 44px; padding: .4em .7em; }
.btn svg { width: 1.15em; height: 1.15em; }
@media (max-width: 759px) { .btn { min-height: 48px; } .btn.sm { min-height: 44px; } }
.actionbar .btn { height: auto; min-height: 52px; }
@media (min-width: 760px) { .actionbar .btn { height: auto; min-height: 46px; } }
.btn.danger.solid, .btn.primary { font-weight: 700; }

/* Choices are buttons you can see - never a strip that scrolls sideways and hides some. */
.seg { flex-wrap: wrap; overflow: visible; }
.seg button { height: auto; min-height: 44px; padding: .35em .95em; font-size: 1rem; }
@media (max-width: 759px) { .seg button { padding: .35em .8em; font-size: 1rem; } }
.toolbar > .seg { max-width: 100%; }

/* Forms */
.input, .select, .textarea { min-height: 48px; font-size: 1.0625rem; }
@media (min-width: 760px) { .input, .select, .textarea { font-size: 1.0625rem; } }
.field > label, .label { font-size: 1rem; }
.check { min-height: 44px; align-items: center; font-size: 1.0625rem; }
.check input { width: 24px; height: 24px; margin: 0; }
.search .input { padding-left: 42px; }

/* Lists, pills, tables */
.row { min-height: 60px; padding: 12px 16px; }
.row .chev { width: 20px; height: 20px; }
.pill { height: auto; min-height: 26px; padding: 2px 10px; font-size: .875rem; }
table.t { font-size: 1rem; }
table.t th { font-size: .8125rem; }
@media (max-width: 639px) { table.t.stack td::before { font-size: .9375rem; } }

/* Shell: tab bar words you can read, a Back that is a real button, toasts you can read */
.tabbar a { font-size: .875rem; letter-spacing: 0; min-height: 48px; }
.tabbar a svg { width: 25px; height: 25px; }
.dot { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px; font-size: .8125rem; }
.nav a { min-height: 44px; font-size: 1.0625rem; }
.nav a svg { width: 21px; height: 21px; }
.back { min-height: 44px; margin: 0; padding: 0 12px 0 6px; border-radius: 10px; color: var(--ink-2); font-size: 1.0625rem; border: 1px solid var(--line-2); background: var(--surface); }
.back:hover { text-decoration: none; border-color: var(--faint); }
.back svg { width: 20px; height: 20px; }
.toast { font-size: 1.0625rem; padding: 12px 12px 12px 16px; align-items: center; }
.toast button { min-height: 44px; min-width: 44px; padding: 6px 14px; border: 2px solid currentColor; border-radius: 10px; text-decoration: none; font-size: 1rem; }
.toast button.toast-x { border-color: transparent; opacity: .85; }
.sheet-head p { font-size: 1rem; }
.sheet-head h2 { font-size: 1.375rem; }
.sheet-close { flex: none; }
.banner { font-size: 1rem; }
.kv { font-size: 1rem; }
.ev .head, .ev .note { font-size: 1rem; } .ev .when { font-size: .9375rem; }
.bubble { font-size: 1.0625rem; } .bubble .by, .bubble .at { font-size: .9375rem; }

/* Top bar on a phone: logo, the Search bar, Updates (with its word) */
.topbar { gap: 8px; padding-left: 12px; padding-right: 12px; }
.searchbtn { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 14px; border: 1px solid var(--line-2); background: var(--raised);
  border-radius: 12px; color: var(--muted); font: 600 1.0625rem/1.2 var(--font-body); cursor: pointer; text-align: left; box-shadow: var(--shadow-1); }
.searchbtn svg { width: 22px; height: 22px; color: var(--ink-2); }
.searchbtn .kbd { margin-left: auto; }
/* in the desktop sidebar (a column) flex: 1 made it grow TALL when the nav is short (a member's); keep its height (Oct 27 2026) */
.sidebar .searchbtn { flex: 0 0 auto; }
.kbd { display: inline-block; min-width: 22px; padding: 1px 6px; border: 1px solid var(--line-2); border-bottom-width: 2px; border-radius: 6px; font: 600 .8125rem/1.4 var(--font-body); color: var(--muted); background: var(--surface); text-align: center; }
.topbtn { flex: none; display: inline-flex; align-items: center; gap: 6px; min-height: 48px; padding: 0 10px; border-radius: 12px; color: var(--ink-2); font-weight: 600; font-size: 1rem; position: relative; text-decoration: none; border: 1px solid transparent; background: none; cursor: pointer; }
.topbtn:hover { background: color-mix(in oklab, var(--ink) 5%, transparent); text-decoration: none; }
.topbtn svg { width: 22px; height: 22px; }
.topbtn .dot { position: static; margin-left: 2px; }
@media (max-width: 420px) { .topbar .brand-mark { display: none !important; } }
.side-search { margin: 0 0 14px; width: 100%; }

/* Screen bar: Back on the left, Help on the right, on every screen */
.screenbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin: 0 0 14px; min-height: 44px; }
.screenbar .help-btn { margin-left: auto; }
.help-btn { color: var(--accent-text); }
.help-btn .q { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; border: 2px solid currentColor; font: 800 .875rem/1 var(--font-body); }

/* Help sheet */
.help-body p { font-size: 1.0625rem; line-height: 1.6; }
.video-slot { margin: 6px 0 4px; aspect-ratio: 16 / 9; border-radius: 14px; border: 2px dashed var(--line-2); background: var(--paper-2); display: grid; place-items: center; text-align: center; padding: 16px; color: var(--muted); }
.video-slot b { display: block; color: var(--ink); font-size: 1.0625rem; margin-bottom: 4px; }
.video-slot iframe { width: 100%; height: 100%; border: 0; border-radius: 12px; }

/* Search: a full screen on a phone, a panel on a laptop */
.search-pop { position: fixed; inset: 0; z-index: 95; background: var(--paper); display: flex; flex-direction: column; animation: fade .15s var(--ease); }
.search-pop .sp-head { display: flex; gap: 8px; align-items: center; padding: calc(env(safe-area-inset-top) + 10px) 12px 10px; border-bottom: 1px solid var(--line); background: var(--surface); }
.search-pop .sp-field { position: relative; flex: 1; }
.search-pop .sp-field svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 22px; height: 22px; color: var(--ink-2); pointer-events: none; }
.search-pop .sp-input { width: 100%; min-height: 52px; padding: 10px 14px 10px 46px; border-radius: 12px; border: 2px solid var(--accent); background: var(--raised); font-size: 1.1875rem; }
.search-pop .sp-input:focus { outline: none; box-shadow: var(--ring); }
.search-pop .sp-body { flex: 1; overflow-y: auto; padding: 12px 12px calc(env(safe-area-inset-bottom) + 24px); }
.search-pop .sp-group { margin: 14px 4px 8px; }
.sp-row { display: flex; align-items: center; gap: 14px; width: 100%; min-height: 64px; padding: 10px 14px; border: 0; border-top: 1px solid var(--line); background: none; color: inherit; text-align: left; cursor: pointer; text-decoration: none; font-size: 1.0625rem; }
.sp-row:first-child { border-top: 0; }
.sp-row:hover, .sp-row.on { background: var(--accent-softer); text-decoration: none; }
.sp-row.on { box-shadow: inset 4px 0 0 var(--accent); }
.sp-row .ic { width: 40px; height: 40px; border-radius: 12px; flex: none; display: grid; place-items: center; background: var(--accent-softer); color: var(--accent); }
.sp-row .ic svg { width: 21px; height: 21px; }
.sp-row .grow { flex: 1; min-width: 0; }
.sp-row .t { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-row .s { color: var(--muted); font-size: 1rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sp-row .kind { flex: none; font: 700 .8125rem/1 var(--font-body); letter-spacing: .04em; text-transform: uppercase; padding: 6px 8px; border-radius: 8px; background: var(--paper-2); color: var(--ink-2); border: 1px solid var(--line); }
.sp-row .kind.action { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.sp-hint { color: var(--muted); padding: 6px 4px; }
@media (min-width: 760px) {
  .search-pop { background: rgba(17, 28, 51, .40); align-items: center; padding: 8vh 24px 24px; }
  .search-pop .sp-panel { width: min(680px, 100%); max-height: 80vh; display: flex; flex-direction: column; background: var(--paper); border-radius: 18px; overflow: hidden; box-shadow: var(--shadow-3); }
}
.search-pop .sp-panel { display: flex; flex-direction: column; flex: 1; min-height: 0; }
@media (min-width: 760px) { .search-pop .sp-panel { flex: none; } }

/* First-day tour: a spotlight ring drawn on top of everything, and a card */
.tour-ring { position: fixed; z-index: 96; border-radius: 14px; pointer-events: none; box-shadow: 0 0 0 4px var(--gold), 0 0 0 9999px rgba(15, 22, 40, .55); transition: all .25s var(--ease); }
.tour-dim { position: fixed; inset: 0; z-index: 96; background: rgba(15, 22, 40, .55); }
.tour { position: fixed; z-index: 97; left: 12px; right: 12px; bottom: calc(env(safe-area-inset-bottom) + 12px); max-width: 520px; margin: 0 auto; background: var(--surface); border-radius: 18px; padding: 18px; box-shadow: var(--shadow-3); border: 1px solid var(--line); }
.tour.top { bottom: auto; top: calc(env(safe-area-inset-top) + 12px); }
.tour h2 { margin: 6px 0 6px; }
.tour p { font-size: 1.0625rem; margin: 0 0 14px; }
.tour .tour-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.tour .tour-foot .btn.primary { margin-left: auto; }
.tour .meter { margin: 0 0 12px; }

/* Text-size choice in My account */
.textsize { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.textsize button { min-height: 64px; border: 2px solid var(--line-2); border-radius: 12px; background: var(--raised); cursor: pointer; font-weight: 700; color: var(--ink); line-height: 1.15; padding: 6px; }
.textsize button .aa { display: block; font-family: var(--font-display); }
.textsize button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-text); box-shadow: inset 0 0 0 1px var(--accent); }
.search-pop .card.list { overflow: hidden; grid-template-columns: minmax(0, 1fr); }
.sp-row { min-width: 0; }
.section > .head a, .section > .head .btn { min-height: 44px; display: inline-flex; align-items: center; }
table.t td a:not(.btn) { display: inline-flex; align-items: center; min-height: 44px; }
.row .title > a, .vc .link a { display: inline-flex; align-items: center; min-height: 44px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
/* the 5 bottom-tab words stay on one line at every text size (they are short labels, 13-15px) */
.tabbar a { font-size: clamp(13px, .875rem, 15px); white-space: nowrap; }
/* rows with buttons (directory, saved emails): the buttons drop below the name on a phone */
@media (max-width: 759px) { .row.wrap-btns { flex-wrap: wrap; } .row.wrap-btns > .grow { flex: 1 1 60%; } }
button.pill, a.pill { min-height: 44px; padding: 6px 12px; cursor: pointer; }
.bubble .by, .bubble .at { font-size: 1rem; }
a.title { display: inline-flex; align-items: center; min-height: 44px; }

/* ---------------------------------------------------------------- Giving lock (Oct 12 2026)
   Always a dark, quiet "vault" moment, in light and dark theme alike. Gold = the lock. */
.vault { --v-ink: #F3EEDF; --v-mute: #B9C1D4; --v-gold: #E6B04A; --v-line: rgba(230, 176, 74, .28);
  position: relative; overflow: hidden; border-radius: 24px; padding: clamp(26px, 6vw, 56px) clamp(18px, 5vw, 56px);
  background: radial-gradient(120% 90% at 85% -10%, #2A3C66 0%, transparent 55%), linear-gradient(160deg, #101A31 0%, #0A1122 70%, #070C18 100%);
  color: var(--v-ink); box-shadow: 0 30px 80px -30px rgba(7, 12, 24, .7); border: 1px solid #1E2A47; isolation: isolate; }
.vault.compact { border-radius: 18px; padding: 24px 18px; }
.vault-glow { position: absolute; z-index: -1; width: 520px; height: 520px; right: -160px; top: -220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(230, 176, 74, .22), transparent 62%); filter: blur(4px); }
.vault-inner { max-width: 470px; margin: 0 auto; text-align: center; }
.vault-mark { width: 74px; height: 74px; margin: 0 auto 18px; border-radius: 22px; display: grid; place-items: center;
  background: linear-gradient(150deg, rgba(230, 176, 74, .22), rgba(230, 176, 74, .06)); border: 1px solid var(--v-line); color: var(--v-gold);
  box-shadow: 0 0 0 8px rgba(230, 176, 74, .05), 0 18px 40px -18px rgba(230, 176, 74, .55); }
.vault-mark svg { width: 34px; height: 34px; }
.vault .vault-eyebrow { color: var(--v-gold); }
.vault-h { color: var(--v-ink); font-size: clamp(2rem, calc(7vw * var(--ts, 1)), 2.75rem); line-height: 1.05; margin: 10px 0 12px; letter-spacing: -.02em; }
.vault.compact .vault-h { font-size: 1.75rem; }
.vault-lede { color: var(--v-mute); font-size: 1.0625rem; margin: 0 auto 22px; max-width: 44ch; }
.vault-form { display: grid; gap: 10px; text-align: left; }
.vault-label { font-weight: 700; color: var(--v-ink); margin-top: 4px; }
.vault .input.vault-pin { height: 58px; font: 600 1.5rem/1 var(--font-body); letter-spacing: .35em; text-align: center; color: #FFFFFF;
  background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .18); border-radius: 14px; }
.vault .input.vault-pin::placeholder { color: rgba(255, 255, 255, .45); letter-spacing: .2em; }
.vault .input.vault-pin:focus { border-color: var(--v-gold); box-shadow: 0 0 0 3px rgba(230, 176, 74, .3); outline: none; }
.vault .btn.vault-btn { background: var(--v-gold); border-color: var(--v-gold); color: #1B1406; font-weight: 800; height: 54px; margin-top: 6px; }
.vault .btn.vault-btn:hover { background: #F0C266; border-color: #F0C266; }
.vault .btn.vault-alt { color: var(--v-ink); border-color: rgba(255, 255, 255, .16); background: transparent; min-height: 48px; }
.vault .btn.vault-alt:hover { background: rgba(255, 255, 255, .06); }
.vault-msg { min-height: 1.5em; margin: 2px 0 0; color: var(--v-mute); font-size: 1rem; }
.vault-msg.bad { color: #FFB4A3; font-weight: 600; }
.vault-sent { display: flex; gap: 10px; align-items: flex-start; color: var(--v-ink); background: rgba(230, 176, 74, .1); border: 1px solid var(--v-line);
  border-radius: 12px; padding: 12px 14px; margin: 0 0 6px; }
.vault-sent svg { color: var(--v-gold); margin-top: 2px; }
.vault-facts { list-style: none; padding: 18px 0 0; margin: 22px 0 0; border-top: 1px solid rgba(255, 255, 255, .1); display: grid; gap: 10px; text-align: left; color: var(--v-mute); font-size: 1rem; }
.vault-facts li { display: flex; gap: 10px; align-items: center; }
.vault-facts svg { color: var(--v-gold); }
.giving-open { display: inline-flex; align-items: center; gap: 8px; color: var(--gold-ink); font-weight: 700; }
/* demo churches (Oct 20 2026): a quiet strip above every screen */
.demo-banner { display: flex; gap: 10px; align-items: center; padding: 10px 16px; background: var(--brass-soft); color: var(--ink); border-bottom: 1px solid color-mix(in oklab, var(--brass) 35%, var(--line)); font-size: 1rem; line-height: 1.4; }
.demo-banner svg { width: 18px; height: 18px; color: var(--brass-ink); flex: none; }
