/* DBWS Membership and Society Management System
 *
 * Mobile-first (proposal section 8).  The brand follows the DBWS membership
 * application in use today, as proposal section 3 asks: the Dawoodi Bohra
 * Welfare Society logo (legacy Content/images/dbws_logo_new_300_165.webp) and the
 * colours of its stylesheets -- deep green #1e4e46, the logo's teal #00a498,
 * mint #26c699, cream #f9f5e8 for the toolbar, #00715d behind the sign-in
 * page, and red #f9243f for alerts.
 *
 * Two brand colours are too light to carry text on white: mint (about 2.2:1)
 * and the red (about 3.9:1).  They are kept for stripes, borders and tints,
 * and a darker shade of the same hue carries the text.  Every value is a
 * token below.
 */

:root {
  /* --- Brand --------------------------------------------------------------- */
  --dbws-green:        #1e4e46;   /* primary: buttons, links, focus ring */
  --dbws-green-dark:   #153832;   /* hover */
  --dbws-teal:         #00a498;   /* the logo's teal: accents, underlines */
  --dbws-mint:         #26c699;   /* decorative only */
  --dbws-cream:        #f9f5e8;   /* navigation bar, as the legacy toolbar */
  --dbws-signin:       #00715d;   /* behind the sign-in card, as the legacy login */
  --dbws-tint:         #e3f4f1;   /* chips and highlights */

  /* --- Neutrals, biased faintly toward the green ---------------------------- */
  --dbws-ink:          #1b2624;
  --dbws-ink-muted:    #56655f;
  --dbws-page:         #f4f7f6;
  --dbws-surface:      #ffffff;
  --dbws-rule:         #d8e2df;

  /* --- State --------------------------------------------------------------- */
  --dbws-danger:       #c41a32;   /* text: the brand red darkened to pass contrast */
  --dbws-danger-edge:  #f9243f;   /* the brand red itself, for borders */
  --dbws-danger-tint:  #fde6e9;
  --dbws-success:      #1f6b3f;
  --dbws-success-tint: #dff0e6;
  --dbws-warning:      #8a6a22;
  --dbws-warning-tint: #f6edd4;

  /* --- Type ----------------------------------------------------------------
   * Glacial Indifference is the legacy heading face.  Its font files are not
   * in either repository, so -- exactly as in the legacy application -- it
   * renders where it is installed and otherwise falls back.  Supplying the
   * .woff2 files and adding an @font-face rule makes it universal.          */
  --dbws-font:         system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --dbws-font-display: "Glacial Indifference", Helvetica, Arial, sans-serif;

  --dbws-radius: 6px;
  --dbws-pill:   999px;   /* the legacy buttons are fully rounded */
  --dbws-gap:    16px;
}

* { box-sizing: border-box; }
/* iOS Safari otherwise inflates text when a phone is turned to landscape (19 September 2026). */
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
/* Form controls do not inherit the page's font on their own. */
input, select, textarea, button { font-family: inherit; }
[hidden] { display: none !important; }

body {
  margin: 0;
  font-family: var(--dbws-font);
  font-size: 16px;
  line-height: 1.5;
  color: var(--dbws-ink);
  background: var(--dbws-page);
}

h1, h2 { font-family: var(--dbws-font-display); text-wrap: balance; }
h1 { font-size: 1.6rem; margin: 0 0 4px; color: var(--dbws-green); letter-spacing: -0.005em; }
h2 { font-size: 1.05rem; margin: 0 0 12px; }

a { color: var(--dbws-green); }
:focus-visible { outline: 3px solid var(--dbws-green); outline-offset: 2px; }

/* --- Header ---------------------------------------------------------------- */

.masthead {
  background: var(--dbws-surface);
  border-bottom: 4px solid var(--dbws-teal);
  padding: 10px 16px;
}
.masthead__inner {
  max-width: 1120px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}
.masthead__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-right: auto;
  text-decoration: none;
}
.masthead__brand img { height: 52px; width: auto; display: block; }
.masthead__product {
  font-family: var(--dbws-font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--dbws-green);
  padding-left: 12px;
  border-left: 1px solid var(--dbws-rule);
}
@media (min-width: 720px) { .masthead__brand img { height: 64px; } }

.masthead__user { display: flex; flex-direction: column; line-height: 1.25; font-size: 0.88rem; }
.masthead__role { font-size: 0.75rem; color: var(--dbws-ink-muted); }

/* Organisation switcher (section 4.1 context switching) */
.org-switch { display: flex; gap: 8px; align-items: center; }
.org-switch select {
  font: inherit;
  font-size: 0.9rem;
  padding: 7px 10px;
  min-height: 40px;
  border-radius: var(--dbws-radius);
  border: 1px solid var(--dbws-rule);
  background: var(--dbws-surface);
  color: var(--dbws-ink);
  min-width: 190px;
  max-width: 100%;
}

/* --- Primary navigation ---------------------------------------------------- */

.primary-nav { background: var(--dbws-cream); border-bottom: 1px solid var(--dbws-rule); position: relative; z-index: 20; }
/* A few links wrap onto a second row rather than scrolling out of sight. */
.primary-nav__list {
  max-width: 1120px; margin: 0 auto; padding: 0 8px;
  list-style: none; display: flex; flex-wrap: wrap; column-gap: 2px;
}
.primary-nav__link, .primary-nav__top {
  display: flex; align-items: center; gap: 6px; padding: 12px; min-height: 44px;
  font: inherit; font-weight: 600; font-size: 0.92rem; white-space: nowrap;
  color: var(--dbws-ink-muted); text-decoration: none;
  background: none; border: 0; border-bottom: 3px solid transparent; border-radius: 0; cursor: pointer;
}
.primary-nav__link:hover, .primary-nav__top:hover { color: var(--dbws-green); }
.primary-nav__link[aria-current="page"], .primary-nav__top.is-current { color: var(--dbws-green); border-bottom-color: var(--dbws-teal); }
.primary-nav__admin { margin-left: auto; }

/* Grouped menus (DBWS, 16 September 2026): the links inside each menu */
.primary-nav__menu { list-style: none; margin: 0; padding: 0; }
.primary-nav__menu a {
  display: block; padding: 9px 12px; border-radius: 4px;
  color: var(--dbws-ink); text-decoration: none; font-size: 0.92rem; font-weight: 500;
}
.primary-nav__menu a small { display: block; color: var(--dbws-ink-muted); font-weight: 400; font-size: 0.78rem; line-height: 1.35; }
.primary-nav__menu a:hover { background: var(--dbws-tint); color: var(--dbws-green-dark); }
.primary-nav__menu a[aria-current="page"] { background: var(--dbws-tint); color: var(--dbws-green); font-weight: 700; }
.primary-nav__divided { border-top: 1px solid var(--dbws-rule); margin-top: 6px; padding-top: 6px; }
.primary-nav__chevron { transition: transform 0.15s; }
.primary-nav__top[aria-expanded="true"] .primary-nav__chevron { transform: rotate(180deg); }

/* Phone and small tablet: one Menu button; inside, each group is a heading over its links. */
.primary-nav__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; max-width: 1120px; margin: 0 auto; padding: 0 12px; }
.primary-nav__trail { font-size: 0.88rem; font-weight: 600; color: var(--dbws-green); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.primary-nav__toggle {
  display: inline-flex; align-items: center; gap: 8px; flex: none; margin: 6px 0; min-height: 40px;
  font: inherit; font-weight: 700; font-size: 0.9rem; color: #fff; background: var(--dbws-green);
  border: 0; border-radius: var(--dbws-pill); padding: 8px 16px; cursor: pointer;
}
.primary-nav__toggle:hover { background: var(--dbws-green-dark); }
@media (max-width: 859px) {
  .primary-nav--grouped .primary-nav__list {
    display: block; padding: 4px 16px 14px; background: var(--dbws-surface); border-top: 1px solid var(--dbws-rule);
  }
  .js-nav.primary-nav--grouped:not(.is-open) .primary-nav__list { display: none; }
  .primary-nav--grouped .primary-nav__link { padding: 10px 0; border-bottom: 1px solid var(--dbws-page); }
  .primary-nav--grouped .primary-nav__link[aria-current="page"] { border-bottom-color: var(--dbws-page); }
  .primary-nav--grouped .primary-nav__top {
    pointer-events: none; padding: 14px 0 2px; min-height: 0; border: 0;
    font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--dbws-teal);
  }
  .primary-nav--grouped .primary-nav__chevron { display: none; }
  .primary-nav--grouped .primary-nav__menu { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); column-gap: 12px; }
  .primary-nav--grouped .primary-nav__menu a { padding: 10px 0; min-height: 44px; border-radius: 0; border-bottom: 1px solid var(--dbws-page); }
  .primary-nav--grouped .primary-nav__menu a small { display: none; }
  .primary-nav--grouped .primary-nav__menu a[aria-current="page"] { background: none; }
  .primary-nav--grouped .primary-nav__divided { border-top: 0; margin-top: 0; padding-top: 0; }
  .primary-nav--grouped .primary-nav__admin { margin-left: 0; }
}
/* Computer: one row of menus, each opening below its heading. */
@media (min-width: 860px) {
  .primary-nav__bar { display: none; }
  .primary-nav--grouped .primary-nav__list { flex-wrap: nowrap; }
  .primary-nav__group { position: relative; }
  .primary-nav__menu {
    display: none; position: absolute; top: 100%; left: 0; min-width: 250px; padding: 6px;
    background: var(--dbws-surface); border: 1px solid var(--dbws-rule); border-top: 3px solid var(--dbws-teal);
    border-radius: 0 0 var(--dbws-radius) var(--dbws-radius); box-shadow: 0 10px 28px rgba(21, 56, 50, 0.16);
  }
  .primary-nav__group.is-open .primary-nav__menu,
  .primary-nav:not(.js-nav) .primary-nav__group:focus-within .primary-nav__menu { display: block; }
  .primary-nav__group.is-open .primary-nav__top { color: var(--dbws-green); background: var(--dbws-surface); }
  /* The menus at the right-hand end open leftwards, to stay on the screen. */
  .primary-nav__group:nth-last-child(-n+2) .primary-nav__menu { left: auto; right: 0; }
}
@media (prefers-reduced-motion: reduce) { .primary-nav__chevron { transition: none; } }

/* --- Layout ---------------------------------------------------------------- */

main { max-width: 1120px; margin: 0 auto; padding: 24px 16px 64px; }

.page-sub { color: var(--dbws-ink-muted); margin: 0 0 24px; }
.page-head {
  display: flex; flex-wrap: wrap; justify-content: space-between;
  align-items: flex-start; gap: 12px 24px; margin-bottom: 8px;
}

.panel {
  background: var(--dbws-surface);
  border: 1px solid var(--dbws-rule);
  border-radius: var(--dbws-radius);
  padding: 20px;
  margin-bottom: var(--dbws-gap);
}

.grid { display: grid; gap: var(--dbws-gap); grid-template-columns: minmax(0, 1fr); }
.grid > * { min-width: 0; }
@media (min-width: 720px) { .grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }

.stat { font-size: 2rem; font-weight: 600; line-height: 1.1; }
.stat-label { color: var(--dbws-ink-muted); font-size: 0.85rem; }
.empty { color: var(--dbws-ink-muted); font-size: 0.92rem; margin: 0; }

.kv { display: grid; grid-template-columns: max-content 1fr; gap: 8px 16px; margin: 0; }
.kv dt { color: var(--dbws-ink-muted); font-size: 0.85rem; }
.kv dd { margin: 0; }
.plain-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.plain-list li { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.chip {
  display: inline-block; font-size: 0.75rem; font-weight: 600;
  padding: 2px 10px; border-radius: var(--dbws-pill); white-space: nowrap;
  background: var(--dbws-tint); color: var(--dbws-green);
}
.sub { display: block; font-size: 0.8rem; color: var(--dbws-ink-muted); }
.row-actions { text-align: right; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Filter bars with a visible label over each control. */
.filter-bar--labelled { align-items: flex-end; margin-bottom: 4px; }
.filter { display: flex; flex-direction: column; gap: 4px; }
.filter--grow { flex: 0 1 340px; max-width: 340px; }
.filter--grow input[type="search"] { width: 100%; }
/* A search box over its label is in a column: it must not grow in height (16 September 2026). */
.filter-bar .filter input[type="search"] { flex: 0 0 auto; }
.filter--actions { flex-direction: row; gap: 8px; }
.aside { margin: 16px 0 0; font-size: 0.9rem; }
code { font-family: ui-monospace, Consolas, monospace; font-size: 0.88em; }

/* --- Tables (scroll rather than break the page on a phone) ----------------- */

.table-scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 0.9rem; }
th, td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--dbws-rule); vertical-align: top; }
th { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--dbws-ink-muted); font-weight: 600; }

/* --- Buttons: fully rounded, as the legacy application's -------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center;
  font: inherit; font-weight: 600;
  padding: 10px 22px; min-height: 44px;
  border: 1px solid transparent;
  border-radius: var(--dbws-pill);
  background: var(--dbws-green);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
}
.btn:hover { background: var(--dbws-green-dark); }
.btn--quiet { background: transparent; color: var(--dbws-green); border-color: var(--dbws-teal); }
.btn--quiet:hover { background: var(--dbws-tint); }
.btn--small { padding: 6px 14px; min-height: 36px; font-size: 0.85rem; }
.btn--danger { background: transparent; color: var(--dbws-danger); border-color: var(--dbws-danger-edge); }
.btn--danger:hover { background: var(--dbws-danger-tint); }

.actions, .form-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-actions { margin-top: 8px; }

/* --- Forms ----------------------------------------------------------------- */

.form { max-width: 440px; }
.form label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 4px; }
.form .optional { font-weight: 400; color: var(--dbws-ink-muted); }
.form input[type="text"],
.form input[type="password"],
.form input[type="email"],
.form input[type="tel"],
.form input[type="url"],
.form input[type="number"],
.form select {
  width: 100%;
  font: inherit;
  padding: 10px 12px;             /* 44px touch target, section 8 */
  border: 1px solid var(--dbws-rule);
  border-radius: var(--dbws-radius);
  background: var(--dbws-surface);
  color: var(--dbws-ink);
}
.form input:focus, .form select:focus { border-color: var(--dbws-green); }
.form .field { margin-bottom: var(--dbws-gap); }
.form .helptext { display: block; font-size: 0.82rem; color: var(--dbws-ink-muted); margin-top: 4px; }
.form .errorlist { margin: 6px 0 0; padding-left: 18px; color: var(--dbws-danger); font-size: 0.85rem; }
.form label.check { display: flex; gap: 8px; align-items: flex-start; font-weight: 400; }
.form label.check input { margin-top: 4px; width: 18px; height: 18px; accent-color: var(--dbws-green); }
.form label.check--indent { margin-left: 26px; }
.form .field--error input,
.form .field--error select { border-color: var(--dbws-danger-edge); }

/* --- Filters and paging ---------------------------------------------------- */

.filter-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: var(--dbws-gap); }
.filter-bar label { font-weight: 600; font-size: 0.88rem; }
.filter-bar select,
.filter-bar input[type="date"] {
  font: inherit; padding: 9px 10px; min-height: 44px;
  border: 1px solid var(--dbws-rule); border-radius: var(--dbws-radius);
  background: var(--dbws-surface); color: var(--dbws-ink);
}
/* A member the renewal run has unticked for itself: listed, dimmed, still tickable
   (27 October 2026). */
tr.is-doubtful > td { background: var(--dbws-warning-tint); }

/* A date and a tick sit beside the year on the annual run (24 October 2026). */
.filter-bar .check { display: flex; gap: 8px; align-items: center; font-weight: 400; font-size: 0.88rem; }
.filter-bar .check input { width: 18px; height: 18px; accent-color: var(--dbws-green); }
.filter-bar .errorlist { margin: 4px 0 0; padding-left: 18px; color: var(--dbws-danger); font-size: 0.85rem; }
.pager { display: flex; gap: 16px; align-items: center; justify-content: center; margin-top: var(--dbws-gap); font-size: 0.9rem; }

/* --- Messages -------------------------------------------------------------- */

.messages { list-style: none; margin: 0 0 var(--dbws-gap); padding: 0; }
.messages li {
  padding: 12px 16px;
  border-radius: var(--dbws-radius);
  border: 1px solid var(--dbws-rule);
  border-left-width: 4px;
  background: var(--dbws-surface);   /* readable on the green sign-in backdrop too */
  margin-bottom: 8px;
  font-size: 0.92rem;
}
.messages .success { background: var(--dbws-success-tint); border-color: var(--dbws-success); }
.messages .error   { background: var(--dbws-danger-tint);  border-color: var(--dbws-danger-edge); color: var(--dbws-ink); }
.messages .warning { background: var(--dbws-warning-tint); border-color: var(--dbws-warning); }
.messages .info    { border-color: var(--dbws-teal); }

/* --- Sign-in pages --------------------------------------------------------- */

.page--signin { background: var(--dbws-signin); }
.signin { max-width: 420px; margin: 32px auto; padding: 0 4px; }
.signin .panel { padding: 28px; border: 0; box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18); }
.signin h1 { font-size: 1.3rem; }
.signin__logo { display: block; width: 220px; max-width: 100%; height: auto; margin: 0 auto 20px; }
.signin__footer { text-align: center; color: #fff; font-size: 0.82rem; margin: 16px 0 0; opacity: 0.9; }
.page--signin .messages { max-width: 420px; margin-left: auto; margin-right: auto; }

/* --- Accessibility --------------------------------------------------------- */

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute; left: 8px; top: -48px; z-index: 10;
  background: var(--dbws-surface); color: var(--dbws-green);
  padding: 8px 12px; border-radius: var(--dbws-radius);
}
.skip-link:focus { top: 8px; }

/* --- Membership (Phase 2) -------------------------------------------------- */

.signin--wide { max-width: 720px; }
.form--wide { max-width: 640px; }
.fieldset { border: 0; border-top: 1px solid var(--dbws-rule); margin: 0 0 8px; padding: 16px 0 0; min-width: 0; }
.fieldset legend {
  font-family: var(--dbws-font-display); font-weight: 700; color: var(--dbws-green);
  padding: 0 8px 0 0; font-size: 1rem;
}
.form textarea,
.form input[type="date"] {
  width: 100%; font: inherit; padding: 10px 12px;
  border: 1px solid var(--dbws-rule); border-radius: var(--dbws-radius);
  background: var(--dbws-surface); color: var(--dbws-ink);
}
.form label:has(> input[type="radio"]),
.form label:has(> input[type="checkbox"]) { display: flex; gap: 8px; align-items: center; font-weight: 400; margin: 6px 0; }
/* A list of checkboxes or radios: one to a line, aligned with everything else on the form. */
.form .field > div > div { margin: 2px 0; }
.form .field > div > div > label { text-align: left; }
.form input[type="radio"] { width: 18px; height: 18px; accent-color: var(--dbws-green); }
.filter-bar input[type="search"] {
  /* Tall enough to read and to tap -- 44px is the size of a fingertip (DBWS, 6 October 2026). */
  font: inherit; padding: 11px 12px; min-height: 44px; flex: 1 1 220px; min-width: 0;
  border: 1px solid var(--dbws-rule); border-radius: var(--dbws-radius);
  background: var(--dbws-surface); color: var(--dbws-ink);
}
.filter-bar select, .filter-bar .btn { min-height: 44px; }
.filter-bar input[type="number"], .filter-bar input[type="text"], .filter-bar input[type="date"] {
  font: inherit; padding: 11px 12px; min-height: 44px; min-width: 0;
  border: 1px solid var(--dbws-rule); border-radius: var(--dbws-radius);
  background: var(--dbws-surface); color: var(--dbws-ink);
}
/* Bot trap on the public form: off-screen for people, still in the form for bots. */
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.status {
  display: inline-block; font-size: 0.75rem; font-weight: 600; white-space: nowrap;
  padding: 2px 10px; border-radius: var(--dbws-pill);
  background: #eef1f0; color: var(--dbws-ink-muted);
}
.status--active, .status--approved { background: var(--dbws-success-tint); color: var(--dbws-success); }
.status--submitted { background: var(--dbws-tint); color: var(--dbws-green); }
.status--locally_approved, .status--suspended { background: var(--dbws-warning-tint); color: var(--dbws-warning); }
.status--rejected { background: var(--dbws-danger-tint); color: var(--dbws-danger); }

/* Approval stages: a real sequence, so numbered. */
.stages {
  list-style: none; counter-reset: stage; padding: 0; margin: 0 0 var(--dbws-gap);
  display: flex; flex-wrap: wrap; gap: 8px;
}
.stages li {
  counter-increment: stage; flex: 1 1 140px;
  padding: 10px 12px; font-size: 0.88rem;
  border: 1px solid var(--dbws-rule); border-radius: var(--dbws-radius);
  background: var(--dbws-surface); color: var(--dbws-ink-muted);
}
.stages li::before { content: counter(stage) ". "; font-weight: 700; }
.stages .is-done { border-color: var(--dbws-teal); background: var(--dbws-tint); color: var(--dbws-green); }
.stages .is-current { border: 2px solid var(--dbws-green); color: var(--dbws-ink); font-weight: 600; }
.stages .is-stopped { border-color: var(--dbws-danger-edge); background: var(--dbws-danger-tint); color: var(--dbws-danger); }

.count-line { color: var(--dbws-ink-muted); font-size: 0.88rem; margin: 0 0 8px; }
.note {
  border-left: 4px solid var(--dbws-teal); background: var(--dbws-tint);
  padding: 10px 14px; border-radius: var(--dbws-radius); font-size: 0.92rem;
}
.subhead { margin-top: 16px; font-size: 0.95rem; }

/* --- Family tree (Phase 3) -------------------------------------------------- */

/* The members' directory: a pocket address book on the page (DBWS, 6 October 2026). */
.directory { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 28px; }
.directory__entry { break-inside: avoid; margin: 0 0 16px; padding: 0 0 12px; border-bottom: 1px solid var(--dbws-rule); }
.directory__name { margin: 0 0 2px; font-size: 1rem; }
.directory__address { margin: 0 0 4px; font-size: 0.92rem; color: var(--dbws-ink-muted); }
.directory__address a { margin-left: 6px; }
.directory__people { list-style: none; margin: 0; padding: 0; }
.directory__people li { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: 0.92rem; }
.directory__person { font-weight: 600; }
@media (max-width: 859px) { .directory { columns: 1; } }

.tree-scroll { overflow-x: auto; }
.tree { display: block; margin: 0 auto; max-width: none; }
/* A family is wider than a page of text: the tree gets the window, up to a point. */
.page--tree main { max-width: 1760px; }
/* Scaled to fit: the viewBox does the work, and the inline max-width stops a small tree growing. */
.tree--fit { width: 100%; height: auto; }
.tree-size { margin: 0 0 10px; }
.tree-node rect { fill: var(--dbws-surface); stroke: var(--dbws-rule); stroke-width: 1.5; }
.tree-node--focal rect { fill: var(--dbws-tint); stroke: var(--dbws-green); stroke-width: 2.5; }
.tree-node--deceased rect { fill: var(--dbws-page); stroke-dasharray: 2 3; }
.tree-name { font: 600 13px var(--dbws-font); fill: var(--dbws-ink); }
.tree-years { font: 12px var(--dbws-font); fill: var(--dbws-ink-muted); }
/* Gujarati and Urdu names for a relationship, beside the English. */
.heritage-name { color: var(--dbws-ink-muted); font-size: 0.92em; white-space: nowrap; }

.tree-link { fill: none; stroke: var(--dbws-teal); stroke-width: 1.6; }
.tree-link--sibling { stroke: var(--dbws-green); }
.tree-link--unconfirmed { stroke: var(--dbws-ink-muted); stroke-dasharray: 5 4; }
/* A marriage that has ended: drawn, so the children keep both parents, but plainly not a marriage. */
.tree-link--partner--ended { stroke: var(--dbws-ink-muted); stroke-dasharray: 2 4; }
.tree-node--marriage rect { fill: var(--dbws-page); }
.tree a:hover rect, .tree a:focus rect { stroke: var(--dbws-green); stroke-width: 2.5; }
.tree a:focus { outline: none; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* --- Photographs --------------------------------------------------------------- */

.person-head { display: flex; gap: 16px; align-items: center; }
.portrait {
  width: 96px; height: 96px; flex: none; object-fit: cover;
  border-radius: 50%; border: 3px solid var(--dbws-tint); background: var(--dbws-page);
}
.portrait--large { width: 160px; height: 160px; display: block; margin-bottom: var(--dbws-gap); }
.form input[type="file"] { font: inherit; max-width: 100%; min-height: 44px; padding: 10px 0; }

.photo-grid {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: var(--dbws-gap); grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
}
.photo-grid figure { margin: 0 0 8px; }
.photo-grid img {
  width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block;
  border-radius: var(--dbws-radius); border: 1px solid var(--dbws-rule);
}
.photo-grid figcaption { font-size: 0.85rem; color: var(--dbws-ink-muted); margin-top: 4px; }

/* --- Businesses ------------------------------------------------------------------ */

.business-list li { justify-content: space-between; align-items: flex-start; }
.photo-preview {
  display: block; max-width: 100%; max-height: 320px; margin-bottom: var(--dbws-gap);
  border-radius: var(--dbws-radius); border: 1px solid var(--dbws-rule);
}

/* --- Gift Aid ------------------------------------------------------------------------ */

.gift-aid__statement {
  margin: -4px 0 var(--dbws-gap) 26px; font-size: 0.9rem; color: var(--dbws-ink);
  border-left: 3px solid var(--dbws-teal); padding-left: 10px;
}
.gift-aid__donor { margin-bottom: var(--dbws-gap); }

/* --- Finance (Phase 4) -------------------------------------------------------------- */

@media (min-width: 720px) { .grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.status--issued { background: var(--dbws-tint); color: var(--dbws-green); }
.status--paid { background: var(--dbws-success-tint); color: var(--dbws-success); }
.status--part_paid { background: var(--dbws-warning-tint); color: var(--dbws-warning); }
.status--overdue { background: var(--dbws-danger-tint); color: var(--dbws-danger); }
.line-table td { vertical-align: top; }
.line-table input, .line-table select {
  width: 100%; font: inherit; padding: 8px 10px;
  border: 1px solid var(--dbws-rule); border-radius: var(--dbws-radius); background: var(--dbws-surface);
}
.line-table td:nth-child(3) { width: 9rem; }
tfoot th { text-transform: none; letter-spacing: 0; font-size: 0.9rem; color: var(--dbws-ink); }

/* A form's problems, summarised at its top (DBWS, 16 September 2026). */
.error-summary {
  margin: 0 0 var(--dbws-gap);
  padding: 14px 16px;
  border: 2px solid var(--dbws-danger-edge);
  border-radius: 6px;
  background: var(--dbws-danger-tint);
}
.error-summary:focus { outline: 3px solid var(--dbws-danger-edge); outline-offset: 2px; }
.error-summary h2 { margin: 0 0 6px; font-size: 1rem; color: var(--dbws-danger); }
.error-summary ul { margin: 0; padding-left: 18px; }
.error-summary li + li { margin-top: 2px; }
.error-summary a { color: var(--dbws-ink); text-decoration: underline; }

/* --- WhatsApp (Phase 5, 5.8): the WhatsApp mark, in WhatsApp's green -------------- */

.icon { display: inline-block; vertical-align: middle; flex: none; }
.btn--whatsapp { background: #25d366; color: #fff; padding: 8px; min-width: 44px; }
.btn--whatsapp:hover { background: #1da851; }
.btn--whatsapp-again { background: transparent; color: #128c7e; border-color: #25d366; }
.btn--whatsapp-again:hover { background: #e7f8ee; }
.heading-with-icon { display: flex; align-items: center; gap: 10px; }
.whatsapp-mark { display: inline-flex; color: #25d366; }

/* --- Events (Phase 5, 5.5) ------------------------------------------------------- */
.event-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.event-card {
  display: flex; gap: 16px; align-items: flex-start; padding: 16px;
  background: var(--dbws-surface); border: 1px solid var(--dbws-rule); border-radius: var(--dbws-radius);
}
.event-card--cancelled { opacity: 0.75; }
.event-card--cancelled .event-card__title a { text-decoration: line-through; }
.event-card__body { min-width: 0; flex: 1; }
.event-card__title { margin: 0 0 4px; font-size: 1.1rem; }
.event-card__meta { margin: 0; font-size: 0.88rem; color: var(--dbws-ink-muted); }
.event-card__tags { margin: 8px 0 0; }
/* A tear-off calendar leaf: the month on the teal band, the day large beneath. */
.event-date {
  flex: none; width: 64px; text-align: center; overflow: hidden;
  border: 1px solid var(--dbws-rule); border-radius: var(--dbws-radius); background: var(--dbws-surface);
}
.event-date__month { display: block; background: var(--dbws-teal); color: #fff; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; padding: 2px 0; }
.event-date__day { display: block; font-family: var(--dbws-font-display); font-size: 1.6rem; font-weight: 700; line-height: 1.2; color: var(--dbws-green); }
.event-date__weekday { display: block; font-size: 0.72rem; color: var(--dbws-ink-muted); padding-bottom: 4px; }
.event-picture { display: block; width: 100%; max-height: 360px; object-fit: cover; border-radius: var(--dbws-radius); margin-bottom: var(--dbws-gap); }
.event-description { margin-top: 16px; }
.event-description p { margin: 0 0 10px; }
.note--danger { border-left-color: var(--dbws-danger-edge); background: var(--dbws-danger-tint); color: var(--dbws-danger); }
.panel-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; margin-bottom: 12px; }
.panel-head h2 { margin: 0; }
.stat-of { font-size: 1rem; color: var(--dbws-ink-muted); font-weight: 400; }
.door-list { list-style: none; margin: 0 0 16px; padding: 0; }
.door-list li { border-bottom: 1px solid var(--dbws-page); padding: 6px 0; }
.door-list label.check input { width: 24px; height: 24px; }

/* --- Event calendars (Phase 5, 5.6) ----------------------------------------------- */
.view-tabs { display: flex; gap: 4px; margin: 8px 0 12px; border-bottom: 1px solid var(--dbws-rule); }
.view-tabs a {
  padding: 8px 16px; min-height: 40px; font-weight: 600; font-size: 0.92rem; text-decoration: none;
  color: var(--dbws-ink-muted); border-bottom: 3px solid transparent; margin-bottom: -1px;
}
.view-tabs a[aria-current="page"] { color: var(--dbws-green); border-bottom-color: var(--dbws-teal); }
.calendar-filter { padding: 12px 16px; }
.calendar-filter summary { cursor: pointer; font-weight: 600; }
.calendar-filter form { margin-top: 12px; display: grid; gap: 10px; }
.calendar-filter__choices { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 4px 16px; }
.calendar-filter .check { display: flex; gap: 8px; align-items: center; font-weight: 400; }
.swatch { display: inline-block; width: 14px; height: 14px; border-radius: 3px; flex: none; }
.calendar-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 12px; }
.calendar-bar__title { margin: 0; font-size: 1.3rem; color: var(--dbws-green); }
.calendar-empty { margin-top: 12px; }
.view-switch { margin: 0 0 12px; font-size: 0.9rem; }
.event-card { border-left: 5px solid var(--org-colour, var(--dbws-teal)); }
.org-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--org-colour, var(--dbws-teal)); margin-right: 6px; }

.calendar-chip {
  display: block; margin-top: 4px; padding: 3px 6px; border-radius: 4px; text-decoration: none; font-size: 0.78rem; line-height: 1.3;
  color: #fff; background: var(--org-colour, var(--dbws-green)); overflow: hidden;
}
.calendar-chip:hover { filter: brightness(1.15); }
.calendar-chip__time { font-weight: 700; margin-right: 4px; }
.calendar-chip__org { display: block; opacity: 0.9; font-size: 0.74rem; }
.calendar-chip--cancelled { text-decoration: line-through; opacity: 0.6; }

.month { background: var(--dbws-surface); border: 1px solid var(--dbws-rule); border-radius: var(--dbws-radius); overflow: hidden; }
.month__head, .month__week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month__head span { padding: 6px 8px; font-size: 0.75rem; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--dbws-ink-muted); background: var(--dbws-page); border-bottom: 1px solid var(--dbws-rule); }
.month__day { min-height: 104px; padding: 6px; border-right: 1px solid var(--dbws-rule); border-bottom: 1px solid var(--dbws-rule); min-width: 0; }
.month__week .month__day:last-child { border-right: 0; }
.month__day--outside { background: var(--dbws-page); }
.month__day--outside .month__date { color: var(--dbws-ink-muted); opacity: 0.7; }
.month__date { font-weight: 600; font-size: 0.85rem; }
.month__weekday { display: none; }
.month__day--today .month__date {
  display: inline-block; min-width: 26px; text-align: center; border-radius: 13px; background: var(--dbws-teal); color: #fff; padding: 0 6px;
}
.calendar-chip__title { overflow-wrap: anywhere; }

.week { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.week__day { background: var(--dbws-surface); border: 1px solid var(--dbws-rule); border-radius: var(--dbws-radius); padding: 10px 14px; }
.week__day--today { border-color: var(--dbws-teal); box-shadow: inset 4px 0 0 var(--dbws-teal); }
.week__date { margin: 0 0 4px; font-size: 0.95rem; }
.week .calendar-chip { font-size: 0.88rem; padding: 6px 10px; }
@media (min-width: 900px) {
  .week { grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 0; border: 1px solid var(--dbws-rule); border-radius: var(--dbws-radius); overflow: hidden; }
  .week__day { border: 0; border-right: 1px solid var(--dbws-rule); border-radius: 0; min-height: 220px; padding: 8px; }
  .week__day:last-child { border-right: 0; }
  .week .calendar-chip { font-size: 0.8rem; padding: 4px 6px; }
}
/* A phone: the month becomes a list of the days that have something on. */
@media (max-width: 719px) {
  .month { background: none; border: 0; }
  .month__head { display: none; }
  .month__week { display: block; }
  .month__day { min-height: 0; border: 1px solid var(--dbws-rule); border-radius: var(--dbws-radius); background: var(--dbws-surface); margin-bottom: 8px; padding: 10px 12px; }
  .month__day--empty, .month__day--outside { display: none; }
  .month__weekday { display: inline; }
  .calendar-chip { font-size: 0.9rem; padding: 6px 10px; }
}

.add-to-calendar { margin-top: 16px; }
.same-day:not(:empty) { margin-top: 8px; }
.copy-field { width: 100%; margin-top: 6px; font: inherit; font-size: 0.8rem; padding: 6px 8px; border: 1px solid var(--dbws-rule); border-radius: var(--dbws-radius); background: var(--dbws-page); color: var(--dbws-ink); }
.whatsapp-next { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.whatsapp-next .btn--whatsapp { display: inline-flex; align-items: center; gap: 10px; padding: 10px 18px; font-size: 1.05rem; }

/* --- Small screens (checked page by page at 390px and 768px, 16 September 2026) ------ */

/* Text hidden for screen readers is positioned absolutely: inside a scrolling table it must
 * stay in the table, or it escapes to the page and widens it on a phone. */
.table-scroll, .tree-scroll { position: relative; -webkit-overflow-scrolling: touch; }
/* Long email addresses and references wrap rather than widen the page. */
main { overflow-wrap: break-word; }
.kv dd { min-width: 0; overflow-wrap: anywhere; }
.filter { min-width: 0; max-width: 100%; }
.filter select, .filter input { max-width: 100%; }

/* --- Event fees and tickets (Phase 5, 5.7) ---------------------------------------- */
.party-row { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 16px; padding: 4px 0; }
.party-row .check { flex: 1 1 220px; }
.party-row--guest { align-items: flex-end; border-bottom: 1px solid var(--dbws-page); padding-bottom: 8px; }
.party-row--guest .field { flex: 1 1 220px; margin: 0; }
.party-row--guest .check { flex: 0 1 auto; margin-bottom: 10px; }
.party-ticket { font: inherit; font-size: 0.88rem; padding: 6px 8px; border: 1px solid var(--dbws-rule); border-radius: var(--dbws-radius); background: var(--dbws-surface); max-width: 100%; }
.price-table td .sub { max-width: 40ch; }
.booking-cost { margin: 12px 0 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.ticket-row legend { font-weight: 700; }
.door-list label.check { flex-wrap: wrap; }
.form select.party-ticket { width: auto; min-height: 36px; padding: 6px 8px; }

/* --- Documents (DBWS, 17 September 2026) ------------------------------------------ */
.doc-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.doc-item { display: flex; gap: 12px; align-items: flex-start; padding: 8px 0; border-bottom: 1px solid var(--dbws-page); }
.doc-item:last-child { border-bottom: 0; }
.doc-item__icon {
  flex: none; width: 44px; height: 44px; display: grid; place-items: center; border-radius: var(--dbws-radius);
  font-size: 0.68rem; font-weight: 700; letter-spacing: 0.04em; color: var(--dbws-green); background: var(--dbws-tint);
}
.doc-item__icon--link { font-size: 1.2rem; background: var(--dbws-cream); }
.doc-item__body { min-width: 0; }
.doc-item__body > a { font-weight: 600; }
.doc-item__description { display: block; margin-top: 4px; font-size: 0.88rem; color: var(--dbws-ink); }

/* --- Cemeteries and graves --------------------------------------------------------- */
.map-frame { position: relative; width: 100%; aspect-ratio: 4 / 3; max-width: 100%; border-radius: var(--dbws-radius); overflow: hidden; border: 1px solid var(--dbws-rule); }
.map-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.map-buttons { margin-top: 12px; }
.leaflet-map { width: 100%; height: 340px; border-radius: var(--dbws-radius); border: 1px solid var(--dbws-rule); z-index: 0; }
.leaflet-map--picker { height: 420px; margin-bottom: 8px; cursor: crosshair; }
@media (max-width: 719px) { .leaflet-map--picker { height: 60vh; } }
.picker-actions { margin-bottom: 12px; }
.grave-photo { display: block; max-width: 100%; max-height: 520px; border-radius: var(--dbws-radius); }
.doc-organisation { margin: 16px 0 4px; padding-top: 12px; border-top: 1px solid var(--dbws-rule); color: var(--dbws-green); }
.panel > h2 + .doc-organisation, .panel > .aside + .doc-organisation { margin-top: 4px; padding-top: 0; border-top: 0; }

/* --- Heritage (Phase 6) ------------------------------------------------------------ */
.leaflet-map--wide { height: 460px; }
@media (max-width: 719px) { .leaflet-map--wide { height: 60vh; } }
.heritage-text { max-width: 70ch; }
.heritage-text p { margin: 0 0 10px; }
.heritage-photo { display: block; max-width: 100%; max-height: 70vh; margin: 0 auto 16px; border-radius: var(--dbws-radius); }
.timeline { list-style: none; margin: 12px 0 0; padding: 0 0 0 18px; border-left: 3px solid var(--dbws-tint); display: grid; gap: 12px; }
.timeline li { position: relative; }
.timeline li::before { content: ""; position: absolute; left: -25px; top: 5px; width: 11px; height: 11px; border-radius: 50%; background: var(--dbws-teal); }
.timeline__when { display: block; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--dbws-ink-muted); }
.approval__photo { display: block; max-width: 100%; max-height: 320px; border-radius: var(--dbws-radius); margin-bottom: 8px; }

/* --- Searching documents ------------------------------------------------------------ */
.doc-search__label { display: block; font-weight: 700; margin-bottom: 6px; }
.doc-search__row { display: flex; gap: 8px; flex-wrap: wrap; }
.doc-search__row input[type="search"] {
  flex: 1 1 260px; min-width: 0; font: inherit; font-size: 1.05rem; padding: 12px 14px;
  border: 1px solid var(--dbws-rule); border-radius: var(--dbws-radius); background: var(--dbws-surface); color: var(--dbws-ink);
}
.doc-search__filters { margin: 12px 0 0; }
.doc-search__part { align-self: flex-end; margin-bottom: 10px; }
.doc-hit__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.doc-hit__title { margin: 0; font-size: 1.1rem; }
.doc-passages { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 12px; }
.doc-passages li { border-left: 3px solid var(--dbws-teal); padding: 2px 0 2px 12px; }
.doc-passage__where { margin: 0 0 4px; font-size: 0.82rem; font-weight: 600; color: var(--dbws-ink-muted); }
.doc-passage__text { margin: 0; max-width: 80ch; }
.doc-passage__text mark { background: #fde68a; color: inherit; padding: 0 2px; border-radius: 2px; }

/* --- Notifications (Phase 7) --------------------------------------------------------- */
.bell { position: relative; display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border-radius: 50%; color: var(--dbws-ink-muted); text-decoration: none; }
.bell:hover { background: var(--dbws-tint); color: var(--dbws-green); }
.bell--unread { color: var(--dbws-green); }
.bell__count { position: absolute; top: 4px; right: 2px; min-width: 19px; height: 19px; padding: 0 5px; border-radius: 10px;
  background: var(--dbws-danger-edge); color: #fff; font-size: 0.7rem; font-weight: 700; line-height: 19px; text-align: center; }
.notice-list { list-style: none; margin: 0; padding: 0; }
.notice a { display: block; padding: 12px 12px 12px 16px; text-decoration: none; color: var(--dbws-ink); border-bottom: 1px solid var(--dbws-page); border-left: 4px solid transparent; }
.notice a:hover { background: var(--dbws-page); }
.notice--unread a { border-left-color: var(--dbws-teal); background: var(--dbws-tint); }
.notice__title { display: block; font-weight: 600; }
.notice--unread .notice__title::after { content: " \2022"; color: var(--dbws-teal); }
.notice__body { display: block; font-size: 0.9rem; color: var(--dbws-ink-muted); }

/* --- Forms and surveys (Phase 7) ----------------------------------------------------- */
.survey-question { border-top: 1px solid var(--dbws-page); padding-top: 12px; margin-top: 12px; }
.survey-question:first-of-type { border-top: 0; margin-top: 0; }
.question-rows { display: grid; gap: 4px; }
.question-row legend { font-weight: 700; }
.tally { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
.tally li { display: grid; grid-template-columns: minmax(90px, 1fr) minmax(80px, 3fr) auto; gap: 10px; align-items: center; font-size: 0.92rem; }
.tally__bar { background: var(--dbws-page); border-radius: var(--dbws-pill); height: 14px; overflow: hidden; }
.tally__fill { display: block; height: 100%; background: var(--dbws-teal); }
.tally__count { color: var(--dbws-ink-muted); font-size: 0.85rem; white-space: nowrap; }
.survey-answers li { display: block; padding: 6px 0; border-bottom: 1px solid var(--dbws-page); }
@media (max-width: 519px) { .tally li { grid-template-columns: 1fr auto; } .tally__bar { grid-column: 1 / -1; } }

/* A short form sitting inside a list item: "Withdraw" beside what was asked for (Phase 7.3). */
.inline-form { display: inline-block; margin-top: 4px; }

/* --- Digital membership card (Phase 7.4) ------------------------------------------------- */
.card-wrap { display: flex; justify-content: center; margin: 16px 0 24px; }
.member-card {
  width: min(420px, 100%); border-radius: 14px; padding: 16px; color: #fff;
  background: linear-gradient(135deg, #0c3b2e 0%, #14624a 100%);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.18);
}
.member-card--invalid { background: linear-gradient(135deg, #4a1f1f 0%, #7a3030 100%); }
.member-card__head { display: flex; justify-content: space-between; font-size: 0.7rem; letter-spacing: 0.08em; text-transform: uppercase; opacity: 0.85; }
.member-card__body { display: flex; gap: 12px; align-items: center; margin: 14px 0; }
.member-card__photo { border-radius: 8px; object-fit: cover; }
.member-card__name { font-size: 1.15rem; font-weight: 600; margin: 0; }
.member-card__line { margin: 2px 0 0; font-size: 0.82rem; opacity: 0.9; }
.member-card__chip { display: inline-block; margin-top: 6px; padding: 2px 8px; border-radius: 999px; background: rgba(255, 255, 255, 0.18); font-size: 0.72rem; }
.member-card__qr { margin-left: auto; background: #fff; border-radius: 8px; padding: 6px; line-height: 0; }
.member-card__qr svg { width: 96px; height: 96px; display: block; }
.member-card__foot { display: flex; justify-content: space-between; gap: 8px; font-size: 0.75rem; opacity: 0.9; border-top: 1px solid rgba(255, 255, 255, 0.25); padding-top: 8px; }

.check { text-align: center; padding: 20px; border-radius: 12px; margin-bottom: 16px; }
.check--good { background: #e7f5ec; border: 1px solid #1d7a45; }
.check--bad { background: #fdeceb; border: 1px solid #a12b2b; }
.check__verdict { margin: 0; font-size: 1.1rem; font-weight: 600; }
.check--good .check__verdict { color: #14603a; }
.check--bad .check__verdict { color: #8c2222; }
.check__name { margin: 6px 0 10px; font-size: 1.4rem; font-weight: 600; }
.check__photo { border-radius: 10px; object-fit: cover; }
.check__why { margin: 10px 0 0; }

@media (max-width: 520px) {
  .member-card__qr svg { width: 74px; height: 74px; }
}

/* --- One search across everything (Phase 7.5) --------------------------------------------- */
.find-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.find-list li { display: grid; gap: 2px; }
.find-list li > a { font-weight: 500; }
.find-list__detail { font-size: 0.82rem; color: var(--muted, #5b6470); }
.panel-head__links { display: flex; gap: 12px; flex-wrap: wrap; }

/* Hours given, one narrow box a row (Phase 7.8). */
.hours-input { width: 6rem; }

/* --- Historical archive (Phase 7.7) ------------------------------------------------------- */
.archive-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
.archive-card { display: grid; gap: 4px; }
.archive-card__link { display: grid; gap: 6px; text-decoration: none; }
.archive-card__picture { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #eef1f0; }
.archive-card__kind { display: flex; align-items: center; justify-content: center; aspect-ratio: 4 / 3;
  border-radius: 8px; background: #eef1f0; color: var(--dbws-ink-muted); font-size: 0.85rem; }
.archive-card__title { font-weight: 500; }
.archive-full { max-width: 100%; border-radius: 10px; margin-bottom: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
a.chip { text-decoration: none; }
.chip--on { background: var(--dbws-teal, #14624a); color: #fff; }

/* --- Show password (19 September 2026) ------------------------------------------------------
 * A phone's browser puts no reveal inside a password box, so the site adds one.  Edge puts its
 * own there on a desktop, which would make two: its native one is hidden. */
.reveal { position: relative; display: block; }
.reveal input { width: 100%; padding-right: 5.2rem; }
.reveal__button {
  position: absolute; top: 50%; right: 4px; transform: translateY(-50%);
  min-height: 40px; min-width: 64px; padding: 8px 12px;
  font: inherit; font-size: 0.85rem; font-weight: 600;
  color: var(--dbws-green); background: none; border: 0; border-radius: var(--dbws-radius); cursor: pointer;
}
.reveal__button:hover { background: var(--dbws-tint); }
.reveal__button:focus-visible { outline: 2px solid var(--dbws-green); outline-offset: -2px; }
.reveal input::-ms-reveal, .reveal input::-ms-clear { display: none; }

/* --- Phones and small tablets, checked at 360, 390 and 768px (19 September 2026) -------------
 * Two things a phone needs that a desktop does not:
 *  - a form control smaller than 16px makes iOS Safari zoom the page the moment it is tapped, and
 *    the member is then left scrolling sideways to read the rest of the form;
 *  - a 36px button is below the 44px touch target section 8 asks for.
 */
@media (max-width: 767px) {
  input, select, textarea { font-size: 16px; }
  .copy-field, .party-ticket, .hours-input, .form select.party-ticket { font-size: 16px; }
  .btn--small { min-height: 44px; padding: 10px 16px; }
  .reveal__button { min-height: 44px; }
}

/* A red note on a record: a Gift Aid declaration waiting to be confirmed (19 September 2026). */
.red-note {
  margin: 0 0 10px; padding: 10px 12px; border-radius: var(--dbws-radius);
  background: var(--dbws-danger-tint); border-left: 4px solid var(--dbws-danger-edge);
  color: var(--dbws-danger); font-weight: 600;
}
.red-note + p { margin-top: 0; }

/* Unread circulars, kept apart inside the same box (DBWS, 19 September 2026). */
.unread-head { margin: 0 0 8px; font-size: 0.82rem; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; color: var(--dbws-ink-muted); }
.unread-head--later { margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--dbws-page); }
.chip--new { background: var(--dbws-teal, #14624a); color: #fff; }

/* --- Help and support (DBWS, 20 September 2026) --------------------------------------------- */
.grid--help { display: grid; gap: 16px; }
@media (min-width: 900px) { .grid--help { grid-template-columns: minmax(0, 1fr) 260px; } }
.help-body h2 { font-size: 1.15rem; margin-top: 20px; }
.help-body h3 { font-size: 1rem; margin-top: 16px; }
.help-body p, .help-body li { max-width: 72ch; }
.help-body code { background: var(--dbws-page); padding: 1px 5px; border-radius: 4px; font-size: 0.9em; }
.help-contents { margin: 0; padding-left: 20px; display: grid; gap: 4px; }
.help-contents li.is-current > a { font-weight: 700; color: var(--dbws-green); }
.help-side { align-self: start; position: sticky; top: 12px; }
.help-move { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; padding-top: 12px;
  border-top: 1px solid var(--dbws-page); }
.help-move__next { margin-left: auto; text-align: right; }

.support-button {
  position: fixed; right: 16px; bottom: 16px; z-index: 40;
  display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; min-height: 48px;
  border-radius: var(--dbws-pill); background: var(--dbws-green); color: #fff; font-weight: 600;
  text-decoration: none; box-shadow: 0 6px 18px rgba(0, 0, 0, 0.22);
}
.support-button:hover { background: var(--dbws-teal); color: #fff; }
.support-button:focus-visible { outline: 3px solid var(--dbws-teal); outline-offset: 3px; }
.support-button__icon { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.2); font-weight: 700; }
.support-button.is-working { opacity: 0.7; }
.support-button.is-working .support-button__words::after { content: "…"; }
@media (max-width: 520px) { .support-button__words { position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; } .support-button { padding: 14px; } }

.support-shots { margin-top: 12px; }
.support-shots__list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.support-shots__list li { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.support-shots__picture { width: 120px; border: 1px solid var(--dbws-rule); border-radius: var(--dbws-radius); }

/* The support button floats over the page, so nothing is left underneath it (20 September 2026). */
@media (max-width: 767px) { main { padding-bottom: 96px; } }
