/* Church & Trellis – design tokens and components */
:root {
  --bg: #F6F4F1; --surface: #FFFFFF; --surface-2: #FBFAF8; --ink: #1D1B19; --muted: #645B53; --line: #E7E1DA; --line-2: #F0EBE5; --line-strong: #D6CDC4; --tag-ink: #000;
  --side: #231E1A; --side-2: #3A322C; --side-ink: #E9E2DB; --side-muted: #B7ADA4;
  --accent: #E8590C; --accent-ink: #B8430A; --accent-soft: #FFE8D9;
  --ok: #1F6B3A; --ok-soft: #DFF3E6; --warn: #7A5300; --warn-soft: #FFF1CC; --bad: #9B1C1C; --bad-soft: #FDE2E2; --away: #E9E5E1;
  --radius: 14px; --shadow: 0 1px 2px rgba(29,27,25,.04), 0 4px 16px rgba(29,27,25,.05);
  font-family: Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; color: var(--ink); background: var(--bg);
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--ink); font-size: 15px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
a { color: var(--accent-ink); }
h1, h2, h3 { line-height: 1.2; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid #2F6FB3; outline-offset: 2px; border-radius: 6px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- layout ---------- */
.app { display: flex; min-height: 100vh; }
.side { width: 248px; flex: 0 0 248px; background: var(--side); color: var(--side-ink); display: flex; flex-direction: column; padding: 18px 12px; position: sticky; top: 0; height: 100vh; }
.side nav { display: flex; flex-direction: column; gap: 2px; flex: 1; overflow: auto; }
.nav { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: var(--side-ink); text-decoration: none; font-weight: 600; font-size: 14.5px; }
.nav:hover { background: #2E2722; }
.nav.on { background: var(--side-2); color: #fff; box-shadow: inset 3px 0 0 var(--accent); }
.brand { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; color: #fff; text-decoration: none; }
.brand b { display: block; font-size: 15.5px; } .brand small { display: block; color: var(--side-muted); font-size: 12px; }
.mark { width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: var(--accent-on, #fff); display: grid; place-items: center; flex: 0 0 auto; }
.who { display: flex; align-items: center; gap: 10px; padding: 12px 6px 0; border-top: 1px solid #3A322C; margin-top: 10px; }
.who span { flex: 1; min-width: 0; } .who b { display: block; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .who small { color: var(--side-muted); font-size: 12px; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.corner { position: absolute; top: 14px; right: 20px; z-index: 4; }
.corner .btn { gap: 6px; }
.top-r { display: flex; gap: 8px; }
main { width: 100%; max-width: 1180px; margin: 0 auto; padding: 28px 32px 96px; outline: none; }
.top { display: none; }
.tabbar { display: none; }
.demo { background: #FFF6E5; border-bottom: 1px solid #F3DDB0; color: #6B4A00; font-size: 13px; padding: 8px 32px; }
.link { background: none; border: 0; padding: 0; color: var(--accent-ink); font-weight: 600; text-decoration: underline; cursor: pointer; }

@media (max-width: 860px) {
  .side { display: none; }
  .corner { display: none; }
  .top { display: flex; align-items: center; justify-content: space-between; background: var(--side); padding: 10px 14px; position: sticky; top: 0; z-index: 5; }
  .top .brand { padding: 0; } .top .mark { width: 32px; height: 32px; }
  .top .icon-btn { color: #fff; border-color: #4A413A; background: transparent; }
  main { padding: 18px 16px 110px; }
  .demo { padding: 8px 16px; }
  .tabbar { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 4px calc(8px + env(safe-area-inset-bottom)); z-index: 6; }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 6px 0; color: var(--muted); text-decoration: none; font-size: 11px; font-weight: 600; background: none; border: 0; min-height: 52px; justify-content: center; }
  .tabbar .on { color: var(--accent-ink); }
}

/* ---------- page parts ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.page-head h1 { margin: 0; font-size: 28px; letter-spacing: -.01em; }
.lead { margin: 6px 0 0; color: var(--muted); font-size: 15px; max-width: 70ch; }
.crumb { display: inline-flex; align-items: center; gap: 4px; font-size: 13.5px; font-weight: 600; text-decoration: none; margin-bottom: 8px; }
.block { margin-bottom: 26px; }
.block > h2, .panel > h2 { font-size: 16px; margin: 0 0 10px; }
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.panel + .panel { margin-top: 16px; }
/* A person who has died (js/people/profile.js): their information blocks are grey. Setting --surface on the block greys
   everything inside that uses it too (lists, boxes), without touching the rest of the page. */
.deceased .panel { --surface: #ECEAE6; --surface-2: #E4E1DC; --line-2: #DAD5CF; background: var(--surface); border-color: #DAD5CF; box-shadow: none; }
.grid2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 16px; align-items: start; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
/* Rosters → Teams: a position's name with how many and which services underneath, its Add button beside them */
.pos-head { flex-wrap: nowrap; align-items: flex-start; }
.pos-head .grow { display: flex; flex-direction: column; gap: 2px; overflow-wrap: anywhere; }
.pos-head .btn { flex: 0 0 auto; }
.muted { color: var(--muted); } .small { font-size: 13px; }
.empty { color: var(--muted); background: var(--surface-2); border: 1px dashed var(--line); border-radius: 12px; padding: 18px; text-align: center; margin: 0; }
.hint { font-size: 13px; color: var(--muted); margin: 6px 0 0; }

/* ---------- controls ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 16px; border-radius: 12px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font-weight: 600; font-size: 14.5px; cursor: pointer; text-decoration: none; white-space: nowrap; }
.btn:hover { border-color: #B9AEA3; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-on, #fff); }
.btn.primary:hover { background: var(--accent-ink); border-color: var(--accent-ink); }
.btn.danger, .btn.primary.danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn.small { min-height: 36px; padding: 0 12px; font-size: 13.5px; border-radius: 10px; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.big-btn, #si-form .btn { width: 100%; }
.btns { display: flex; flex-wrap: wrap; gap: 10px; }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); display: grid; place-items: center; cursor: pointer; color: var(--ink); flex: 0 0 auto; }
.icon-btn.ghost { background: transparent; border-color: transparent; color: inherit; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; font-weight: 600; font-size: 14px; }
.field small { font-weight: 400; color: var(--muted); }
/* A small, quiet icon in front of a field's label (People: a person's page and Edit details), so people see what it asks */
.f-lab { display: inline-flex; align-items: center; gap: 6px; }
.f-ico { flex: none; color: var(--muted); opacity: .7; }
.kv dt .f-ico { opacity: .8; }
@media print { .f-ico { display: none; } }
.field input, .field select, .field textarea, .search input, select.inline { border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); padding: 10px 12px; min-height: 44px; font-weight: 400; font-size: 15px; width: 100%; }
/* Dates that can be typed (js/datebox.js): a box to type in, and the phone's calendar behind a small button */
.date-typed { display: flex; gap: 6px; align-items: stretch; }
.date-typed .date-text { flex: 1; min-width: 0; }
.date-typed .date-text.bad { border-color: #C0392B; }
.date-typed .date-cal { min-height: 44px; border: 1px solid var(--line-strong); border-radius: 10px; flex: none; width: 48px; padding: 0; color: transparent; cursor: pointer; position: relative;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='22' height='22' viewBox='0 0 24 24' fill='none' stroke='%238A7F76' stroke-width='2' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E") center no-repeat; }
.date-cal::-webkit-datetime-edit, .date-cal::-webkit-inner-spin-button, .date-cal::-webkit-clear-button { display: none; }
.date-cal::-webkit-calendar-picker-indicator { position: absolute; inset: 0; width: auto; height: auto; opacity: 0; cursor: pointer; }
.field textarea { min-height: 84px; resize: vertical; }
.two { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0 14px; }
.check { display: flex; align-items: flex-start; gap: 10px; font-weight: 500; font-size: 14.5px; padding: 8px 0; }
.item.pf-cg-item { display: block; padding: 6px 16px; min-height: 0; }
.pf-cgl-row { margin: 0 0 0 30px; padding-top: 0; }
.pf-cgl-row[hidden] { display: none; }
.check input { width: 20px; height: 20px; margin-top: 1px; accent-color: var(--accent); flex: 0 0 auto; }
.search { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px; padding: 0 12px; min-height: 46px; flex: 1; min-width: 220px; }
.search input { border: 0; padding: 0; min-height: 40px; outline: none; }
.seg { display: inline-flex; background: #EDE8E2; border-radius: 12px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg button { border: 0; background: transparent; padding: 8px 14px; border-radius: 9px; font-weight: 600; font-size: 14px; color: var(--muted); text-decoration: none; cursor: pointer; min-height: 38px; display: inline-flex; align-items: center; }
.seg .on { background: var(--surface); color: var(--ink); box-shadow: 0 1px 2px rgba(0,0,0,.08); }

/* ---------- bits ---------- */
.av { --c: #E8590C; --s: 36px; width: var(--s); height: var(--s); border-radius: 50%; background: color-mix(in srgb, var(--c) 16%, var(--surface)); color: var(--c); display: inline-grid; place-items: center; font-weight: 700; font-size: calc(var(--s) * .36); flex: 0 0 auto; }
.tag { --c: #6B625A; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 700; padding: 3px 9px; border-radius: 999px; color: color-mix(in srgb, var(--c) 82%, var(--tag-ink)); background: color-mix(in srgb, var(--c) 13%, var(--surface)); white-space: nowrap; }
.tag.ok { --c: #1F8A4C; } .tag.warn { --c: #B7791F; } .tag.bad { --c: #C0392B; } .tag.grey { --c: #6B625A; }
.dot { --c: #E8590C; width: 10px; height: 10px; border-radius: 3px; background: var(--c); flex: 0 0 auto; }
.note { border-radius: 12px; padding: 12px 14px; font-size: 14px; margin: 0 0 14px; }
.note.warn { background: var(--warn-soft); color: var(--warn); }
.note.bad { background: var(--bad-soft); color: var(--bad); }
.note.info { background: #E6EEF7; color: #1E4E8C; }
.note.ok { background: var(--ok-soft); color: var(--ok); }
.note ul { margin: 6px 0 0; padding-left: 18px; }
.locked { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--muted); font-weight: 600; }

/* ---------- Home ---------- */
.todo { list-style: none; margin: 0; padding: 0; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.todo li + li { border-top: 1px solid var(--line-2); }
.todo a { display: flex; align-items: center; gap: 12px; padding: 13px 16px; color: var(--ink); text-decoration: none; min-height: 52px; }
.todo a:hover { background: var(--surface-2); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.appcard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 6px; text-decoration: none; color: var(--ink); min-height: 132px; box-shadow: var(--shadow); transition: border-color .15s, transform .15s; }
.appcard:hover { border-color: #CFC4B9; transform: translateY(-1px); }
.appcard .ic { --c: #E8590C; width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 14%, var(--surface)); margin-bottom: 4px; }
.appcard b { font-size: 15.5px; } .appcard > span:last-child { color: var(--muted); font-size: 13px; }
@media (max-width: 520px) { .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .appcard { min-height: 120px; padding: 14px; } }

/* ---------- lists ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
/* A table that becomes one card per row on a phone (each box labelled from data-label) */
@media (max-width: 560px) {
  table.stack-phone thead { display: none; }
  table.stack-phone, table.stack-phone tbody, table.stack-phone tr, table.stack-phone td { display: block; width: 100%; }
  table.stack-phone tr { padding: 10px 0; border-bottom: 1px solid var(--line-2); }
  table.simple.stack-phone td { padding: 4px 0; border: 0; }
  table.simple.stack-phone td input, table.simple.stack-phone td select { padding: 8px 10px; border: 1px solid var(--line-strong); border-radius: 9px; }
  table.stack-phone td[data-label]::before { content: attr(data-label); display: block; font-size: 12.5px; font-weight: 600; color: var(--muted); margin: 4px 0 2px; }
  table.stack-phone td input, table.stack-phone td select { width: 100%; }
}
/* A row whose text would be squeezed by its buttons on a phone: the buttons drop below the text instead */
@media (max-width: 560px) { .item.wrap-phone { flex-wrap: wrap; row-gap: 8px; } .item.wrap-phone > .grow { flex: 1 1 200px; min-width: 200px; } }
.item { display: flex; align-items: center; gap: 12px; padding: 12px 16px; color: var(--ink); text-decoration: none; min-height: 60px; }
.item + .item { border-top: 1px solid var(--line-2); }
/* Leave: wallchart, month calendar, year planner */
.lv-nav { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; } .lv-nav b { min-width: 150px; text-align: center; }
.lv-wall { overflow-x: auto; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.lv-wall table { border-collapse: collapse; font-size: 12px; }
.lv-wall th, .lv-wall td { border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 0; min-width: 24px; height: 28px; text-align: center; }
.lv-wall thead th { padding: 4px 0; font-weight: 600; color: var(--muted); } .lv-wall thead th span { display: block; font-size: 10px; } .lv-wall thead th b { color: var(--ink); }
.lv-wall .lv-name { position: sticky; left: 0; background: var(--surface); text-align: left; padding: 0 10px; min-width: 140px; white-space: nowrap; font-weight: 600; z-index: 1; }
.lv-wall .lv-name a { color: var(--ink); text-decoration: none; }
.lv-wall td.lv-off, .lv-planner i.lv-off { background: repeating-linear-gradient(135deg, var(--line-2) 0 3px, transparent 3px 7px); }
.lv-wall td.lv-on { background: var(--c); }
.lv-wall td.lv-on.lv-half { background: linear-gradient(to right, var(--c) 50%, transparent 50%); }
.lv-views { display: flex; width: max-content; max-width: 100%; }
.lv-chip.lv-pend { background: repeating-linear-gradient(135deg, color-mix(in srgb, var(--c) 30%, var(--surface)) 0 4px, var(--surface) 4px 8px) !important; }
.lv-wall td.lv-pend, .lv-planner i.lv-pend { background: repeating-linear-gradient(135deg, var(--c) 0 4px, color-mix(in srgb, var(--c) 35%, var(--surface)) 4px 8px) !important; }
.lv-wall td.lv-block { box-shadow: inset 0 -3px 0 #C0392B; }
.lv-wall th.lv-today, .lv-cal-cell.lv-today { outline: 2px solid var(--accent); outline-offset: -2px; }
.lv-wall th.lv-blockh b { color: #C0392B; }
.lv-count td { font-weight: 700; color: var(--muted); } .lv-count td.lv-bad { background: #FDE2E2; color: #9B1C1C; }
.lv-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--muted); }
.lv-legend i { display: inline-block; width: 14px; height: 14px; border-radius: 3px; background: var(--c, transparent); vertical-align: -2px; margin-right: 5px; border: 1px solid var(--line); }
.lv-legend i.lv-off { background: repeating-linear-gradient(135deg, var(--line-2) 0 3px, transparent 3px 7px); } .lv-legend i.lv-block { box-shadow: inset 0 -3px 0 #C0392B; }
.lv-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.lv-cal-h { font-size: 12px; font-weight: 700; color: var(--muted); text-align: center; padding: 4px 0; }
.lv-cal-cell { min-height: 84px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px 5px; display: flex; flex-direction: column; gap: 3px; overflow: hidden; }
.lv-cal-cell b { font-size: 12px; } .lv-cal-cell small { font-size: 10.5px; color: #B45309; } .lv-cal-cell.lv-empty { background: transparent; border: 0; }
.lv-cal-cell.lv-off { background: var(--surface-2); } .lv-cal-cell.lv-block { border-color: #E9A6A0; }
.lv-chip { display: block; font-size: 11px; padding: 1px 6px; border-radius: 999px; background: color-mix(in srgb, var(--c) 22%, var(--surface)); border-left: 3px solid var(--c); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lv-planner { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.lv-pm { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 8px; } .lv-pm > b { font-size: 13px; }
.lv-pm-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-top: 6px; }
.lv-pm-grid i { font-style: normal; font-size: 10.5px; text-align: center; padding: 3px 0; border-radius: 4px; color: var(--muted); }
.lv-pm-grid i.lv-on { background: var(--c); color: #fff; font-weight: 700; } .lv-pm-grid i.lv-today { outline: 2px solid var(--accent); }
@media (max-width: 600px) { .lv-cal-cell { min-height: 56px; } .lv-chip { font-size: 9.5px; padding: 0 4px; } }
.ls-rule { border: 1px solid var(--line-2); border-radius: 12px; padding: 12px; margin: 0 0 10px; }
.ls-rule-row { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; }
.ls-rule-row .field { margin: 0 0 6px; min-width: 120px; }
.ls-rule-row .lr-min { width: 70px; }
/* A person's name as a chip that opens their page (Care groups) */
.name-chip { display: inline-flex; align-items: center; max-width: 100%; padding: 3px 11px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); color: var(--ink); font-weight: 600; font-size: 13.5px; text-decoration: none; overflow-wrap: anywhere; }
.name-chip:hover, .name-chip:focus-visible { border-color: var(--accent); color: var(--accent-ink); }
/* Saving as you go: the panel's own save button is hidden; a small note says "Saved" */
[data-autosave] { display: none !important; }
/* Saving as you go (js/app.js autoNote): a large green "Saved" at the bottom centre, and the tick or box that was saved glows */
#autosaved { position: fixed; left: 50%; bottom: 28px; z-index: 70; display: flex; align-items: center; gap: 10px; padding: 12px 22px 12px 14px; border-radius: 999px;
  font-size: 17px; font-weight: 700; background: #1F8A4C; color: #fff; box-shadow: 0 10px 30px rgba(20, 60, 35, .35); opacity: 0; transform: translate(-50%, 24px) scale(.9);
  transition: opacity .2s, transform .25s cubic-bezier(.2, 1.4, .4, 1); pointer-events: none; max-width: calc(100% - 32px); }
#autosaved .as-ic { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--surface); color: #1F8A4C; font-size: 17px; flex: none; }
#autosaved.show { opacity: 1; transform: translate(-50%, 0) scale(1); }
#autosaved.bad { background: #B42318; box-shadow: 0 10px 30px rgba(120, 20, 20, .35); } #autosaved.bad .as-ic { color: #B42318; }
@media (max-width: 860px) { #autosaved { bottom: 92px; font-size: 16px; } }
.just-saved { animation: just-saved 1.6s ease-out; border-radius: 8px; }
@keyframes just-saved { 0%, 30% { background: #CDEFD9; box-shadow: 0 0 0 3px #CDEFD9; } 100% { background: transparent; box-shadow: 0 0 0 3px transparent; } }
@media (prefers-reduced-motion: reduce) { #autosaved { transition: opacity .2s; transform: translate(-50%, 0); } .just-saved { animation: none; background: #CDEFD9; } }
/* The save buttons that remain (pop-up windows, notes): pale orange */
.btn.save { background: var(--accent-soft); color: var(--accent-ink); border-color: color-mix(in srgb, var(--accent) 35%, var(--surface)); }
.btn.save:hover, .btn.save:focus-visible { background: color-mix(in srgb, var(--accent) 22%, var(--surface)); border-color: color-mix(in srgb, var(--accent) 60%, var(--surface)); }
.pf-top { display: flex; gap: 8px; flex-wrap: wrap; justify-content: flex-end; margin: -4px 0 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.pf-top .btn { gap: 6px; }
.pp-tags { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; flex: 0 1 auto; }
/* People list on a phone: the tags go under the name, so long names and households keep the full width */
@media (max-width: 600px) {
  .pp-row { flex-wrap: wrap; row-gap: 6px; }
  .pp-row .grow { flex: 1 1 0; }
  .pp-row .pp-tags { flex: 1 0 100%; justify-content: flex-start; padding-left: 48px; }   /* in line with the name (36px picture + 12px gap) */
}
a.item:hover, button.item:hover { background: var(--surface-2); }
button.item { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; }
.item b { display: block; font-size: 14.5px; } .item small { display: block; color: var(--muted); font-size: 13px; }
.kv { display: grid; grid-template-columns: fit-content(45%) minmax(0, 1fr);   /* labels take only the width the longest one needs (any language), never more than 45% */ gap: 8px 14px; font-size: 14.5px; margin: 0; }
.map-link { display: inline-grid; place-items: center; width: 26px; height: 26px; margin: -4px 0 -4px 2px; border-radius: 8px; color: var(--accent-ink); vertical-align: middle; }
.map-link:hover, .map-link:focus-visible { background: var(--surface-2); }
.kv dt { color: var(--muted); } .kv dd { margin: 0; overflow-wrap: anywhere; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat span { color: var(--muted); font-size: 13px; } .stat b { display: block; font-size: 28px; line-height: 1.1; margin-top: 2px; }

/* ---------- roster matrix ---------- */
.matrix-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.matrix { border-collapse: separate; border-spacing: 0; width: 100%; min-width: 760px; font-size: 14px; }
@media (max-width: 699px) { .matrix { min-width: 0; } .matrix tbody th { min-width: 120px; } }
.matrix th, .matrix td { padding: 6px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.matrix thead th { position: sticky; top: 0; background: var(--surface); text-align: left; font-size: 13px; padding: 12px 8px; z-index: 1; }
.matrix tbody th { text-align: left; font-weight: 600; padding: 10px 14px; position: sticky; left: 0; background: var(--surface); min-width: 150px; z-index: 1; }
.matrix tbody th small { display: block; font-weight: 400; color: var(--muted); font-size: 12.5px; }
/* Six services side by side: the roster slides sideways, with a slider above it and a clear scroll bar below */
.matrix-wrap { scrollbar-width: auto; scrollbar-color: var(--accent) var(--surface-2); }
.matrix-wrap::-webkit-scrollbar { height: 14px; }
.matrix-wrap::-webkit-scrollbar-track { background: var(--surface-2); border-radius: 0 0 var(--radius) var(--radius); }
.matrix-wrap::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 8px; border: 3px solid var(--surface-2); }
@media (min-width: 700px) { .matrix thead th.svc-col, .matrix td { min-width: 180px; } }
/* The top row (date, time, communion) stays in view as people scroll down: the roster scrolls inside its own box */
.matrix-wrap { max-height: calc(100vh - 120px); max-height: calc(100dvh - 120px); overflow: auto; }
@media (max-width: 699px) { .matrix-wrap { max-height: calc(100vh - 200px); max-height: calc(100dvh - 200px); } }
.matrix thead th { z-index: 2; }
.matrix thead th:first-child { left: 0; z-index: 3; }
.ro-view { display: flex; align-items: center; gap: 16px; margin: 0 0 10px; flex-wrap: wrap; }
.ro-count { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.ro-step { display: inline-flex; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 3px; box-shadow: var(--shadow); }
.ro-step button { border: 0; background: var(--surface-2); width: 30px; height: 30px; border-radius: 999px; font: inherit; font-size: 18px; font-weight: 600; line-height: 1; color: var(--ink); cursor: pointer; }
.ro-step button:hover:not([disabled]) { background: var(--accent-soft); color: var(--accent-ink); }
.ro-step button[disabled] { opacity: .35; cursor: default; }
.ro-step output { min-width: 96px; text-align: center; font-weight: 600; font-size: 14px; }
.ro-step output b { color: var(--accent-ink); font-size: 16px; margin-right: 2px; }
.ro-chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 6px 12px; font: inherit; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; }
.ro-chip:hover { color: var(--ink); }
.ro-chip.on { background: var(--accent-soft); border-color: #F6C6A6; color: var(--accent-ink); }
.ro-slide { display: block; flex: 1; min-width: 200px; margin: 0; }
.ro-slide[hidden] { display: none; }
.svc-eye { float: right; margin: -6px -4px 0 4px; opacity: .55; }
.svc-eye:hover, .svc-eye:focus-visible { opacity: 1; }
.ro-hidden { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 12px; }
.ro-hidden .btn { gap: 6px; }
.ro-slide input { width: 100%; accent-color: var(--accent); cursor: ew-resize; height: 22px; }
.team-h { display: flex; align-items: center; gap: 4px; }
.team-tools { display: inline-flex; align-items: center; gap: 2px; font-size: 16px; }
.team-tools .icon-btn[disabled] { opacity: .3; cursor: default; }
.matrix .team-row th { background: var(--surface-2); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); padding: 8px 14px; }
.slot { display: flex; flex-direction: column; gap: 4px; }
.chip { display: flex; align-items: center; gap: 6px; width: 100%; text-align: left; border-radius: 10px; padding: 7px 9px; border: 1px solid transparent; font-size: 13.5px; font-weight: 600; cursor: pointer; min-height: 38px; background: var(--ok-soft); color: #173F27; }
.chip.pending { background: var(--warn-soft); color: #4D3500; }
.chip.declined { background: #F2EEEA; color: var(--muted); text-decoration: line-through; }
.chip.auto { background: #E6EEF7; color: #1E3E66; border: 1px dashed #7FA3CF; }
.chip.gap { background: var(--surface); border: 1px dashed #D9A39A; color: var(--bad); font-weight: 600; }
.chip.away { background: var(--away); color: var(--muted); border: 1px dashed #9C948C; }
.chip .tg { margin-left: auto; opacity: .8; }
.legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--muted); margin: 0 0 12px; }
.legend span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; }

/* ---------- leave ---------- */
.bal { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
a.stat { color: var(--ink); text-decoration: none; } a.stat:hover { border-color: var(--accent); } .stat.warn b { color: #B45309; }
.lv-bars { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 10px; }
.lv-bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; font-size: 11px; color: var(--muted); }
.lv-bar-col { width: 100%; max-width: 34px; display: flex; flex-direction: column-reverse; border-radius: 4px 4px 0 0; overflow: hidden; min-height: 0; }
.lv-bar-col i { display: block; background: var(--c); min-height: 2px; } .lv-bar b { font-size: 11px; color: var(--ink); margin-top: 3px; min-height: 14px; }
.bal .stat { border-left: 4px solid var(--c, var(--accent)); }
.bar { height: 6px; background: #EFEAE4; border-radius: 4px; overflow: hidden; margin-top: 8px; } .bar i { display: block; height: 100%; background: var(--c, var(--accent)); }
.fbal { border-radius: 12px; padding: 10px 14px; background: color-mix(in srgb, var(--c, #E8590C) 9%, var(--surface)); border: 1px solid var(--line); border-left: 4px solid var(--c, #E8590C); margin: -4px 0 14px; font-size: 14px; }
.fbal b { font-size: 18px; }

/* ---------- dialogs and toast ---------- */
.overlay { position: fixed; inset: 0; background: rgba(29, 27, 25, .45); display: grid; place-items: center; padding: 16px; z-index: 50; overflow-y: auto; }
.dialog { background: var(--surface); border-radius: 18px; width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.dialog.wide { width: min(820px, 100%); }
.dlg-h { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 18px 20px 6px; }
.dlg-h h2 { margin: 0; font-size: 19px; } .dlg-h p { margin: 4px 0 0; color: var(--muted); font-size: 14px; }
.dlg-body { padding: 10px 20px; }
.dlg-foot { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding: 12px 20px 18px; border-top: 1px solid var(--line-2); margin-top: 6px; }
.dialog.ar-preview-dialog { display: flex; flex-direction: column; width: min(1000px, 100%); height: min(850px, calc(100vh - 32px)); overflow: hidden; }
.ar-preview-body { display: flex; flex: 1; flex-direction: column; min-height: 0; overflow: auto; }
.ar-preview-meta { flex: none; margin: 0 0 10px; color: var(--muted); font-size: 13px; overflow-wrap: anywhere; }
.ar-preview-frame { flex: 1; width: 100%; min-height: 360px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); }
.ar-preview-image-wrap { display: grid; flex: 1; min-height: 0; place-items: center; overflow: auto; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; }
.ar-preview-image { display: block; max-width: 100%; max-height: 68vh; object-fit: contain; }
.ar-preview-text { flex: 1; max-height: 68vh; overflow: auto; margin: 0; padding: 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; font: 14px/1.55 ui-monospace, SFMono-Regular, Menlo, monospace; }
.ar-preview-text.rich { font: inherit; }
.ar-preview-unsupported { display: grid; justify-items: start; gap: 14px; padding: 20px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); }
.ar-preview-unsupported p { margin: 0; }
@media (max-width: 600px) {
  .overlay:has(.ar-preview-dialog) { padding: 8px; }
  .dialog.ar-preview-dialog { height: calc(100vh - 16px); max-height: calc(100vh - 16px); border-radius: 14px; }
  .ar-preview-frame { min-height: 0; }
  .ar-preview-image { max-height: 60vh; }
}
.cards.in-dialog { padding: 10px 20px 4px; }
.toast { visibility: hidden; opacity: 0; position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 140%); background: #1D1B19; color: #fff; padding: 12px 18px; border-radius: 12px; font-weight: 600; font-size: 14px; z-index: 60; transition: transform .25s, opacity .25s; max-width: calc(100% - 32px); }
.toast.show { visibility: visible; opacity: 1; transform: translate(-50%, 0); } .toast.bad { background: var(--bad); }
@media (max-width: 860px) { .toast { bottom: 86px; } }

/* ---------- sign in ---------- */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background: var(--side); }
.signin-card { background: var(--surface); border-radius: 20px; padding: 26px; width: min(560px, 100%); box-shadow: 0 20px 60px rgba(0,0,0,.3); }
.signin-card h1 { margin: 16px 0 4px; font-size: 26px; }
/* The name: Church & Trellis, its "&" always in the brand orange */
.amp { color: var(--accent); }
.brand.big { padding: 0; color: var(--ink); } .brand.big small { color: var(--muted); }
.role-h { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 18px 0 8px; }
.pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.pick button { display: flex; align-items: center; gap: 10px; text-align: left; padding: 10px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; min-height: 56px; }
.pick button:hover { border-color: var(--accent); }
.pick b { display: block; font-size: 14px; } .pick small { color: var(--muted); font-size: 12px; }
.fine { font-size: 12.5px; color: var(--muted); margin: 20px 0 0; }
table.simple { width: 100%; border-collapse: collapse; font-size: 14px; }
table.simple th, table.simple td { text-align: left; padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
table.simple th { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.table-wrap { overflow-x: auto; }
.field .check input, .check input[type=checkbox], .check input[type=radio] { width: 20px; height: 20px; min-height: 0; padding: 0; margin-top: 2px; }
.aw-days { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 2px 10px; max-height: 240px; overflow: auto; }
.aw-day { margin: 0; padding: 6px 0; }
.daybox { display: inline-flex; flex-wrap: wrap; gap: 3px; margin: 4px 0; }
.daybox label { position: relative; cursor: pointer; }
.daybox input { position: absolute; opacity: 0; inset: 0; }
.daybox span { display: inline-grid; place-items: center; width: 34px; height: 30px; border: 1px solid var(--line-strong); border-radius: 8px; font-size: 13px; font-weight: 600; color: var(--ink); }
.daybox input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-on, #fff); }
.daybox input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.ls-term { padding: 10px 0; border-bottom: 1px solid #EEE7E0; }
.ls-term-dates { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; gap: 8px; align-items: end; }
.ls-term-dates input { min-width: 0; width: 100%; }
#ls-levels .daybox { flex-wrap: nowrap; }
#ls-levels td { vertical-align: middle; }
/* Church at a glance (People, Administrators) */
.glance-wrap { margin: 0 0 6px; }
.glance-wrap > summary { cursor: pointer; padding: 10px 0; list-style-position: inside; }
.glance-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 12px; margin-bottom: 8px; }
.glance h3 { margin: 0 0 10px; font-size: 15px; }
.sbars { display: grid; gap: 6px; }
.sbar { display: grid; grid-template-columns: minmax(90px, 38%) 1fr auto; align-items: center; gap: 10px; font-size: 13.5px; min-height: 24px; }
.sbar-l { color: var(--ink); }
.sbar-t { height: 12px; background: var(--line-2); border-radius: 0 4px 4px 0; overflow: hidden; }
.sbar-t i { display: block; height: 100%; background: var(--accent); border-radius: 0 4px 4px 0; }
.sbar-v { font-weight: 600; font-variant-numeric: tabular-nums; min-width: 64px; text-align: right; }
.sbar-v small { color: var(--muted); font-weight: 400; }
@media (max-width: 480px) { .glance-grid { grid-template-columns: 1fr; } }
.glance-grid > .glance { margin: 0; }
.simple th.lt { white-space: normal; min-width: 72px; max-width: 120px; font-size: 12.5px; line-height: 1.25; vertical-align: bottom; text-align: center; }
.simple td.lt { text-align: center; }
.simple thead th { vertical-align: bottom; }
.grid2 > .panel + .panel { margin-top: 0; }   /* the grid gap spaces them */
/* A person's page (js/people/profile.js): up to three columns, each stacking its own blocks, so short blocks sit under each
   other instead of leaving gaps beside a long one. Two columns on smaller screens (the third, Consent, across the bottom). */
.person-cols { display: grid; gap: 16px; align-items: start; grid-template-columns: minmax(0, 1fr); }
.pcol { min-width: 0; }
.pcol > * + * { margin-top: 16px; }
@media (min-width: 640px) { .person-cols.cols-2, .person-cols.cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .person-cols.cols-3 > .pcol.c { grid-column: 1 / -1; } }
@media (min-width: 1250px) { .person-cols.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .person-cols.cols-3 > .pcol.c { grid-column: auto; } }
[hidden] { display: none !important; }   /* "hidden" always wins over a layout class (.two, .row…) */

/* Advanced search (People) */
.adv-rows { margin-top: 10px; }
.adv-row { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) auto; gap: 10px; align-items: center; padding: 6px 0; }
.adv-row:has(.adv-n) { grid-template-columns: 28px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.4fr) auto; }
.adv-row select, .adv-row input { width: 100%; min-width: 0; min-height: 44px; padding: 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.adv-row select:disabled { opacity: .5; }
.adv-n { font-weight: 600; color: var(--muted); }
.adv-two { display: flex; gap: 8px; align-items: center; min-width: 0; }
.adv-two > * { flex: 1 1 0; }
.adv-two > span.muted { flex: 0 0 auto; }
.adv-none { padding: 0 4px; }
.adv-row { border-radius: 12px; transition: opacity .18s ease, transform .18s ease; }
/* Remove: a quiet ×, coloured only when you reach for it. Add: one soft dashed invitation under the last filter. */
.adv-x { width: 36px; height: 36px; border-radius: 999px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; transition: background .15s, color .15s, transform .15s; }
.adv-x:hover, .adv-x:focus-visible { background: var(--bad-soft); color: var(--bad); }
.adv-x:active { transform: scale(.88); }
.adv-add { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; min-height: 48px; margin-top: 12px; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); background: transparent; color: var(--accent-ink); font: inherit; font-weight: 600; cursor: pointer; transition: background .15s, border-color .15s, color .15s; }
.adv-add:hover, .adv-add:focus-visible { border-style: solid; border-color: var(--accent); background: var(--accent-soft); }
.adv-add:active { transform: scale(.99); }
.adv-new { animation: adv-in .28s ease both; }
.adv-gone { opacity: 0; transform: translateX(16px) scale(.98); }
@keyframes adv-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .adv-new { animation: none; } .adv-row, .adv-add, .adv-x { transition: none; } }
.adv-join { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 12.5px; font-weight: 700; letter-spacing: .04em; }
.adv-join::before, .adv-join::after { content: ''; flex: 1; border-top: 1px solid var(--line-2); }
.adv-cols { display: flex; flex-wrap: wrap; gap: 8px; }
.adv-col { display: inline-flex; align-items: center; gap: 2px; padding: 2px 4px 2px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface-2); font-size: 14px; }
.adv-col.fixed { padding: 10px 14px; color: var(--muted); }
.adv-col .icon-btn { width: 32px; height: 32px; border-radius: 999px; font-size: 18px; }
.adv-col .icon-btn:disabled { opacity: .3; cursor: default; }
/* A column you can drag: a grip on the left, lifted with a shadow while it moves, a soft space where it will land */
.adv-col[data-k] { padding-left: 8px; cursor: grab; touch-action: none; user-select: none; -webkit-user-select: none; transition: box-shadow .15s, background .15s; }
.adv-col[data-k]:hover { border-color: var(--line-strong); }
.adv-col[data-k]:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.adv-grip { display: grid; place-items: center; width: 14px; margin-right: 6px; color: var(--muted); opacity: .6; }
.adv-col.adv-lift { position: fixed; z-index: 90; margin: 0; cursor: grabbing; background: var(--surface); border-color: var(--accent); box-shadow: 0 10px 28px rgba(0,0,0,.18); pointer-events: none; }
.adv-col.adv-hole { padding: 0; border: 1.5px dashed var(--line-strong); background: var(--accent-soft); opacity: .6; }
.th-sort { background: none; border: 0; padding: 0; font: inherit; color: inherit; cursor: pointer; text-align: left; }
.th-sort:hover { color: var(--ink); text-decoration: underline; }
.adv-table td { white-space: nowrap; }
@media (max-width: 760px) {
  /* Each filter becomes a soft card: the field with its × beside it, then how to compare, then the value. */
  .adv-row, .adv-row:has(.adv-n) { grid-template-columns: minmax(0, 1fr) 32px; gap: 8px; padding: 12px; background: var(--surface-2); border: 1px solid var(--line-2); }
  .adv-row > :not(.adv-x):not(.adv-fpick) { grid-column: 1 / -1; }
  .adv-row .adv-fpick { grid-column: 1; width: 100%; }
  .adv-row .adv-x { grid-column: 2; grid-row: 1; width: 32px; height: 32px; }
  .adv-row:has(.adv-n) .adv-x { grid-row: 2; }
  .adv-join { margin: 6px 0; }
}
.pp-searchrow { align-items: flex-start; }
.pp-searchcol { flex: 1; min-width: 220px; display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.pp-searchcol .search { width: 100%; }
.pp-sortrow { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.pp-sortrow #pp-count { margin: 0; }
.pp-sort { gap: 8px; align-items: center; flex-wrap: wrap; }
.seg.small button { padding: 4px 10px; min-height: 32px; font-size: 13px; }
.adv-link { font-size: 13.5px; color: var(--accent-ink); text-decoration: underline; text-underline-offset: 2px; padding: 4px 2px; }
.adv-link:hover { text-decoration-thickness: 2px; }

/* Language picker (sidebar, menu, sign-in) */
.lang-pick { display: inline-flex; align-items: center; gap: 6px; position: relative; }
.lang-pick svg { position: absolute; left: 10px; pointer-events: none; opacity: .75; }
.lang-sel, .mode-sel { appearance: none; -webkit-appearance: none; font: inherit; font-size: 13.5px; min-height: 36px; padding: 6px 28px 6px 32px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%236B625A' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 10px center; color: var(--ink); cursor: pointer; }
.side-lang { padding: 10px 6px 0; }
.side-lang .lang-pick { width: 100%; }
.side-lang .lang-sel, .side-lang .mode-sel { width: 100%; background-color: transparent; color: var(--side-ink); border-color: #3A322C; }
.side-lang .lang-sel option, .side-lang .mode-sel option { color: #222; }
.side-mode { margin-top: 6px; } .side-mode .mode-sel { min-height: 32px; font-size: 12.5px; color: var(--side-muted); border-color: transparent; }
.side-mode .mode-sel:hover, .side-mode .mode-sel:focus-visible { border-color: var(--side-2); color: var(--side-ink); }
.mode-pick { width: 100%; }
.signin-lang { display: flex; justify-content: flex-end; margin: -6px 0 6px; }

.signin-card { position: relative; }
.signin-lang { position: absolute; top: 22px; right: 22px; margin: 0; }
/* On a phone the card is too narrow for the language box to sit beside the church's name, so it covers it: put it on its own line under the name */
@media (max-width: 640px) { .signin-lang { position: static; display: flex; justify-content: flex-end; margin: 14px 0 0; } }
.kv-sub { display: block; font-size: 12.5px; color: var(--muted); margin-top: 1px; }

/* Boxes that must be filled in: shaded (key at the top of the form) */
:root { --req-bg: #FFF3E6; --req-line: #E9BF94; }
.field.req input:not([type=checkbox]):not([type=radio]):not([type=file]), .field.req select, .field.req textarea { background-color: var(--req-bg); border-color: var(--req-line); }
.field.req select { background-color: var(--req-bg); }
.req-key { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); margin: 0 0 12px; }
.req-swatch { width: 22px; height: 14px; border-radius: 4px; background: var(--req-bg); border: 1px solid var(--req-line); flex: 0 0 auto; }
.live-n { color: var(--ink) !important; font-weight: 500; }
.field input::placeholder, .field textarea::placeholder { color: #A39A92; opacity: 1; }

/* ---------- Me (members' details, days away, serving) ---------- */
.me-who { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.me-who h1 { margin: 0; } .me-who .lead { margin: 4px 0 0; }
.me-tabs { margin: 0 0 18px; }
.me-tabs a, .me-tabs button { white-space: nowrap; }
.me-cal { width: 44px; flex: 0 0 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent-ink); text-align: center; font-size: 11px; font-weight: 600; text-transform: uppercase; line-height: 1.1; padding: 5px 0; }
.me-cal b { display: block; font-size: 18px; color: var(--ink); }
.me-offer { display: block; margin-top: 4px; }
.me-offer .tag { margin-left: 2px; }
.steps { margin: 4px 0 16px; padding-left: 22px; } .steps li { margin: 4px 0; }
@media (max-width: 700px) { .me-tabs { display: flex; } .me-tabs a { flex: 1; justify-content: center; } }
.offer-item { flex-wrap: wrap; } .offer-item .grow { flex: 1 1 60%; min-width: 0; }
@media (max-width: 700px) { .offer-item .btns { width: 100%; justify-content: flex-end; } }
/* Settings → Who can see what: the number opens the list of names */
.who-has summary { cursor: pointer; color: var(--accent-ink); text-decoration: underline dotted; text-underline-offset: 3px; list-style: none; }
.who-has summary::-webkit-details-marker { display: none; }
.see-opts { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; margin-top: 8px; }
.me-chips { margin: 6px 0 2px; gap: 6px; flex-wrap: wrap; }
.see-opts label.see-care { white-space: normal; }
.see-opts .see-col { display: flex; flex-direction: column; gap: 4px; flex: 1 1 260px; min-width: 0; }
.see-opts:has(.see-col) { align-items: flex-start; } .see-opts:has(.see-col) > .muted { padding-top: 2px; }
.see-opts label { display: inline-flex; align-items: center; gap: 6px; font-size: 13.5px; white-space: nowrap; cursor: pointer; }
.who-list { display: flex; flex-direction: column; gap: 4px; margin-top: 6px; font-size: 13.5px; white-space: nowrap; }
.av.pic { background-size: cover; background-position: center; color: transparent; }
/* A small number on a button, e.g. Late spouses 3 */
.btn .count { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 6px; border-radius: 10px; background: var(--accent, #E8590C); color: #fff; font-size: 12px; font-weight: 700; }
/* Labels for groups of tick boxes (e.g. Volunteering) */
.field-l { display: block; font-weight: 600; font-size: 14px; margin: 0 0 6px; padding: 0; }
fieldset { border: 0; padding: 0; margin: 0 0 12px; min-width: 0; }
.vol-dept { border: 1px solid var(--line, #E7E1DA) !important; }
/* Advanced search: tick boxes for changing many people at once */
.adv-table th.sel, .adv-table td.sel { width: 36px; text-align: center; padding-left: 6px; padding-right: 6px; }
.adv-table td.sel input, .adv-table th.sel input { width: 18px; height: 18px; cursor: pointer; }
/* Long jobs: a turning cross over the page */
.busy { position: fixed; inset: 0; z-index: 1000; display: grid; place-items: center; background: rgba(28, 24, 20, .45); }
.busy[hidden] { display: none; }
.busy-box { background: var(--surface); color: var(--ink, #1C1814); border-radius: 18px; padding: 24px 28px; text-align: center; max-width: 320px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.busy-box p { margin: 10px 0 0; font-weight: 600; }
.busy-box p.small { margin-top: 4px; font-weight: 400; color: var(--muted, #6B625A); }
.busy-cross { width: 26px; height: 26px; fill: var(--accent, #E8590C); animation: busy-turn 1.4s linear infinite; will-change: transform; }
@keyframes busy-turn { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .busy-cross { animation: busy-pulse 1.6s ease-in-out infinite; } @keyframes busy-pulse { 50% { opacity: .35; } } }
body.is-busy { cursor: progress; }
.note .busy-cross { width: 18px; height: 18px; vertical-align: -3px; margin-right: 6px; }
/* Choosing the face in a photo */
.crop { position: relative; width: 100%; max-width: 360px; margin: 0 auto; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: #F2EEE9; }
.crop canvas { width: 100%; height: 100%; display: block; cursor: grab; touch-action: none; }
.crop canvas:active { cursor: grabbing; }
.crop canvas:focus-visible { outline: 3px solid var(--accent, #E8590C); outline-offset: -3px; }
.crop-ring { position: absolute; inset: 0; pointer-events: none; border-radius: 12px; box-shadow: inset 0 0 0 9999px rgba(0,0,0,.35); -webkit-mask: radial-gradient(circle at center, transparent 49.5%, #000 50%); mask: radial-gradient(circle at center, transparent 49.5%, #000 50%); }
.crop-zoom { display: flex; align-items: center; gap: 10px; max-width: 360px; margin: 12px auto 0; }
.crop-zoom input { flex: 1; }
.crop-zoom .icon-btn { font-size: 20px; font-weight: 700; min-width: 40px; }
/* Advanced search: type part of a field's name above its list */
/* The field list in Advanced search: a button that opens a list with a box to type in (as in Elvanto) */
.adv-fpick { position: relative; min-width: 0; }
.adv-fbtn { width: 100%; min-height: 44px; padding: 8px 32px 8px 10px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; text-align: left; cursor: pointer; position: relative; }
.adv-fbtn span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.adv-fbtn::after { content: ""; position: absolute; right: 12px; top: 50%; margin-top: -3px; border: 5px solid transparent; border-top-color: currentColor; border-bottom: 0; }
.adv-fbtn[aria-expanded="true"] { border-color: var(--accent, #2f6f5e); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent, #2f6f5e) 20%, transparent); }
.adv-fpop { position: absolute; z-index: 30; left: 0; top: calc(100% + 4px); width: max(100%, 300px); max-width: calc(100vw - 32px); background: var(--surface); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 30px rgba(0,0,0,.18); padding: 6px; display: flex; flex-direction: column; }
.adv-fpop[hidden] { display: none; }
.adv-row .adv-fpop .adv-ff { min-height: 40px; margin-bottom: 6px; }
.adv-flist { max-height: 320px; overflow-y: auto; display: flex; flex-direction: column; }
.adv-fg { display: flex; flex-direction: column; }
.adv-fg[hidden], .adv-fo[hidden], .adv-fnone[hidden] { display: none; }
.adv-fgh { padding: 8px 10px 4px; font-size: 13px; font-weight: 700; color: var(--muted, #6b625a); background: var(--line-2, #f0ede8); border-radius: 6px; margin-top: 4px; }
.adv-fo { display: block; width: 100%; text-align: left; padding: 8px 12px 8px 20px; border: 0; background: none; color: var(--ink); font: inherit; border-radius: 6px; cursor: pointer; min-height: 36px; }
.adv-fo:hover, .adv-fo.act { background: color-mix(in srgb, var(--ink) 10%, transparent); }
.adv-fo.on { font-weight: 700; }
.adv-fnone { padding: 10px 12px; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0 !important; }
.adv-fcount { font-size: 12px; padding-left: 2px; }
/* Prompts on Home and My details (photo of yourself, iPhone home screen) */
.panel.prompt { margin-bottom: 16px; border-left: 4px solid var(--accent, #E8590C); }
.panel.prompt h2 { font-size: 1.05rem; }

/* "View as": an Administrator seeing Church & Trellis as another role */
.viewas { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 16px; background: #FFF4D6; color: #5C4300; border-bottom: 1px solid #F0D98A; font-size: 14px; }
.viewas span { flex: 1 1 220px; }
.viewas .btn { margin-left: auto; }
/* No internet: view only (js/app.js shell) */
.offline-bar { display: flex; align-items: center; gap: 10px; padding: 10px 16px; background: #E8EEF6; color: #1F3A5C; border-bottom: 1px solid #C3D2E6; font-size: 14px; }
.viewas-pick { display: grid; gap: 8px; }
/* Care groups: finding a group or a person (js/mod-care.js) */
.cg-search { max-width: 520px; margin: 0 0 14px; } .cg-search .empty { margin-top: 10px; }
.cg-hit { background: #FFF1C2; border-radius: 8px; box-shadow: 0 0 0 2px #F5D46B inset; }
.viewas-pick .btn { justify-content: flex-start; width: 100%; }
/* Small fold-out sections inside a panel */
details.sub { margin: 12px 0 4px; border: 1px solid var(--line-2); border-radius: 10px; padding: 8px 12px; }
details.sub > summary { cursor: pointer; font-weight: 600; color: var(--accent-ink); }
details.sub[open] > summary { margin-bottom: 8px; }
/* Care group cards: carers and members folded, so many groups fit on one page */
details.cg-fold { margin: 8px 0 0; padding: 6px 12px; }
details.cg-fold > summary { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
details.cg-fold[open] > summary { white-space: normal; }
.cg-names { font-weight: 400; }

/* Care groups: type part of a name to find someone to add */
.cg-q { width: 100%; min-height: 40px; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; }
.cg-hits { margin-top: 6px; }
.cg-hits .cg-pick { width: 100%; text-align: left; background: var(--surface); border: 1px solid var(--line-2); border-radius: 10px; cursor: pointer; font: inherit; color: var(--ink); margin-top: 4px; }
.cg-hits .cg-pick:hover, .cg-hits .cg-pick:focus-visible { border-color: var(--accent); }
/* Every dropdown: one box – tap for the whole list, type to narrow it (findables() in app.js) */
.find-box { position: relative; }
.find-box.find-inline { display: inline-block; vertical-align: middle; max-width: 100%; }
.find-box.find-inline .find-list { min-width: 220px; right: auto; }
.find-box .find-in { display: block; width: 100%; min-height: 44px; padding: 10px 38px 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 400; font-size: 15px; margin: 0; text-overflow: ellipsis; cursor: pointer; }
.find-box .find-in:focus { cursor: text; outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.find-box .find-in:disabled { opacity: .55; cursor: default; }
.find-arrow { position: absolute; right: 6px; top: 50%; width: 28px; height: 28px; margin-top: -14px; cursor: pointer; }
.find-arrow::after { content: ''; position: absolute; left: 10px; top: 9px; width: 7px; height: 7px; border: solid var(--muted); border-width: 0 2px 2px 0; transform: rotate(45deg); transition: transform .18s ease, top .18s ease; }
.find-box.open .find-arrow::after { transform: rotate(-135deg); top: 12px; }
.find-in:disabled + .find-arrow { pointer-events: none; opacity: .4; }
.find-list { position: absolute; z-index: 40; left: 0; right: 0; top: calc(100% + 4px); max-height: min(300px, 50vh); overflow-y: auto; margin: 0; padding: 4px; list-style: none;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.16); animation: find-pop .14s ease-out; }
@keyframes find-pop { from { opacity: 0; transform: translateY(-4px); } }
.find-list li { padding: 9px 10px; font-size: 15px; border-radius: 8px; cursor: pointer; font-weight: 400; overflow-wrap: anywhere; }
.find-list li.keep { color: var(--muted); }
.find-list li.chosen { font-weight: 600; }
.find-list li.chosen::after { content: ' ✓'; color: var(--accent); }
.find-list li.on { background: var(--accent-soft); }
.find-list li.off { opacity: .45; cursor: default; }
.find-list li.none { cursor: default; color: var(--muted); font-style: italic; }
.find-sel { position: absolute !important; left: 0; bottom: 0; width: 1px !important; height: 1px !important; min-height: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0; pointer-events: none; }
label.field:has(.find-sel), :has(> .find-sel) { position: relative; }
.field.req .find-box .find-in, .find-box.is-req .find-in { background-color: var(--req-bg); border-color: var(--req-line); }
.field.is-off .find-box .find-in { cursor: not-allowed; }
.lang-pick .find-box .find-in, .mode-pick .find-box .find-in { min-height: 36px; padding: 6px 30px 6px 32px; font-size: 13.5px; border-color: var(--line); }
.lang-pick svg { z-index: 1; }
.lang-pick .find-list, .mode-pick .find-list { right: 0; left: auto; }
.side-lang .find-box, .side-mode .find-box { display: block; }
.side-lang .find-box .find-in, .side-mode .find-box .find-in { min-height: 36px; padding: 6px 30px 6px 32px; font-size: 13.5px; background: transparent; color: var(--side-ink); border-color: #3A322C; }
.side-mode .find-box .find-in { min-height: 32px; font-size: 12.5px; color: var(--side-muted); border-color: transparent; }
.side-lang .find-arrow::after, .side-mode .find-arrow::after { border-color: var(--side-muted); }
.side-lang .find-list, .side-mode .find-list { top: auto; bottom: calc(100% + 4px); left: 0; right: 0; color: var(--ink); }

/* Care groups: the name may wrap; Rename, Duplicate and Delete sit close together */
.cg-head { align-items: flex-start; gap: 8px; }
.cg-head > .grow { min-width: 0; overflow-wrap: anywhere; }
.cg-head > .grow .small { display: block; margin-top: 2px; }
.cg-tools { display: flex; gap: 0; flex: 0 0 auto; margin: -4px -6px 0 0; }
.cg-tools .icon-btn { width: 32px; height: 32px; border-radius: 8px; }
/* Care groups: the carer star beside each member – faint until hovered, filled for a carer */
.cg-lead { width: 32px; height: 32px; border-radius: 8px; color: var(--muted); opacity: .4; transition: opacity .15s, color .15s; }
.item:hover .cg-lead, .cg-lead:focus-visible { opacity: 1; }
.cg-lead:hover { color: var(--ok); }
.cg-lead.on { color: var(--ok); opacity: 1; }
.cg-lead.on svg path { fill: currentColor; }

/* Translations: "Help improve the … wording on this page", at the foot of each page in another language */
main { flex: 1 0 auto; display: flex; flex-direction: column; }   /* so the line below can sit at the very bottom */
.page-body { flex: 1 0 auto; }
.improve { margin: 40px -16px -80px 0; font-size: 11.5px; text-align: right; }   /* a footnote: bottom right, into main's bottom padding */
.improve a { display: inline-flex; align-items: center; gap: 4px; color: #9A918A; text-decoration: none; }
.improve a:hover, .improve a:focus-visible { color: var(--muted); text-decoration: underline; }
.improve svg { width: 12px; height: 12px; opacity: .7; }
@media (max-width: 860px) { .improve { margin: 32px 0 0; } }   /* phones: stay above the bottom menu */
.panel.inset { background: var(--bg, #faf8f5); box-shadow: none; border: 1px solid var(--line, #e7e1d9); }
/* Duplicate check while typing: who else already has this email or mobile */
.dup-hint { display: block; margin-top: 6px; padding: 6px 10px; border-radius: 8px; background: var(--warn-soft); color: var(--warn) !important; font-size: 13px; }
.dup-hint a { color: inherit; font-weight: 600; }
/* Messages: a count on a menu entry or phone tab (e.g. unread messages), and the message list */
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent-ink); color: #fff; font-size: 11.5px; font-weight: 700; line-height: 1; }
.tab-ic { position: relative; display: inline-flex; }
.tab-ic .badge { position: absolute; top: -6px; right: -12px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 10.5px; box-shadow: 0 0 0 2px var(--surface); }
.msg { display: block; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.msg:last-child { border-bottom: 0; }
.msg-top { display: flex; gap: 10px; align-items: baseline; flex-wrap: wrap; }
.msg-top b { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.msg.new { box-shadow: inset 3px 0 0 var(--accent); }
.msg.new .msg-top b::before { content: ''; display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); margin-right: 8px; vertical-align: middle; }
.msg-body { margin: 6px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.msg-turns { margin-top: 8px; }
.msg-turns .item { flex-wrap: wrap; gap: 6px; }
.msg-turns .item .grow { flex: 1 1 180px; }   /* on a phone the date gets a full line; the buttons go underneath, not beside a narrow column */
.msg-foot { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.msg-foot .grow { font-size: 13px; }
.msg-re { margin: 6px 0 0; padding-left: 8px; border-left: 3px solid var(--line); }
.msg-quote { margin: 0 0 14px; padding: 8px 12px; border-left: 3px solid var(--a, #E8590C); background: var(--surface-2); border-radius: 6px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 180px; overflow: auto; }
.pp-name { min-height: 44px; }
.me-req { margin: 8px 0 12px; }
.msg-read > summary { cursor: pointer; } .msg-read .tag { margin: 2px 2px 0 0; display: inline-block; }
#ms-body { min-height: 140px; }
/* Messages: ticking who gets a message */
.ms-pick-box { padding: 12px 14px; margin: 0 0 14px; }
.ms-find { width: 100%; min-height: 44px; padding: 10px 12px; border: 1px solid var(--line-strong); border-radius: 10px; background: var(--surface); color: var(--ink); font: inherit; font-size: 15px; }
.ms-find::placeholder { color: #A39A92; opacity: 1; }
.ms-list { max-height: 320px; overflow: auto; display: grid; gap: 2px; }
.ms-list .check { margin: 0; padding: 6px 2px; }
.ms-list .check[hidden] { display: none; }
.who-pick { display: grid; gap: 10px; margin: 0 0 16px; }

/* ---------- services: each with its own look (Rosters → Services, Me → Serving) ---------- */
.svc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; }
.svc-card { display: flex; flex-direction: column; gap: 8px; text-align: left; text-decoration: none; color: var(--ink); cursor: pointer;
  background: var(--surface); border: 1px solid var(--line); border-top: 4px solid var(--svc-line); border-radius: var(--radius); padding: 12px 14px; box-shadow: var(--shadow); font: inherit; }
.svc-card:hover { border-color: var(--svc-line); }
/* A service's colours where its date is shown: the roster's column heads, My serving, Settings → Church Services */
.matrix th.svc-col { background: var(--svc-soft); box-shadow: inset 0 4px 0 var(--svc-line); }
.matrix th.svc-col .muted { color: var(--svc-ink); }
.item.svc-tint { box-shadow: inset 4px 0 0 var(--svc-line); }
.item.svc-tint small { color: var(--svc-ink); }
/* How many a position needs: a small − + beside "2 per service" (Rosters → Teams) */
.need-step { display: inline-flex; gap: 4px; margin-right: 8px; vertical-align: middle; }
.need-step button { width: 26px; height: 26px; border-radius: 999px; border: 1px solid var(--line-strong); background: var(--surface); color: var(--ink); font: inherit; font-weight: 700; line-height: 1; cursor: pointer; }
.need-step button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-ink); }
.need-step button:disabled { opacity: .35; cursor: default; }
.svc-card.on { background: var(--svc-soft); border: 2px solid var(--svc-line); border-top-width: 4px; }
.svc-top { display: flex; align-items: center; gap: 10px; }
.svc-top b { display: block; font-size: 16px; color: var(--svc-ink); } .svc-top small { display: block; color: var(--muted); font-size: 12.5px; }
.svc-ico { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--svc-soft); color: var(--svc-ink); flex: 0 0 auto; }
.svc-ico.big { width: 56px; height: 56px; }
.svc-card.on .svc-ico { background: var(--surface); }
.svc-foot { color: var(--svc-ink); font-weight: 600; font-size: 12.5px; }
.moods { display: flex; flex-wrap: wrap; gap: 4px; }
.mood { font-size: 11.5px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--svc-soft); color: var(--svc-ink); }
.svc-card.on .mood { background: var(--surface); }
.svc-hero { display: flex; align-items: center; gap: 14px; background: var(--svc-soft); border-left: 6px solid var(--svc-line); border-radius: 0; padding: 14px 18px; margin-bottom: 16px; }
.svc-hero h1 { margin: 0; color: var(--svc-ink); }
.svc-page .panel > h2 { color: var(--svc-ink); }
.theme-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.theme-pick { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); font-weight: 600; cursor: pointer; color: var(--svc-ink); min-height: 48px; }
.theme-pick.on { background: var(--svc-soft); border: 2px solid var(--svc-line); }
.theme-pick[disabled], .pchip[disabled] { cursor: default; opacity: .8; }
.pchips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.pchip { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; min-height: 38px; border-radius: 999px; border: 1px dashed var(--line); background: var(--surface); color: var(--muted); font-weight: 600; font-size: 13.5px; cursor: pointer; }
.pchip:hover { border-color: var(--svc-line, var(--accent)); color: var(--ink); }
.pchip.on { border: 1px solid var(--svc-line, var(--accent)); background: var(--svc-soft, var(--accent-soft)); color: var(--svc-ink, var(--accent-ink)); }
.pchip .tag { padding: 1px 6px; font-size: 11px; }
.dept-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 12px; }
.dept { border-top: 3px solid var(--svc-line); background: var(--surface-2); border-radius: 0; padding: 10px 12px 12px; }
.dept.off { border-top-color: var(--line); }
.dept .link.small { font-size: 13px; }
.svc-page .hint + .dept-grid { margin-top: 12px; }
@media (max-width: 560px) {
  .svc-grid { grid-template-columns: 1fr 1fr; gap: 8px; }
  .svc-card { padding: 10px; }
  .svc-card .moods { display: none; }
  .svc-card .svc-ico { width: 32px; height: 32px; }
}
.svc-kind { font-size: 14px; margin: 14px 0 8px; color: var(--muted); font-weight: 700; }

/* Settings → Colours (js/mod-settings.js renderTheme), like Leave Manager's "My colour": a live sample, round swatches, any colour */
.th-prev { display: flex; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); margin: 4px 0 16px; max-width: 560px; }
.th-pside { width: 64px; background: var(--s); display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 12px 0; }
.th-pmark { width: 34px; height: 34px; border-radius: 10px; background: var(--a); color: var(--ao, #fff); display: grid; place-items: center; margin-bottom: 4px; }
.th-pnav { width: 36px; height: 7px; border-radius: 4px; background: var(--s2); } .th-pnav.on { box-shadow: inset 3px 0 0 var(--a); background: color-mix(in srgb, var(--s2) 70%, #fff 10%); }
.th-pmain { flex: 1; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding: 16px 18px; background: var(--surface-2); }
.th-pbtn { display: inline-flex; align-items: center; gap: 6px; background: var(--a); color: var(--ao, #fff); font-weight: 700; font-size: 14px; padding: 9px 16px; border-radius: 10px; }
.th-psave { background: var(--as); color: var(--ai); border: 1px solid color-mix(in srgb, var(--a) 35%, var(--surface)); font-weight: 700; font-size: 14px; padding: 8px 15px; border-radius: 10px; }
.th-plink { color: var(--ai); font-weight: 600; text-decoration: underline; font-size: 14px; }
.th-pcross svg { width: 30px; height: 30px; fill: var(--a); display: block; animation: busy-turn 1.4s linear infinite; }
@media (prefers-reduced-motion: reduce) { .th-pcross svg { animation: none; } }
.th-sws { display: flex; flex-wrap: wrap; gap: 10px; max-width: 560px; }
.th-sw { width: 34px; height: 34px; border-radius: 50%; background: var(--c); border: 0; padding: 0; cursor: pointer; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--line); transition: transform .12s, box-shadow .12s; }
.th-sw:hover { transform: scale(1.08); }
.th-sw.on { box-shadow: 0 0 0 3px var(--surface), 0 0 0 5px var(--c); }
.th-sw:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.th-any { margin: 20px 0 6px; font-size: 14px; font-weight: 600; } .th-any > label { display: block; margin-bottom: 10px; }
/* "Or pick any colour": our own picker – a colour area (the shade's colours from soft to strong, light to dark), a rainbow bar, the code */
.th-pick { --h: 20; max-width: 360px; display: grid; gap: 14px; padding: 14px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); box-shadow: 0 1px 2px rgba(0,0,0,.04); }
.th-sv { position: relative; height: 170px; border-radius: 12px; cursor: crosshair; touch-action: none; user-select: none;
  background: linear-gradient(to top, #000, transparent), linear-gradient(to right, #fff, hsl(var(--h), 100%, 50%)); }
.th-sv:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; }
.th-svk { position: absolute; width: 24px; height: 24px; margin: -12px 0 0 -12px; border-radius: 50%; border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 2px 6px rgba(0,0,0,.3); pointer-events: none; }
.th-hue { -webkit-appearance: none; appearance: none; width: 100%; height: 16px; margin: 0; border-radius: 999px; cursor: pointer; outline-offset: 4px;
  background: linear-gradient(to right, #f00 0%, #ff0 16.6%, #0f0 33.3%, #0ff 50%, #00f 66.6%, #f0f 83.3%, #f00 100%); }
.th-hue::-webkit-slider-thumb { -webkit-appearance: none; width: 24px; height: 24px; border-radius: 50%; background: hsl(var(--h), 100%, 50%); border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 2px 6px rgba(0,0,0,.3); }
.th-hue::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: hsl(var(--h), 100%, 50%); border: 3px solid #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25), 0 2px 6px rgba(0,0,0,.3); }
.th-hue::-moz-range-track { background: transparent; }
.th-hexrow { display: flex; align-items: center; gap: 10px; }
.th-chip { width: 40px; height: 40px; border-radius: 10px; flex: 0 0 auto; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.th-hexin { flex: 1; min-width: 0; font: 600 15px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .04em; text-transform: uppercase; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); color: var(--ink); }
#st-theme .btn.save { margin-top: 10px; }

/* ---------- Dark (html[data-mode=dark]; js/app.js applyMode – each person chooses: Light, Dark or Same as this device) ----------
 * The church's colour stays: js/app.js gives it a lighter shade for writing and a dark pale shade (--accent-ink, --accent-soft). */
html[data-mode=dark] { color-scheme: dark;
  --bg: #13110F; --surface: #1E1A17; --surface-2: #191614; --ink: #ECE6E0; --muted: #A89E95; --line: #39322C; --line-2: #2B2521; --line-strong: #4B423A; --tag-ink: #fff;
  --ok: #6FCF97; --ok-soft: #1B3326; --warn: #E8BE66; --warn-soft: #362C16; --bad: #F2908A; --bad-soft: #3B1E1E; --away: #2C2723;
  --req-bg: #2E2419; --req-line: #6B4A2C;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 4px 16px rgba(0,0,0,.35); }
html[data-mode=dark] .deceased .panel { --surface: #2A2724; --surface-2: #26231F; --line-2: #3A3530; border-color: #3A3530; }
html[data-mode=dark] .demo { background: #2E2617; border-bottom-color: #5A4A26; color: var(--ink); }
html[data-mode=dark] .viewas { background: #33290F; color: #F3DC9B; border-bottom-color: #5E4C1C; }
html[data-mode=dark] .offline-bar { background: #1B2636; color: #BCD0EC; border-bottom-color: #2F4260; }
html[data-mode=dark] .note.info, html[data-mode=dark] .chip.auto { background: #1B2636; color: #BCD0EC; }
html[data-mode=dark] .seg, html[data-mode=dark] .bar, html[data-mode=dark] .chip.declined { background: #2B2521; }
html[data-mode=dark] .btn:hover { border-color: #6A5F55; } html[data-mode=dark] .appcard:hover { border-color: #5A5047; }
html[data-mode=dark] .cg-hit { background: #3A3112; box-shadow: 0 0 0 2px #6B5A1E inset; }
html[data-mode=dark] .field input::placeholder, html[data-mode=dark] .field textarea::placeholder, html[data-mode=dark] .ms-find::placeholder { color: #776D64; }
html[data-mode=dark] .ls-term { border-bottom-color: var(--line); } html[data-mode=dark] .panel.inset { background: var(--bg); border-color: var(--line); }
html[data-mode=dark] .chip.gap { border-color: #7A4540; }
html[data-mode=dark] .just-saved { animation-name: just-saved-dark; }
@keyframes just-saved-dark { 0%, 30% { background: #1E4A30; box-shadow: 0 0 0 3px #1E4A30; } 100% { background: transparent; box-shadow: 0 0 0 3px transparent; } }
html[data-mode=dark] .th-pmain { background: var(--bg); }
html[data-mode=dark] .th-sw:not(.on) { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px rgba(255,255,255,.22); }
html[data-mode=dark] img.photo, html[data-mode=dark] .av.pic { filter: brightness(.92); }
/* Dark: roster slots and their key, green buttons */
html[data-mode=dark] .chip { color: #CFEBD9; }
html[data-mode=dark] .chip.pending { color: #F3DC9B; }
html[data-mode=dark] .chip.declined { background: #2B2521; }
html[data-mode=dark] .chip.auto { background: #1B2636; color: #BCD0EC; border-color: #3E5C86; }
html[data-mode=dark] .chip.gap { color: var(--bad); }
html[data-mode=dark] .chip.away { border-color: #5A524B; }
html[data-mode=dark] .legend i[style*="#E6EEF7"] { background: #1B2636 !important; border-color: #3E5C86 !important; }
html[data-mode=dark] .legend i[style*="background:#fff"], html[data-mode=dark] .legend i[style*="background: #fff"] { background: var(--surface) !important; }
html[data-mode=dark] .btn.ok { background: #237A4B; border-color: #237A4B; color: #fff; }
html[data-mode=dark] .legend i[style*="#F2EEEA"] { background: #2B2521 !important; }

/* The loading screen (index.html), before Church & Trellis's code has run: the menu colour, the logo and the turning cross */
.splash { min-height: 100vh; display: grid; place-items: center; background: var(--side); color: #fff; padding: 24px; text-align: center; }
.splash-in { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.splash-mark { width: 56px; height: 56px; border-radius: 14px; }
.splash h1 { margin: 4px 0 0; font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.splash-cross { width: 30px; height: 30px; margin-top: 10px; fill: color-mix(in srgb, var(--accent) 45%, #fff); }
.splash p { margin: 0; color: var(--side-muted); font-size: 13px; min-height: 1em; }
/* Dark: each service's look (its pale shade and dark writing are set per service, so they are mixed here instead) */
html[data-mode=dark] .matrix th.svc-col, html[data-mode=dark] .svc-card.on, html[data-mode=dark] .svc-ico, html[data-mode=dark] .mood, html[data-mode=dark] .svc-hero { background: color-mix(in srgb, var(--svc-line) 20%, var(--surface)); }
html[data-mode=dark] .svc-card.on .svc-ico, html[data-mode=dark] .svc-card.on .mood { background: color-mix(in srgb, var(--svc-line) 32%, var(--surface)); }
html[data-mode=dark] .matrix th.svc-col .muted, html[data-mode=dark] .item.svc-tint small, html[data-mode=dark] .svc-top b, html[data-mode=dark] .svc-ico, html[data-mode=dark] .mood, html[data-mode=dark] .svc-foot, html[data-mode=dark] .svc-hero h1, html[data-mode=dark] .svc-page .panel > h2 { color: color-mix(in srgb, var(--svc-line) 50%, #fff); }
/* Dark: plain boxes that have no style of their own (e.g. Terminology's words) */
html[data-mode=dark] input:not([type=checkbox]):not([type=radio]):not([type=color]):not([type=range]), html[data-mode=dark] select, html[data-mode=dark] textarea { background-color: var(--surface); color: var(--ink); border-color: var(--line-strong); }
/* Dark: small round add / remove buttons (Advanced search filters) */


/* Back to the top / to the bottom (js/app.js jumpButtons): bottom right of a long page, up above down; above the phone's tab bar */
#jump { position: fixed; right: 18px; bottom: 22px; z-index: 55; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
#to-top, #to-bottom { pointer-events: auto; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--accent-ink);
  display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.14); opacity: 0; transform: translateY(8px); transition: opacity .2s, transform .2s; }
#to-top[hidden], #to-bottom[hidden] { display: none; }
#to-top.show, #to-bottom.show { opacity: .92; transform: none; }
#to-top:hover, #to-top:focus-visible, #to-bottom:hover, #to-bottom:focus-visible { opacity: 1; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, var(--surface)); }
@media (max-width: 860px) { #jump { bottom: 84px; right: 14px; } }
@media (prefers-reduced-motion: reduce) { #to-top, #to-bottom { transition: none; } }
/* A floating ✕ at the top right that stays while scrolling (About): looks like the jump arrows; under the phone's top bar */
.float-close { position: fixed; top: 18px; right: 18px; z-index: 55; width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.14); opacity: .92; }
.float-close:hover, .float-close:focus-visible { opacity: 1; background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, var(--surface)); }
@media (max-width: 860px) { .float-close { top: calc(76px + env(safe-area-inset-top)); right: 14px; } }

/* ---------- Settings: a page per topic, the topics down the left (a strip across the top on phones) ---------- */
.set-wrap { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 32px; align-items: start; }
.set-nav { position: sticky; top: 16px; display: flex; flex-direction: column; gap: 14px; }
.set-q { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 0 10px; color: var(--muted); }
.set-q:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.set-q input { border: 0; background: transparent; padding: 9px 0; min-width: 0; flex: 1; outline: none; font-size: 14px; }
.set-grp { display: flex; flex-direction: column; gap: 1px; }
.set-gl { margin: 0 0 4px; padding: 0 10px; font-size: 11.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.set-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 9px; color: var(--ink); text-decoration: none; font-weight: 500; font-size: 14.5px; min-height: 38px; }
.set-link svg { color: var(--muted); flex: none; }
.set-link:hover { background: var(--line-2); }
.set-link.on { background: var(--accent-soft); color: var(--accent-ink); font-weight: 650; }
.set-link.on svg { color: var(--accent-ink); }
.set-link[hidden], .set-grp[hidden] { display: none; }
.set-main { max-width: 820px; min-width: 0; }
.set-head { margin: 2px 0 18px; }
.set-head h2 { margin: 0; font-size: 22px; letter-spacing: -.01em; }
.set-head p { margin: 4px 0 0; color: var(--muted); }
.set-lead { margin: -6px 0 16px; }
.set-rows { margin: 4px 0 14px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 14px 0; border-top: 1px solid var(--line-2); }
.set-row:first-child { border-top: 0; padding-top: 4px; }
label.set-row { cursor: pointer; }
.set-l { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.set-l b { font-weight: 600; }
.set-l.req b::after { content: ' *'; color: var(--bad); }
.set-l small { color: var(--muted); font-size: 13px; line-height: 1.4; }
.set-c { flex: 0 0 300px; }
.set-c input:not([type=checkbox]), .set-c select { width: 100%; padding: 9px 11px; border: 1px solid var(--line-strong); border-radius: 9px; background-color: var(--surface); }
.set-c.sw { flex: none; }
/* A switch (a tick box that looks like one): on = the church's colour */
.sw input { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; border-radius: 13px; background: var(--line-strong); position: relative; cursor: pointer; margin: 0; transition: background .15s; flex: none; }
.sw input::after { content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .15s; }
.sw input:checked { background: var(--accent-ink); }
.sw input:checked::after { transform: translateX(18px); }
@media (prefers-reduced-motion: reduce) { .sw input, .sw input::after { transition: none; } }
@media (max-width: 860px) {
  .set-wrap { grid-template-columns: 1fr; gap: 16px; }
  .set-nav { position: sticky; top: 0; z-index: 4; flex-direction: row; gap: 6px; overflow-x: auto; padding: 8px 0; margin: -8px 0 0; background: var(--bg); scrollbar-width: none; }
  .set-nav::-webkit-scrollbar { display: none; }
  .set-q, .set-gl, .set-none { display: none; }
  .set-grp { flex-direction: row; gap: 6px; }
  .set-link { white-space: nowrap; border: 1px solid var(--line); background: var(--surface); padding: 7px 12px; min-height: 40px; }
  .set-row { flex-direction: column; align-items: stretch; gap: 8px; }
  label.set-row { flex-direction: row; align-items: center; }
  .set-c { flex: none; }
}
html[data-mode=dark] .set-link:hover { background: var(--side-2); }
.panel > .hint + .set-rows { margin-top: 12px; }

/* Advanced search: ask in your own words (js/people/search.js askPanel, js/ask.js) */
.ask-row { display: flex; gap: 8px; align-items: center; margin: 0; }
.ask-row input[type=search] { flex: 1; min-width: 0; font-size: 16px; padding: 12px 14px; border-radius: 12px; }
.ask-mic { width: 46px; height: 46px; flex: 0 0 auto; border-radius: 50%; border: 1px solid var(--line); background: var(--surface); color: var(--accent-ink); display: grid; place-items: center; cursor: pointer; }
.ask-mic.on { background: var(--accent); color: var(--accent-on, #fff); border-color: var(--accent); animation: ask-pulse 1.2s ease-in-out infinite; }
@keyframes ask-pulse { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 50% { box-shadow: 0 0 0 10px color-mix(in srgb, var(--accent) 0%, transparent); } }
@media (prefers-reduced-motion: reduce) { .ask-mic.on { animation: none; } }
.ask-live { margin: 8px 0 0; font-weight: 600; color: var(--accent-ink); }
.ask-ex { display: flex; flex-wrap: wrap; gap: 8px; }
.ask-chip { text-align: left; font: inherit; font-size: 13.5px; line-height: 1.35; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink); cursor: pointer; }
.ask-chip:hover, .ask-chip:focus-visible { border-color: var(--accent); color: var(--accent-ink); }
.ask-said { margin-top: 14px; } .ask-said .tag { margin: 2px 4px 2px 0; display: inline-block; }
.ask-exw summary { cursor: pointer; margin: 12px 0 8px; } .ask-exw[open] summary { margin-bottom: 10px; }
@media (max-width: 520px) { .ask-row { flex-wrap: wrap; } .ask-row input[type=search] { flex-basis: 100%; } .ask-row .btn.primary { flex: 1; justify-content: center; } }

/* reCAPTCHA (App Check for Ask with AI): its badge is hidden; Ask shows Google's notice in words instead, as Google allows */
.grecaptcha-badge { visibility: hidden !important; }
/* Edit details: a box that doesn't apply to this person (e.g. a wedding anniversary for someone single) */
.field.is-off { opacity: .55; }
.field.is-off input, .field.is-off select { cursor: not-allowed; }
.field .off-why { display: block; font-style: italic; }
/* "i" tips (Hub.tip): a small round mark; the explanation floats above the page */
.tip { display: inline-flex; align-items: center; justify-content: center; width: 17px; height: 17px; border-radius: 50%; border: 1px solid var(--line-strong);
  color: var(--muted); font: italic 700 11px/1 Georgia, serif; cursor: help; vertical-align: 2px; margin-left: 2px; user-select: none; }
.tip:hover, .tip:focus { color: var(--ink); border-color: var(--ink); outline: none; }
.tip-box { position: absolute; z-index: 1000; background: var(--ink); color: var(--surface); padding: 8px 11px; border-radius: 8px; font-size: 13px; line-height: 1.45;
  box-shadow: 0 6px 20px rgba(0,0,0,.18); pointer-events: none; }
/* Who can see what: a grid of ticks, one column per kind of access */
.see-grid td.c, .see-grid th.c, #access-kinds .c { text-align: center; }
.see-grid td:first-child { min-width: 180px; }

/* Applying to become a Church Partner (js/people/apply.js) */
.yn { border: 0; padding: 0; margin: 0 0 14px; } .yn legend { margin-bottom: 6px; font-weight: 600; font-size: 14px; }
.yn.field { display: flex; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0 28px; } .yn legend { width: 100%; float: left; }
.yn .check.inline { display: inline-flex; padding: 6px 0; }
.decl { margin: 0 0 14px; padding: 12px 16px; border-left: 4px solid var(--accent); background: var(--surface-2); border-radius: 0 10px 10px 0; line-height: 1.55; font-size: 14.5px; }
.app-kv dt { white-space: normal; }
/* Name badges: a preview on screen (People → Name badges) */
.badge-prev { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; }
.badge-prev .badge { position: relative; width: 210px; height: 118px; border: 2px solid var(--ink); border-radius: 6px; background: #fff; color: #111; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 6px; font-family: "Open Sans", Inter, sans-serif; }
.badge-prev .badge b { font-size: 28px; line-height: 1.15; } .badge-prev .badge span { font-size: 20px; line-height: 1.2; }
.badge-prev .badge .icon-btn { position: absolute; top: 2px; right: 2px; }
.badge-line { margin: 8px 0 0; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }

/* Printing only one part (an application, or sheets of name badges): everything else is hidden */
#print-only { display: none; }
@media print {
  html.printing body > *:not(#print-only) { display: none !important; }
  html.printing #print-only { display: block; }
  html.printing, html.printing body { background: #fff !important; }
  #print-only.app { font-family: Inter, sans-serif; color: #000; padding: 4mm 2mm; } #print-only.app .no-print, #print-only.app .icon-btn { display: none !important; }
  #print-only.app h1 { font-size: 18pt; margin: 0 0 10pt; } #print-only.app .panel { border: 0; box-shadow: none; padding: 0; }
  #print-only.app dl.kv { display: grid; grid-template-columns: 38% 1fr; gap: 4pt 12pt; font-size: 10.5pt; } #print-only.app dt { font-weight: 700; }
  /* Name badges (js/badges.js): each sheet is one page, each label placed in millimetres from the top-left corner */
  #print-only.badges .sheet { position: relative; overflow: hidden; page-break-after: always; break-after: page; }
  #print-only.badges .sheet.a4 { page: badges; } #print-only.badges .sheet.letter { page: badgesLetter; }
  #print-only.badges .sheet:last-child { page-break-after: auto; break-after: auto; }
  /* Invitation to become a Church Partner: an A4 poster with the QR code, and a paper form */
  #print-only.invite { font-family: Inter, Arial, sans-serif; color: #000; }
  #print-only.invite .poster { width: 190mm; margin: 12mm auto 0; text-align: center; }
  #print-only.invite .poster h1 { font-size: 34pt; margin: 0 0 4mm; } #print-only.invite .poster .big { font-size: 18pt; margin: 0 0 8mm; }
  #print-only.invite .poster .qr-box svg { width: 110mm; height: 110mm; box-shadow: none; } #print-only.invite .poster .qr-link { font-size: 12pt; margin: 3mm 0 8mm; word-break: break-all; max-width: none; color: #000; }
  #print-only.invite .poster ol { text-align: left; font-size: 15pt; line-height: 1.5; margin: 0 auto 6mm; max-width: 150mm; } #print-only.invite .poster .small { font-size: 11pt; }
  #print-only.invite .paper-form { font-size: 10pt; padding: 2mm 4mm; }
  #print-only.invite .pf-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8mm; margin-bottom: 4mm; }
  #print-only.invite .pf-head h1 { font-size: 17pt; margin: 0; } #print-only.invite .pf-head p { margin: 1mm 0 0; }
  #print-only.invite .pf-q { margin: 0 0 3.2mm; break-inside: avoid; } #print-only.invite .pf-q b { display: block; font-weight: 600; margin-bottom: 1mm; }
  #print-only.invite .pf-line { display: block; border-bottom: 0.6pt solid #555; height: 7mm; }
  #print-only.invite .pf-yn { font-weight: 400; } #print-only.invite .pf-q .decl { font-size: 9pt; font-style: italic; margin: 1mm 0; }
  #print-only.invite .two { display: grid; grid-template-columns: 1fr 1fr; gap: 0 8mm; }
  /* The roster on paper (Rosters → More → Print the roster): A4 landscape, one service per sheet, only the positions in use */
  #print-only.roster { font-family: Inter, Arial, sans-serif; color: #000; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
  #print-only.roster .ro-sheet { page: rosterA4; break-after: page; page-break-after: always; }
  #print-only.roster .ro-sheet:last-child { break-after: auto; page-break-after: auto; }
  #print-only.roster .ro-ph { display: flex; justify-content: space-between; align-items: flex-end; gap: 6mm; border-bottom: 1.4pt solid var(--svc-ink, #333); padding-bottom: 2mm; margin-bottom: 3mm; }
  #print-only.roster .ro-ph h1 { font-size: 16pt; margin: 0; line-height: 1.15; } #print-only.roster .ro-ph p { margin: 1mm 0 0; font-size: 10pt; }
  #print-only.roster .ro-ph .ro-church { text-align: right; font-size: 9pt; color: #444; }
  #print-only.roster table { width: 100%; border-collapse: collapse; table-layout: fixed; font-size: 8.5pt; line-height: 1.25; }
  #print-only.roster th, #print-only.roster td { border: 0.5pt solid #999; padding: 1.2mm 1.4mm; vertical-align: top; text-align: left; overflow-wrap: anywhere; }
  #print-only.roster thead th { background: var(--svc-soft, #f2f2f2); font-size: 8.5pt; text-align: center; }
  #print-only.roster thead th small { display: block; font-weight: 400; font-size: 7.5pt; }
  #print-only.roster thead th svg { vertical-align: -1px; }
  #print-only.roster col.ro-pc { width: 34mm; }
  #print-only.roster tbody th { font-weight: 600; }
  #print-only.roster tr.ro-team th { background: #eee; font-size: 8pt; text-transform: uppercase; letter-spacing: .04em; padding-top: .8mm; padding-bottom: .8mm; }
  #print-only.roster td span { display: block; } #print-only.roster td.na { background: repeating-linear-gradient(135deg, #f3f3f3 0 2mm, #fff 2mm 4mm); }
  #print-only.roster tr { break-inside: avoid; page-break-inside: avoid; }
  #print-only.roster .ro-pf { display: flex; justify-content: space-between; font-size: 7.5pt; color: #555; margin-top: 2mm; }
}
@page rosterA4 { size: A4 landscape; margin: 9mm; }
@page badges { size: A4 portrait; margin: 0; }   /* only the badge sheets: the margins are in the layout itself */
@page badgesLetter { size: letter portrait; margin: 0; }
/* A badge, printed or in the layout preview (People → Name badges → Badge layout) */
.lab { position: absolute; box-sizing: border-box; border: 0 solid #000; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 0 2mm; overflow: hidden;
  font-family: "Open Sans", Inter, Arial, sans-serif; color: #000; background: none; }
.lab b { display: block; font-weight: 700; line-height: 1.15; white-space: nowrap; } .lab span { display: block; font-weight: 400; line-height: 1.2; white-space: nowrap; }
.bl-prev { background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 14px; display: flex; justify-content: center; overflow: hidden; }
.bl-page { position: relative; background: #fff; box-shadow: 0 1px 6px rgba(0,0,0,.18); flex: 0 0 auto; }
.bl-page .sheet { position: absolute; top: 0; left: 0; transform-origin: 0 0; }
.bl-page .lab.paper { outline: 0.2mm dashed #9aa; }
/* About → Brochures: the brochure in a frame, and its colour and font */
.bro-wrap { background: var(--surface-2); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.bro-wrap iframe { display: block; width: 100%; min-height: 400px; border: 0; background: transparent; }
.bro-design { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin-top: 14px; }
.bro-design .bro-l { font-weight: 600; font-size: .9rem; color: var(--muted); }
.bro-design select { max-width: 260px; }
.bro-sw { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--line-strong); background: var(--c); cursor: pointer; padding: 0; }
.bro-sw.on { box-shadow: 0 0 0 3px var(--ink); }
.bro-pick input { width: 34px; height: 34px; padding: 0; border: 1px solid var(--line-strong); border-radius: 8px; background: none; cursor: pointer; }
.bro-design .bro-l + select, .bro-pick { margin-right: 6px; }
/* The QR code for the partnership form (People → Partnership applications, and the Invite window) */
.qr-box { display: inline-flex; flex-direction: column; align-items: center; gap: 6px; }
.qr-box svg { display: block; border-radius: 6px; box-shadow: 0 0 0 1px var(--line); }
.qr-box .qr-link { margin: 0; font-size: .82rem; color: var(--muted); word-break: break-all; max-width: 280px; text-align: center; }

/* People list: tick boxes (Administrators and the Senior Pastor); the rest of the row still opens the person */
.pick-bar { position: sticky; top: 0; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; padding: 10px 12px; margin-bottom: 10px; background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius); box-shadow: var(--shadow); }
.pick-bar[hidden] { display: none; }
.pick-bar .pick-n { font-weight: 600; }
.pp-row.pickable { padding: 0 16px 0 0; gap: 0; flex-wrap: nowrap; }
.pp-tick { display: flex; align-items: center; justify-content: center; align-self: stretch; padding: 0 8px 0 14px; cursor: pointer; flex: 0 0 auto; }
.pp-tick input { width: 20px; height: 20px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.pp-tickall { display: inline-flex; padding: 0 8px 0 0; vertical-align: middle; }
.pp-link { display: flex; align-items: center; gap: 12px; flex: 1 1 0; min-width: 0; padding: 12px 0 12px 4px; color: inherit; text-decoration: none; }
.pp-row.pickable:hover { background: var(--surface-2); }
.pp-row.pickable.on { background: var(--accent-soft); }
@media (max-width: 600px) {
  .pp-link { flex-wrap: wrap; row-gap: 6px; } .pp-link .grow { flex: 1 1 0; }
  .pp-link .pp-tags { flex: 1 0 100%; justify-content: flex-start; padding-left: 48px; }
}
/* Archive and Library: a record or a book – its buttons drop below the words when there isn't room beside them (phones) */
.rec-item { align-items: flex-start; flex-wrap: wrap; }
.rec-item > .grow { flex: 1 1 240px; min-width: 0; overflow-wrap: anywhere; }
.rec-item .tag { margin-top: 4px; }
.rec-acts { display: flex; align-items: center; gap: 4px; margin-left: auto; }
@media print { .pick-bar { display: none; } }

/* Sign-in codes (js/people/profile.js): the code, its QR and the printed slip */
.code-qr svg { display: block; margin: 4px auto 8px; border-radius: 10px; }
.code-big { text-align: center; font: 700 2rem/1.2 ui-monospace, 'SF Mono', Menlo, Consolas, monospace; letter-spacing: .14em; margin: 4px 0 8px; }
.code-slip.print { text-align: center; padding: 12mm 8mm; border: 1.5pt dashed #999; border-radius: 6mm; max-width: 120mm; margin: 0 auto; }
.code-slip.print h1 { font-size: 20pt; margin: 4pt 0 8pt; }

/* Library: cover pictures (js/mod-library.js) and the policy */
.lib-sort { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.lib-filters { margin-bottom: 12px; }
.lib-filters .field { margin: 0; }
.lib-tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.lib-tabs .btn .muted { color: inherit; opacity: .75; }
.lib-report-search { margin: 12px 0; }
.lib-cover { width: 40px; height: 54px; flex: 0 0 auto; border-radius: 4px; display: inline-grid; place-items: center; color: var(--muted, #888);
  background: color-mix(in srgb, var(--muted, #888) 12%, var(--surface, #fff)); background-size: cover; background-position: center; margin-right: 4px; }
.lib-cover.pic { color: transparent; }
.lib-cover-pick { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.lib-cover-now { width: 72px; min-height: 96px; display: grid; place-items: center; border: 1px dashed var(--line, #ccc); border-radius: 6px; text-align: center; }
.lib-cover-now img { max-width: 72px; max-height: 110px; border-radius: 4px; display: block; }
.lib-cover-drop { display: flex; gap: 14px; align-items: center; padding: 10px; border: 1px dashed var(--line, #ccc); border-radius: 8px; }
.lib-cover-drop.drag { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.lib-cover-drop p { margin: 0 0 8px; }
.lib-cover-drop small { display: block; margin-top: 6px; }
.lib-cover-choices { margin-top: 8px; }
.lib-cover-choices p { margin: 4px 0; }
.lib-cover-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.lib-cover-option { padding: 0; border: 2px solid var(--line, #ccc); border-radius: 6px; background: var(--surface); cursor: pointer; line-height: 0; }
.lib-cover-option:hover, .lib-cover-option:focus-visible { border-color: var(--accent); }
.lib-cover-option img { width: 64px; height: 92px; object-fit: cover; border-radius: 4px; }
.lib-duplicate-list { display: grid; gap: 12px; }
.lib-duplicate-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; padding: 12px; border: 1px solid var(--line, #ddd); border-radius: 8px; }
.lib-duplicate-item { min-width: 0; }
.lib-duplicate-item h3 { margin: 0 0 8px; overflow-wrap: anywhere; }
.lib-duplicate-item dl { display: grid; grid-template-columns: minmax(80px, auto) 1fr; gap: 4px 10px; margin: 0; font-size: .9em; }
.lib-duplicate-item dd { margin: 0; overflow-wrap: anywhere; }
.lib-duplicate-pair > .btns { grid-column: 1 / -1; }
.lib-info-results { display: flex; align-items: flex-start; gap: 14px; }
.lib-info-cover { width: 96px; max-height: 144px; object-fit: contain; flex: 0 0 auto; border-radius: 4px; }
.lib-info-description { max-height: 32vh; overflow: auto; white-space: pre-line; }
.lib-info-links { margin: 12px 0 0; }
.lib-policy-text { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 8px; max-height: 60vh; overflow: auto; }
/* chips that open a page (a person's midweek and leadership groups, their library books) */
a.tag.tag-link { text-decoration: none; cursor: pointer; }
a.tag.tag-link:hover, a.tag.tag-link:focus-visible { outline: 2px solid color-mix(in srgb, var(--c) 45%, transparent); outline-offset: 1px; }
@media (max-width: 600px) {
  .lib-duplicate-pair { grid-template-columns: 1fr; }
  .lib-duplicate-pair > .btns { grid-column: 1; }
  .lib-cover-drop { align-items: flex-start; }
}
/* Leadership: where someone is in their term of office */
.term { display: block; margin-top: 6px; }
.term-bar { display: flex; gap: 3px; max-width: 260px; }
.term-bar i { flex: 1; height: 8px; border-radius: 4px; background: var(--line-2); overflow: hidden; position: relative; }
.term-bar i.done { background: color-mix(in srgb, var(--accent) 55%, var(--surface)); }
.term-bar i.now::before { content: ''; position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); background: var(--accent); border-radius: 4px; }
.term.soon .term-bar i.now::before { background: #C77700; }
.term.urgent .term-bar i.now::before, .term.over .term-bar i.now::before { background: #B42318; }
.term small { display: block; margin-top: 2px; }
.term-note { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-top: 4px; }
/* formatted documents (js/richtext.js): the Library policy, Archive notes */
.rich h3, .rich h4, .rich h5 { margin: 12px 0 4px; } .rich h3:first-child, .rich h4:first-child { margin-top: 0; }
.rich p { margin: 0 0 8px; line-height: 1.55; } .rich ul, .rich ol { margin: 0 0 8px; padding-left: 22px; } .rich li { margin: 2px 0; }
.rt-tools { display: flex; gap: 4px; flex-wrap: wrap; margin: 2px 0 4px; }
.rt-tools button { min-width: 34px; }
/* Library policy shown as a document */
.lib-doc { line-height: 1.55; overflow-wrap: anywhere; }
.lib-doc h3 { font-size: 1.15rem; margin: 1em 0 .4em; } .lib-doc h4 { font-size: 1rem; margin: .9em 0 .3em; letter-spacing: .02em; }
.lib-doc h5 { font-size: .95rem; margin: .8em 0 .3em; }
.lib-doc p { margin: 0 0 .7em; } .lib-doc ul, .lib-doc ol { margin: 0 0 .7em 1.3em; padding: 0; } .lib-doc li { margin: .2em 0; }
.lib-doc > :first-child { margin-top: 0; }
.lib-doc-short { margin-top: 8px; max-height: 40vh; overflow: auto; }
/* Library policy: how to format it */
.lib-legend { margin-top: 8px; font-weight: 400; }
.lib-legend-t { width: 100%; border-collapse: collapse; margin-top: 6px; font-size: 14px; }
.lib-legend-t th { text-align: left; font-weight: 600; padding: 4px 8px; border-bottom: 1px solid var(--line); }
.lib-legend-t td { padding: 6px 8px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.lib-legend-t td.lib-doc > * { margin: 0; } .lib-legend-t td.lib-doc h3, .lib-legend-t td.lib-doc h4, .lib-legend-t td.lib-doc h5 { margin: 0; }
.lib-legend-t code { font-size: 13px; white-space: nowrap; }
#lib-pol-prev { margin-top: 8px; max-height: 40vh; overflow: auto; font-weight: 400; }

/* ---------- Review 14 Nov 2026: consistency fixes ---------- */
/* No blue frame round the whole page after moving to another screen (the page is focused for screen readers) */
main:focus, main:focus-visible { outline: none; }
/* The initials picture by the name in the side menu stays round */
.who > .av { flex: 0 0 auto; }
/* "View as…" sits in the side menu with the language and appearance, not floating over the page */
.side-viewas { display: flex; align-items: center; gap: 8px; width: 100%; margin-top: 6px; padding: 6px 10px; min-height: 32px; border: 1px solid transparent; border-radius: 10px;
  background: transparent; color: var(--side-muted); font: inherit; font-size: 12.5px; cursor: pointer; text-align: left; }
.side-viewas:hover, .side-viewas:focus-visible { border-color: var(--side-2); color: var(--side-ink); }
/* A "More ▾" menu: a button that opens a short list of less-used actions */
details.menu { position: relative; display: inline-block; }
details.menu > summary { list-style: none; cursor: pointer; }
details.menu > summary::-webkit-details-marker { display: none; }
details.menu[open] > summary { background: var(--surface-2); }
.menu-list { position: absolute; right: 0; top: calc(100% + 6px); z-index: 20; min-width: 230px; max-width: min(320px, 90vw); display: flex; flex-direction: column;
  padding: 6px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(29,27,25,.14); }
.menu-list > button, .menu-list > a, .menu-list .btn { display: flex; align-items: center; gap: 8px; width: 100%; justify-content: flex-start; text-align: left; padding: 9px 12px;
  min-height: 40px; border: 0; border-radius: 8px; background: transparent; color: var(--ink); font: inherit; font-size: 14px; font-weight: 500; text-decoration: none; cursor: pointer; box-shadow: none; }
.menu-list > button:hover, .menu-list > a:hover, .menu-list .btn:hover { background: var(--surface-2); }
@media (max-width: 700px) { .page-head .btns details.menu .menu-list { right: auto; left: 0; } }
/* Library: tabs under the title, one toolbar for status, search and sorting, nothing shown that's empty */
.lib-section { margin: 0 0 16px; }
.lib-toolbar .lib-tabs { gap: 6px; }
.lib-toolbar .pchip { border-style: solid; }
.lib-n { font-weight: 500; opacity: .7; }
details.lib-more { margin-top: 12px; }
details.lib-more > summary { cursor: pointer; font-weight: 600; color: var(--accent-ink); font-size: 14px; }
details.lib-more[open] > summary { margin-bottom: 12px; }
.lib-books-head { align-items: center; }
/* An item's loans, under it in the one list (librarians): who has it, and Returned */
.lib-loans { flex: 1 1 100%; display: flex; flex-direction: column; gap: 6px; }
.lib-loan { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; padding: 6px 10px; border-radius: 10px; background: var(--bg); border: 1px solid var(--line-2); }
.lib-loan > .grow { flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; }
.lib-empty { padding: 32px 18px; }
.lib-empty p { margin: 0 0 14px; }
.row-menu > summary { font-size: 18px; line-height: 1; letter-spacing: 1px; }
.menu-list .menu-danger, .menu-list > button.menu-danger { color: var(--bad); }
.menu-list > button[disabled] { opacity: .5; cursor: default; }

/* ---------- Messages, as on WhatsApp: received on the left, sent on the right, time and ticks in the corner ---------- */
.msg-chat { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: var(--radius); background: color-mix(in srgb, var(--accent) 5%, var(--bg)); }
.msg-chat .msg { position: relative; max-width: min(88%, 640px); padding: 9px 12px 6px; border: 0; border-radius: 12px; background: var(--surface); box-shadow: 0 1px 1px rgba(29,27,25,.08); }
.msg-chat .msg.in { align-self: flex-start; border-top-left-radius: 4px; }
.msg-chat .msg.out { align-self: flex-end; border-top-right-radius: 4px; background: color-mix(in srgb, #25D366 14%, var(--surface)); }
.msg-chat .msg.new { box-shadow: 0 1px 1px rgba(29,27,25,.08), inset 3px 0 0 #25D366; }
.msg-chat .msg.new .msg-top b { font-weight: 800; }
.msg-chat .msg.new .msg-top b::before { background: #25D366; }
.msg-chat .msg:not(.new) .msg-top b { font-weight: 600; }
.msg-top { align-items: center; }
.msg-who { color: var(--muted); font-size: 12.5px; margin-top: 2px; }
.msg-chat .msg-body { margin: 6px 0 2px; }
.msg-chat .msg-foot { margin-top: 2px; justify-content: flex-end; }
.msg-time { margin-left: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--muted); white-space: nowrap; }
.msg-status { display: inline-flex; align-items: center; line-height: 0; }
button.msg-status { background: none; border: 0; padding: 4px; margin: -4px; cursor: pointer; font: inherit; border-radius: 6px; }
button.msg-status:focus-visible { outline: 2px solid var(--tick-blue); }
.msg-chat .msg-time { position: relative; }
.msg-mark-tip { position: absolute; right: 0; bottom: calc(100% + 8px); width: max-content; max-width: min(260px, 70vw); background: #1D1B19; color: #fff; font-size: 12.5px; line-height: 1.35; white-space: normal; text-align: left; padding: 8px 11px; border-radius: 10px; box-shadow: 0 4px 14px rgba(0,0,0,.18); z-index: 5; animation: tipIn .15s ease-out; }
.msg-mark-tip::after { content: ''; position: absolute; right: 8px; top: 100%; border: 6px solid transparent; border-top-color: #1D1B19; }
@keyframes tipIn { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
:root { --tick-grey: #8696A0; --tick-blue: #34B7F1; }
.msg-status.sent, .msg-status.delivered { color: var(--tick-grey); }
.msg-status.read, .msg-status.some { color: var(--tick-blue); }
.msg-word { font-size: 11px; font-weight: 600; line-height: 1; white-space: nowrap; }
.msg-status.sent .msg-word, .msg-status.delivered .msg-word { color: var(--tick-grey); }
.msg-legend { padding: 10px 14px; margin-bottom: 12px; }
.msg-legend > summary { cursor: pointer; font-weight: 600; }
.msg-legend-list { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.msg-legend-list li { display: flex; gap: 10px; align-items: center; font-size: 14px; }
.msg-legend-list .msg-status { flex: 0 0 72px; justify-content: center; }
.msg-legend-list .msg-status svg { transform: scale(1.35); }
.msg-legend-list .msg-word { white-space: normal; text-align: center; font-size: 12px; line-height: 1.2; }
.msg-legend .hint { margin: 0 0 10px; }
/* How should the delivery signs look? – four picture cards, two to a row */
.msg-styles { border: 0; padding: 0; margin: 0; min-width: 0; }
.msg-styles > legend { padding: 0; margin: 0 0 8px; font-weight: 600; font-size: 15px; }
.msg-style-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.msg-style { position: relative; display: flex; flex-direction: column; gap: 6px; padding: 10px; border: 1.5px solid var(--line); border-radius: 12px; background: var(--surface); cursor: pointer; }
.msg-style.on { border: 2px solid var(--accent); padding: 9.5px; background: color-mix(in srgb, var(--accent) 6%, var(--surface)); }
.msg-style:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 2px; }
.msg-style > b { font-size: 14px; padding-right: 22px; }
.msg-style-tick { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); display: grid; place-items: center; line-height: 0; }
.msg-style-steps { display: flex; align-items: center; gap: 5px; min-height: 20px; flex-wrap: wrap; }
.msg-style-steps svg { transform: scale(1.2); }
.msg-style-arrow { color: var(--line-strong); font-size: 12px; line-height: 1; }
.msg-style-what { font-size: 12.5px; line-height: 1.35; color: var(--muted); }
.msg-style-like { align-self: flex-start; margin-top: auto; font-size: 11.5px; line-height: 1.3; padding: 3px 7px; border-radius: 6px; background: var(--accent-soft); color: var(--accent-ink); }
.msg-unread-bar { align-self: center; padding: 4px 12px; border-radius: 999px; background: var(--surface); color: var(--muted); font-size: 12px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em; box-shadow: 0 1px 1px rgba(29,27,25,.08); }
.msg-chat .msg-read { font-size: 12.5px; }
html[data-mode=dark] .msg-chat .msg.out { background: color-mix(in srgb, #25D366 22%, var(--surface)); }

/* Choosing between a few options in a window (e.g. which Sesotho spelling) */
.choices { display: grid; gap: 10px; }
.btn.choice { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; text-align: left; padding: 12px 14px; height: auto; white-space: normal; }
/* Consent window: what withdrawing a consent means, shown under the unticked box */
.cf-without { display: block; margin: 6px 0 0; padding: 8px 10px; font-size: 13px; }
.cf-without[hidden] { display: none; }

/* Home: What's new and Did you know? (js/tips.js) */
.panel.tips-card { margin: 0 0 18px; border-left: 4px solid var(--accent, #E8590C); }
.tips-card h2 { font-size: 1rem; margin: 0 0 6px; }
.tips-card h2 + .tips-news, .tips-card h2 + .tip-text { margin-top: 0; }
.tips-card .tips-news { margin: 0 0 12px; padding-left: 1.2em; }
.tips-card .tips-news li + li { margin-top: 4px; }
.tips-card .tip-text { margin: 0; }
.tips-card .btns { margin-top: 12px; flex-wrap: wrap; }
.tips-all { list-style: none; margin: 0; padding: 0; }
.tips-all li { display: flex; gap: 10px; align-items: center; padding: 10px 0; }
.tips-all li + li { border-top: 1px solid var(--line-2); }

/* ---------- Messages: "To" and "Who is this for?" (js/mod-messages.js toButton, chooser) ---------- */
.ms-to { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 56px; margin-top: 6px; padding: 10px 14px; border: 1px solid var(--req-line); border-radius: 14px; background: var(--req-bg); text-align: left; cursor: pointer; }
.ms-to:hover { border-color: var(--line-strong); }
.ms-to .grow, .ms-rowbtn .grow { display: flex; flex-direction: column; min-width: 0; }
.ms-to b, .ms-rowbtn b { font-weight: 600; overflow-wrap: anywhere; }
.ms-to small, .ms-aud small { color: var(--muted); font-size: 13px; font-weight: 400; }
.ms-to-change { color: var(--accent-ink); font-weight: 600; font-size: 14px; flex: 0 0 auto; }
.ms-ico, .ms-ini { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; font-size: 13px; font-weight: 700; letter-spacing: .02em; }
.ms-ico { border-radius: 11px; }
.ms-ico.k-office { background: #E3ECF7; color: #2D5A8C; } .ms-ico.k-people { background: #EDE6F5; color: #5B3F86; }
.ms-ico.k-staff { background: var(--ok-soft); color: var(--ok); } .ms-ico.k-partners { background: #F5ECD9; color: #7A5300; }
.ms-choose { display: flex; flex-direction: column; gap: 18px; }
.ms-find-to { display: flex; align-items: center; gap: 10px; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); color: var(--muted); }
.ms-find-to input { flex: 1; border: 0; outline: 0; background: transparent; font-size: 15px; color: var(--ink); min-width: 0; }
.ms-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.ms-aud { position: relative; border: 1px solid var(--line); background: var(--surface); color: var(--ink); cursor: pointer; text-align: left; }
.ms-aud:hover { border-color: var(--line-strong); }
.ms-card { display: flex; flex-direction: column; gap: 8px; padding: 14px; border-radius: 16px; min-height: 120px; }
.ms-card b { font-size: 15px; font-weight: 600; }
.ms-card small { margin-top: -4px; }
.ms-sec h3 { margin: 0 0 8px; font-size: 12.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.ms-sec h3 span { font-weight: 500; }
.ms-rows { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; }
.ms-rowbtn { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 14px; border: 0; border-bottom: 1px solid var(--line-2); border-radius: 0; width: 100%; }
.ms-rowbtn:last-child { border-bottom: 0; }
.ms-tick { display: none; width: 22px; height: 22px; border-radius: 50%; background: var(--ok); color: #fff; align-items: center; justify-content: center; flex: 0 0 auto; }
.ms-card .ms-tick { position: absolute; top: 12px; right: 12px; }
.ms-aud.on { background: var(--ok-soft); }
.ms-card.on { border: 2px solid var(--ok); padding: 13px; }
.ms-aud.on .ms-tick { display: inline-flex; }
.ms-aud[hidden], .ms-sec[hidden], .ms-cards[hidden] { display: none; }
@media (max-width: 640px) { .ms-cards { grid-template-columns: 1fr 1fr; } }

/* ---------- Gentle movement (js/app.js): short, soft and quiet, so Church & Trellis feels alive without getting in the way ---------- */
:root { --ease-out: cubic-bezier(.22, 1, .36, 1); --ease-spring: cubic-bezier(.2, 1.3, .4, 1); }
/* A new page eases in */
.page-body.page-in { animation: page-in .24s ease-out both; }   /* fading only: nothing moves under a finger about to tap */
@keyframes page-in { from { opacity: 0; } to { opacity: 1; } }
/* Pop-up windows: the shade fades in, the window rises and settles; closing fades it away */
.overlay { animation: shade-in .2s ease-out both; }
.overlay .dialog { animation: dialog-in .28s var(--ease-out) both; }
.overlay.again, .overlay.again .dialog { animation: none; }
.overlay.leaving { animation: shade-out .2s ease-in both; pointer-events: none; z-index: 49; }
.overlay.leaving .dialog { animation: dialog-out .2s ease-in both; }
@keyframes shade-in { from { background: rgba(29, 27, 25, 0); } }
@keyframes shade-out { to { background: rgba(29, 27, 25, 0); } }
@keyframes dialog-in { from { opacity: 0; transform: translateY(14px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes dialog-out { to { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (max-width: 860px) { @keyframes dialog-in { from { opacity: 0; transform: translateY(32px); } to { opacity: 1; transform: none; } } }
/* A section that folds open slides its contents in */
details.unfold > :not(summary) { animation: unfold .26s var(--ease-out) both; }
@keyframes unfold { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
/* A message that has just arrived glides into the conversation */
.msg.arrive { animation: msg-arrive .42s var(--ease-spring) both; transform-origin: left bottom; }
.msg.out.arrive { transform-origin: right bottom; }
@keyframes msg-arrive { from { opacity: 0; transform: translateY(14px) scale(.96); } to { opacity: 1; transform: none; } }
/* "Saved": a small green tick draws itself in the message at the bottom */
.toast { display: flex; align-items: center; gap: 10px; }
.toast.show { transition: transform .32s var(--ease-spring), opacity .2s; }
.toast-tick { width: 22px; height: 22px; flex: none; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.toast-tick circle { fill: #1F8A4C; stroke: none; transform-origin: center; animation: tick-ring .3s var(--ease-spring) both; }
.toast-tick path { stroke: #fff; stroke-width: 2.6; stroke-dasharray: 16; stroke-dashoffset: 16; animation: tick-draw .3s .15s ease-out forwards; }
@keyframes tick-ring { from { transform: scale(.3); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes tick-draw { to { stroke-dashoffset: 0; } }
/* People who have asked their phone for less motion get none of this */
@media (prefers-reduced-motion: reduce) {
  .page-body.page-in, .overlay, .overlay .dialog, details.unfold > :not(summary), .msg.arrive, .toast-tick circle { animation: none; }
  .toast-tick path { animation: none; stroke-dashoffset: 0; }
  .toast.show { transition: opacity .2s; }
}

/* Holy Communion: the chip under each date in the roster, the panel under Rosters → Services */
.comm-chip { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 2px 9px; border-radius: 999px; border: 1px dashed var(--line); background: transparent; color: var(--muted); font: inherit; font-size: 11.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.comm-chip.on { border: 1px solid #C2414F; background: #FBE6E8; color: #8A1D2C; }
.comm-chip[disabled] { cursor: default; }
.comm-chip:not([disabled]):hover { border-color: #C2414F; }
.comm-panel h2 { display: flex; align-items: center; gap: 8px; }
.comm-next { margin: 12px 0 0; font-weight: 600; color: var(--svc-ink, var(--ink)); }
.comm-roles { margin-top: 10px; }
.comm-roles summary { cursor: pointer; color: var(--muted); font-size: 13.5px; }
.comm-mark { display: inline-flex; color: #C2414F; margin-left: 2px; }
.btn.choice.on { border-color: var(--accent); background: var(--accent-soft); }
.btn.choice b { display: inline-flex; align-items: center; gap: 6px; }
html[data-mode=dark] .comm-chip.on { background: #4A1F26; color: #F4B9C0; border-color: #C2414F; }

/* ---------- Subscription: a coffee a month, and the prayer circle (js/mod-support.js) ---------- */
.sp-tabs { margin-bottom: 20px; }
.sp-hero { display: grid; grid-template-columns: 170px 1fr; gap: 26px; align-items: center; padding: 26px 30px; margin-bottom: 26px; border-radius: 22px; color: #3B2414;
  background: radial-gradient(120% 140% at 0% 0%, #FFF8EE 0%, #F6E6D2 55%, #EBCFAE 100%); border: 1px solid #EAD6BD; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.sp-hero::after { content: ''; position: absolute; right: -60px; bottom: -80px; width: 260px; height: 260px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.55), transparent 70%); pointer-events: none; }
.sp-hero-cup { width: 170px; height: auto; color: #A57A55; display: block; }
.sp-steam path { animation: sp-steam 3.2s ease-in-out infinite; transform-box: fill-box; }
.sp-steam path:nth-child(2) { animation-delay: .7s; } .sp-steam path:nth-child(3) { animation-delay: 1.4s; }
@keyframes sp-steam { 0% { opacity: 0; transform: translateY(8px); } 40% { opacity: .9; } 100% { opacity: 0; transform: translateY(-10px); } }
.sp-kicker { margin: 0 0 6px; font-size: 12.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
.sp-hero .sp-kicker { color: #9A5A22; }
.sp-hero h2 { margin: 0 0 10px; font-size: 24px; line-height: 1.25; letter-spacing: -.01em; font-family: Georgia, 'Times New Roman', serif; font-weight: 600; max-width: 34ch; }
.sp-hero p { margin: 0; max-width: 62ch; color: #5A3B24; }
.sp-hero p.sp-hero-more { margin-top: 10px; }
.sp-chip { display: inline-flex !important; align-items: center; gap: 6px; margin-top: 12px !important; padding: 6px 12px; border-radius: 999px; background: rgba(255,255,255,.7); font-weight: 600; font-size: 13.5px; }
.sp-step { margin-bottom: 28px; }
.sp-step-h { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 14px; }
.sp-step-h > div:nth-child(2) { flex: 1; min-width: 220px; }
.sp-step-h h2 { margin: 2px 0 2px; font-size: 18px; } .sp-step-h p { margin: 0; color: var(--muted); font-size: 14px; }
.sp-n { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--accent-on, #fff); font-weight: 700; font-size: 14px; }
.sp-cur { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.sp-cups { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
.sp-cup { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px 10px 14px; border-radius: 18px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; text-align: center; transition: transform .18s ease, box-shadow .18s ease, border-color .18s; }
.sp-cup:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(60,35,15,.10); }
.sp-cup .cup-art { margin-bottom: 6px; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
.sp-cup.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 10px 24px rgba(60,35,15,.12); }
.sp-cup.on .cup-art { transform: rotate(-14deg) scale(1.06); }
.sp-cup b { font-size: 14.5px; } .sp-cup small { color: var(--muted); font-size: 12px; line-height: 1.3; min-height: 2.6em; }
.sp-price { margin-top: 4px; font-weight: 700; font-size: 16px; color: var(--accent-ink); }
.sp-world { margin-top: 12px; } .sp-world summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--accent-ink); }
.sp-table-wrap { overflow-x: auto; margin-top: 10px; }
.sp-table { border-collapse: collapse; width: 100%; font-size: 14px; background: var(--surface); border-radius: 12px; overflow: hidden; }
.sp-table th, .sp-table td { padding: 9px 12px; text-align: left; border-bottom: 1px solid var(--line-2); } .sp-table th { font-size: 12.5px; color: var(--muted); }
.sp-table td + td, .sp-table th + th { text-align: right; } .sp-table tr.on td { background: var(--accent-soft); font-weight: 600; }
.sp-plans { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.sp-plan { position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 4px; padding: 20px 18px 18px; border-radius: 20px; border: 1.5px solid var(--line); background: var(--surface); text-align: left; cursor: pointer; transition: transform .18s, box-shadow .18s, border-color .18s; }
.sp-plan:hover { transform: translateY(-2px); box-shadow: 0 8px 22px rgba(60,35,15,.10); }
.sp-plan.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), 0 12px 28px rgba(60,35,15,.12); }
.sp-plan-pray { background: linear-gradient(160deg, var(--surface) 40%, #F1ECFB); }
.sp-ribbon { position: absolute; top: -11px; right: 16px; box-shadow: 0 2px 6px rgba(0,0,0,.15); padding: 4px 10px; border-radius: 999px; background: #2E7D4F; color: #fff; font-size: 12px; font-weight: 700; }
.sp-plan-cups { display: flex; flex-wrap: wrap; gap: 4px; min-height: 26px; align-items: center; color: #6D3FC0; margin-bottom: 6px; }
.sp-plan-cups i { width: 14px; height: 16px; border-radius: 2px 2px 6px 6px; background: linear-gradient(#C9935F 0 30%, #F1E4D0 30%); box-shadow: inset 0 0 0 1.5px #A57A55; position: relative; }
.sp-plan-cups i::after { content: ''; position: absolute; right: -5px; top: 4px; width: 5px; height: 7px; border: 1.5px solid #A57A55; border-left: 0; border-radius: 0 4px 4px 0; }
.sp-big { font-size: 30px; font-weight: 800; letter-spacing: -.02em; line-height: 1.1; } .sp-big small { font-size: 14px; font-weight: 600; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.sp-plan b { font-size: 15px; } .sp-sub { color: var(--muted); font-size: 13.5px; }
.sp-gift { display: flex; flex-wrap: wrap; gap: 18px; align-items: flex-end; }
.sp-gift-cups { display: flex; gap: 8px; flex-wrap: wrap; }
.sp-gc { width: 56px; height: 66px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; font-weight: 700; color: var(--muted); }
.sp-gc small { font-size: 12.5px; }
.sp-gc-cup { width: 20px; height: 22px; border-radius: 2px 2px 8px 8px; box-shadow: inset 0 0 0 1.5px var(--line-strong); background: transparent; transition: background .25s; position: relative; }
.sp-gc.full .sp-gc-cup { background: linear-gradient(#C9935F 0 28%, #F1E4D0 28%); box-shadow: inset 0 0 0 1.5px #A57A55; }
.sp-gc.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); color: var(--accent-ink); }
.sp-other { margin: 0; min-width: 170px; } .sp-money { display: flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); overflow: hidden; }
.sp-money span { padding: 0 10px; color: var(--muted); font-weight: 700; } .sp-money input { border: 0; padding: 11px 10px 11px 0; width: 120px; background: transparent; outline: none; font-weight: 600; }
.sp-who { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; max-width: 620px; }
.sp-whob { display: grid; grid-template-columns: auto 1fr; grid-template-rows: auto auto; column-gap: 12px; align-items: center; text-align: left; padding: 14px 16px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink); }
.sp-whob svg { grid-row: span 2; color: var(--accent); } .sp-whob small { color: var(--muted); }
.sp-whob.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sp-others { margin-top: 14px; }
.sp-total { position: sticky; bottom: 12px; z-index: 3; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 16px 20px; border-radius: 18px;
  background: color-mix(in srgb, var(--surface) 88%, transparent); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid var(--line); box-shadow: 0 10px 30px rgba(40,25,10,.14); }
.sp-total > div { display: flex; flex-direction: column; gap: 2px; } .sp-total small { color: var(--muted); }
.sp-total-n { font-size: 26px; font-weight: 800; letter-spacing: -.02em; } .sp-total-n small { font-size: 14px; font-weight: 600; margin-left: 6px; }
.sp-total.pray { background: color-mix(in srgb, #F1ECFB 85%, transparent); }
.sp-foot { color: var(--muted); font-size: 13px; text-align: center; margin-top: 18px; }
/* prayer cards */
.pcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 14px; }
.pcard { display: flex; flex-direction: column; border-radius: 18px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.pcard.pick { cursor: pointer; border-width: 1.5px; transition: transform .18s, box-shadow .18s; } .pcard.pick:hover { transform: translateY(-2px); }
.pcard.pick.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.pc-pic { aspect-ratio: 16 / 9; background: var(--line-2); overflow: hidden; } .pc-pic img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pc-ph { display: grid; place-items: center; color: #fff; } .pc-any { background: linear-gradient(135deg, #F5B53B, #E8590C); }
.pc-body { padding: 14px 16px 16px; } .pc-body h3 { margin: 0 0 2px; font-size: 16px; } .pc-body p { margin: 0; color: var(--muted); font-size: 13.5px; }
.pc-place { display: flex; align-items: center; gap: 5px; }
.pc-points { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.pc-points li { position: relative; padding-left: 22px; font-size: 14.5px; line-height: 1.4; }
.pc-points li::before { content: ''; position: absolute; left: 2px; top: 4px; width: 12px; height: 12px; border-radius: 50% 50% 50% 0; transform: rotate(-45deg); background: #F5B53B; box-shadow: 0 0 0 3px rgba(245,181,59,.22); }
.pc-help { display: inline-block; margin-top: 10px; padding: 3px 9px; border-radius: 999px; background: var(--warn-soft); color: var(--warn); font-size: 12px; font-weight: 600; }
.pcard.big { flex-direction: row; } .pcard.big .pc-pic { aspect-ratio: auto; flex: 0 0 42%; min-height: 220px; } .pcard.big .pc-body { padding: 22px 24px; align-self: center; }
.pcard.big h3 { font-size: 22px; font-family: Georgia, 'Times New Roman', serif; font-weight: 600; } .pcard.big .pc-points li { font-size: 16px; }
/* the prayer circle */
.sp-circle-intro { display: grid; grid-template-columns: 140px 1fr; gap: 24px; align-items: center; padding: 26px 28px; margin-bottom: 22px; border-radius: 22px;
  background: radial-gradient(120% 140% at 100% 0%, #F3EEFC 0%, #E7DDF8 60%, #D9CBF3 100%); border: 1px solid #DDD0F2; color: #2B1E46; }
.sp-circle-intro h2 { margin: 0 0 8px; font-size: 22px; font-family: Georgia, 'Times New Roman', serif; font-weight: 600; } .sp-circle-intro p { margin: 0 0 10px; max-width: 64ch; }
.sp-circle-art { color: #6D3FC0; } .sp-dots circle { animation: sp-glow 4s ease-in-out infinite; } .sp-dots circle:nth-child(even) { animation-delay: 2s; }
@keyframes sp-glow { 50% { opacity: .45; } }
.sp-month { margin-bottom: 22px; } .sp-month-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-top: 14px; } .sp-month-foot p { margin: 0; color: var(--muted); max-width: 60ch; }
.sp-amen { display: inline-flex; align-items: center; gap: 6px; margin: 0; color: var(--ok); font-weight: 600; }
.sp-pray-grid { margin-bottom: 18px; } .sp-all summary { cursor: pointer; font-weight: 600; margin-bottom: 12px; }
.sp-home .sp-home-h { display: flex; align-items: center; gap: 8px; color: #6D3FC0; margin-bottom: 10px; } .sp-home .sp-home-h h2 { margin: 0; color: var(--ink); }
.sp-home .pcard { box-shadow: none; } .sp-home .pcard .pc-pic { aspect-ratio: 21 / 9; } .sp-home .btns { margin-top: 12px; }
.sp-nudge { border-left: 4px solid #F5B53B; margin-bottom: 18px; } .sp-nudge .sp-home-h { display: flex; align-items: center; gap: 8px; color: #6D3FC0; margin-bottom: 6px; } .sp-nudge .sp-home-h h2 { margin: 0; color: var(--ink); } .sp-nudge p { margin: 0 0 12px; max-width: 64ch; } .sp-onoff .hint { margin: 8px 0 0; }
/* our prayer card */
.sp-card-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.sp-preview { position: sticky; top: 20px; } .sp-preview .pcard.big { flex-direction: column; } .sp-preview .pcard.big .pc-pic { aspect-ratio: 16 / 9; min-height: 0; }
.sp-hide { padding: 12px 14px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--line); margin-bottom: 14px; }
.sp-photo { display: flex; gap: 14px; align-items: center; margin: 4px 0 10px; } .sp-photo > img, .sp-photo > .pc-pic { width: 120px; height: 90px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; aspect-ratio: auto; }
.sp-photo p { margin: 2px 0 8px; } .sp-photo .pc-ph svg { width: 40px; height: 40px; }
.sp-point textarea { resize: vertical; } .sp-point textarea.sp-flag { border-color: var(--warn); box-shadow: 0 0 0 3px var(--warn-soft); }
.sp-count { display: flex; justify-content: space-between; gap: 10px; font-weight: 500; color: var(--muted); font-size: 12.5px; } .sp-warn { color: var(--warn); font-weight: 600; }
/* dialogs */
.sp-promise-dlg, .sp-thanks { text-align: center; } .sp-promise-dlg .check, .sp-thanks .btns, .sp-promise-dlg .btns { justify-content: center; text-align: left; }
.sp-promise-art { color: #6D3FC0; display: flex; justify-content: center; } .sp-vow { font-family: Georgia, 'Times New Roman', serif; font-size: 18px; line-height: 1.45; margin: 8px auto 6px; max-width: 40ch; }
.sp-thanks-art { display: flex; justify-content: center; margin: 4px 0 6px; } .sp-thanks-art .cup-art { animation: sp-turn 1.2s cubic-bezier(.2,.8,.2,1) both; }
@keyframes sp-turn { from { transform: rotate(-90deg) scale(.6); opacity: 0; } }
.sp-pay-big { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin: 2px 0 0; font-variant-numeric: tabular-nums; } .sp-pay-big small { font-size: 15px; font-weight: 600; color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.sp-ways { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin: 14px 0 6px; }
.sp-ways span { padding: 5px 12px; border-radius: 999px; background: var(--surface-2, #F6F1EA); border: 1px solid var(--line); font-size: 13px; font-weight: 600; }
.sp-pending { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; border-left: 4px solid var(--accent); } .sp-pending .btns { margin: 0; }
.sp-thanks-page .btns { margin-top: 14px; } .sp-thanks-page .sp-kicker { font-size: 15px; }
@media (max-width: 860px) {
  .sp-hero { grid-template-columns: 1fr; text-align: center; padding: 22px 18px; } .sp-hero-art { display: flex; justify-content: center; } .sp-hero-cup { width: 130px; }
  .sp-hero h2 { font-size: 20px; margin-left: auto; margin-right: auto; } .sp-hero p { margin: 0 auto; }
  .sp-cups { grid-template-columns: none; grid-auto-flow: column; grid-auto-columns: 42%; overflow-x: auto; scroll-snap-type: x mandatory; padding: 4px 2px 10px; }
  .sp-cup { scroll-snap-align: start; }
  .sp-plans, .sp-who, .sp-card-grid { grid-template-columns: 1fr; }
  .sp-total { bottom: 78px; } .sp-total .btn { width: 100%; }
  .sp-circle-intro { grid-template-columns: 1fr; text-align: center; } .sp-circle-art { display: flex; justify-content: center; }
  .pcard.big { flex-direction: column; } .pcard.big .pc-pic { aspect-ratio: 16 / 9; min-height: 0; } .sp-preview { position: static; }
}
@media (prefers-reduced-motion: reduce) { .sp-steam path, .sp-dots circle, .sp-thanks-art .cup-art { animation: none; } .sp-cup, .sp-plan, .pcard.pick, .sp-cup .cup-art { transition: none; } }
html[data-mode=dark] .sp-hero { background: radial-gradient(120% 140% at 0% 0%, #3A2A1C 0%, #2C2017 60%, #22180F 100%); border-color: #4A3626; color: #F3E6D6; }
html[data-mode=dark] .sp-hero p, html[data-mode=dark] .sp-hero .sp-kicker { color: #D9C2A6; } html[data-mode=dark] .sp-chip { background: rgba(255,255,255,.08); }
html[data-mode=dark] .sp-circle-intro { background: radial-gradient(120% 140% at 100% 0%, #2B2340 0%, #221B33 70%); border-color: #3B3058; color: #E7DEF7; }
html[data-mode=dark] .sp-circle-art, html[data-mode=dark] .sp-promise-art, html[data-mode=dark] .sp-home .sp-home-h { color: #B9A0F0; }
html[data-mode=dark] .sp-plan-pray { background: linear-gradient(160deg, var(--surface) 40%, #2A2340); } html[data-mode=dark] .sp-total.pray { background: color-mix(in srgb, #2A2340 85%, transparent); }
html[data-mode=dark] .sp-plan-cups { color: #B9A0F0; }
/* Subscription: "Your subscription" (next payment, gift coffees, payment holiday), on the page and on Home */
.sp-status { padding: 20px 22px; margin-bottom: 26px; border-radius: 22px; background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow); }
.sp-status.compact { margin-bottom: 16px; padding: 16px 18px; }
.sp-status-top { display: flex; gap: 16px; align-items: center; margin-bottom: 12px; } .sp-status h2 { margin: 0; font-size: 19px; line-height: 1.3; } .sp-status.compact h2 { font-size: 16px; }
.sp-status .sp-kicker { margin-bottom: 2px; } .sp-status-amt { margin: 4px 0 0; color: var(--muted); font-weight: 600; }
.sp-st-soon { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: linear-gradient(135deg, var(--surface) 60%, var(--accent-soft)); }
.sp-st-due, .sp-st-late { border-color: #E2B65A; background: linear-gradient(135deg, var(--surface) 55%, var(--warn-soft)); }
.sp-st-holiday { background: linear-gradient(135deg, var(--surface) 55%, #E5F1FB); }
.sp-quick { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 12px; font-weight: 600; font-size: 13.5px; color: var(--muted); }
.sp-qg { display: inline-flex; align-items: center; gap: 6px; min-height: 38px; padding: 0 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; color: var(--ink); cursor: pointer; transition: transform .15s; }
.sp-qg small { color: var(--muted); font-weight: 600; } .sp-qg:active { transform: scale(.96); }
.sp-qg.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent-ink); } .sp-qg.on .sp-gc-cup { background: linear-gradient(#C9935F 0 28%, #F1E4D0 28%); box-shadow: inset 0 0 0 1.5px #A57A55; }
.sp-qg .sp-gc-cup { width: 14px; height: 16px; }
.sp-hol-left { margin: 10px 0 0; }
.sp-hol { text-align: center; } .sp-hol .btns { justify-content: center; } .sp-hol .field { text-align: left; }
.sp-hol-art { position: relative; display: inline-block; margin: 4px 0; }
.sp-zz { position: absolute; top: -6px; right: -18px; font-weight: 800; color: #5B8FC7; font-size: 18px; } .sp-zz span { font-size: .8em; margin-left: 2px; position: relative; top: -8px; }
.sp-zz, .sp-zz span { animation: sp-doze 2.4s ease-in-out infinite; } .sp-zz span:last-child { animation-delay: .6s; }
@keyframes sp-doze { 50% { opacity: .35; transform: translateY(-3px); } }
.sp-giftgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; margin: 12px 0 16px; }
.sp-gg { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 12px 4px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); cursor: pointer; color: var(--ink); transition: transform .15s, border-color .15s; }
.sp-gg:hover { transform: translateY(-2px); border-color: var(--accent); } .sp-gg small { color: var(--muted); } .sp-gg .sp-gc-cup { background: linear-gradient(#C9935F 0 28%, #F1E4D0 28%); box-shadow: inset 0 0 0 1.5px #A57A55; }
.sp-thanks .sp-other { display: inline-flex; text-align: left; }
@media (max-width: 860px) { .sp-giftgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } .sp-status .btns .btn { flex: 1 1 auto; } }
@media (prefers-reduced-motion: reduce) { .sp-zz, .sp-zz span { animation: none; } }
html[data-mode=dark] .sp-st-holiday { background: linear-gradient(135deg, var(--surface) 55%, #1B2636); }
.sp-more > summary { cursor: pointer; font-weight: 700; font-size: 15px; padding: 12px 16px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); margin-bottom: 18px; list-style-position: inside; }
.sp-more[open] > summary { margin-bottom: 22px; }
@media (min-width: 861px) { .sp-total { margin-right: 52px; } }
/* Subscription: one cup where you live – three kinds of cup, then the price in the church's own money */
.sp-cups.sp-kinds { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.sp-cupprice { margin: 16px 0 4px; max-width: 260px; } .sp-cupprice .sp-money input { width: 100%; font-size: 18px; }
.sp-photo-btns { margin: 0; gap: 8px; } .sp-photo-btns .btn { gap: 6px; }
@media (max-width: 860px) { .sp-cups.sp-kinds { grid-auto-columns: 62%; } }

/* Rosters: "Go to a date" beside Earlier / Later (the date box from js/datebox.js: type a date or tap its calendar) */
.ro-date { display: inline-flex; width: 190px; }
.ro-date .date-typed { width: 100%; }
.ro-date .date-typed { gap: 6px; }
.ro-date .date-text { min-height: 44px; width: 100%; padding: 0 12px; border: 1px solid var(--line-strong); border-radius: 12px; background: var(--surface); color: var(--ink); font: inherit; font-weight: 600; font-size: 14.5px; }
/* Archives: folders, Year → Month, and the summary before saving */
.ar-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 14px; font-size: 14px; color: var(--muted); }
.ar-crumbs button { background: none; border: 0; padding: 4px 2px; font: inherit; font-weight: 600; color: var(--accent, var(--ink)); cursor: pointer; border-radius: 6px; }
.ar-crumbs button:hover { text-decoration: underline; } .ar-crumbs button[aria-current] { color: var(--ink); cursor: default; text-decoration: none; }
.ar-tiles { margin-bottom: 14px; }
button.appcard.ar-folder { font: inherit; text-align: left; cursor: pointer; align-items: flex-start; }
.ar-folder .tag { margin-top: auto; display: inline-flex; align-items: center; gap: 4px; }
.ar-docs { margin-top: 4px; }
.ar-where { margin: -4px 0 12px; min-height: 1em; }
.ar-check-h { font-size: 16px; margin: 4px 0 10px; }
.ar-plan { margin: 0 0 14px; padding-left: 20px; display: grid; gap: 6px; }
.ar-warn { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; } .ar-warn > span { flex: 1 1 240px; }
.ar-noask { margin-top: 6px; border-top: 1px solid var(--line); padding-top: 12px; }
.btn.ar-del { color: var(--bad); }
.ar-folder .ar-sub { color: var(--muted); font-size: 13px; }
.ar-folder .tag { max-width: 100%; white-space: normal; text-align: left; line-height: 1.3; }
.ar-folder .ic { transition: transform .2s var(--ease-spring, ease); } .ar-folder:hover .ic { transform: scale(1.06) rotate(-3deg); }
/* Midweek Groups online: this week's links (js/mod-life.js) */
.st-block { margin: 10px 0 4px; }
.st-next { padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, #3E7D5A 8%, var(--surface)); border: 1px solid color-mix(in srgb, #3E7D5A 18%, var(--line)); margin-bottom: 8px; }
.st-next .btns { margin-top: 8px; }
.st-links { flex-wrap: wrap; align-items: center; }
.st-links .btn.primary { animation: st-glow 2s ease-in-out infinite; }
@keyframes st-glow { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, #3E7D5A 35%, transparent); } 50% { box-shadow: 0 0 0 6px transparent; } }
@media (prefers-reduced-motion: reduce) { .st-links .btn.primary { animation: none; } }
.st-check { display: block; width: 100%; font-size: 12px; }
.st-past summary { cursor: pointer; font-weight: 600; font-size: 14px; margin: 6px 0; }
.st-home { background: linear-gradient(135deg, color-mix(in srgb, #3E7D5A 14%, var(--surface)), var(--surface) 70%); border-color: color-mix(in srgb, #3E7D5A 25%, var(--line)); }
.st-home .btns { margin-top: 10px; }
.st-open { margin: 6px 0 10px; }
#st-body small.ok { color: #1F8A4C; } #st-body small.bad { color: var(--bad); }
/* Settings → Access and roles (js/mod-settings.js renderAccessPage) */
.acc-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.acc-jump button { border: 1px solid var(--line); background: var(--surface); color: inherit; border-radius: 999px; padding: 6px 12px; font: inherit; font-size: 13px; font-weight: 600; cursor: pointer; }
.acc-jump button:hover { border-color: var(--a, #E8590C); color: var(--a, #E8590C); }
.acc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.acc-card { --c: #6B625A; border: 1px solid color-mix(in srgb, var(--c) 22%, var(--line)); border-radius: 16px; padding: 14px 14px 10px; background: linear-gradient(160deg, color-mix(in srgb, var(--c) 9%, var(--surface)), var(--surface) 55%); display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease; }
.acc-card:hover { transform: translateY(-2px); box-shadow: 0 8px 22px -14px color-mix(in srgb, var(--c) 60%, transparent); }
@media (prefers-reduced-motion: reduce) { .acc-card, .acc-card:hover { transition: none; transform: none; } }
.acc-card header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.acc-card header b { flex: 1; font-size: 15px; }
.acc-ic { width: 30px; height: 30px; border-radius: 10px; display: inline-grid; place-items: center; color: var(--c); background: color-mix(in srgb, var(--c) 15%, var(--surface)); }
.acc-n { font-weight: 700; color: var(--muted); }
.acc-h { margin: 8px 0 2px; font-size: 11px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: color-mix(in srgb, var(--c) 75%, var(--muted)); }
.acc-lines { margin: 0; padding-left: 18px; font-size: 13.5px; line-height: 1.45; }
.acc-lines li { margin: 2px 0; }
.acc-act { display: flex; gap: 6px; margin-top: auto; padding-top: 10px; flex-wrap: wrap; }
.acc-job .btn { white-space: nowrap; }
@media (max-width: 600px) { .acc-job { flex-wrap: wrap; } .acc-job .btn { margin-left: auto; } }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 2px; }   /* names in a serving group, each opening the person's page */
