/* Kindred — Family Life Ministry, House on the Rock (The Refuge, Abuja).
   ---------------------------------------------------------------------------
   The palette and the type are taken from the ministry's own live site,
   familylife.hotrrefuge.org: navy #172B4D, brand blue #0A48B3, the green
   #2DCE89 it uses for every action, slate #525F7F body text, Roboto throughout.
   Nothing here is invented.

   LIGHT FIRST. Every value below is designed for the light theme, on white
   surfaces over a soft grey page. The dark block near the bottom is derived from
   it afterwards and never drives a decision.
   --------------------------------------------------------------------------- */

:root {
  /* brand, straight from the ministry's site */
  --navy: #172B4D;
  --navy-deep: #101E36;
  --navy-soft: #EDF1F7;
  --brand: #0A48B3;
  --brand-deep: #083A93;
  --brand-soft: #E7EEFB;
  --green: #2DCE89;          /* the ministry's accent — rules, dots, highlights */
  --green-deep: #18855A;     /* the same green, dark enough to carry white text */
  --green-darker: #146043;   /* text on a green tint */
  --green-soft: #E4F8EF;

  /* surfaces — white cards on a soft grey page */
  --bg: #F4F6FA;
  --bg-tint: #EDF1F7;
  --surface: #FFFFFF;
  --surface-2: #F7F9FC;
  --surface-3: #EDF1F7;
  --border: #E1E7F0;
  --border-strong: #C7D2E2;

  /* type */
  --text: #101E36;
  --text-soft: #525F7F;
  --muted: #5F6E8A;
  --on-brand: #FFFFFF;
  --on-green: #FFFFFF;
  --on-bad: #FFFFFF;
  --on-navy: #FFFFFF;
  --on-navy-soft: #C3D0E0;   /* a paragraph on a navy panel */
  --on-navy-muted: #AEBFD2;  /* the small print on a navy panel */

  --ok: #1E9E68;
  --ok-soft: #E4F8EF;
  --warn: #9A6206;
  --warn-soft: #FDF3E2;
  --bad: #C02B3F;
  --bad-soft: #FCE9EC;
  --info: #0A48B3;
  --info-soft: #E7EEFB;

  /* Two different jobs. --ring is the soft halo round a field or a chosen tile.
     --focus is the keyboard outline, and it is opaque: at 28% the old ring
     measured 1.6:1 on the page and 1.04:1 on the navy bar. */
  --ring: rgba(10, 72, 179, .28);
  --focus: #0A48B3;
  --focus-on-shell: #FFFFFF;
  /* The edge of a field. --border-strong is 1.5:1 on a card; the boundary of a
     control needs 3:1. */
  --field-border: #8493AD;
  --shadow-sm: 0 1px 2px rgba(16, 30, 54, .05), 0 1px 3px rgba(16, 30, 54, .04);
  --shadow: 0 1px 3px rgba(16, 30, 54, .06), 0 8px 24px rgba(16, 30, 54, .08);
  --shadow-lg: 0 2px 6px rgba(16, 30, 54, .07), 0 18px 48px rgba(16, 30, 54, .12);

  --radius: 16px;
  --radius-sm: 11px;
  --radius-lg: 24px;
  --radius-pill: 999px;

  /* Glass. Translucent white over a living background, never over nothing.
     Long-form reading surfaces stay opaque - a page of the manual is not a
     place to be clever. */
  --glass: rgba(255, 255, 255, .72);
  --glass-strong: rgba(255, 255, 255, .88);
  --glass-border: rgba(255, 255, 255, .85);
  --glass-edge: rgba(16, 30, 54, .07);
  --blur: saturate(160%) blur(16px);
  --blur-strong: saturate(170%) blur(22px);

  /* The wash behind everything. Warm enough that the page feels like a room. */
  --wash-1: rgba(45, 206, 137, .22);
  --wash-2: rgba(10, 72, 179, .16);
  --wash-3: rgba(255, 206, 148, .26);

  --sans: Roboto, "Segoe UI", ui-sans-serif, system-ui, -apple-system, Arial, sans-serif;
  --serif: "Roboto Slab", Georgia, "Times New Roman", serif;

  --shell: #172B4D;
  --on-shell: #FFFFFF;
  --shell-muted: #AEBFD2;    /* was #9AADC2: 4.3:1 on the bar, under the 4.5 floor */

  --tabbar-h: 66px;          /* the phone tab bar, as measured */
  color-scheme: light;       /* native pickers, tick boxes and file buttons follow the theme */
}

* { box-sizing: border-box; }
/* The menu bar sticks to the top, so a link to a place on the page has to stop
   short of it or the heading lands underneath. */
html { height: 100%; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  background-image:
    radial-gradient(58rem 30rem at 4% -4%, var(--wash-1), transparent 58%),
    radial-gradient(52rem 30rem at 98% 6%, var(--wash-2), transparent 56%),
    radial-gradient(54rem 32rem at 52% 106%, var(--wash-3), transparent 60%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  color: var(--text-soft);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.6;
  -webkit-text-size-adjust: 100%;
  /* An email address or a link is one long word. It breaks rather than running
     out of its card and over whatever is beside it. */
  overflow-wrap: break-word;
  /* Footer sits at the bottom of the window on a short page and at the bottom of
     the content on a long one, instead of riding up under the last card. */
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4 { color: var(--text); font-weight: 700; margin: 0 0 .5rem; line-height: 1.25; }
h1 { font-size: 1.55rem; letter-spacing: -.01em; }
h2 { font-size: 1.15rem; }
h3 { font-size: 1rem; }
p { margin: 0 0 .8rem; }
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
small, .small { font-size: .8rem; }
.muted { color: var(--muted); }
.soft { color: var(--text-soft); }
strong, b { color: var(--text); font-weight: 700; }
hr { border: 0; border-top: 1px solid var(--border); margin: 1.25rem 0; }

.wrap { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 20px; }
.narrow { max-width: 560px; }
.reading { max-width: 740px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.spacer { flex: 1; }
.stack > * + * { margin-top: 14px; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); }
/* A grid child may shrink below its longest word, so that word can wrap. */
.grid > * { min-width: 0; }
.nowrap, .ref { white-space: nowrap; }   /* a reference code is never split over two lines */

/* The first thing a keyboard reaches on every page. Out of sight until then. */
.skip-link {
  position: absolute; left: 12px; top: -80px; z-index: 100;
  padding: 11px 18px; border-radius: var(--radius-sm);
  background: var(--surface); color: var(--text); font-weight: 700; font-size: .9rem;
  border: 2px solid var(--focus); box-shadow: var(--shadow-lg); text-decoration: none;
}
.skip-link:focus, .skip-link:focus-visible { top: 12px; outline: none; }
main:focus { outline: none; }            /* <main tabindex="-1"> is a landing place, not a control */

/* ---------- the navy shell: masthead + nav ---------- */
.masthead { background: var(--shell); color: var(--on-shell); }
.masthead-inner {
  max-width: 1120px; margin: 0 auto; padding: 14px 20px;
  display: flex; align-items: center; gap: 14px;
}
/* Not buttons: a button in the masthead keeps its own text colour. Inheriting
   the shell's put near-white words on the bright green in dark (1.6:1). */
.masthead a:where(:not(.btn)) { color: inherit; text-decoration: none; }
.brandmark { display: flex; align-items: center; gap: 11px; min-width: 0; min-height: 44px; }
.brandmark img { height: 34px; width: auto; display: block; }
.brandmark .divider { width: 1px; height: 26px; background: rgba(255, 255, 255, .22); flex: none; }
.brandmark .name { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brandmark .name b { font-size: 1.06rem; font-weight: 700; letter-spacing: .01em; color: var(--on-shell); }
.brandmark .name span {
  font-size: .7rem; color: var(--shell-muted); white-space: nowrap;
  overflow: hidden; text-overflow: ellipsis;
}

.whoami { display: flex; align-items: center; gap: 8px; color: var(--shell-muted); font-size: .82rem; }
.whoami .dot {
  width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--on-brand);
  display: grid; place-items: center; font-weight: 700; font-size: .82rem; flex: none;
}
.icon-btn, .theme-btn {
  background: transparent; color: var(--on-shell); border: 1px solid rgba(255, 255, 255, .24);
  border-radius: var(--radius-sm); width: 34px; height: 34px; display: grid; place-items: center;
  cursor: pointer; flex: none;
}
.icon-btn:hover, .theme-btn:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .4); }
.icon-btn .moon, .theme-btn .moon { display: none; }

.nav {
  border-bottom: 3px solid var(--green);
  position: sticky; top: 0; z-index: 30;
  background: color-mix(in srgb, var(--shell) 88%, transparent);
  -webkit-backdrop-filter: var(--blur-strong); backdrop-filter: var(--blur-strong);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .nav { background: var(--shell); }
}

/* The row wraps; it does not scroll. overflow-x:auto here also made overflow-y
   auto, which clipped the More menu to the 44px bar: it opened, and nobody could
   see it. Sideways scrolling is kept only for the public strip on a phone. */
.nav-inner {
  max-width: 1120px; margin: 0 auto; padding: 0 20px;
  display: flex; gap: 2px; flex-wrap: wrap; align-items: stretch;
}
.nav-inner::-webkit-scrollbar { display: none; }
/* The More menu may also sit beside the row instead of inside it. */
@media (min-width: 681px) {
  .nav:has(> .more) {
    display: flex; align-items: stretch;
    padding: 0 max(20px, calc((100% - 1120px) / 2 + 20px));
  }
  .nav:has(> .more) > .nav-inner { flex: 1 1 auto; min-width: 0; max-width: none; margin: 0; padding: 0; }
}
.nav a {
  padding: 11px 14px; color: var(--shell-muted); font-size: .86rem; font-weight: 500;
  white-space: nowrap; border-bottom: 3px solid transparent; margin-bottom: -3px;
}
.nav a:hover { color: var(--on-shell); text-decoration: none; }
.nav a.on { color: var(--on-shell); border-bottom-color: var(--green); font-weight: 700; }

.more { position: relative; }
/* More keeps to the right edge of whichever line it lands on. When the row
   wrapped (a team account between 681px and 705px) it dropped to the left of a
   second line, and its menu, which hangs from its right edge, opened off-screen. */
.nav-inner > .more { margin-left: auto; }
.more > summary {
  padding: 11px 14px; color: var(--shell-muted); font-size: .86rem; font-weight: 500;
  cursor: pointer; list-style: none; white-space: nowrap;
}
.more > summary::-webkit-details-marker { display: none; }
.more[open] > summary, .more > summary:hover { color: var(--on-shell); }
/* Opaque: a menu is read, not looked through. Capped to the window and scrolls
   inside itself, because an administrator's list is taller than a laptop screen.
   When it does, the edge it runs under is shaded, so a list that happens to end
   on a whole row does not look finished: the two "cover" layers travel with the
   list and hide each shade once that end has been reached. Not every screen
   draws a scrollbar, so the bar alone is no cue. */
.more-menu {
  position: absolute; right: 0; top: 100%; z-index: 40; min-width: 210px;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 130px); max-height: calc(100dvh - 130px);
  overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin;
  background-color: var(--surface);
  background-image:
    linear-gradient(var(--surface) 45%, transparent),
    linear-gradient(transparent, var(--surface) 55%),
    linear-gradient(var(--more-shade), transparent),
    linear-gradient(transparent, var(--more-shade));
  background-position: top, bottom, top, bottom;
  background-size: 100% 44px, 100% 44px, 100% 22px, 100% 22px;
  background-repeat: no-repeat;
  background-attachment: local, local, scroll, scroll;
  --more-shade: color-mix(in srgb, var(--text) 26%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  padding: 7px; display: grid; gap: 2px; margin-top: 6px;
}
.more-menu a, .more-menu button {
  padding: 9px 12px; color: var(--text-soft); border: 0; border-radius: var(--radius-sm);
  font-size: .86rem; white-space: nowrap; margin: 0;
}
/* Sign out is a button in a small form now, and reads as one more line. */
.more-menu form { margin: 0; display: grid; }
.more-menu button {
  background: transparent; font-family: inherit; font-weight: 400; text-align: left;
  cursor: pointer; width: 100%;
}
.nav .more-menu button { font-weight: 500; }
.more-menu button:hover { background: var(--surface-2); color: var(--text); }
.more-menu a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.more-menu a.on { background: var(--surface-2); color: var(--brand); font-weight: 700; }
.more-menu hr { border: 0; border-top: 1px solid var(--border); margin: 6px 4px; }
.more > summary.on { color: var(--on-shell); font-weight: 700; }

main { flex: 1 0 auto; padding: 26px 0 60px; }

.page-head { margin-bottom: 20px; }
.page-head .eyebrow {
  font-size: .68rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--brand); font-weight: 700; margin-bottom: 5px;
}
.page-head p { color: var(--muted); margin: 0; }

.crumbs { font-size: .8rem; color: var(--muted); margin-bottom: 10px; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--brand); }

/* ---------- cards ---------- */
.card {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 20px; box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  transition: box-shadow .2s ease, transform .2s ease, border-color .2s ease;
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .card { background: var(--surface); }
}
/* A surface holding a page of reading stays opaque and still. */
.card.solid, .reader .card { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
.card.flush { padding: 0; overflow: hidden; }
.card-head {
  padding: 15px 20px; border-bottom: 1px solid var(--glass-edge);
  background: color-mix(in srgb, var(--surface) 55%, transparent);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.card-head h2, .card-head h3 { margin: 0; }
.card-body { padding: 20px; }
.panel {
  background: color-mix(in srgb, var(--surface) 62%, transparent);
  border: 1px solid var(--glass-border); border-radius: var(--radius); padding: 15px 17px;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.accent { border-left: 3px solid var(--green); }

.stat {
  background: var(--glass); border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, .55);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.stat .fig { font-size: 1.9rem; font-weight: 700; color: var(--text); line-height: 1.1; letter-spacing: -.02em; }
.stat .cap { font-size: .78rem; color: var(--muted); margin-top: 4px; }

/* ---------- buttons: the ministry's green is the action colour ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px 20px; border-radius: var(--radius-pill); border: 1px solid var(--border-strong);
  background: var(--glass-strong); color: var(--text);
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease; font: inherit; font-size: .84rem; font-weight: 700;
  letter-spacing: .02em; cursor: pointer; text-decoration: none; line-height: 1.4;
}
.btn:hover {
  background: var(--surface); text-decoration: none;
  transform: translateY(-1px); box-shadow: var(--shadow-sm);
}
.btn:active { transform: translateY(0); }
.btn:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.btn[disabled], .btn.is-disabled { opacity: .5; cursor: not-allowed; }
.btn-primary {
  background: var(--green-deep); border-color: var(--green-deep); color: var(--on-green);
  box-shadow: 0 2px 12px color-mix(in srgb, var(--green-deep) 32%, transparent);
}
.btn-primary:hover { background: var(--green-darker); border-color: var(--green-darker); color: var(--on-green); }
.btn-blue { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
/* Hover deepens to --brand-deep, not --navy: in dark --navy is near-black and
   the button's dark words vanished on it (1.04:1) the moment it was pointed at. */
.btn-blue:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: var(--on-brand); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--brand); }
.btn-ghost:hover { background: var(--brand-soft); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: var(--on-bad); }
.btn-danger:hover { background: var(--bad); border-color: var(--bad); color: var(--on-bad); filter: brightness(.92); }
.btn-sm { padding: 6px 12px; font-size: .78rem; white-space: nowrap; }  /* "Take it" stays on one line; the row wraps instead */
.btn-lg { padding: 12px 22px; font-size: .9rem; }
.btn-block { width: 100%; }
.btn-pill { border-radius: var(--radius-pill); }

/* ---------- forms ---------- */
label {
  display: block; font-size: .78rem; font-weight: 700; color: var(--text);
  margin-bottom: 6px; letter-spacing: .01em;
}
/* Every kind of box a person types or picks in. A kind left off this list falls
   back to the browser's own: that is how the date-and-time box came to be a
   small white square on a dark form. The type is 1rem (16px) on purpose: an
   iPhone zooms the page on any field smaller than that, and leaves it zoomed. */
input:not([type]), input[type="text"], input[type="email"], input[type="password"], input[type="tel"],
input[type="number"], input[type="date"], input[type="time"], input[type="datetime-local"],
input[type="month"], input[type="week"], input[type="search"], input[type="url"],
select, textarea {
  width: 100%; padding: 12px 15px; font: inherit; font-size: 1rem;
  color: var(--text); background: var(--glass-strong); border: 1px solid var(--field-border);
  border-radius: var(--radius-sm);
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease;
}
/* A date box sizes itself to its own pattern unless told; give it the same
   height as its neighbours and let the picker's icon be seen. */
input[type="date"], input[type="time"], input[type="datetime-local"],
input[type="month"], input[type="week"] { min-height: 50px; -webkit-appearance: none; appearance: none; }
textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: 1; }
input:focus, select:focus, textarea:focus {
  outline: none; border-color: var(--focus); background: var(--surface);
  box-shadow: 0 0 0 1px var(--focus), 0 0 0 4px var(--ring);
}
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--bad); }
input:disabled, select:disabled, textarea:disabled { background: var(--surface-3); color: var(--muted); cursor: not-allowed; }

/* Tick boxes and radios: 20px, in the brand colour, never stretched. */
input[type="checkbox"], input[type="radio"] {
  width: 20px; height: 20px; min-height: 0; flex: none; padding: 0;
  accent-color: var(--brand); margin: 0 10px 0 0; vertical-align: -4px; cursor: pointer;
}
/* An empty box is drawn here, from the same tokens as a field's edge. Left to
   the browser, an unticked box in dark is a dull grey square that reads as
   switched off. A ticked one stays the browser's own, filled with accent-color,
   so a page that sets its own accent keeps it and paper prints a real tick. */
input[type="checkbox"]:not(:checked):not(:indeterminate), input[type="radio"]:not(:checked) {
  -webkit-appearance: none; appearance: none;
  background: var(--surface); border: 2px solid var(--field-border); border-radius: 4px;
}
input[type="radio"]:not(:checked) { border-radius: 50%; }
input[type="checkbox"]:not(:checked):not(:disabled):hover,
input[type="radio"]:not(:checked):not(:disabled):hover { border-color: var(--brand); }
input[type="checkbox"]:disabled, input[type="radio"]:disabled { cursor: not-allowed; }
input[type="checkbox"]:disabled:not(:checked), input[type="radio"]:disabled:not(:checked) { opacity: .55; }
input[type="checkbox"]:focus, input[type="radio"]:focus { box-shadow: none; }
input[type="checkbox"]:focus-visible, input[type="radio"]:focus-visible {
  outline: 3px solid var(--focus); outline-offset: 2px;
}

/* Choosing a file. The button is the site's own, in both themes. */
input[type="file"] {
  width: 100%; max-width: 100%; font: inherit; font-size: .9rem; color: var(--text-soft);
  padding: 8px; border: 1px dashed var(--field-border); border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 60%, transparent); cursor: pointer;
}
input[type="file"]::file-selector-button {
  font: inherit; font-size: .8rem; font-weight: 700; letter-spacing: .02em;
  margin: 0 12px 0 0; padding: 8px 15px; min-height: 36px;
  border-radius: var(--radius-pill); border: 1px solid var(--border-strong);
  background: var(--surface); color: var(--text); cursor: pointer;
}
input[type="file"]::file-selector-button:hover { background: var(--surface-2); }
input[type="file"]:focus { box-shadow: none; }
input[type="file"]:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }

.field { margin-bottom: 16px; }
.field .help { font-size: .77rem; color: var(--muted); margin-top: 6px; }
.field .help-again { color: var(--warn); font-weight: 700; }
.field .err { font-size: .78rem; color: var(--bad); margin-top: 6px; font-weight: 700; }
.req { color: var(--bad); }

/* One tick box and its sentence: side by side, and the sentence is the target. */
.check-row { display: flex; align-items: flex-start; gap: 10px; }
.check-row input[type="checkbox"] { margin: 2px 0 0; }
.check-row label {
  flex: 1; min-width: 0; font-weight: 400; color: var(--text-soft); margin: 0; font-size: .88rem;
  line-height: 1.5; cursor: pointer; padding: 1px 0;
}

/* A set of radios or tick boxes, one to a line. Django writes each as
   <label><input> words</label>; the label is the row. */
.choices-label { font-size: .78rem; font-weight: 700; color: var(--text); margin-bottom: 6px; letter-spacing: .01em; }
.choices > div:not(.choices-label), .choices > ul { display: grid; gap: 2px; margin: 0; padding: 0; list-style: none; }
.choices label,
label:where([id^="id_"] > div > *):where(:has(> input[type="radio"]), :has(> input[type="checkbox"])) {
  display: flex; align-items: flex-start; margin: 0; padding: 6px 0;   /* the box brings its own right margin */
  font-size: .9rem; font-weight: 400; color: var(--text-soft); line-height: 1.5; cursor: pointer;
}

/* What went wrong, said once at the top of a refused form. */
.form-summary { scroll-margin-top: 84px; }
.form-summary ul { margin: 8px 0 0; padding-left: 20px; }
.form-summary li + li { margin-top: 3px; }
.form-summary a { color: inherit; font-weight: 700; text-decoration: underline; }
.form-summary:focus { outline: 2px solid var(--bad); outline-offset: 2px; }
fieldset {
  border: 1px solid var(--glass-border); border-radius: var(--radius);
  padding: 18px 20px; margin: 0 0 18px;
  background: color-mix(in srgb, var(--surface) 58%, transparent);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
legend { font-weight: 700; color: var(--text); padding: 0 8px; font-size: .9rem; }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
/* More to the side: the edge fades, so a table or a row of filters that runs on
   does not look as if it simply stops. app.js sets data-cue as it scrolls. */
[data-cue="right"] {
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
}
[data-cue="left"] {
  -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to left, #000 calc(100% - 40px), transparent);
}
[data-cue="both"] {
  -webkit-mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 40px, #000 calc(100% - 40px), transparent);
}
table.data { width: 100%; border-collapse: collapse; font-size: .86rem; }
table.data thead th {
  text-align: left; padding: 11px 14px; background: var(--surface-2); color: var(--muted);
  font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}
table.data tbody th {
  text-align: left; padding: 11px 14px; color: var(--muted); font-weight: 700;
  font-size: .7rem; letter-spacing: .08em; text-transform: uppercase;
  border-bottom: 1px solid var(--border); vertical-align: top; width: 34%;
}
table.data td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: top; color: var(--text-soft); }
table.data tbody tr:last-child td, table.data tbody tr:last-child th { border-bottom: 0; }
table.data tbody tr:hover td { background: var(--surface-2); }
table.data tfoot td { background: var(--surface-2); font-weight: 700; color: var(--text); }

/* ---------- badges, alerts, empty ---------- */
.badge {
  display: inline-block; padding: 3px 10px; border-radius: var(--radius-pill);
  font-size: .7rem; font-weight: 700; letter-spacing: .03em;
  background: var(--surface-3); color: var(--text-soft);
  white-space: nowrap;
}
.badge-ok { background: var(--green-soft); color: var(--green-darker); }
.badge-warn { background: var(--warn-soft); color: var(--warn); }
.badge-bad { background: var(--bad-soft); color: var(--bad); }
.badge-info, .badge-plum {
  background: var(--brand-soft); color: var(--brand);
  /* In dark, --brand-soft sits within a shade of the card it is on, so the
     pill disappears and the words read as stray blue text. */
  border: 1px solid color-mix(in srgb, var(--brand) 30%, transparent);
}

.alert {
  border-radius: var(--radius); padding: 13px 16px; margin-bottom: 16px; font-size: .88rem;
  border: 1px solid var(--glass-border); border-left: 3px solid var(--muted);
  background: var(--glass-strong); color: var(--text-soft);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.alert-success { background: var(--green-soft); border-color: var(--green-soft); border-left-color: var(--green); color: var(--green-darker); }
.alert-warning { background: var(--warn-soft); border-color: var(--warn-soft); border-left-color: var(--warn); color: var(--warn); }
.alert-error { background: var(--bad-soft); border-color: var(--bad-soft); border-left-color: var(--bad); color: var(--bad); }
.alert-info { background: var(--brand-soft); border-color: var(--brand-soft); border-left-color: var(--brand); color: var(--brand); }

.empty { text-align: center; padding: 34px 18px; color: var(--muted); }
.empty h3 { color: var(--text-soft); margin-bottom: 4px; }
.empty p { margin: 0; font-size: .88rem; }

/* ---------- footer ---------- */
.foot {
  margin-top: auto; flex-shrink: 0;
  background: var(--navy-deep); color: var(--shell-muted); padding: 24px 0; font-size: .78rem;
  border-top: 3px solid var(--green);
}
.foot a { color: var(--shell-muted); text-decoration: underline; }
.foot a:hover { color: var(--on-shell); }

/* ---------- scrollbars, focus ---------- */
* { scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: var(--radius-pill); }
::-webkit-scrollbar-track { background: transparent; }
/* The keyboard's place on the page. Opaque, and white on the navy shell, where
   brand blue on navy would be invisible. A menu that drops out of the shell is
   a light surface again, so it takes the ordinary colour back. */
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; }
.masthead :focus-visible, .nav :focus-visible, .foot :focus-visible, .pub-foot :focus-visible,
.journey :focus-visible, .pub-band :focus-visible { outline-color: var(--focus-on-shell); }
.nav :focus-visible { outline-offset: -3px; }   /* inside the bar, clear of the green rule */
.masthead .more-menu :focus-visible, .nav .more-menu :focus-visible {
  outline-color: var(--focus); outline-offset: -2px;
}
summary { cursor: pointer; }

@media (max-width: 680px) {
  h1 { font-size: 1.32rem; }
  .wrap { padding: 0 16px; }
  .card { padding: 15px; }
  .card-body, .card-head { padding: 14px 15px; }
  .masthead-inner { padding: 12px 16px; }
  .brandmark .name span { display: none; }
  /* Hide the first name, keep the face. This used to hide every span, and a
     person without a photo is drawn as a span: the menu shrank to nothing, and
     with it Sign out and the theme switch. */
  .whoami > span:not(.avatar) { display: none; }
  main { padding: 18px 0 44px; }
}

/* ===========================================================================
   DARK — derived from the light design above, never the other way round.
   =========================================================================== */
:root[data-theme="dark"] {
  --navy: #0E1626;
  --navy-deep: #0A111D;
  --navy-soft: #1B2942;
  --brand: #6BA1F5;
  --brand-deep: #8FBBFF;
  --brand-soft: #16233B;
  --green: #35D896;
  --green-deep: #35D896;
  --green-darker: #5FE4AF;
  --green-soft: #12301F;

  --bg: #0B121E;
  --bg-tint: #101A29;
  --surface: #141E2E;
  --surface-2: #1A2537;
  --surface-3: #22304A;
  --border: #253449;
  --border-strong: #3A4C68;

  --text: #EAF0FA;
  --text-soft: #B6C4DA;
  --muted: #8296B3;
  --on-brand: #0B121E;
  --on-green: #08160F;
  --on-bad: #1A0D10;
  --on-navy: #EAF0FA;
  --on-navy-soft: #B6C4DA;
  --on-navy-muted: #9DB0CB;

  --ok: #35D896;
  --ok-soft: #12301F;
  --warn: #E8B45C;
  --warn-soft: #2E2411;
  --bad: #F2848F;
  --bad-soft: #331A1E;
  --info: #6BA1F5;
  --info-soft: #16233B;

  --ring: rgba(107, 161, 245, .35);
  --focus: #8FBBFF;
  --focus-on-shell: #EAF0FA;
  --field-border: #5F769B;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 2px 8px rgba(0, 0, 0, .45);
  --shadow-lg: 0 18px 48px rgba(0, 0, 0, .55);

  --shell: #0E1626;
  --on-shell: #EAF0FA;
  --shell-muted: #8296B3;

  /* Dark glass is smoked, not milky. */
  --glass: rgba(26, 37, 55, .74);
  --glass-strong: rgba(26, 37, 55, .90);
  --glass-border: rgba(120, 150, 190, .16);
  --glass-edge: rgba(255, 255, 255, .06);
  --wash-1: rgba(53, 216, 150, .09);
  --wash-2: rgba(107, 161, 245, .09);
  --wash-3: rgba(255, 214, 165, .05);

  color-scheme: dark;
}
:root[data-theme="dark"] .card,
:root[data-theme="dark"] .stat { box-shadow: var(--shadow-sm); }

:root[data-theme="dark"] .icon-btn .sun,
:root[data-theme="dark"] .theme-btn .sun { display: none; }
:root[data-theme="dark"] .icon-btn .moon,
:root[data-theme="dark"] .theme-btn .moon { display: block; }

/* No-JS floor: a dark device that never ran the toggle still gets the dark set. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --navy: #0E1626; --navy-deep: #0A111D; --navy-soft: #1B2942;
    --brand: #6BA1F5; --brand-deep: #8FBBFF; --brand-soft: #16233B;
    --green: #35D896; --green-deep: #35D896; --green-darker: #5FE4AF; --green-soft: #12301F;
    --bg: #0B121E; --bg-tint: #101A29;
    --surface: #141E2E; --surface-2: #1A2537; --surface-3: #22304A;
    --border: #253449; --border-strong: #3A4C68;
    --text: #EAF0FA; --text-soft: #B6C4DA; --muted: #8296B3;
    --on-brand: #0B121E; --on-green: #08160F; --on-bad: #1A0D10; --on-navy: #EAF0FA;
    --on-navy-soft: #B6C4DA; --on-navy-muted: #9DB0CB;
    --ok: #35D896; --ok-soft: #12301F;
    --warn: #E8B45C; --warn-soft: #2E2411;
    --bad: #F2848F; --bad-soft: #331A1E;
    --info: #6BA1F5; --info-soft: #16233B;
    --ring: rgba(107, 161, 245, .35);
    --focus: #8FBBFF; --focus-on-shell: #EAF0FA; --field-border: #5F769B;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4); --shadow: 0 2px 8px rgba(0, 0, 0, .45);
    --shadow-lg: 0 18px 48px rgba(0, 0, 0, .55);
    --shell: #0E1626; --on-shell: #EAF0FA; --shell-muted: #8296B3;
    --glass: rgba(26, 37, 55, .74); --glass-strong: rgba(26, 37, 55, .90);
    --glass-border: rgba(120, 150, 190, .16); --glass-edge: rgba(255, 255, 255, .06);
    --wash-1: rgba(53, 216, 150, .09); --wash-2: rgba(107, 161, 245, .09);
    --wash-3: rgba(255, 214, 165, .05);
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .icon-btn .sun,
  :root:not([data-theme="light"]) .theme-btn .sun { display: none; }
  :root:not([data-theme="light"]) .icon-btn .moon,
  :root:not([data-theme="light"]) .theme-btn .moon { display: block; }
}

/* A page arrives rather than appearing. Small, once, and off entirely for
   anyone who has asked their device for less movement. */
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
main > .wrap > * { animation: rise .34s cubic-bezier(.22, .8, .3, 1) both; }
main > .wrap > *:nth-child(2) { animation-delay: .04s; }
main > .wrap > *:nth-child(3) { animation-delay: .08s; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* (Print lives at the very end of this file, after every theme block, so that
   paper always resolves light.) */

/* ---------------------------------------------------------------------------
   Compatibility aliases. The first build used a plum-and-gold palette taken from
   the printed manual, which is not the ministry's brand. Templates written
   against those names keep working and pick up the real colours. New work uses
   the names above.
   --------------------------------------------------------------------------- */
:root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
  --plum: var(--brand);
  --plum-deep: var(--navy);
  --plum-soft: var(--brand-soft);
  --gold: var(--green);
  --gold-deep: var(--green-deep);
  --gold-soft: var(--green-soft);
  --on-plum: var(--on-brand);
  --on-gold: var(--on-green);
  --masthead: var(--shell);
  --on-masthead: var(--on-shell);
}
.wordmark { display: flex; flex-direction: column; line-height: 1.2; }
.wordmark b { font-size: 1.06rem; font-weight: 700; color: var(--on-shell); }
.wordmark span { font-size: .7rem; color: var(--shell-muted); }
.crest { height: 30px; width: auto; }

/* ===========================================================================
   TWO PLACES, ONE SYSTEM
   ---------------------------------------------------------------------------
   The Support Team runs a cycle; a participant is walking through one. Those
   are different jobs and they should not feel the same. Same tokens, same
   components — the shell changes register.

   The desk is denser, cooler and quieter: more on screen, blue for action,
   nothing decorative competing with a queue.

   A participant's side is warmer and roomier: fewer things, said larger, with
   the ministry's green doing the work and more air around it.
   =========================================================================== */

/* -- the desk -------------------------------------------------------------- */
[data-audience="team"] {
  --radius: 12px;
  --radius-sm: 9px;
  --wash-1: rgba(10, 72, 179, .11);
  --wash-2: rgba(45, 206, 137, .08);
  --wash-3: rgba(120, 150, 190, .10);
}
[data-audience="team"] .brandmark .name b em {
  font-style: normal; font-weight: 400; color: var(--green); letter-spacing: .04em;
}
[data-audience="team"] main { padding: 20px 0 48px; }
[data-audience="team"] .card { padding: 16px; }
[data-audience="team"] .card-body, [data-audience="team"] .card-head { padding: 13px 16px; }
[data-audience="team"] h1 { font-size: 1.4rem; }
[data-audience="team"] .grid { gap: 13px; }
[data-audience="team"] .stat { padding: 14px 16px; }
[data-audience="team"] .stat .fig { font-size: 1.65rem; }
[data-audience="team"] .page-head { margin-bottom: 16px; }
[data-audience="team"] .page-head .eyebrow { color: var(--brand); }
/* Blue is the desk's action colour; green stays for things that are finished. */
[data-audience="team"] .btn-primary {
  background: var(--brand); border-color: var(--brand); color: var(--on-brand);
  box-shadow: 0 2px 12px color-mix(in srgb, var(--brand) 30%, transparent);
}
[data-audience="team"] .btn-primary:hover { background: var(--brand-deep); border-color: var(--brand-deep); color: var(--on-brand); }
[data-audience="team"] table.data { font-size: .84rem; }
[data-audience="team"] table.data td, [data-audience="team"] table.data thead th { padding: 9px 12px; }

/* -- the journey ----------------------------------------------------------- */
[data-audience="member"] {
  --radius: 20px;
  --radius-sm: 13px;
}
[data-audience="member"] main { padding: 32px 0 72px; }
[data-audience="member"] h1 { font-size: 1.78rem; }
[data-audience="member"] .page-head { margin-bottom: 26px; }
[data-audience="member"] .page-head .eyebrow { color: var(--green-darker); }
[data-audience="member"] .card { padding: 24px; }
[data-audience="member"] .card-body { padding: 24px; }
[data-audience="member"] .grid { gap: 20px; }
[data-audience="member"] .stat .fig { font-size: 2.1rem; }
[data-audience="member"] .card h2 { font-family: var(--serif); font-size: 1.2rem; }
[data-audience="member"] .btn-lg { padding: 14px 26px; }

@media (max-width: 680px) {
  [data-audience="member"] main { padding: 20px 0 52px; }
  [data-audience="member"] .card { padding: 18px; }
  [data-audience="member"] h1 { font-size: 1.44rem; }
}

/* -- the journey: a progress strip, because "where am I" is the first question -- */
.journey {
  position: relative; overflow: hidden; border-radius: var(--radius);
  background: var(--navy); color: var(--on-navy); padding: 26px 28px;
  box-shadow: var(--shadow);
}
.journey::before {
  content: ""; position: absolute; width: 30rem; height: 30rem; right: -9rem; top: -13rem;
  border-radius: 50%; background: radial-gradient(circle, rgba(45,206,137,.30), transparent 66%);
}
.journey .inner { position: relative; }
.journey .kicker {
  font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--green); font-weight: 700; margin-bottom: 7px;
}
.journey h1 { color: var(--on-navy); font-family: var(--serif); margin-bottom: 6px; }
.journey p { color: var(--on-navy-soft); margin: 0; }
.journey .bar {
  margin-top: 20px; height: 9px; border-radius: 99px;
  background: rgba(255, 255, 255, .16); overflow: hidden;
}
.journey .bar span { display: block; height: 100%; border-radius: 99px; background: var(--green); }
.journey .marks {
  margin-top: 10px; display: flex; justify-content: space-between;
  font-size: .76rem; color: var(--on-navy-muted);
}
.journey .marks b { color: var(--on-navy); }

.up-next { display: grid; gap: 10px; }
.up-next .slot {
  display: flex; gap: 13px; align-items: flex-start;
  padding: 13px 15px; border-radius: var(--radius-sm);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--glass-border);
}
.up-next .when {
  flex: none; width: 46px; text-align: center; line-height: 1.1;
  border-right: 1px solid var(--border); padding-right: 12px;
}
.up-next .when b { display: block; font-size: 1.12rem; color: var(--text); }
.up-next .when span { font-size: .66rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.up-next .what { min-width: 0; }
.up-next .what b { display: block; font-size: .92rem; line-height: 1.35; }
.up-next .what span { font-size: .78rem; color: var(--muted); }

.person-row { display: flex; align-items: center; gap: 13px; }
.person-row .avatar {
  width: 46px; height: 46px; border-radius: 50%; flex: none;
  background: var(--brand-soft); color: var(--brand);
  display: grid; place-items: center; font-weight: 700; font-size: 1.05rem;
}
.grid { align-items: start; }

/* ===========================================================================
   PHONE
   ---------------------------------------------------------------------------
   Most of this is read on a phone, standing up, on Nigerian data. That is the
   real device, so it gets a real bottom bar with thumb-sized targets rather
   than a desktop nav squeezed sideways.
   =========================================================================== */

.tabbar { display: none; }

@media (max-width: 680px) {
  /* The sideways-scrolling top nav is a desktop idea. Off it goes. */
  .nav { display: none; }

  /* Solid, with no backdrop filter: a filter here would make the bar the frame
     for anything fixed inside it, and the More sheet opens from inside it. */
  .tabbar {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    background: var(--surface);
    border-top: 1px solid var(--border);
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -1px 24px rgba(16, 30, 54, .10);
  }
  /* The content fades out under the bar rather than being cut off by it. */
  .tabbar::before {
    content: ""; position: absolute; left: 0; right: 0; top: -22px; height: 22px;
    background: linear-gradient(to top, var(--bg), transparent); pointer-events: none;
  }
  /* A tab is a link or a button. */
  .tabbar > a, .tabbar > button {
    flex: 1 1 0; min-width: 0; display: flex; flex-direction: column; align-items: center;
    gap: 3px; padding: 7px 2px 6px; border-radius: var(--radius-sm); position: relative;
    color: var(--muted); font: inherit; font-size: .64rem; font-weight: 600; letter-spacing: .01em;
    text-decoration: none; -webkit-tap-highlight-color: transparent;
    min-height: 53px; justify-content: center;
    background: transparent; border: 0; cursor: pointer;
  }
  .tabbar > a > span, .tabbar > button > span {
    max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .tabbar > a > svg, .tabbar > button > svg { width: 21px; height: 21px; stroke-width: 1.9; }
  .tabbar > a.on, .tabbar > button.on, .tabbar > button[aria-expanded="true"] { color: var(--green-darker); }
  .tabbar > a.on > svg, .tabbar > button.on > svg { stroke-width: 2.4; }
  .tabbar > a:active, .tabbar > button:active { background: var(--surface-2); }
  [data-audience="team"] .tabbar > a.on, [data-audience="team"] .tabbar > button.on,
  [data-audience="team"] .tabbar > button[aria-expanded="true"] { color: var(--brand); }
  /* A number riding on a tab: how many things are waiting. */
  .tabbar > a > .count, .tabbar > button > .count {
    position: absolute; top: 3px; left: calc(50% + 6px);
  }

  /* Room for the bar, plus the home indicator on an iPhone — but only on a
     page that has a bar. The public pages have none, and the old blanket
     padding left a 60px strip of page under their footer. */
  body:has(.tabbar) { padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  @supports not selector(:has(*)) {
    .tabbar ~ footer { margin-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px)); }
  }

  /* Thumb-sized everything. 44px is the floor, not the target. */
  .btn { min-height: 44px; padding: 11px 20px; }
  .btn-sm { min-height: 44px; padding: 9px 14px; font-size: .8rem; }
  /* Radios, tick boxes and file choosers are left out: stretched to 46px each
     radio took a row of its own and pushed its label underneath. */
  input:where(:not([type="checkbox"], [type="radio"], [type="file"], [type="range"], [type="hidden"])),
  select, textarea { min-height: 46px; font-size: 16px; }
  .more-menu a, .more-menu button, .nav a { min-height: 44px; display: flex; align-items: center; }
  .icon-btn, .theme-btn { width: 44px; height: 44px; }
  .seg a { min-height: 44px; display: inline-flex; align-items: center; padding: 0 15px; }
  /* A breadcrumb is one line of small type; its tap area is not. The padding is
     taken back by the margin, so nothing on the page moves. */
  .crumbs a { display: inline-block; padding: 13px 5px; margin: -13px -5px; }
  .choices label,
  label:where([id^="id_"] > div > *):where(:has(> input[type="radio"]), :has(> input[type="checkbox"])) {
    min-height: 44px; align-items: center;
  }
  /* One tick box and its sentence. The box stays level with the first line of
     the words, as it is on a wide screen, and the sentence is 44px to press: its
     padding is taken back by the margin, so the row keeps its height. The row
     used to be stretched to 44px with the words centred in it, and a page that
     set the row's alignment for itself left the box a line above its words. */
  .check-row label { padding: 12px 0; margin: -12px 0; }
  .foot a { display: inline-block; padding: 13px 0; margin: -13px 0; }
  /* A link in a line of words ("Directions", "Ask for it here") is a line of
     small type, 15px tall. It is an inline box, so padding above and below
     gives it a thumb's height and moves nothing. Any link with no class of its
     own that sits straight inside a paragraph, a list item, a dd or a line of
     .small; the focus ring is pulled back in to the words. */
  main :where(p, dd, li, div.small) > a:where(:not([class])) { padding-block: 13px; --link-ring: -11px; }
  /* Padding that moves nothing can reach over the next link, and the later of
     the two then takes the taps meant for the earlier. So where two would meet
     (two links in one paragraph, or a link in each of two lines that follow one
     another) the links take their room in the line instead: those lines stand
     further apart, and no two boxes can touch. */
  main :where(:where(p, dd, li, div.small):has(> a:not([class]) ~ a:not([class]))) > a:where(:not([class])),
  main :where(:where(p, dd, li, div.small):has(> a:not([class]))) + :where(p, dd, li, div.small) > a:where(:not([class])),
  main :where(:where(p, dd, li, div.small):has(> a:not([class])):has(+ :where(p, dd, li, div.small) > a:not([class]))) > a:where(:not([class])) {
    display: inline-block; padding-block: 10px; --link-ring: -8px;
  }
  main :where(p, dd, li, div.small) > a:where(:not([class])):focus-visible { outline-offset: var(--link-ring); }

  /* The masthead is chrome, not content — make it small and let it scroll away. */
  .masthead-inner { padding: 10px 16px; gap: 10px; }
  .brandmark img { height: 28px; }
  .brandmark .name b { font-size: .98rem; }

  .card { border-radius: var(--radius); }
  .grid { gap: 14px; }
  .table-wrap { margin: 0 -15px; padding: 0 15px; }
  .journey { padding: 22px 20px; border-radius: var(--radius); }
  .journey h1 { font-size: 1.44rem; }
}

/* A phone in landscape, or a small tablet: keep the bar, widen the gutters. */
@media (max-width: 680px) and (orientation: landscape) {
  .tabbar > a, .tabbar > button { flex-direction: row; gap: 7px; font-size: .72rem; }
  .tabbar > a > svg, .tabbar > button > svg { width: 18px; height: 18px; }
}

/* Installed as an app: no browser chrome, so the masthead carries the status bar. */
@media (display-mode: standalone) {
  .masthead { padding-top: env(safe-area-inset-top, 0px); }
}

/* -- the menu behind your own name ---------------------------------------- */
/* 44px to aim at, whatever is inside: a 32px face alone was the whole target. */
.whoami-menu > summary {
  list-style: none; cursor: pointer; padding: 0 2px; min-width: 44px; min-height: 44px;
  justify-content: flex-end; border-radius: var(--radius-sm);
}
.whoami-menu > summary::-webkit-details-marker { display: none; }
@media (max-width: 680px) { .whoami-menu > summary { justify-content: center; } }
.whoami-menu > summary:hover .dot { filter: brightness(1.12); }
.whoami-menu .more-menu { min-width: 232px; }
.menu-head {
  padding: 9px 12px 11px; margin-bottom: 4px; border-bottom: 1px solid var(--border);
  display: flex; flex-direction: column; line-height: 1.3;
}
.menu-head b { font-size: .9rem; color: var(--text); }
/* Not the face: an initial drawn in --muted at this size was 4.4:1. */
.menu-head span:not(.avatar):not(.who) { font-size: .74rem; color: var(--muted); }
.menu-theme {
  width: 100%; text-align: left; background: transparent; border: 0; cursor: pointer;
  padding: 9px 12px; border-radius: var(--radius-sm); font: inherit; font-size: .86rem;
  color: var(--text-soft);
}
.menu-theme:hover { background: var(--surface-2); color: var(--text); }
.menu-theme .moon { display: none; }
:root[data-theme="dark"] .menu-theme .sun { display: none; }
:root[data-theme="dark"] .menu-theme .moon { display: inline; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .menu-theme .sun { display: none; }
  :root:not([data-theme="light"]) .menu-theme .moon { display: inline; }
}

/* ---------- a person, shown as a person ---------------------------------- */
.avatar {
  border-radius: 50%; flex: none; display: block; object-fit: cover;
  background: var(--brand-soft); color: var(--brand);
  border: 1px solid var(--glass-border);
}
/* A photograph that fails to load leaves its tinted circle, not its alt text
   spilling out of it. `.person-row .avatar` sets a colour of its own and is the
   more specific rule, so it is named here too. */
img.avatar, .person-row img.avatar { color: transparent; overflow: hidden; }
.avatar-initial {
  display: grid; place-items: center; font-weight: 700; line-height: 1;
  text-transform: uppercase; letter-spacing: .01em;
}
.avatar-xs { width: 24px; height: 24px; font-size: .68rem; }
.avatar-sm { width: 32px; height: 32px; font-size: .8rem; }
.avatar-md { width: 46px; height: 46px; font-size: 1.05rem; }
.avatar-lg { width: 72px; height: 72px; font-size: 1.6rem; }
.avatar-xl { width: 112px; height: 112px; font-size: 2.4rem; }

/* The picker: you see the photograph, not the file name. */
.photo-picker { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.photo-picker .preview {
  width: 96px; height: 96px; border-radius: 50%; object-fit: cover; flex: none;
  background: var(--surface-3); border: 1px solid var(--border);
  display: grid; place-items: center; color: var(--muted); font-size: 2rem; font-weight: 700;
}
.photo-picker .choose { display: grid; gap: 7px; }
.photo-picker input[type="file"] { display: none; }
.photo-picker .hint { font-size: .78rem; color: var(--muted); }

/* ---------- a grid on a phone ---------------------------------------------
   Two up is for the small number tiles only: side by side they save a screen.
   It used to apply to every .grid, which squeezed whole cards (a couple's
   details, a payment table, "Ask or talk") into 170px columns. Cards go one to
   a line. A grid can also ask for two-up by name with .grid-tiles. */
@media (max-width: 680px) {
  .grid { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .grid:has(> .stat), .grid.grid-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid:has(> .stat) > .card, .grid:has(> .stat) > .panel, .grid:has(> .stat) > form { grid-column: 1 / -1; }
  /* An inline "span 2" would conjure a second column out of nothing. */
  .grid > .wide, .grid > [style*="grid-column"] { grid-column: 1 / -1 !important; }
  .stat { padding: 14px; }
  .stat .fig { font-size: 1.5rem; }
  .stat .cap { font-size: .72rem; }
  [data-audience="member"] .card { padding: 16px; }
  .card h2 { font-size: 1.02rem; }
  .card p { font-size: .86rem; }
}
/* Under about 360px two columns start to squeeze; give up gracefully. */
@media (max-width: 359px) {
  .grid, .grid:has(> .stat), .grid.grid-tiles { grid-template-columns: minmax(0, 1fr); }
}
.menu-head { flex-direction: row; align-items: center; gap: 11px; }
.menu-head .who { display: flex; flex-direction: column; min-width: 0; }
.account-head { display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }

/* ===========================================================================
   RECORDS: LISTS AND CARDS, NOT CRAMPED TABLES
   ---------------------------------------------------------------------------
   A table is right when you are comparing a column down the page. Most of what
   Kindred shows is not that — it is a list of people, each with a few facts and
   one thing you might do about them. Squeezing that into four columns produces
   the wrapping, hyphenating mess this replaces.

   .recordlist  — a list of records: a lead (face or date), a title, some meta,
                  and an action. Reflows to stacked on a phone by itself.
   .chips       — a set of small values. "3, 4, 5, 6, 7, 8, 9, 10, 11, 12" is a
                  wall; ten chips is a glance.
   table.stacked — for genuine tables: below 680px each row becomes a card, with
                  each cell labelled from its data-label attribute.
   =========================================================================== */

.recordlist { display: grid; gap: 10px; }
.recordlist .record {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 14px 16px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--glass-border);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.recordlist .record:hover { border-color: var(--border-strong); }
.recordlist .lead { flex: none; }
.recordlist .lead.date {
  width: 48px; text-align: center; line-height: 1.1; padding-right: 13px;
  border-right: 1px solid var(--border);
}
.recordlist .lead.date b { display: block; font-size: 1.12rem; color: var(--text); }
.recordlist .lead.date span {
  font-size: .64rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
}
.recordlist .body { flex: 1 1 200px; min-width: 0; }
.recordlist .body .title { font-weight: 700; color: var(--text); font-size: .94rem; line-height: 1.35; }
.recordlist .body .meta { font-size: .8rem; color: var(--muted); margin-top: 3px; }
.recordlist .body .meta b { color: var(--text-soft); font-weight: 600; }
.recordlist .tail { flex: none; margin-left: auto; display: flex; align-items: center; gap: 8px; }
.recordlist .tail:empty { display: none; }

.chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 6px; }
.chip {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 8px; border-radius: 8px;
  background: var(--surface-3); color: var(--text-soft);
  font-size: .76rem; font-weight: 700; font-variant-numeric: tabular-nums;
}
.chip-owed { background: var(--warn-soft); color: var(--warn); }
.chip-done { background: var(--green-soft); color: var(--green-darker); }

@media (max-width: 680px) {
  .recordlist .record { padding: 13px 14px; gap: 12px; }
  .recordlist .tail { margin-left: 0; flex-basis: 100%; }
  .recordlist .tail .btn { width: 100%; }

  /* On a phone the whole card opens the record, not just the 18px of its
     title. Anything else in the card that can be pressed stays on top. */
  .recordlist .record { position: relative; }
  .recordlist .record .title a::after { content: ""; position: absolute; top: 0; right: 0; bottom: 0; left: 0; }
  :where(.recordlist .record) :where(a, button, input, select, textarea, label, summary, .tail):not(:where(.title a)) {
    position: relative; z-index: 1;
  }

  /* A genuine table becomes one card per row. Each cell keeps its heading. */
  table.stacked, table.stacked thead, table.stacked tbody,
  table.stacked tr, table.stacked th, table.stacked td { display: block; }
  table.stacked thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  table.stacked tbody tr {
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
    padding: 6px 4px; margin-bottom: 10px;
  }
  table.stacked tbody td, table.stacked tbody th {
    border: 0; padding: 7px 12px; width: auto; text-align: left;
    display: flex; justify-content: space-between; gap: 6px 10px; align-items: baseline;
  }
  table.stacked tbody td::before {
    content: attr(data-label); flex: none;
    font-size: .68rem; letter-spacing: .08em; text-transform: uppercase;
    color: var(--muted); font-weight: 700; padding-top: 2px;
  }
  table.stacked tbody td:empty { display: none; }
  table.stacked tbody tr:hover td { background: transparent; }
  /* The value may wrap; the heading beside it may not be squeezed. */
  table.stacked tbody td { text-align: right; overflow-wrap: anywhere; }
  table.stacked tbody td > * { min-width: 0; max-width: 100%; }
  /* A cell that holds several things (four badges, a person's roles) wraps them
     under one another on the right and keeps its heading on the left: in one
     unbroken line they ran out of the card and were cut off. A cell of plain
     words is left as it was, beside its heading. */
  table.stacked tbody td:has(> * ~ *) { flex-wrap: wrap; justify-content: flex-end; }
  table.stacked tbody td:has(> * ~ *)::before { margin-right: auto; }
  /* A cell with no heading is the row's action: it takes the whole line, and
     its button with it, so the thing to press is never off the edge. */
  table.stacked tbody td:not([data-label])::before, table.stacked tbody td[data-label=""]::before { content: none; }
  table.stacked tbody td:not([data-label]), table.stacked tbody td[data-label=""] { text-align: left; justify-content: flex-start; }
  table.stacked tbody td:not([data-label]) > .btn, table.stacked tbody td[data-label=""] > .btn { flex: 1 1 auto; }
  /* The table is cards now; the wrapper has nothing left to scroll or fade. */
  .table-wrap:has(> table.stacked) { overflow: visible; -webkit-mask-image: none; mask-image: none; }
  .recordlist .tail { flex-wrap: wrap; }
}

/* ---------- people, as cards ---------------------------------------------
   Used where a list is a list of humans: counsellors, the team, members. */
.peoplegrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }
.person-card { display: flex; flex-direction: column; gap: 14px; }
.person-card.is-closed { opacity: .82; }
.person-top { display: flex; align-items: center; gap: 13px; }
.person-name { display: flex; flex-direction: column; gap: 5px; align-items: flex-start; min-width: 0; }
.person-name b { font-size: 1rem; color: var(--text); line-height: 1.25; }
.person-bio {
  margin: 0; font-size: .86rem; color: var(--text-soft); line-height: 1.55;
  /* Three lines, then it stops — an ellipsis mid-sentence at an arbitrary word
     count reads as a bug. */
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.person-foot {
  margin-top: auto; padding-top: 13px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap;
}
.ways { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.ways-label { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }

/* A capacity meter reads at a glance; "1 of 4 / 3 places left" did not. */
.meter-head {
  display: flex; justify-content: space-between; gap: 10px;
  font-size: .82rem; color: var(--text-soft); margin-bottom: 7px;
}
.meter-head b { color: var(--text); }
.meter-track {
  height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden;
}
.meter-fill {
  display: block; height: 100%; border-radius: 99px; background: var(--green);
  transition: width .3s ease;
}
.meter-fill.is-full { background: var(--warn); }

@media (max-width: 680px) {
  .peoplegrid { grid-template-columns: 1fr; gap: 12px; }
  .person-foot .btn { width: 100%; }
}

/* A lone card at the end of a two-up row looks like a mistake rather than a
   choice. If it is the odd one out, let it take the whole line. */
@media (max-width: 680px) {
  .grid > .stat:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .grid.grid-tiles > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .grid > .stat:last-child:nth-child(odd) { display: flex; align-items: baseline; gap: 12px; }
  .grid > .stat:last-child:nth-child(odd) .cap { margin-top: 0; }
}

/* ===========================================================================
   WORKFLOW: THE DESK, STATES, MOVES AND HISTORY
   Shared by every process — events, care, questions, giving, messages.
   Tokens only, so both themes resolve from the blocks above.
   =========================================================================== */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* --muted on this pill was 4.4:1 in dark at 11px ("Cancelled", "Referred on"). */
.badge-muted { background: var(--surface-3); color: var(--text-soft); border: 1px solid var(--border); }

.stat-link { display: block; color: inherit; text-decoration: none; border: 1px solid transparent; }
.stat-link:hover { text-decoration: none; border-color: var(--border-strong); }
.stat-link.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--ring); }

.seg {
  display: flex; gap: 6px; flex-wrap: nowrap; overflow-x: auto; margin: 0 0 16px;
  padding-bottom: 4px; scrollbar-width: thin;
}
.seg a {
  flex: none; padding: 7px 13px; border-radius: var(--radius-pill); font-size: .8rem; font-weight: 600;
  color: var(--text-soft); background: var(--surface); border: 1px solid var(--border);
  white-space: nowrap;
}
.seg a:hover { text-decoration: none; border-color: var(--border-strong); }
/* The chosen filter is filled with the brand colour. It was --navy, which in
   dark is darker than the page: the chosen chip read as the switched-off one. */
.seg a.on { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }

.recordlist .record.is-urgent { border-left: 4px solid var(--bad); }

.wf-actions { display: flex; flex-direction: column; gap: 10px; }
.wf-move { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin: 0; }
.wf-move input[type="text"] { flex: 1 1 220px; min-width: 0; }

.timeline { list-style: none; margin: 0; padding: 0 0 0 18px; border-left: 2px solid var(--border); }
.timeline li { position: relative; padding: 0 0 16px 6px; }
.timeline li:last-child { padding-bottom: 0; }
.timeline li::before {
  content: ""; position: absolute; left: -25px; top: 5px; width: 12px; height: 12px;
  border-radius: 50%; background: var(--surface); border: 3px solid var(--brand);
}
.timeline li.tl-ok::before { border-color: var(--green-deep); }
.timeline li.tl-warn::before { border-color: var(--warn); }
.timeline li.tl-bad::before { border-color: var(--bad); }
.timeline li.tl-muted::before { border-color: var(--muted); }
.tl-head { display: flex; gap: 10px; flex-wrap: wrap; align-items: baseline; }
.tl-head b { font-size: .9rem; }
.tl-note {
  margin-top: 5px; font-size: .85rem; color: var(--text-soft); white-space: pre-wrap;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 8px 11px;
}

.flow { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.flow-gap { width: 14px; height: 2px; background: var(--border-strong); border-radius: 2px; }

/* A key-value list for a record's facts. */
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; margin: 0; font-size: .88rem; }
.facts dt { color: var(--muted); font-weight: 600; }
.facts dd { margin: 0; color: var(--text); min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 520px) {
  .facts { grid-template-columns: 1fr; gap: 2px; }
  .facts dd { margin-bottom: 8px; }
}

/* Two columns on a record screen: the work on the left, its history on the right. */
.split { display: grid; gap: 18px; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* ===========================================================================
   THE PUBLIC SITE
   The same building as the member area: the navy shell, the green rule, the
   wash behind the page. What changes is scale — a visitor is being welcomed,
   not handed a task list — so headings are larger and sections breathe.
   =========================================================================== */
.pub-account { display: flex; align-items: center; gap: 10px; }
/* Sign in stays in the header at every width. It was hidden under 420px, which
   left a returning person on a phone with only "Create account" to press. */
.pub-signin {
  color: var(--on-shell); font-size: .86rem; font-weight: 600; white-space: nowrap;
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 4px;
}
.pub-signin:hover { color: var(--on-shell); text-decoration: underline; }
.pub-account .btn { white-space: nowrap; }
@media (max-width: 420px) {
  .pub-account { gap: 6px; }
  .pub-account .btn-sm { padding-left: 12px; padding-right: 12px; }
}
@media (max-width: 359px) {
  /* The narrowest phones: the logo gives way before Sign in does. */
  .masthead-inner { gap: 6px; }
  .masthead .brandmark:not(:has(.name)) img { height: 24px; }
  .pub-account .btn-sm { padding-left: 9px; padding-right: 9px; font-size: .74rem; }
}

.pub-hero { padding: 26px 0 8px; display: grid; gap: 28px; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); align-items: center; }
.pub-hero h1 {
  font-family: var(--serif); font-size: clamp(2rem, 4.6vw, 3.25rem); line-height: 1.08;
  letter-spacing: -.02em; margin: 0 0 14px; color: var(--text);
}
.pub-hero .lede { font-size: clamp(1rem, 1.6vw, 1.14rem); color: var(--text-soft); max-width: 34em; margin: 0 0 22px; }
.pub-hero .eyebrow, .pub-eyebrow {
  display: inline-flex; align-items: center; gap: 8px; font-size: .72rem; font-weight: 700;
  letter-spacing: .14em; text-transform: uppercase; color: var(--green-darker); margin-bottom: 12px;
}
.pub-eyebrow::before, .pub-hero .eyebrow::before {
  content: ""; width: 22px; height: 3px; border-radius: 3px; background: var(--green);
}
.pub-cta { display: flex; gap: 10px; flex-wrap: wrap; }
.pub-hero-art { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; max-width: 440px; justify-self: end; width: 100%; }
.pub-hero-art img {
  width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; object-position: top; border-radius: var(--radius);
  box-shadow: var(--shadow); display: block;
}
.pub-hero-art img:nth-child(even) { transform: translateY(18px); }
@media (max-width: 860px) {
  .pub-hero { grid-template-columns: 1fr; padding-top: 6px; }
  .pub-hero-art { justify-self: stretch; max-width: none; grid-template-columns: repeat(4, 1fr); gap: 8px; }
  .pub-hero-art img { aspect-ratio: 3 / 4; }
  .pub-hero-art img:nth-child(even) { transform: none; }
}

.pub-section { margin-top: 56px; }
.pub-section > header { display: flex; align-items: end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.pub-section h2 { font-family: var(--serif); font-size: clamp(1.35rem, 2.6vw, 1.75rem); margin: 0; letter-spacing: -.01em; }
.pub-section > header p { margin: 4px 0 0; color: var(--muted); max-width: 40em; }

.units { display: grid; gap: 16px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 960px) { .units { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 520px) { .units { grid-template-columns: 1fr; } }
.unit-card {
  display: flex; flex-direction: column; border-radius: var(--radius-lg); overflow: hidden;
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
  color: inherit; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease;
}
.unit-card:hover { text-decoration: none; transform: translateY(-3px); box-shadow: var(--shadow); }
.unit-card img { width: 100%; height: auto; aspect-ratio: 4 / 5; object-fit: cover; object-position: top; display: block; }
.unit-card .unit-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.unit-card .unit-body b { color: var(--text); font-size: 1rem; }
.unit-card .unit-body span { font-size: .86rem; color: var(--text-soft); line-height: 1.5; }
.unit-card .unit-more { margin-top: auto; padding-top: 6px; font-size: .82rem; font-weight: 700; color: var(--brand); }
@media (max-width: 520px) {
  .unit-card { flex-direction: row; }
  .unit-card img { width: 34%; aspect-ratio: auto; height: auto; min-height: 150px; }
}

.pub-band {
  margin-top: 56px; border-radius: var(--radius-lg); padding: clamp(22px, 4vw, 40px);
  background: var(--navy); color: var(--on-navy);
  display: grid; gap: 18px; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); align-items: center;
}
.pub-band h2 { color: var(--on-navy); font-family: var(--serif); font-size: clamp(1.3rem, 2.4vw, 1.7rem); margin: 0 0 8px; }
.pub-band p { color: var(--shell-muted); margin: 0; }
.pub-band .pub-cta { justify-content: flex-end; }
@media (max-width: 760px) { .pub-band { grid-template-columns: 1fr; } .pub-band .pub-cta { justify-content: flex-start; } }

.ways-grid { display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.way {
  display: flex; flex-direction: column; gap: 6px; padding: 18px; border-radius: var(--radius);
  background: var(--glass-strong); border: 1px solid var(--glass-border); color: inherit;
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
}
.way:hover { text-decoration: none; border-color: var(--border-strong); }
.way b { color: var(--text); }
.way span { font-size: .86rem; color: var(--text-soft); }
.way .go { margin-top: auto; font-size: .82rem; font-weight: 700; color: var(--brand); }

.postgrid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.postcard { display: flex; flex-direction: column; border-radius: var(--radius); overflow: hidden; background: var(--surface); border: 1px solid var(--border); color: inherit; }
.postcard:hover { text-decoration: none; border-color: var(--border-strong); }
.postcard img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; display: block; background: var(--surface-3); }
.postcard .pc-body { padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 6px; }
.postcard .pc-body b { color: var(--text); line-height: 1.35; }
.postcard .pc-body span { font-size: .8rem; color: var(--muted); }

.pub-foot { background: var(--shell); color: var(--shell-muted); margin-top: 64px; padding: 40px 0 0; font-size: .88rem; }
.pub-foot a { color: var(--on-shell); }
/* h2 or h3: the footer's headings look the same whichever level the page order calls for. */
.pub-foot h2, .pub-foot h3 { color: var(--on-shell); font-family: var(--sans); font-size: .78rem; letter-spacing: .12em; text-transform: uppercase; margin: 0 0 10px; }
.pub-foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.pub-foot p { margin: 0 0 8px; }
.pub-foot-grid { display: grid; gap: 26px; grid-template-columns: 1.5fr 1fr 1fr 1fr; padding-bottom: 28px; }
.pub-foot-logo { height: 46px; width: auto; display: block; margin-bottom: 12px; }
.pub-foot-base {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 14px 20px 22px; border-top: 1px solid color-mix(in srgb, var(--shell-muted) 30%, transparent);
  font-size: .78rem;
}
@media (max-width: 860px) { .pub-foot-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .pub-foot-grid { grid-template-columns: 1fr; } }

/* A plain, readable column for public forms and articles. */
.pub-narrow { max-width: 680px; margin: 0 auto; }
.pub-form-card { padding: clamp(18px, 3vw, 28px); }

.pub-band { border: 1px solid var(--border); }
.pub-title { font-family: var(--serif); font-size: clamp(1.6rem, 3.4vw, 2.3rem); line-height: 1.15; letter-spacing: -.01em; margin: 0 0 12px; }
.lede { font-size: 1.05rem; color: var(--text-soft); }

.unit-hero {
  display: grid; gap: clamp(18px, 4vw, 40px); align-items: center;
  grid-template-columns: minmax(180px, 300px) minmax(0, 1fr); margin-top: 8px;
}
.unit-hero img {
  width: 100%; height: auto; aspect-ratio: 454 / 791; object-fit: cover;
  border-radius: var(--radius-lg); box-shadow: var(--shadow); display: block;
}
.unit-hero h1 { font-family: var(--serif); font-size: clamp(1.9rem, 4.4vw, 3rem); line-height: 1.08; letter-spacing: -.02em; margin: 0 0 12px; }
@media (max-width: 680px) {
  .unit-hero { grid-template-columns: 1fr; }
  .unit-hero img { max-width: 220px; aspect-ratio: 4 / 5; object-position: top; }
}

.contact-grid { display: grid; gap: clamp(20px, 4vw, 44px); grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 820px) { .contact-grid { grid-template-columns: 1fr; } }

/* The public site has no tab bar, so its navigation row stays on a phone and
   scrolls sideways. app.js brings the page you are on into view and fades the
   edge while there is more to the side. */
@media (max-width: 680px) {
  .nav.pub-nav { display: block; }
  .nav.pub-nav .nav-inner { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .nav.pub-nav a { padding: 10px 11px; font-size: .82rem; flex: none; }
  /* The public masthead is the logo alone: a little larger, so it can be read. */
  .brandmark:not(:has(.name)) img { height: 32px; }
  .pub-foot li a, .pub-foot p a, .pub-foot-base a {
    display: inline-flex; align-items: center; min-height: 44px;
  }
  .pub-foot ul { gap: 0; }
}
.flow-moves th { text-align: left; }

/* ===========================================================================
   SHARED PIECES
   Small things more than one part of Kindred uses. Tokens only.
   =========================================================================== */

/* -- a count: how many are waiting, on a nav item, a tab or a heading ------- */
.count {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--radius-pill); background: var(--brand); color: var(--on-brand);
  font-size: .68rem; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
  vertical-align: 1px; margin-left: 6px;
}
.count-urgent, .count.is-urgent { background: var(--bad); color: var(--on-bad); }
.nav .count { background: var(--green); color: var(--navy-deep); }
.nav .count-urgent, .nav .count.is-urgent { background: var(--bad); color: var(--on-bad); }
:root[data-theme="dark"] .nav .count { color: var(--on-green); }
:root[data-theme="dark"] .nav .count-urgent, :root[data-theme="dark"] .nav .count.is-urgent { color: var(--on-bad); }

/* -- the bell: your notices, with the number not yet read ------------------- */
.bell {
  position: relative; flex: none; display: grid; place-items: center;
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  color: inherit; border: 1px solid color-mix(in srgb, currentColor 26%, transparent);
  text-decoration: none;
}
.bell:hover { background: color-mix(in srgb, currentColor 11%, transparent); text-decoration: none; }
.bell.on { background: color-mix(in srgb, currentColor 16%, transparent); }
.bell-count {
  position: absolute; top: -7px; right: -7px; min-width: 19px; height: 19px; padding: 0 5px;
  display: grid; place-items: center; border-radius: var(--radius-pill);
  background: var(--bad); color: var(--on-bad); font-size: .66rem; font-weight: 700; line-height: 1;
  box-shadow: 0 0 0 2px var(--surface);   /* a ring of whatever it sits on */
}
.masthead .bell-count { box-shadow: 0 0 0 2px var(--shell); }
@media (max-width: 680px) { .bell { width: 44px; height: 44px; } }

/* -- a notice: one line telling a person something of theirs moved ---------- */
.notice {
  display: block; padding: 13px 16px; border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 70%, transparent);
  border: 1px solid var(--glass-border); border-left: 4px solid var(--border-strong);
  color: var(--text-soft); text-decoration: none;
}
.recordlist .record.notice { display: flex; border-left-width: 4px; border-left-style: solid; border-left-color: var(--border-strong); }
a.notice:hover { text-decoration: none; border-color: var(--border-strong); }
.notice .title, .notice > b { color: var(--text-soft); font-weight: 500; }
.notice.is-unread { background: var(--surface); }
.notice.is-unread .title, .notice.is-unread > b { color: var(--text); font-weight: 700; }
.notice-info.is-unread, .recordlist .record.notice-info.is-unread { border-left-color: var(--brand); }
.notice-action.is-unread, .recordlist .record.notice-action.is-unread { border-left-color: var(--warn); }
.notice-good.is-unread, .recordlist .record.notice-good.is-unread { border-left-color: var(--green-deep); }
.notice-urgent, .recordlist .record.notice-urgent { border-left-color: var(--bad); }
.notice-urgent.is-unread { background: var(--bad-soft); }

/* -- a private link: the way back for someone with no account --------------
   <div class="private-link">
     <a href="{{ link }}">{{ link }}</a>
     <button type="button" class="btn btn-sm" data-copy>Copy link</button>
   </div>
   The address wraps anywhere, so it never pushes a phone sideways. */
.private-link {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 12px 14px; border-radius: var(--radius-sm);
  background: var(--surface-2); border: 1px dashed var(--field-border);
  font-size: .86rem; color: var(--text); min-width: 0; max-width: 100%;
  overflow-wrap: anywhere; word-break: break-word;
}
.private-link > a, .private-link > code, .private-link > span, .private-link > input {
  flex: 1 1 220px; min-width: 0; overflow-wrap: anywhere; word-break: break-all;
}
.private-link > code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .82rem; }
.private-link > input { font-size: .86rem; }
.private-link > .btn, .private-link > button { flex: none; }
span.private-link, a.private-link, code.private-link { display: inline-block; }
.btn.is-copied { border-color: var(--green-deep); color: var(--green-darker); }
@media (max-width: 680px) {
  .private-link > .btn, .private-link > button { flex: 1 1 auto; }
}

/* Shown on paper only: a heading line for a printed list, room for a signature. */
.only-print { display: none; }

/* ===========================================================================
   PRINT
   Paper is light, whatever theme the screen is in. This block is last so it
   outranks every theme block above: it puts the whole light token set back,
   takes away the controls, and prints what is in a field as plain text.
   A register, a class list or a counselling record printed from dark mode used
   to come out with near-white headings on white paper.
   =========================================================================== */
@page { margin: 14mm; }
@media print {
  :root, :root[data-theme="dark"], :root:not([data-theme="light"]) {
    color-scheme: light;
    --navy: #172B4D; --navy-deep: #101E36; --navy-soft: #EDF1F7;
    --brand: #0A48B3; --brand-deep: #083A93; --brand-soft: #E7EEFB;
    --green: #2DCE89; --green-deep: #18855A; --green-darker: #146043; --green-soft: #E4F8EF;
    --bg: #FFFFFF; --bg-tint: #FFFFFF;
    --surface: #FFFFFF; --surface-2: #F7F9FC; --surface-3: #EDF1F7;
    --border: #C9D1DE; --border-strong: #9AA6B8; --field-border: #7A879B;
    --text: #000000; --text-soft: #1B2433; --muted: #46526A;
    --on-brand: #FFFFFF; --on-green: #FFFFFF; --on-bad: #FFFFFF;
    --on-navy: #000000; --on-navy-soft: #1B2433; --on-navy-muted: #46526A;
    --ok: #146043; --ok-soft: #E4F8EF;
    --warn: #7A4E05; --warn-soft: #FDF3E2;
    --bad: #A31F33; --bad-soft: #FCE9EC;
    --info: #0A48B3; --info-soft: #E7EEFB;
    --ring: transparent; --focus: #000000; --focus-on-shell: #000000;
    --shadow-sm: none; --shadow: none; --shadow-lg: none;
    --glass: #FFFFFF; --glass-strong: #FFFFFF; --glass-border: #C9D1DE; --glass-edge: #C9D1DE;
    --wash-1: transparent; --wash-2: transparent; --wash-3: transparent;
    --shell: #FFFFFF; --on-shell: #000000; --shell-muted: #46526A;
  }
  html, body {
    background: #fff !important; background-image: none !important; color: #000;
    display: block; min-height: 0; padding: 0 !important; font-size: 11pt;
  }
  *, *::before, *::after { animation: none !important; transition: none !important; }

  /* Chrome and controls have no place on paper. */
  .no-print, .masthead, .nav, .foot, .pub-foot, .tabbar, .skip-link, .crumbs, .seg,
  .bell, .btn, .icon-btn, .theme-btn, .wf-actions, form.wf-move, .alert[data-dismiss],
  [data-copy], [data-share], [data-theme-toggle], input[type="file"], input[type="submit"],
  input[type="button"], .form-summary { display: none !important; }
  /* Finding and paging are things done on a screen. A form that only looks
     something up (a search, a row of filters) and the pager under a list stay
     off the paper, and so does a fold that is shut: on screen it is one line to
     press ("+ Book a session"), and what it holds is not showing. */
  form[method="get" i], form[role="search"], form.filters, nav.pager, .pager { display: none !important; }
  /* (A rule of its own: a browser that cannot read :has() drops the whole rule it is in.) */
  details:not([open]):has(form, .btn, button) { display: none !important; }
  /* A fold left open over an entry form nobody has filled in ("Book a session":
     an empty date box, "Choose…") stays off as well. One with something typed
     into any of its forms prints. */
  details:has(form[data-unfilled]):not(:has(form[method="post" i]:not([data-unfilled]))) { display: none !important; }
  .card:has(> form[method="get" i]):not(:has(> :not(form[method="get" i], h2, h3))) { display: none !important; }
  .only-print { display: block; }
  span.only-print { display: inline; }

  main, [data-audience] main { padding: 0 !important; }
  .wrap { max-width: none; padding: 0; }
  a { color: inherit; text-decoration: none; }

  .card, .stat, .panel, .alert, fieldset, .record, .recordlist .record, .notice, .private-link {
    background: #fff !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important;
    box-shadow: none !important; border-color: #bbb;
  }
  .card-head { background: #fff !important; }
  /* An entry form nobody has filled in is not part of the record beside it: its
     empty date box and the first answer on each list printed as if a session had
     been recorded. app.js marks a form that writes while it holds nothing; in a
     card that comes after another card (the record), it stays off the paper. A
     form that is the page itself (the first or only card, a register, a sheet
     to fill in by hand) still prints, empty or not. */
  .card ~ .card > form[data-unfilled] { display: none !important; }
  /* A card that held nothing but its buttons or such a form would print as an
     empty box under a heading. */
  .card:has(> .wf-actions):not(:has(> :not(h2, h3, .wf-actions))),
  .card ~ .card:has(> form[data-unfilled]):not(:has(> :not(h2, h3, .help, .wf-actions, form[data-unfilled]))) { display: none; }
  /* A navy panel prints without its background, so its words turn dark. */
  .journey, .pub-band { background: #fff !important; border: 1px solid #bbb; }
  .journey::before { display: none; }
  .journey .kicker { color: #000; }
  .badge, .chip { background: #fff !important; color: #000 !important; border: 1px solid #888; }

  /* What is in a field, as plain words over a rule. */
  input:not([type="checkbox"]):not([type="radio"]), select, textarea {
    border: 0 !important; border-bottom: 1px solid #888 !important; border-radius: 0 !important;
    background: transparent !important; box-shadow: none !important; color: #000 !important;
    padding: 2px 0 !important; min-height: 0 !important; -webkit-appearance: none; appearance: none;
  }
  input::placeholder, textarea::placeholder { color: transparent; }

  .table-wrap, [data-cue] { overflow: visible !important; -webkit-mask-image: none !important; mask-image: none !important; margin: 0; padding: 0; }
  table.data { font-size: 10pt; }
  table.data thead { display: table-header-group; }
  table.data thead th { background: #eee !important; color: #000; }
  table.data td, table.data tbody th { color: #000; border-bottom-color: #bbb; }
  tr, .record, .stat, .timeline li { break-inside: avoid; }
  h1, h2, h3 { break-after: avoid; }
  .split { grid-template-columns: 1fr; }
}
