/* ==========================================================================
   Parish Directory — application chrome.

   The printed directory has its own stylesheet (directory.css); this file
   styles the screens people work in.

   The palette is the engraved one: ink navy for authority, parchment and
   vellum for paper, gilt for the one accent a ledger is allowed. Fraunces
   sets anything read as a title or a quantity, Inter everything read as an
   instruction — a register, not a dashboard.

   Every class the templates and public/javascripts/*.js already use is kept,
   so this is a re-skin and not a rename.
   ========================================================================== */

:root {
  /* ---- ink ---- */
  --ink:        #141B2E;
  --ink-soft:   #4A5268;
  --ink-faint:  #7B8296;
  --ink-lift:   #1D273F;   /* the hover of an inked button */

  /* ---- paper ---- */
  --parchment:  #F7F4ED;   /* the page */
  --vellum:     #EFEADE;   /* a panel inset into the page */
  --panel:      #FFFDF9;   /* a card standing on the page */

  /* ---- gilt, and the two muted signals ---- */
  --gilt:       #B08A3E;
  --gilt-deep:  #8F6E2C;
  --sage:       #43614C;
  --sage-bg:    #E4EDE6;
  --sage-line:  #B7CEBF;
  --rose:       #8C3F2E;
  --rose-bg:    #F6E8E3;
  --rose-line:  #DCBDB2;

  /* ---- rules ---- */
  --rule:       #DED6C4;   /* a hairline on paper */
  --rule-soft:  #EBE5D6;   /* the hairline between rows */
  --rule-firm:  #C4B9A2;   /* the edge of a control you can type in */

  --radius:     3px;       /* engraved, not rounded */
  --radius-lg:  5px;

  /* ---- aliases kept for markup written against the old names ---- */
  --paper:      #FFFDF9;
  --paper-warm: #EFEADE;
  --line:       #DED6C4;
  --band:       #EFEADE;
  --band-dark:  #DED6C4;
  --canvas:     #141B2E;
  --danger:     #8C3F2E;
  --danger-bg:  #F6E8E3;
  --ok:         #43614C;
  --ok-bg:      #E4EDE6;

  --serif: 'Fraunces', 'Iowan Old Style', Georgia, 'Times New Roman', serif;
  --sans:  'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

* { box-sizing: border-box; }

body.app {
  margin: 0;
  min-height: 100vh;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--gilt-deep); text-decoration: none; }
a:hover { color: var(--ink); }

/* Anything read as a title or a quantity is set in the serif. */
h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -.01em;
  color: var(--ink);
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
}

/* ==========================================================================
   The top bar
   ========================================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--ink);
  color: var(--parchment);
  border-bottom: 2px solid var(--gilt);
}

/*
 * Three columns, not a wrapping row. Who you are signed in as, and how to
 * stop being signed in, are the two controls that must never move: as a grid
 * they hold their column and it is the navigation in the middle that gives
 * way. The brand ellipsises, so a long parish name shortens itself before the
 * nav folds, without anyone having to guess the widths in advance.
 */
.topbar-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 26px;
  min-height: 64px;
  display: grid;
  grid-template-columns: minmax(0, auto) minmax(min-content, 1fr) auto;
  align-items: center;
  gap: 10px 22px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  max-width: 30ch;
  padding: 11px 0;
  color: var(--parchment);
}
.brand:hover { color: #fff; }
.brand .mark { flex: none; width: 28px; height: 28px; display: block; object-fit: contain; }
.brand .name {
  min-width: 0;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 16px;
  letter-spacing: .015em;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand small {
  display: block;
  margin-top: 2px;
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 400;
  letter-spacing: .06em;
  color: rgba(247, 244, 237, .52);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/*
 * One row, and it must stay one row. A super administrator working inside a
 * church gets six items, which is the case that used to wrap the bar; below
 * the breakpoint the nav moves to a full-width row of its own and wrapping is
 * allowed again there, deliberately.
 */
.nav {
  display: flex;
  gap: 2px;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  min-width: 0;
}
.nav a,
.nav summary {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 13px;
  border-radius: var(--radius);
  font-size: 13.5px;
  font-weight: 500;
  color: rgba(247, 244, 237, .72);
  white-space: nowrap;
  transition: color .15s, background .15s;
}
.nav a:hover { background: rgba(247, 244, 237, .08); color: var(--parchment); }
.nav a.active { background: var(--parchment); color: var(--ink); font-weight: 600; }

/* ---------- the folded-away tiers: Manage, and System while acting ---------- */

.nav-menu { position: relative; }
.nav-menu > summary {
  cursor: pointer;
  list-style: none;          /* the disclosure triangle, replaced below */
  user-select: none;
}
.nav-menu > summary::-webkit-details-marker { display: none; }
.nav-menu > summary::after {
  content: '';
  width: 5px;
  height: 5px;
  margin-left: 2px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.nav-menu > summary:hover { background: rgba(247, 244, 237, .08); color: var(--parchment); }
.nav-menu > summary.active,
.nav-menu[open] > summary { background: var(--parchment); color: var(--ink); font-weight: 600; }
.nav-menu[open] > summary::after { transform: translateY(1px) rotate(-135deg); }
.nav-menu > summary:focus-visible { outline: 2px solid var(--gilt); outline-offset: 1px; }

.nav-menu-items {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  z-index: 50;
  min-width: 224px;
  display: flex;
  flex-direction: column;
  gap: 1px;
  padding: 6px;
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 44px -14px rgba(20, 27, 46, .38);
}
.nav-menu-items a {
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 13.5px;
  color: var(--ink-soft);
}
.nav-menu-items a:hover,
.nav-menu-items a.active { background: var(--vellum); color: var(--ink); }

/* ---------- who is signed in ---------- */

.whoami {
  display: flex;
  align-items: center;
  gap: 11px;
  justify-self: end;
  padding-left: 20px;
  border-left: 1px solid rgba(247, 244, 237, .14);
  font-size: 12.5px;
  color: rgba(247, 244, 237, .7);
}
.whoami > a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  color: inherit;
}
.whoami > a:hover strong { color: #fff; }
.whoami .who { text-align: right; line-height: 1.25; min-width: 0; }
.whoami strong {
  display: block;
  /* Long enough to recognise yourself by, short enough to leave the nav its
     row. It ellipsises, so the cost of the cap is a few characters of an
     address that was being trimmed anyway. */
  max-width: 15ch;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 600;
  color: var(--parchment);
}
.whoami .role {
  display: block;
  font-size: 10.5px;
  letter-spacing: .04em;
  color: rgba(247, 244, 237, .48);
}
/* The initials plate. */
.whoami .ava {
  flex: none;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--gilt);
  color: var(--ink);
  font-family: var(--serif);
  font-weight: 600;
  font-size: 13px;
}
.whoami form { flex: none; }
.whoami .btn.ghost {
  background: transparent;
  border-color: rgba(247, 244, 237, .2);
  color: rgba(247, 244, 237, .68);
}
.whoami .btn.ghost:hover {
  background: rgba(247, 244, 237, .06);
  border-color: rgba(247, 244, 237, .44);
  color: var(--parchment);
}

/* ==========================================================================
   The banners that ride under the bar
   ========================================================================== */

.default-password-banner {
  background: var(--vellum);
  border-bottom: 1px solid var(--rule);
  color: var(--ink-soft);
  font-size: 13.5px;
}
.default-password-banner .inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 11px 26px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.default-password-banner .inner::before {
  content: '';
  flex: none;
  width: 3px;
  align-self: stretch;
  background: var(--gilt);
}
.default-password-banner span { flex: 1; }
.default-password-banner strong { color: var(--ink); }
.default-password-banner a { border-bottom: 1px solid rgba(143, 110, 44, .4); }
.default-password-banner a:hover { border-bottom-color: var(--gilt-deep); }

/* ==========================================================================
   The shell, and the head of a page
   ========================================================================== */

.shell { max-width: 1240px; margin: 0 auto; padding: 36px 26px 72px; }

.app-foot {
  max-width: 1240px;
  margin: -40px auto 0;
  padding: 18px 26px 28px;
  text-align: center;
  font-size: 11.5px;
  color: var(--ink-soft);
}
.app-foot a { color: var(--ink-soft); }
.app-foot a:hover { color: var(--gilt-deep); }
.app-foot-copyright { margin: 6px 0 0; }

/*
 * The eyebrow, the title, the actions. The eyebrow is the italic serif line
 * that says where you are; the title is the page. Both stay left, the actions
 * are pushed right by .spacer, and .sub takes the whole width underneath.
 */
.page-head {
  display: flex;
  align-items: flex-end;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 30px;
  padding-bottom: 22px;
  border-bottom: 1px solid var(--rule);
}
.page-head .titleblock { min-width: 0; }
.page-head .eyebrow {
  margin: 0 0 5px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 14px;
  font-weight: 400;
  color: var(--gilt-deep);
}
.page-head h1 {
  margin: 0;
  font-size: 38px;
  font-weight: 400;
  letter-spacing: -.015em;
  line-height: 1.05;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.page-head .spacer { margin-left: auto; }
.page-head p.sub {
  margin: 10px 0 0;
  width: 100%;
  max-width: 74ch;
  font-size: 13.5px;
  color: var(--ink-faint);
}
.page-head .actions { margin: 0; }

.section-title { margin: 34px 0 14px; font-size: 20px; font-weight: 500; }

/* ==========================================================================
   Cards, and the board head
   ========================================================================== */

.card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 22px 24px;
  margin-bottom: 22px;
}
.card > h2 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 500;
}
.card > h2 .hint {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 12.5px;
  letter-spacing: 0;
  color: var(--ink-faint);
}

/*
 * A heading with something set against it on the right — a count, a filter, a
 * "next 30 days". The rule beneath is what separates a board's title from its
 * contents; the negative margin pulls it out to the card's own edges so the
 * rule runs the full width rather than floating inside the padding.
 */
.board-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: -22px -24px 18px;
  padding: 20px 24px 17px;
  border-bottom: 1px solid var(--rule-soft);
}
.board-head h2 { margin: 0; font-size: 20px; font-weight: 500; }
.board-head .sub { margin: 3px 0 0; font-size: 12.5px; color: var(--ink-faint); }
.board-head .count { font-size: 11.5px; font-weight: 500; color: var(--ink-faint); white-space: nowrap; }
.board-head .filters { display: flex; gap: 10px; flex-wrap: wrap; }
/* The filters against a board heading are not the page-wide filter bar: they
   size to their own content, or two of them stack and push the head open. */
.board-head .filters select {
  width: auto;
  min-width: 150px;
  font-size: 12.5px;
  padding: 8px 30px 8px 12px;
}

/* A board that is nothing but a list wants its rows flush to the edges. */
.card.flush { padding-left: 0; padding-right: 0; padding-bottom: 8px; }
.card.flush > .board-head { margin-left: 0; margin-right: 0; }

/* A card of destructive, irreversible actions — visually set apart from the
   ordinary settings cards above it so nobody scrolls past this by habit. */
.danger-zone { border-color: var(--rose-line); }
.danger-zone > h2 { color: var(--rose); }
.danger-zone-intro { margin: 0 0 18px; }
.danger-zone-item {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding-top: 16px;
  border-top: 1px solid var(--rule-soft);
}
.danger-zone-item + .danger-zone-item { margin-top: 16px; }
.danger-zone-item .label {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink);
}
.danger-zone-item p { max-width: 480px; }
.danger-zone-confirm { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.danger-zone-confirm input[type="text"] { min-width: 220px; }

/* The name to type, and whether what is typed matches it yet. A disabled
   button is not a message; these two are. */
.danger-zone-hint { flex: 1 0 100%; margin: 2px 0 0; max-width: 520px; }
.danger-zone-name {
  /* Set in the mono face so a curly apostrophe is visibly a curly one, and
     so trailing spaces in the parish's own name have nowhere to hide. */
  font-family: ui-monospace, 'SFMono-Regular', Consolas, 'Liberation Mono', monospace;
  font-size: .95em;
  color: var(--ink);
  background: var(--vellum);
  padding: 1px 5px;
  border-radius: 2px;
}
.danger-zone-state { display: block; margin-top: 3px; color: var(--rose); }
.danger-zone-state.is-match { color: var(--sage); font-weight: 600; }
.danger-zone-state[hidden] { display: none; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 22px;
  align-items: start;
}
.stack > * + * { margin-top: 14px; }
.church-section + .church-section { margin-top: 30px; }

.empty {
  text-align: center;
  padding: 46px 20px;
  color: var(--ink-faint);
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
}

/* ==========================================================================
   The stat ledger
   ========================================================================== */

/*
 * Four figures in one ruled panel rather than four floating cards. A ledger
 * is read across, and the hairlines between the columns are what say the four
 * belong to one another; the accent column is the one the parish is working
 * towards, the muted one is what is left over.
 */
/*
 * Four columns is what the dashboard has, and it is not what every ledger
 * has: the system overview sets six figures and a church page sets two. A
 * fixed four-track grid left the six ragged across two rows and the two
 * stranded in the left half of a panel ruled for four.
 *
 * So the same construction as the verification chain — flexible cells, and
 * the hairlines between them are the 1px gap showing the panel's own
 * background through. It is right at any count, and the cells on a wrapped
 * final row stretch to fill it.
 */
.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 26px;
}
.stat {
  /* 150px, not 200: the widest ledger in the application is the system
     overview’s six figures, and at 200px the sixth wrapped to a row of its
     own across the full width. This fits all six on one line at 1240px and
     still leaves a 44px numeral room to breathe. */
  flex: 1 1 150px;
  padding: 22px 24px;
  background: var(--panel);
}
.stat .n {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 44px;
  line-height: .95;
  letter-spacing: -.02em;
  color: var(--ink);
}
.stat .n .delta { font-family: var(--sans); font-size: 12px; font-weight: 600; color: var(--sage); }
.stat .k {
  margin-top: 12px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.stat .foot { margin-top: 3px; font-size: 12px; color: var(--ink-soft); }
.stat.accent { background: linear-gradient(180deg, #FBF8F0, var(--panel)); }
.stat.accent .n { color: var(--gilt-deep); }
.stat.muted .n { color: var(--ink-faint); }

/* ==========================================================================
   Forms
   ========================================================================== */

.field { margin-bottom: 16px; }
.field label, .field > .label {
  display: block;
  margin-bottom: 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.field .help, p.help { font-size: 12.5px; color: var(--ink-faint); }
.field .help { margin-top: 5px; }

/*
 * A choice between two whole courses of action, rather than a value to type.
 * Each option carries the paragraph that explains what it will do, because
 * "skip" and "update" are the same length on screen and nothing else on the
 * page says which one loses data.
 */
.field.choice {
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 12px 16px 6px;
  margin: 0 0 16px;
}
.field.choice legend {
  padding: 0 6px;
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.choice-row {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 9px 0;
  margin: 0;
  cursor: pointer;
  /* Overrides .field label, which is the uppercase caption style. */
  font-size: 14.5px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
.choice-row + .choice-row { border-top: 1px solid var(--rule-soft); }
.choice-row input[type=radio] {
  width: 16px;
  height: 16px;
  margin: 3px 0 0;
  flex: none;
  cursor: pointer;
  accent-color: var(--ink);
}
.choice-row .help { display: block; margin-top: 3px; }

input[type=text], input[type=password], input[type=email], input[type=number],
input[type=search], input[type=date], select, textarea {
  width: 100%;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--rule-firm);
  border-radius: var(--radius);
  padding: 10px 12px;
  transition: border-color .16s, box-shadow .16s;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--gilt);
  box-shadow: 0 0 0 3px rgba(176, 138, 62, .16);
}
input[type=color] {
  width: 100%; height: 42px; padding: 3px;
  border: 1px solid var(--rule-firm); border-radius: var(--radius); background: var(--panel);
}
input[type=file] { font: inherit; font-size: 13.5px; }
select {
  appearance: none;
  padding-right: 32px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5 11 1.5' stroke='%237B8296' stroke-width='1.6' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 11px center;
  background-size: 11px;
}

/*
 * The role picker in the users table. Selects are width:100% above, which is
 * right in a form column and wrong in a table cell: sizing it to its own
 * longest option makes the column as wide as it needs to be, and the floor
 * keeps it there in a browser that measures the option list less generously.
 */
.role-set { display: flex; gap: 6px; align-items: center; }
.role-set select { width: auto; min-width: 16ch; flex: 0 0 auto; }

/*
 * A tick and its sentence.
 *
 * The caption style above — uppercase, tracked, semibold — is right for the
 * name of a field and wrong for the sentence beside a checkbox, and a
 * .checkline is a <label> inside a .field, so it inherited it. Templates were
 * undoing that one at a time with an inline style, and the ones that had not
 * been noticed shouted. It is reset here instead, once.
 */
.checkline {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 0;
  font-size: 14.5px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
  color: var(--ink);
}
.checkline input { width: auto; accent-color: var(--ink); }

/* The address and the hometown address are compared by eye, so they get the
   same box: equal columns, and one height for both. */
.address-pair .field { display: flex; flex-direction: column; }
.address-pair textarea { min-height: 104px; flex: 1 1 auto; }

/* "Same as the address above", offered next to the hometown address and the
   spouse's home — a checkbox and a read-only copy while it is ticked. */
.same-address { margin-top: 6px; font-size: 13.5px; color: var(--ink-faint); }
.is-copied { background: var(--vellum); color: var(--ink-soft); }

/* Show/hide password. The wrapper is added by password-toggle.js, so without
   JavaScript the field is a plain password box and nothing looks broken. */
.password-field { position: relative; display: block; }
.password-field input { width: 100%; padding-right: 42px; }
.password-field .toggle-password {
  position: absolute;
  top: 0; right: 0;
  height: 100%; width: 40px;
  display: flex; align-items: center; justify-content: center;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0 var(--radius) var(--radius) 0;
  color: var(--ink-faint);
  cursor: pointer;
}
.password-field .toggle-password:hover { color: var(--ink); }
.password-field .toggle-password:focus-visible {
  outline: 2px solid var(--gilt);
  outline-offset: -3px;
}
.password-field .toggle-password svg { width: 19px; height: 19px; display: block; }

/* Both dates the directory records are day and month only, so each stays a
   pair of fields — a date picker would insist on a year nobody supplied. The
   day box is held to what a two-digit number needs and no more, so the rest
   of the track goes to the month, which has to show a word. */
.daymonth { display: grid; grid-template-columns: 72px minmax(0, 1fr); gap: 8px; }
.daymonth select { min-width: 0; }

/* Same two-box track as a date, but the first box here holds a whole relation
   rather than a two-digit day: "Mother-in-law" has to fit without scrolling
   under the caret. The column gives way on a narrow screen. */
.relation-add { display: grid; grid-template-columns: minmax(0, 220px) minmax(0, 1fr); gap: 8px; }

.actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 20px; }
.actions .spacer { margin-left: auto; }

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: flex-end;
  margin-bottom: 20px;
}
.filter-bar label {
  display: flex;
  flex-direction: column;
  gap: 5px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.filter-bar select { min-width: 180px; }
/* Wide enough for a full name — this is the box the office reaches for most. */
.filter-bar input[type=search] { min-width: 240px; }

/* ==========================================================================
   Buttons
   ========================================================================== */

.btn {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  text-align: center;
  background: var(--ink);
  color: var(--parchment);
  border: 1px solid var(--ink);
  padding: 11px 18px;
  border-radius: var(--radius);
  transition: background .16s, border-color .16s, color .16s;
}
.btn:hover { background: var(--ink-lift); border-color: var(--ink-lift); color: var(--parchment); }
.btn:focus-visible { outline: 2px solid var(--gilt); outline-offset: 2px; }

.btn.ghost { background: transparent; border-color: var(--rule-firm); color: var(--ink-soft); }
.btn.ghost:hover { background: var(--vellum); border-color: var(--ink-soft); color: var(--ink); }

.btn.danger { background: var(--rose); border-color: var(--rose); color: #fff; }
.btn.danger:hover { background: #73301F; border-color: #73301F; color: #fff; }

.btn.small { padding: 6px 12px; font-size: 12.5px; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

.linkbtn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  color: var(--gilt-deep);
  cursor: pointer;
}
.linkbtn.muted { color: var(--ink-faint); }
.linkbtn:hover { text-decoration: underline; }

/* ==========================================================================
   Messages
   ========================================================================== */

.alert {
  border-radius: var(--radius-lg);
  border: 1px solid;
  border-left-width: 3px;
  padding: 13px 16px;
  margin-bottom: 20px;
  font-size: 14px;
}
.alert.error  { background: var(--rose-bg); border-color: var(--rose-line); border-left-color: var(--rose); color: #5F2A1E; }
.alert.notice { background: var(--sage-bg); border-color: var(--sage-line); border-left-color: var(--sage); color: #2C4434; }
.alert ul { margin: 6px 0 0; padding-left: 20px; }
.alert strong { font-weight: 600; }

/* ==========================================================================
   The idle notice

   Deliberately a stop rather than a toast in the corner. It is asking a
   question — carry on, or go — and it appears on a page that may have an
   unsaved family form under it, so it covers the work instead of competing
   with it for attention.

   Kept out of anything printed: a directory sent to the printer while the
   notice is up should come out as the register, not as the register with a
   warning across it.
   ========================================================================== */

.session-dialog {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(20, 27, 46, .55);
}
/* `display: flex` above would otherwise beat the browser's own [hidden] rule,
   and the notice would stand on every page from the moment it loaded. */
.session-dialog[hidden] { display: none; }

.session-dialog-card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-top: 3px solid var(--gilt);
  border-radius: var(--radius-lg);
  box-shadow: 0 18px 44px rgba(20, 27, 46, .28);
  padding: 26px 28px;
  max-width: 460px;
  width: 100%;
}

.session-dialog-card h2 {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 600;
  margin: 0 0 10px;
  color: var(--ink);
}
.session-dialog-card p {
  margin: 0 0 20px;
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink-soft);
}
.session-dialog-card strong { color: var(--ink); font-weight: 600; }
.session-dialog-card .actions { margin-top: 0; }
.session-dialog-card form { margin: 0; }

@media print { .session-dialog { display: none !important; } }

/* ==========================================================================
   Tables — a register, read across
   ========================================================================== */

.table-wrap { overflow-x: auto; }

.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th, .table td {
  padding: 11px 13px;
  text-align: left;
  border-bottom: 1px solid var(--rule-soft);
  vertical-align: middle;
}
.table th {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
.table tbody tr:last-child td { border-bottom: none; }
.table tbody tr:hover td { background: var(--vellum); }
.table td.right, .table th.right { text-align: right; }
.table .nowrap { white-space: nowrap; }
/* Figures line up under one another when they are read as a column. */
.table td.num, .table .tabular { font-variant-numeric: tabular-nums; }

/* The tick column on the verification status list: a narrow gutter, and a box
   big enough to hit on a phone without the row growing taller for it. */
.table th.tick, .table td.tick { width: 34px; padding-right: 0; text-align: center; }
.table .tick input[type="checkbox"] {
  width: 16px; height: 16px; margin: 0;
  vertical-align: middle; cursor: pointer; accent-color: var(--ink);
}

/* A small landscape thumbnail in a table row — the same 4:3 crop as the
   photo-box, just small enough that a row of them still reads as a list. */
.table th.photo, .table td.photo { width: 56px; }
.table .thumb, .table .thumb-empty {
  width: 44px;
  aspect-ratio: 4 / 3;
  border-radius: 2px;
  display: block;
}
.table .thumb { object-fit: cover; border: 1px solid var(--rule-firm); }
.table .thumb-empty { border: 1px dashed var(--rule-firm); background: var(--vellum); }

/*
 * The review table. The existing value is set back and the proposed value
 * forward, so which of the two columns is the proposal is legible without
 * reading the header — a reviewer clearing a hundred lines reads the shape of
 * the row, not its heading.
 */
.table.diff td { vertical-align: top; }
.table.diff td.was { color: var(--ink-faint); }
.table.diff td.now { font-weight: 600; }
.table.diff tr.composition { background: rgba(176, 138, 62, .07); }
.table.diff tr.composition td.now,
.table.diff tr.composition td.was { font-style: normal; }

/* ==========================================================================
   Tags, chips and counters
   ========================================================================== */

.tag {
  display: inline-block;
  padding: 3px 9px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  background: var(--vellum);
  border: 1px solid var(--rule);
  color: var(--ink-soft);
}
.tag.draft { background: #F6EEDC; border-color: #E3D3AE; color: var(--gilt-deep); }
.tag.ok    { background: var(--sage-bg); border-color: var(--sage-line); color: var(--sage); }

/* The badge on the Review tab: a queue nobody can see the size of grows. */
.badge {
  display: inline-block;
  min-width: 18px;
  padding: 1px 6px;
  border-radius: 20px;
  background: var(--gilt);
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.nav a.active .badge { background: var(--ink); color: var(--gilt); }

/* The one place a password is deliberately shown in full: it is the shared
   default, printed so the office can copy it into the invitation email. */
.default-password {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 17px;
  letter-spacing: .04em;
  background: var(--vellum);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 10px 14px;
  margin: 0;
  display: inline-block;
  user-select: all;
}

details.invite > summary {
  cursor: pointer;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 17px;
}
details.invite > summary .hint {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 12.5px;
  color: var(--ink-faint);
}
details.invite textarea { min-height: 96px; font-size: 13.5px; }

/* ==========================================================================
   The verification chain, as a register
   ========================================================================== */

/*
 * Eight steps read left to right as one ruled track rather than eight loose
 * tiles: the count and the step name sit in one cell because the pair is the
 * sentence — "110 Invitation Sent" — and the cell is a link, so the number
 * opens the names behind it.
 *
 * Each cell carries a 2px strip along its top edge. It is transparent until
 * the step means something — gilt for where the parish is working now, sage
 * for the end of the chain, ink and sage again for the two ends of a move —
 * which is what makes the state legible without reading the labels.
 */
/*
 * The hairlines between the steps are the 1px `gap`, showing the track's own
 * background through, rather than a border on each cell. A chain has as many
 * steps as the installation defines and wraps when the column is narrow, and
 * borders cannot know which cell ended a row: they left a rule hanging in the
 * gap after the last step and doubled against the track's own edge. A gap
 * cannot be drawn where there is no neighbour, so it is right at any count
 * and at any width.
 *
 * `flex: 1 1 130px` rather than a grid for the same reason — the steps left
 * over on the final row stretch to fill it instead of stopping halfway.
 */
.chain {
  display: flex;
  flex-wrap: wrap;
  gap: 1px;
  background: var(--rule-soft);
  border: 1px solid var(--rule-soft);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.chain-step {
  position: relative;
  flex: 1 1 130px;
  padding: 17px 14px 15px;
  background: var(--panel);
  color: var(--ink);
  transition: background .15s;
}
.chain-step::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: transparent;
}
.chain-step:hover { background: var(--vellum); color: var(--ink); }
.chain-step .n {
  display: block;
  font-family: var(--serif);
  font-weight: 400;
  font-size: 28px;
  line-height: 1;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
}
.chain-step .k {
  display: block;
  margin-top: 9px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  line-height: 1.35;
  color: var(--ink-faint);
}

/* A step nobody is standing at is still a link; it is only quieter. */
.chain-step.is-empty .n { color: #C7BFAE; }
.chain-step.is-empty .k { color: #A9A292; }

/* Where the filter currently is. */
.chain-step.is-current { background: #FBF7EE; }
.chain-step.is-current::before { background: var(--gilt); }
.chain-step.is-current .n { color: var(--gilt-deep); }

/*
 * The chain as a pair of ends rather than eight separate links. A step being
 * moved *from* is inked in the page's own dark; the step being moved *to*
 * takes the green this stylesheet already uses for anything settled. The
 * steps the chain will not run to are dimmed in place: their counts are still
 * worth reading, and a tile that disappeared under the pointer would move the
 * other seven out from under it.
 */
/*
 * Pinned to the corner rather than set in the flow.
 *
 * The badge appears only once a step has been picked as an end of a move,
 * and in the flow it pushed that cell taller than its seven neighbours —
 * which, in a stretched row, made the whole chain jump the moment anyone
 * touched it. Out of the flow it costs no height and nothing moves.
 */
.chain-step .role {
  display: none;
  position: absolute;
  top: 7px;
  right: 8px;
  padding: 2px 8px;
  border-radius: 20px;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
}
.chain-step.is-source { background: var(--panel); }
.chain-step.is-source::before { background: var(--ink); }
.chain-step.is-source .role { display: inline-block; background: var(--ink); }
.chain-step.is-target { background: var(--sage-bg); }
.chain-step.is-target::before { background: var(--sage); }
.chain-step.is-target .n { color: var(--sage); }
.chain-step.is-target .role { display: inline-block; background: var(--sage); }
/* Dimmed, not disabled: it is still the link to those families. */
.chain-step.is-unreachable { opacity: .4; }

/*
 * The note under the chain. It is the one paragraph on the dashboard that
 * corrects a wrong belief — that the app sends the invitations — so it is set
 * apart on vellum with a gilt edge rather than left as another line of help.
 */
.chain-lede { margin: 0 0 14px; }
.chain-note {
  margin: 18px 0 0;
  padding: 13px 16px;
  background: var(--vellum);
  border-left: 2px solid var(--gilt);
  border-radius: 0 var(--radius) var(--radius) 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.chain-note b, .chain-note strong { color: var(--ink); font-weight: 600; }
.chain-hint { margin: 14px 2px 0; font-size: 12.5px; color: var(--ink-soft); }

/*
 * The bar above the families list, where a ticked batch is deleted. It is the
 * page's one destructive control, so it sits in a card of its own with the
 * warning beside the button rather than under the table where the ticks are.
 */
.bulk-bar {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 16px;
  border-color: var(--rose-line);
}
.bulk-bar .btn.danger[disabled] { opacity: .5; cursor: not-allowed; }
.bulk-bar .help { flex: 1 1 320px; }

/* ==========================================================================
   Moving a batch from one step to another
   ========================================================================== */

.move-panel {
  margin-top: 18px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--panel);
}
.move-panel[hidden] { display: none; }

.move-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 15px;
  background: var(--vellum);
  border-bottom: 1px solid var(--rule);
}
.move-bar .route { display: flex; align-items: center; gap: 10px; }
.move-bar .chip {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.move-bar .chip.from { background: var(--ink); color: var(--parchment); }
.move-bar .chip.to { background: var(--sage); color: #fff; }
.move-bar .arrow { color: var(--ink-faint); }
.move-count { margin-left: auto; font-size: 12.5px; color: var(--ink-faint); }
.move-count b { color: var(--ink); }

/* The search sits above the tools, so "Tick all shown" reads as acting on
   what the box has just narrowed the list to. */
.move-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 15px;
  border-bottom: 1px solid var(--rule-soft);
}
.move-search input[type=search] { flex: 1 1 auto; min-width: 0; }
.move-found {
  flex: 0 0 auto;
  font-size: 12px;
  color: var(--ink-faint);
  white-space: nowrap;
}
.move-found[hidden] { display: none; }

.move-tools {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--rule-soft);
  font-size: 12.5px;
}
.move-see { margin-left: auto; font-size: 12px; }
.move-see[hidden] { display: none; }

/* Tall enough to scan a step at a glance, short enough that the tiles above
   and the batch buttons below stay on the screen with it. */
.move-list { max-height: 300px; overflow-y: auto; }
.move-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 15px;
  border-bottom: 1px solid var(--rule-soft);
  cursor: pointer;
}
.move-row[hidden] { display: none; }
.move-row:last-child { border-bottom: none; }
.move-row:hover { background: var(--vellum); }
.move-row input { width: 16px; height: 16px; cursor: pointer; accent-color: var(--ink); }
.move-who { font-weight: 500; }
.move-meta { margin-left: auto; font-size: 12px; color: var(--ink-faint); }
.move-empty[hidden] { display: none; }
.move-empty {
  margin: 0;
  padding: 24px 15px;
  text-align: center;
  color: var(--ink-faint);
  font-family: var(--serif);
  font-style: italic;
}

.move-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 14px 15px;
  background: var(--vellum);
}
.move-actions .move-note { margin: 0; flex: 1 1 240px; }

/* ==========================================================================
   Coming up — the almanac of birthdays and anniversaries
   ========================================================================== */

/*
 * A dated list rather than a table. The day and month are set apart on the
 * left in the serif, because that is what the reader scans down; the name and
 * how far off it is follow, divided by a hairline so the date reads as a
 * gutter and not as a first column of prose.
 */
.events { padding: 4px 0; }
.event {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--rule-soft);
  transition: background .13s;
}
.event:last-child { border-bottom: none; }
.event:hover { background: var(--vellum); }
.event .date { flex: none; width: 42px; text-align: center; }
.event .date .d {
  font-family: var(--serif);
  font-weight: 500;
  font-size: 19px;
  line-height: 1;
  color: var(--ink);
}
.event .date .m {
  margin-top: 2px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--gilt-deep);
}
.event .divider { flex: none; width: 1px; height: 30px; background: var(--rule); }
.event .body { flex: 1; min-width: 0; }
.event .nm {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}
.event .nm a { color: var(--ink); }
.event .nm a:hover { color: var(--gilt-deep); }
/* Italic serif, so an anniversary is marked without another loud chip. */
.event .anniv {
  padding: 1px 8px;
  border-radius: 20px;
  background: var(--vellum);
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0;
  text-transform: none;
  color: var(--gilt-deep);
}
.event .when { margin-top: 2px; font-size: 12px; color: var(--ink-faint); }
.event .go { flex: none; color: #C4BBA7; display: flex; transition: color .15s; }
.event:hover .go { color: var(--gilt); }

/* ==========================================================================
   Getting started — a numbered guide
   ========================================================================== */

.steps { padding: 6px 24px 18px; margin: 0; list-style: none; counter-reset: step; }
.step {
  display: flex;
  gap: 15px;
  padding: 14px 0;
  border-bottom: 1px solid var(--rule-soft);
}
.step:last-child { border-bottom: none; }
.step .idx {
  flex: none;
  width: 26px;
  height: 26px;
  margin-top: 1px;
  border-radius: 50%;
  border: 1px solid var(--gilt);
  display: grid;
  place-items: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 12.5px;
  color: var(--gilt-deep);
}
/* The numeral is drawn by the counter, so the markup carries no loose digits
   that could drift out of step with the order of the list. */
.steps .step .idx::before { counter-increment: step; content: counter(step); }
.step .txt { font-size: 13.5px; line-height: 1.55; color: var(--ink-soft); }
.step .txt a { font-weight: 600; border-bottom: 1px solid rgba(143, 110, 44, .35); }
.step .txt a:hover { border-bottom-color: var(--gilt-deep); }
.step .txt strong { color: var(--ink); font-weight: 600; }

/* ==========================================================================
   Family index — the searchable register on the dashboard
   ========================================================================== */

.family-index { margin-top: 20px; }
.fi-controls { padding: 0 24px 14px; }
.fi-controls input[type=search] { width: 100%; }
.fi-row { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 12px; }

.fi-toggle { display: inline-flex; border: 1px solid var(--rule); border-radius: 20px; overflow: hidden; flex: none; }
.fi-toggle button {
  border: none;
  background: var(--panel);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-soft);
  padding: 6px 14px;
  cursor: pointer;
}
.fi-toggle button.on { background: var(--vellum); color: var(--ink); }

.fi-groups { display: flex; flex-wrap: wrap; gap: 6px; }
.fi-chip {
  border: 1px solid var(--rule);
  background: var(--panel);
  color: var(--ink-soft);
  font: inherit;
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 10px;
  border-radius: 20px;
  cursor: pointer;
}
.fi-chip .n { font-weight: 500; color: var(--ink-faint); margin-left: 4px; }
.fi-chip.on { background: var(--ink); border-color: var(--ink); color: var(--panel); }
.fi-chip.on .n { color: var(--gilt); }

.fi-az { display: flex; flex-wrap: wrap; gap: 2px; padding: 0 24px 10px; justify-content: center; }
.fi-az a {
  font-family: var(--serif);
  font-size: 12px;
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--ink);
  text-decoration: none;
}
.fi-az a:hover { background: var(--vellum); }
.fi-az a.off { color: #CBC3B5; pointer-events: none; }

.fi-sec-head { display: flex; align-items: baseline; gap: 10px; margin: 18px 24px 8px; }
.fi-sec-head .l { font-family: var(--serif); font-size: 18px; font-weight: 500; }
.fi-sec-head .s { font-size: 10.5px; font-weight: 600; letter-spacing: .06em; color: var(--ink-faint); text-transform: uppercase; }
.fi-sec-head .line { flex: 1; height: 1px; background: var(--rule); }
.fi-section:first-of-type .fi-sec-head { margin-top: 4px; }

mark.fi-hit { background: #F5E3BF; color: inherit; border-radius: 2px; }
.family-index .empty { padding: 28px 24px; text-align: center; color: var(--ink-faint); font-size: 13px; }

/* ==========================================================================
   Comma-separated boxes (tag-input.js)
   ========================================================================== */

/* A member's mobile numbers and email addresses are one column holding a short
   list. Committed values become chips so the boundary between them is visible.
   Without that script none of this is rendered and the field stays a plain
   text input. */
.tag-field {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  width: 100%;
  min-height: 42px;
  padding: 5px 7px;
  background: var(--panel);
  border: 1px solid var(--rule-firm);
  border-radius: var(--radius);
  cursor: text;
}
.tag-field:focus-within {
  border-color: var(--gilt);
  box-shadow: 0 0 0 3px rgba(176, 138, 62, .16);
}

.tag-field .tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  padding: 2px 4px 2px 9px;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0;
  text-transform: none;
  line-height: 1.5;
  color: var(--ink);
  background: var(--vellum);
  border: 1px solid var(--rule);
  border-radius: 20px;
}
.tag-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* A warning, not a refusal — lib/phone.js and lib/email.js decide on save. */
.tag-field .tag.is-bad {
  color: var(--rose);
  background: var(--panel);
  border-color: var(--rose);
  border-style: dashed;
}

.tag-remove {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  padding: 0;
  font-size: 15px;
  line-height: 1;
  color: var(--ink-faint);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.tag-remove:hover { color: var(--ink); background: rgba(20, 27, 46, .07); }
.tag-field .tag.is-bad .tag-remove { color: var(--rose); }

/* The box people type in. It is inside the bordered field, so it carries none
   of its own, and it grows to fill whatever the chips left on the line. */
.tag-entry {
  flex: 1 1 90px;
  min-width: 90px;
  width: auto;
  padding: 3px 2px;
  background: transparent;
  border: 0;
  border-radius: 0;
}
.tag-entry:focus { outline: none; box-shadow: none; border: 0; }

/* ==========================================================================
   The member editor
   ========================================================================== */

.members-editor { display: grid; gap: 12px; }

/* Nine fields to a member, which is more than fits across any screen the
   parish office actually has — so the row wraps rather than pretending. Equal
   tracks with a floor wide enough for a month name and a ten-digit number. */
.member-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 12px;
  align-items: end;
  padding: 14px;
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  background: var(--vellum);
}
.member-row .field { margin: 0; min-width: 0; }
.member-row .drop { grid-column: 1 / -1; justify-self: end; align-self: end; }

/* ==========================================================================
   One family, read on screen
   ========================================================================== */

.detail-grid { display: grid; grid-template-columns: 1fr 300px; gap: 22px; align-items: start; }

/*
 * The household's facts as a hairline register: the caption on vellum, the
 * value on panel, one rule between rows. It is the same shape the printed
 * entry uses, so the screen and the book agree about what an entry looks like.
 */
.detail-grid dl {
  margin: 0;
  display: grid;
  grid-template-columns: 190px 1fr;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.detail-grid dt {
  padding: 11px 13px;
  background: var(--vellum);
  border-bottom: 1px solid var(--rule-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--ink-faint);
  display: flex;
  align-items: center;
}
.detail-grid dd {
  margin: 0;
  padding: 11px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--rule-soft);
  font-size: 14px;
}
.detail-grid dl > dt:nth-last-of-type(1),
.detail-grid dl > dd:nth-last-of-type(1) { border-bottom: none; }

.photo-box {
  border: 1px solid var(--rule-firm);
  background: var(--panel);
  padding: 8px;
  border-radius: var(--radius);
}
.photo-box img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: var(--vellum);
}
.photo-box .none {
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--vellum);
  color: var(--ink-faint);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-weight: 600;
}
.photo-box.small { max-width: 128px; padding: 5px; }

/* ==========================================================================
   Review
   ========================================================================== */

.line-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}
.line-actions input[type=text] { width: 150px; padding: 6px 9px; font-size: 12.5px; }

.review-block + .review-block { margin-top: 20px; }
.batch-routine {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--rule-soft);
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}
.batch-routine .help { margin: 0; }

.tier-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px 18px;
}
.tier-grid .checkline { font-size: 13.5px; text-transform: none; letter-spacing: 0; font-weight: 400; }

/* Visible to a screen reader, not on the page. */
.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;
}

/* ==========================================================================
   The sign-in screens
   ========================================================================== */

/*
 * Two halves. The left is the ceremonial plate — the crest, the name of the
 * thing, and one sentence about what it is for; the right is the work: a
 * form, and nothing else competing with it.
 *
 * `body.auth` on its own is the single centred column, which is what the
 * error page wants. `.split` is what the sign-in pages add.
 */
body.auth {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 18px;
  background: var(--parchment);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body.auth.split {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  align-items: stretch;
  padding: 0;
}

/* ---------- left: the plate ---------- */

.auth-plate {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 44px;
  padding: 60px 68px;
  overflow: hidden;
  color: var(--parchment);
  background: radial-gradient(120% 90% at 20% 10%, #1B2338 0%, var(--ink) 55%, #0F1524 100%);
}
/* The engraved double keyline, as on the frontispiece of the printed book. */
.auth-plate::before,
.auth-plate::after {
  content: '';
  position: absolute;
  pointer-events: none;
}
.auth-plate::before { inset: 26px; border: 1px solid rgba(176, 138, 62, .32); }
.auth-plate::after  { inset: 31px; border: 1px solid rgba(176, 138, 62, .14); }

.auth-plate .crest { position: relative; z-index: 2; display: flex; align-items: center; gap: 18px; }
.auth-plate .crest .mark { flex: none; width: 76px; height: 76px; display: block; object-fit: contain; }
.auth-plate .wordmark {
  display: block;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 23px;
  letter-spacing: .09em;
  line-height: 1.15;
  text-transform: uppercase;
  color: #E4C777;
}
.auth-plate .crest .sub {
  display: block;
  margin-top: 6px;
  font-size: 14px;
  letter-spacing: .03em;
  color: rgba(247, 244, 237, .55);
}
.auth-plate .crest .sub a {
  color: rgba(247, 244, 237, .72);
  border-bottom: 1px solid rgba(228, 199, 119, .35);
}
.auth-plate .crest .sub a:hover { color: #E4C777; border-bottom-color: #E4C777; }

.auth-plate .hero { position: relative; z-index: 2; margin: auto 0; max-width: 30ch; }
.auth-plate .hero .kicker {
  margin: 0 0 22px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 17px;
  color: rgba(247, 244, 237, .7);
}
.auth-plate .hero h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(36px, 4.4vw, 58px);
  line-height: 1.03;
  letter-spacing: -.012em;
  color: var(--parchment);
}
.auth-plate .hero h1 em { font-style: italic; color: var(--gilt); }
.auth-plate .hero p {
  margin: 26px 0 0;
  max-width: 34ch;
  font-size: 14.5px;
  line-height: 1.7;
  color: rgba(247, 244, 237, .66);
}

.auth-plate .plate-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: .02em;
  color: rgba(247, 244, 237, .4);
}
.auth-plate .plate-foot .dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--gilt); opacity: .7;
}

/* ---------- right: the stage the form stands on ---------- */

.auth-stage {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px;
  background: var(--parchment);
  /* Feint ruling, the way a ledger page is ruled. */
  background-image: linear-gradient(rgba(20, 27, 46, .05) 1px, transparent 1px);
  background-size: 100% 34px;
}
/* A gilt edge down the seam, fading out — the gutter of the open book. */
.auth-stage::after {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 2px;
  background: linear-gradient(var(--gilt), transparent 60%);
  opacity: .5;
}

.auth-card {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
}
/* Standing on its own, with no plate beside it, the card needs its own edges. */
body.auth:not(.split) .auth-card {
  background: var(--panel);
  border: 1px solid var(--rule);
  border-radius: var(--radius-lg);
  padding: 34px 34px 30px;
  box-shadow: 0 24px 60px -24px rgba(20, 27, 46, .3);
}
.auth-card .eyebrow {
  margin: 0 0 10px;
  font-family: var(--serif);
  font-style: italic;
  font-size: 15px;
  color: var(--gilt-deep);
}
.auth-card h1 {
  margin: 0 0 8px;
  font-family: var(--serif);
  font-weight: 500;
  font-size: 32px;
  line-height: 1.12;
  letter-spacing: -.01em;
}
.auth-card .parish,
.auth-card .lede {
  margin: 0 0 32px;
  max-width: 38ch;
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.auth-card .field { margin-bottom: 20px; }
.auth-card .btn { width: 100%; padding: 14px; font-size: 14.5px; }

/* The way out of this screen and into the other one. */
.auth-card .alt {
  margin: 26px 0 0;
  padding-top: 22px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  line-height: 1.6;
  color: var(--ink-soft);
}
.auth-card .alt a { font-weight: 600; border-bottom: 1px solid rgba(143, 110, 44, .4); }
.auth-card .alt a:hover { border-bottom-color: var(--gilt-deep); }

.auth-card .legal-links {
  margin: 14px 0 0;
  font-size: 11.5px;
  color: var(--ink-soft);
}
.auth-card .legal-links a { color: var(--ink-soft); }
.auth-card .legal-links a:hover { color: var(--gilt-deep); }

.auth-card pre {
  background: var(--vellum);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 12px;
  font-size: 12px;
  overflow: auto;
  max-height: 320px;
}

/* ==========================================================================
   "Powered & Secured By", under the sign-in card
   ========================================================================== */

/*
 * In the directory's own palette, not the navy and gold of the site this came
 * from. `--vellum` over `--rule` is the same panel the rest of the
 * application is built from, so the plate belongs to the page rather than
 * sitting on top of it. The one accent, standing in for the brand's gold, is
 * this stylesheet's own gilt-deep — the brand gold at 1.5:1 on this
 * background could not be read.
 *
 * 420px keeps the plate narrower than the sign-in card it sits under rather
 * than squaring up to it.
 */
.indus-badge {
  --indus-accent: var(--gilt-deep);

  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 420px;
  margin: 20px auto 0;
  padding: 18px 20px 20px;
  border-radius: var(--radius-lg);
  background: var(--vellum);
  border: 1px solid var(--rule);

  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
/*
 * Off the split layout the badge stands alone on the page's own background
 * and needs to be lifted off it, the way the auth card is.
 */
body.auth:not(.split) .indus-badge { box-shadow: 0 24px 60px -24px rgba(20, 27, 46, .3); }

.indus-badge .plabel {
  font-size: 10px;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  font-weight: 600;
}
.indus-badge .logos {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}
.indus-badge .owlwrap { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.indus-badge .owlname {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .04em;
  line-height: 1;
  color: var(--ink);
}
.indus-badge .owlname .def { color: var(--indus-accent); }
.indus-badge .owl {
  height: 72px;
  width: auto;
  filter: drop-shadow(0 3px 10px rgba(20, 27, 46, .22));
}
/* Typed rather than part of the artwork — see the partial for why. */
.indus-badge .owltag {
  font-size: 8px;
  font-weight: 700;
  letter-spacing: .5px;
  text-transform: uppercase;
  line-height: 1;
  /* --ink-soft rather than --ink-faint: at 8px this is the smallest type on
     the screen, and the fainter ink lands a whisker under AA. */
  color: var(--ink-soft);
}
.indus-badge .owltag .last { color: var(--indus-accent); }
.indus-badge .divider {
  width: 1px;
  height: 66px;
  background: linear-gradient(180deg, transparent, var(--rule-firm), transparent);
}
/*
 * The network mark is the banner: reversed out of its own dark ground, so it
 * needs a corner and a lift, not a card. A pale chip behind it would only put
 * a second border around a tile that already has an edge.
 *
 * The supplied file is 520x235 with the lock-up centred in a wide margin, and
 * at the width the plate can spare that margin is most of what you see — the
 * wordmark comes out smaller than the shield beside it. So the box is set to
 * the ratio of the mark rather than of the file, 520x150, and the artwork is
 * `cover`ed into it: the dead navy is trimmed evenly off top and bottom, the
 * wordmark lands at about the size it had as a chip, and a file swapped for
 * one of another shape is cropped rather than stretched.
 */
.indus-badge .induschip {
  display: block;
  width: 200px;
  max-width: 100%;
  aspect-ratio: 520 / 150;
  border-radius: var(--radius);
  overflow: hidden;
  line-height: 0;
  box-shadow: 0 3px 10px rgba(20, 27, 46, .22);
}
.indus-badge .indus {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/*
 * Narrow screens. The plate is 420px wide and its contents need about 390 of
 * that, so it is a phone rather than a tablet that runs out of room: the rule
 * drops out and the marks come down a size. The banner's box keeps its ratio
 * off its own width, so it is never squashed out of proportion.
 */
@media (max-width: 460px) {
  .indus-badge { padding: 16px 14px 18px; }
  .indus-badge .logos { gap: 16px; }
  .indus-badge .divider { display: none; }
  .indus-badge .owl { height: 64px; }
  .indus-badge .induschip { width: 210px; }
}

/* ==========================================================================
   The dashboard's two columns
   ========================================================================== */

/*
 * The work on the left, the almanac and the guide stacked on the right. Not
 * equal halves: the verification chain needs room to stay one row of eight,
 * and the two boards beside it are lists that read perfectly well narrow.
 */
.cols { display: grid; grid-template-columns: 1.55fr .95fr; gap: 22px; align-items: start; }
.side { display: flex; flex-direction: column; gap: 22px; }
.side > .card { margin-bottom: 0; }

@media (max-width: 1080px) {
  .cols { grid-template-columns: 1fr; }
}

/* ==========================================================================
   The import pages: instructions to read, one control to use
   ========================================================================== */

/*
 * The upload panel keeps its place on screen while the instructions beside it
 * are scrolled — the rules are long, the control is small, and somebody
 * re-reading the naming rule should not have to scroll back up to act on it.
 *
 * Only where there are in fact two columns. Below 1080px `.cols` stacks, and a
 * sticky panel in a single column would pin itself over the prose underneath
 * it. `align-items: start` on `.cols` is what lets this work at all: a grid
 * item stretched to the row's full height has no room left to move in.
 */
@media (min-width: 1081px) {
  .upload-panel { position: sticky; top: 24px; }
}

/*
 * The file picker, which is otherwise the one unstyled control on the page —
 * the browser's default sits flush against the label in a different typeface
 * and looks like something the stylesheet forgot.
 */
.field input[type="file"] {
  width: 100%;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink-soft);
  background: var(--vellum);
  border: 1px dashed var(--rule-firm);
  border-radius: var(--radius);
  padding: 14px;
  cursor: pointer;
}
.field input[type="file"]:hover { border-color: var(--ink-faint); }
.field input[type="file"]:focus-visible {
  outline: 2px solid var(--gilt);
  outline-offset: 2px;
}
/* The "Choose file" button inside the control, inked to match .btn.ghost. */
.field input[type="file"]::file-selector-button {
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  margin-right: 12px;
  padding: 7px 13px;
  color: var(--ink-soft);
  background: var(--panel);
  border: 1px solid var(--rule-firm);
  border-radius: var(--radius);
  cursor: pointer;
}
.field input[type="file"]::file-selector-button:hover {
  background: var(--vellum);
  border-color: var(--ink-soft);
  color: var(--ink);
}

/* ==========================================================================
   Responsive
   ========================================================================== */

/* The plate is scenery; below a laptop the form takes the whole screen and
   the plate becomes a band across the top carrying the crest alone. */
@media (max-width: 900px) {
  body.auth.split { grid-template-columns: 1fr; }
  .auth-plate {
    gap: 0;
    padding: 26px 24px;
    text-align: center;
    align-items: center;
  }
  .auth-plate::before, .auth-plate::after { display: none; }
  .auth-plate .crest { justify-content: center; }
  .auth-plate .crest .mark { width: 54px; height: 54px; }
  .auth-plate .hero, .auth-plate .plate-foot { display: none; }
  .auth-stage { padding: 36px 22px 48px; }
  .auth-stage::after { display: none; }
}

@media (max-width: 1000px) {
  /*
   * Two rows on purpose. Three columns on a narrow window leaves the
   * navigation a sliver between two things that will not shrink, so the bar
   * becomes the brand and the identity on top — still never displaced — with
   * the navigation given the full width underneath.
   */
  .topbar-inner { grid-template-columns: minmax(0, 1fr) auto; padding-bottom: 8px; }
  .nav {
    grid-row: 2;
    grid-column: 1 / -1;
    justify-content: flex-start;
    /* A full-width row can afford to wrap; the middle column could not. */
    flex-wrap: wrap;
  }
  .whoami { grid-row: 1; grid-column: 2; }
  .brand { grid-row: 1; grid-column: 1; max-width: none; }
  /* Dropping off the right edge of a narrow screen: hang it from the left. */
  .nav-menu-items { right: auto; left: 0; }

  .detail-grid { grid-template-columns: 1fr; }
  .detail-grid dl { grid-template-columns: 1fr; }
  .detail-grid dt { border-bottom: none; }
  .filter-bar select,
  .filter-bar input[type=search] { min-width: 0; width: 100%; }
  .line-actions { justify-content: flex-start; }
  .member-row { grid-template-columns: 1fr; }
}

@media (max-width: 720px) {
  .shell { padding: 26px 18px 56px; }
  .page-head h1 { font-size: 30px; }
  /* One figure to a row: below this a 200px cell would be cramped rather
     than merely narrow. */
  .stat { flex-basis: 100%; }
  .card { padding: 18px; }
  .board-head { margin: -18px -18px 16px; padding: 17px 18px 15px; }
  .card.flush { padding-left: 0; padding-right: 0; }
  .event, .steps { padding-left: 18px; padding-right: 18px; }
}

@media print {
  .topbar, .page-head .actions, .default-password-banner, .no-print { display: none !important; }
  body.app { background: #fff; }
  .card { border-color: #ccc; break-inside: avoid; }
}
