/* =====================================================================
   Repairs & Advancement · the department register
   ---------------------------------------------------------------------
   The site is the department's register: every member has a file, every
   rank is a section, every event and promotion is an entry with a date.
   The design borrows from record keeping, not from app templates:
     - two inks on paper: near-black for text, sage (#85a16b) for the
       department's own mark; a night version of the same paper
     - Schola (Century Schoolbook) for titles and figures, the face of
       court records and forms; Instrument Sans for the interface; IBM
       Plex Mono for file numbers, codes and times
     - ruled ledgers instead of cards: hairlines between entries, a heavy
       rule over each section, a double rule under the masthead
     - square corners, no gradients, no glows, no shadows except on things
       that float (menus, dialogs)
   Colours are tokens below; light is the default, [data-theme="dark"]
   is the night version (set in index.html before anything paints).
   ===================================================================== */

/* ---------- Fonts (self-hosted; licences in /assets/fonts) ---------- */
@font-face { font-family: "Schola"; src: url("/assets/fonts/schola-regular.woff2") format("woff2"), url("/assets/fonts/schola-regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Schola"; src: url("/assets/fonts/schola-bold.woff2") format("woff2"), url("/assets/fonts/schola-bold.woff") format("woff"); font-weight: 700; font-style: normal; font-display: swap; }
@font-face { font-family: "Schola"; src: url("/assets/fonts/schola-italic.woff2") format("woff2"), url("/assets/fonts/schola-italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/assets/fonts/instrument-sans-regular.woff2") format("woff2"), url("/assets/fonts/instrument-sans-regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/assets/fonts/instrument-sans-bold.woff2") format("woff2"), url("/assets/fonts/instrument-sans-bold.woff") format("woff"); font-weight: 600 800; font-style: normal; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("/assets/fonts/instrument-sans-italic.woff2") format("woff2"), url("/assets/fonts/instrument-sans-italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/assets/fonts/plex-mono-regular.woff2") format("woff2"), url("/assets/fonts/plex-mono-regular.woff") format("woff"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Plex Mono"; src: url("/assets/fonts/plex-mono-bold.woff2") format("woff2"), url("/assets/fonts/plex-mono-bold.woff") format("woff"); font-weight: 600 800; font-style: normal; font-display: swap; }

/* ---------- Tokens: paper (light) ---------- */
:root {
  color-scheme: light;
  --paper: #f3f1ea;          /* the page */
  --sheet: #fbfaf6;          /* fields, tables, anything laid on the page */
  --well: #e9e6dc;           /* hover, header rows, quiet fills */
  --ink: #1a1b18;
  --ink-2: #45463f;
  --muted: #64655c;
  --faint: #8f9086;          /* disabled, quiet marks */
  --placeholder: #73746b;    /* 4.5:1 on fields */
  --rule: #d8d4c8;           /* hairlines between entries */
  --rule-2: #bfbaab;         /* control borders */
  --rule-ink: #1a1b18;       /* the heavy rule over a section */

  --sage: #85a16b;           /* the department's mark */
  --sage-ink: #46632f;       /* sage as text on paper */
  --sage-deep: #354d22;
  --sage-wash: #e2e8d6;
  --on-sage: #10140c;

  --bad: #a2392b;   --bad-wash: #f5e2dd;  --bad-line: #d8a397;  --bad-solid: #a2392b;
  --warn: #7a560a;  --warn-wash: #f3ead0; --warn-line: #d3be83;
  --info: #2f5d8a;  --info-wash: #e0e8f1; --info-line: #a8bfd8;
  --gold: #7a560a;  --gold-wash: #f2e8cb; --gold-line: #cfb36a; --gold-solid: #c9a646;
  --dmo: #2e6b45;   --dmo-wash: #dfece2;  --dmo-line: #9cc4a8;
  --cpm: #5b3f8a;   --cpm-wash: #ebe3f5;  --cpm-line: #bba7d9;
  --former: #8f3f30;
  --teal: #1f6359;  --teal-wash: #dcede9; --teal-line: #93c4bc;
  --orange: #94491a; --orange-wash: #f6e4d4; --orange-line: #dfb08a;
  --on-gold: #1a1405;

  --t-lr: #67685f; --t-mr: #4f6f38; --t-hr: #2f6a52; --t-ex: #8a6512; --t-lead: #7d5000;

  --focus: #46632f;
  --bar: #8b8c83;            /* chart bars; the latest one is sage */
  --shadow: 0 1px 0 rgba(26, 27, 24, .04), 0 10px 28px rgba(26, 27, 24, .12);
  --scrim: rgba(26, 27, 24, .38);
  --toast-bg: #1a1b18; --toast-ink: #f3f1ea;

  --serif: "Schola", "Century Schoolbook", "TeX Gyre Schola", Georgia, serif;
  --sans: "Instrument Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: "Plex Mono", "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;

  --bar-h: 60px;
  --gutter: clamp(16px, 3.2vw, 48px);
  --maxw: 1280px;
  --r: 3px;                  /* controls */
  --r-sm: 2px;               /* labels */

  /* names kept from the previous stylesheet so older markup keeps working */
  --bg: var(--paper); --surface: var(--sheet); --raised: var(--sheet); --line: var(--rule); --line-soft: var(--rule);
  --accent: var(--sage); --accent-hi: var(--sage-ink); --accent-lo: var(--sage); --accent-wash: var(--sage-wash);
  --display: var(--serif); --body: var(--sans);
  --panel: var(--sheet); --panel-line: var(--rule); --panel-line-hi: var(--sage);
}

/* ---------- Tokens: night (dark) ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #0d0d0c;
  --sheet: #151514;
  --well: #1d1d1b;
  --ink: #ebeae3;
  --ink-2: #b9b7ad;
  --muted: #8c8a80;
  --faint: #66645d;
  --placeholder: #817f76;
  --rule: #2a2926;
  --rule-2: #403e39;
  --rule-ink: #8c8a80;

  --sage: #85a16b;
  --sage-ink: #a7c18c;
  --sage-deep: #c3d8ad;
  --sage-wash: rgba(133, 161, 107, .15);
  --on-sage: #0d0f0a;

  --bad: #e8907f;   --bad-wash: rgba(232, 144, 127, .09);  --bad-line: #6e3a32;  --bad-solid: #b4473b;
  --warn: #dfc06a;  --warn-wash: rgba(223, 192, 106, .08); --warn-line: #6a5c2e;
  --info: #93b6e3;  --info-wash: rgba(147, 182, 227, .09); --info-line: #34507a;
  --gold: #e8d08a;  --gold-wash: rgba(232, 208, 138, .08); --gold-line: #6d5f2c; --gold-solid: #d2bf80;
  --dmo: #8fd19e;   --dmo-wash: rgba(143, 209, 158, .08);  --dmo-line: #2f5a3a;
  --cpm: #c6a8f0;   --cpm-wash: rgba(198, 168, 240, .08);  --cpm-line: #4a3a66;
  --former: #e0a39a;
  --teal: #7fd4cb;  --teal-wash: rgba(127, 212, 203, .08); --teal-line: #2f5e57;
  --orange: #f2b27a; --orange-wash: rgba(242, 178, 122, .08); --orange-line: #6a4a2e;
  --on-gold: #14110a;

  --t-lr: #9a9993; --t-mr: #85a16b; --t-hr: #a9c58f; --t-ex: #d2bf80; --t-lead: #efd98f;

  --focus: #a7c18c;
  --bar: #66655e;
  --shadow: 0 1px 0 rgba(0, 0, 0, .4), 0 12px 32px rgba(0, 0, 0, .55);
  --scrim: rgba(0, 0, 0, .62);
  --toast-bg: #ebeae3; --toast-ink: #10110e;
}

/* Tier colour for one element: chips, career strip, numbers. */
.t-lr { --tc: var(--t-lr); } .t-mr { --tc: var(--t-mr); } .t-hr { --tc: var(--t-hr); }
.t-ex { --tc: var(--t-ex); } .t-lead { --tc: var(--t-lead); }
/* text laid on a tier colour: the tiers are dark on paper, light at night */
:is(.t-lr, .t-mr, .t-hr, .t-ex, .t-lead) { --on-tc: var(--sheet); }
:root[data-theme="dark"] :is(.t-lr, .t-mr, .t-hr, .t-ex, .t-lead) { --on-tc: var(--on-sage); }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { background: var(--paper); scroll-padding-top: calc(var(--bar-h) + 72px); -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { overflow-x: clip; }
body {
  /* a column, so the footer sits at the bottom of short pages */
  display: flex; flex-direction: column; min-height: 100vh; min-height: 100dvh;
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 1rem/1.5 var(--sans);
  font-kerning: normal; text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale;
}
main { flex: 1 0 auto; outline: none; padding-bottom: 80px; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
b, strong { font-weight: 700; }
img { max-width: 100%; }
mark { background: color-mix(in srgb, var(--sage) 32%, transparent); color: inherit; padding: 0 1px; }
::selection { background: color-mix(in srgb, var(--sage) 40%, transparent); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: var(--r-sm); }
[hidden] { display: none !important; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 20px 0; }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.skip { position: absolute; left: -999px; top: 8px; z-index: 50; padding: 8px 14px; background: var(--ink); color: var(--paper); border-radius: var(--r); }
.skip:focus { left: 8px; }
.num, .tnum { font-variant-numeric: tabular-nums; }

/* ---------- Type ---------- */
.display, .page-title {
  font-family: var(--serif); font-weight: 700; color: var(--ink);
  line-height: 1.02; letter-spacing: -0.012em; text-wrap: balance;
}
.page-title { font-size: clamp(2.1rem, 4.2vw, 3rem); }
.smallcaps { font-variant-caps: all-small-caps; letter-spacing: .06em; }
.kicker, .dateline { color: var(--muted); font-size: .9rem; }
.lead-note { color: var(--ink-2); margin-top: 12px; max-width: 64ch; }
.hint, .muted-note { color: var(--muted); font-size: .875rem; }
.empty { color: var(--muted); padding: 10px 0; }
.loading { color: var(--muted); padding-top: 72px; }
.err { padding-top: 72px; padding-bottom: 24px; display: flex; flex-direction: column; align-items: flex-start; gap: 16px; }
.err p { max-width: 52ch; font-family: var(--serif); font-size: 1.35rem; line-height: 1.3; }

/* A section: heading over a heavy rule, entries ruled below. */
.block { padding-top: 48px; }
.block.first { padding-top: 32px; }
.block > h2, .block-h, .sec-h {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 6px 16px;
  border-top: 2px solid var(--rule-ink); padding-top: 10px; margin-bottom: 18px;
}
.block > h2, .block-h h2, .sec-h h2 { font-family: var(--serif); font-weight: 700; font-size: 1.375rem; line-height: 1.2; letter-spacing: -0.005em; }
.block-h h2 { margin: 0; }
.block h3 { font-size: .8125rem; font-weight: 700; color: var(--ink-2); margin: 22px 0 8px; letter-spacing: .01em; }
.block h2 .count, .sec-h .count { font-family: var(--sans); font-size: .875rem; font-weight: 400; color: var(--muted); }
.sub { color: var(--muted); font-size: .875rem; margin-top: 12px; }
.duo { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 56px; }

/* ---------- Masthead ---------- */
.bar { position: sticky; top: 0; z-index: 20; background: var(--paper); border-bottom: 3px double var(--rule-ink); }
.bar-in { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: var(--bar-h); }
.brand { display: inline-flex; align-items: center; gap: 11px; min-width: 0; font-family: var(--serif); font-weight: 700; font-size: 1.1875rem; letter-spacing: -0.005em; white-space: nowrap; }
.brand::before { content: ""; flex: none; width: 32px; height: 32px; background: url("/assets/img/ra-seal.png") center / contain no-repeat; }
/* Staff and leadership pages say so next to the name: they're internal. */
body.e-mode .brand::after { content: "Internal"; margin-left: 2px; padding: 0 5px; border: 1px solid var(--rule-2); border-radius: var(--r-sm);
  font-family: var(--mono); font-size: .62rem; font-weight: 400; letter-spacing: .04em; line-height: 1.7; color: var(--muted); }
.bar nav { display: flex; align-items: stretch; height: 100%; gap: 2px; overflow-x: auto; scrollbar-width: none; }
.bar nav::-webkit-scrollbar { display: none; }
.bar nav a { position: relative; display: flex; align-items: center; padding: 0 11px; color: var(--ink-2); font-size: .9375rem; white-space: nowrap; }
.bar nav a:hover { color: var(--ink); }
.bar nav a.on { color: var(--ink); font-weight: 700; }
.bar nav a.on::after { content: ""; position: absolute; left: 11px; right: 11px; bottom: 0; height: 3px; background: var(--sage); }
.bar nav a.acct-link { margin-left: 10px; }
.bar nav a.acct-link::before { content: ""; position: absolute; left: -6px; top: 50%; height: 18px; margin-top: -9px; border-left: 1px solid var(--rule-2); }
.bar nav a.ext::after { content: "\2197"; margin-left: 4px; font-size: .8em; opacity: .7; }
/* When the links don't fit (phones, narrow windows) the row scrolls; fade the edge that has more past it. */
.bar nav.more-left { -webkit-mask-image: linear-gradient(to right, transparent, #000 32px); mask-image: linear-gradient(to right, transparent, #000 32px); }
.bar nav.more-right { -webkit-mask-image: linear-gradient(to left, transparent, #000 32px); mask-image: linear-gradient(to left, transparent, #000 32px); }
.bar nav.more-left.more-right { -webkit-mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent);
  mask-image: linear-gradient(to right, transparent, #000 32px, #000 calc(100% - 32px), transparent); }
/* Laptop widths: tighten the masthead so every link still fits on one line */
@media (max-width: 1180px) {
  .brand { font-size: 1.0625rem; }
  .bar nav a { padding: 0 8px; }
  .bar nav a.on::after { left: 8px; right: 8px; }
}
@media (max-width: 1060px) { body.e-mode .brand::after { display: none; } }
@media (max-width: 860px) {
  :root { --bar-h: 93px; }
  .bar { position: relative; }
  .bar-in { height: auto; flex-direction: column; align-items: stretch; gap: 0; padding-left: 0; padding-right: 0; }
  .brand { height: 50px; padding: 0 var(--gutter); font-size: 1.0625rem; border-bottom: 1px solid var(--rule); }
  .brand::before { width: 28px; height: 28px; }
  .bar nav { height: 42px; padding: 0 calc(var(--gutter) - 10px); }
  .bar nav a { padding: 0 10px; font-size: .9375rem; }
  .bar nav a.on::after { left: 10px; right: 10px; }
  html { scroll-padding-top: 96px; }
  .tools { top: 0; }
}

/* ---------- Footer ---------- */
.site-foot { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 10px 32px; margin-top: 8px;
  padding-top: 18px; padding-bottom: 28px; color: var(--muted); font-size: .875rem;
  /* hairline the width of the text column, not the padded box */
  background: linear-gradient(var(--rule), var(--rule)) no-repeat top center / calc(100% - 2 * var(--gutter)) 1px; }
.site-foot a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.site-foot a:hover { color: var(--ink); }
.foot-end { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.site-foot .linkish { color: var(--ink-2); font-size: inherit; padding: 3px 0; margin: -3px 0; }
body.e-mode .site-foot, body.app-mode .site-foot { display: none; }
.foot-text { max-width: none; color: inherit; line-height: inherit; }
.foot-text > * + * { margin-top: .3em; }

/* Theme switch: Auto / Light / Dark */
.theme-sw { display: inline-flex; align-items: center; gap: 2px; }
.theme-sw > span { margin-right: 6px; color: var(--muted); }
.theme-sw button { border: 0; background: none; padding: 4px 6px; margin: -2px 0; color: var(--muted); cursor: pointer; border-radius: var(--r-sm); font-size: inherit; }
.theme-sw button:hover { color: var(--ink); }
.theme-sw button[aria-pressed="true"] { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--sage); text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* ---------- Links and buttons ---------- */
.link, .site-text a, .lead-note a, .prose a { color: var(--sage-ink); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.link:hover, .site-text a:hover, .lead-note a:hover, .prose a:hover { color: var(--sage-deep); }
.linkish { background: none; border: 0; padding: 0; color: var(--sage-ink); font: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: transparent; text-underline-offset: 3px; }
.linkish:hover { text-decoration-color: currentColor; }
.linkish.danger, .linkish.armed { color: var(--bad); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: var(--r); cursor: pointer; white-space: nowrap;
  border: 1px solid var(--rule-2); background: var(--sheet); color: var(--ink); font-weight: 400;
  transition: border-color .12s ease-out, background-color .12s ease-out;
}
.btn:hover { border-color: var(--ink-2); }
.btn.solid { background: var(--sage); border-color: var(--sage); color: var(--on-sage); font-weight: 700; }
.btn.solid:hover { background: color-mix(in srgb, var(--sage) 86%, var(--ink)); border-color: color-mix(in srgb, var(--sage) 86%, var(--ink)); }
.btn:disabled { opacity: .55; cursor: default; }

input[type="search"], .field {
  width: 100%; height: 42px; padding: 0 12px; border-radius: var(--r);
  border: 1px solid var(--rule-2); background: var(--sheet); color: var(--ink); outline: none;
  -webkit-appearance: none; appearance: none;
}
::placeholder { color: var(--placeholder); opacity: 1; }
input[type="search"]:focus, .field:focus { border-color: var(--ink-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 30%, transparent); }
/* The browser's own clear button, drawn in the page's ink instead of system blue */
input[type="search"]::-webkit-search-cancel-button {
  -webkit-appearance: none; appearance: none; width: 12px; height: 12px; margin-left: 8px; cursor: pointer; background: currentColor; opacity: .5;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1 1l10 10M11 1 1 11' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M1 1l10 10M11 1 1 11' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
}
input[type="search"]::-webkit-search-cancel-button:hover { opacity: 1; }

/* Segmented choice (Events / Attendance, Handbook tabs): words with a rule under the chosen one */
.seg { display: inline-flex; gap: 2px; border-bottom: 1px solid var(--rule); }
.seg button { position: relative; border: 0; background: none; padding: 6px 10px 8px; cursor: pointer; color: var(--muted); font-size: .9375rem; }
.seg button:hover { color: var(--ink); }
.seg button.on { color: var(--ink); font-weight: 700; }
.seg button.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--sage); }

/* ---------- Labels: chips and stamps ---------- */
.chip, .stag {
  display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; font-style: normal;
  padding: 0 7px; border-radius: var(--r-sm); border: 1px solid var(--rule-2);
  color: var(--ink-2); background: transparent; font-size: .78rem; font-weight: 400; line-height: 1.6;
}
.chip.tier { font-family: var(--mono); font-size: .72rem; letter-spacing: .04em; color: var(--tc); border-color: color-mix(in srgb, var(--tc) 55%, transparent); }
.chip.dept { color: var(--sage-ink); border-color: color-mix(in srgb, var(--sage) 60%, transparent); }
.chip.former { color: var(--former); border-color: color-mix(in srgb, var(--former) 45%, transparent); }
.chip.now { margin-left: 10px; vertical-align: 2px; color: var(--on-tc, var(--on-sage)); background: var(--tc, var(--sage)); border-color: var(--tc, var(--sage)); font-weight: 700; }
.chip.now-chip { color: var(--on-sage); background: var(--sage); border-color: var(--sage); font-weight: 700; }
.chip.tag-gold   { color: var(--gold); border-color: var(--gold-line); }
.chip.tag-red    { color: var(--bad); border-color: var(--bad-line); }
.chip.tag-orange { color: #a0521b; border-color: #dfb08a; }
.chip.tag-green  { color: var(--sage-ink); border-color: color-mix(in srgb, var(--sage) 60%, transparent); }
.chip.tag-teal   { color: #22675f; border-color: #8fc3bc; }
.chip.tag-blue   { color: var(--info); border-color: var(--info-line); }
.chip.tag-purple { color: var(--cpm); border-color: var(--cpm-line); }
.chip.tag-pink   { color: #8e3462; border-color: #dba4c0; }
.chip.tag-grey   { color: var(--ink-2); }
:root[data-theme="dark"] .chip.tag-orange { color: #e5b27f; border-color: #6a4a2e; }
:root[data-theme="dark"] .chip.tag-teal { color: #86cfc4; border-color: #2f5e57; }
:root[data-theme="dark"] .chip.tag-pink { color: #e6a3c4; border-color: #6e3a54; }
.stag.ok { color: var(--sage-ink); border-color: color-mix(in srgb, var(--sage) 60%, transparent); background: var(--sage-wash); }
.stag.warn { color: var(--warn); border-color: var(--warn-line); background: var(--warn-wash); }
.stag.off { color: var(--muted); }
.dot { display: inline-block; width: 9px; height: 9px; background: var(--tc); }

/* Non-obtainable (locked) awards: the same small stamp everywhere */
.aw-lock { display: inline-block; vertical-align: 1px; margin-left: 6px; padding: 0 5px; border: 1px solid var(--rule-2); border-radius: var(--r-sm);
  color: var(--muted); font-family: var(--mono); font-size: .66rem; font-weight: 400; line-height: 1.6; letter-spacing: .02em; white-space: nowrap; }

/* ---------- Avatars: small ID photographs ---------- */
.av {
  flex: none; display: inline-flex; align-items: center; justify-content: center; overflow: hidden;
  width: 36px; height: 36px; border-radius: var(--r-sm); background: var(--well); border: 1px solid var(--rule);
  color: var(--muted); font-family: var(--mono); font-size: .72rem; letter-spacing: .02em;
}
.av img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av.big { width: 112px; height: 112px; font-size: 1.6rem; }

/* ---------- Notices ---------- */
.notice { margin-top: 20px; padding: 10px 14px; border: 1px solid var(--rule-2); border-left-width: 4px; background: var(--sheet); color: var(--ink); }
.notice.tone-warn { border-color: var(--warn-line); border-left-color: var(--warn); background: var(--warn-wash); }
.notice.tone-ok { border-color: color-mix(in srgb, var(--sage) 60%, transparent); border-left-color: var(--sage); background: var(--sage-wash); }
.notice.tone-info { border-left-color: var(--info); }

/* ---------- Bar chart ---------- */
.pulse {
  --chart-h: 150px;
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px;
  height: calc(var(--chart-h) + 50px); padding-top: 24px; border-bottom: 1px solid var(--rule-ink); margin-bottom: 26px;
}
.pulse li { position: relative; display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; }
.pulse i { display: block; position: relative; width: 100%; height: calc(var(--chart-h) * var(--r)); min-height: 1px; background: var(--bar); font-style: normal; }
.pulse li:last-child i, .pulse li.hi i { background: var(--sage); }
.pulse i::before { content: attr(data-v); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); padding-bottom: 3px;
  font-size: .72rem; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.pulse .partial i { background: repeating-linear-gradient(135deg, var(--sage) 0 3px, transparent 3px 6px); outline: 1px solid var(--sage); outline-offset: -1px; }
.pulse span { position: absolute; top: calc(100% + 6px); left: 0; right: 0; display: flex; justify-content: center; font-size: .72rem; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .pulse { gap: 3px; } .pulse li:nth-child(even) span { visibility: hidden; } .pulse i::before { font-size: .65rem; } }

/* ---------- Home ---------- */
.home-top { padding-top: clamp(28px, 4.5vw, 56px); padding-bottom: 8px; }
.home-id { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 6px clamp(18px, 2.4vw, 32px); align-items: center; }
.home-id .seal { grid-row: 1 / span 3; width: clamp(80px, 9vw, 120px); height: auto; aspect-ratio: 1; }
.home-id .dateline { grid-column: 2; }
.home-id .display { grid-column: 2; font-size: clamp(2.4rem, 5.4vw, 4.25rem); }
.home-id .hero-text { grid-column: 2; margin-top: 6px; }
/* Small phones: the seal sits above the name so a long department name keeps its full width */
@media (max-width: 520px) {
  .home-id { grid-template-columns: minmax(0, 1fr); }
  .home-id .seal { grid-row: auto; width: 64px; margin-bottom: 8px; }
  .home-id .dateline, .home-id .display, .home-id .hero-text { grid-column: 1; }
}
.display, .page-title { overflow-wrap: break-word; }
.find { display: flex; gap: 8px; margin-top: 28px; max-width: 560px; }
.find input { height: 44px; font-size: 1rem; }
.find .btn { min-height: 44px; }
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 64px; margin-top: 12px; }
@media (min-width: 1080px) {
  .home-grid { grid-template-columns: minmax(0, 1fr) 340px; grid-template-rows: auto 1fr; align-items: start; }
  .home-grid > .next-ev { grid-column: 2; grid-row: 1; margin-top: 32px; }
  .home-grid > .home-main { grid-column: 1; grid-row: 1 / span 2; }
  .home-grid > .home-side { grid-column: 2; grid-row: 2; }
}
.summary { font-family: var(--serif); font-size: clamp(1.125rem, 1.6vw, 1.3125rem); line-height: 1.5; max-width: 62ch; color: var(--ink); }
.summary b { font-weight: 700; font-variant-numeric: lining-nums; }
.summary + .tiers { margin-top: 22px; }
.tierbar { display: flex; gap: 2px; height: 10px; }
.tierbar i { background: var(--tc); min-width: 2px; }
.tierkey { display: flex; flex-wrap: wrap; gap: 6px 26px; margin-top: 12px; color: var(--ink-2); font-size: .875rem; }
.tierkey li { display: flex; align-items: center; gap: 8px; }
.tierkey b { color: var(--ink); font-variant-numeric: tabular-nums; }
.crew { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 0 32px; }
.crew a { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.crew a:hover b { text-decoration: underline; text-underline-offset: 3px; }
.crew b { display: block; font-weight: 700; }
.crew small { color: var(--muted); font-size: .875rem; }
.next-ev { display: grid; gap: 2px; margin-top: 24px; padding: 14px 16px 16px; border: 1px solid var(--rule-ink); background: var(--sheet); color: var(--ink-2); }
.next-ev:hover { background: var(--well); }
.next-label { font-size: .8125rem; color: var(--muted); }
.next-label.live { color: var(--sage-ink); font-weight: 700; }
.next-ev b { font-family: var(--serif); font-size: 1.375rem; line-height: 1.2; color: var(--ink); margin: 2px 0 4px; }
.next-ev .rel { margin-top: 6px; font-size: .8125rem; color: var(--sage-ink); }
.gazette li { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 2px 12px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.gazette time { grid-row: 1 / span 2; padding-top: 2px; font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.gazette a { font-weight: 700; }
.gazette a:hover { text-decoration: underline; text-underline-offset: 3px; }
.gazette span { color: var(--ink-2); font-size: .875rem; }
.gazette span i { font-style: normal; color: var(--muted); padding: 0 4px; }
/* older class names */
.feed li { display: grid; grid-template-columns: 1fr auto; gap: 2px 16px; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.feed a { font-weight: 700; } .feed span { grid-column: 1; color: var(--ink-2); font-size: .875rem; } .feed time { grid-row: 1; grid-column: 2; color: var(--muted); font-size: .8125rem; }

/* ---------- Page scaffolding ---------- */
.page { padding-top: clamp(28px, 4vw, 48px); }
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 24px; padding-bottom: 6px; }
.page-head .seg { margin-bottom: 4px; }
.page-text { margin: 14px 0 0; }
.block .page-text { margin: -6px 0 18px; }
.hero-text { margin-top: 12px; }
.roster-text { margin: 18px 0 0; }

/* ---------- Roster (public): the register of members ---------- */
.reg-head { padding-top: clamp(28px, 4vw, 48px); }
.tools { position: sticky; top: calc(var(--bar-h) + 3px); z-index: 6; background: var(--paper); border-bottom: 1px solid var(--rule); }
.tools-in { display: grid; gap: 10px; padding-top: 14px; padding-bottom: 0; }
.tools input[type="search"] { max-width: 560px; }
.pills { display: flex; gap: 0 4px; overflow-x: auto; scrollbar-width: none; margin: 0 -10px; }
.pills::-webkit-scrollbar { display: none; }
.pill { position: relative; flex: none; border: 0; background: none; cursor: pointer; padding: 8px 10px 10px; color: var(--ink-2); font-size: .9375rem; }
.pill:hover { color: var(--ink); }
.pill span { margin-left: 6px; color: var(--muted); font-size: .8125rem; font-variant-numeric: tabular-nums; }
.pill.on { color: var(--ink); font-weight: 700; }
.pill.on span { color: var(--muted); font-weight: 400; }
.pill.on::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: 0; height: 3px; background: var(--sage); }

.list { padding-top: 6px; columns: 340px 3; column-gap: 40px; }
.list > .empty, .list > .more { column-span: all; }
.group { display: flex; align-items: baseline; gap: 10px; break-after: avoid; padding: 26px 0 6px; border-bottom: 2px solid var(--rule-ink); }
.list > .group:first-child { padding-top: 14px; }
.group .rk { font-family: var(--mono); font-size: .75rem; color: var(--muted); min-width: 1.6em; }
.group b, .group { font-family: var(--serif); font-weight: 700; font-size: 1.0625rem; color: var(--ink); }
.group span:last-child { margin-left: auto; font-family: var(--sans); font-weight: 400; font-size: .8125rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 8px 2px; border-bottom: 1px solid var(--rule); break-inside: avoid; }
.row:hover { background: var(--well); }
.row .av { width: 32px; height: 32px; }
.who { min-width: 0; display: block; }
.name { display: block; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.name .chip { margin-left: 8px; font-weight: 400; vertical-align: 1px; }
.handle { display: flex; gap: 12px; color: var(--muted); font-size: .8125rem; white-space: nowrap; overflow: hidden; }
.meta { display: flex; align-items: center; gap: 5px; }
.emp { min-width: 46px; text-align: right; font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.more { display: flex; margin: 22px 0 0; }
.foot { color: var(--muted); font-size: .8125rem; padding-top: 28px; }
@media (max-width: 720px) { .meta .dept, .emp { display: none; } }

/* ---------- Profile: a member's file ---------- */
.profile { padding-top: 22px; }
.back { display: inline-block; color: var(--muted); font-size: .875rem; padding: 4px 0; margin-bottom: 18px; }
.back::before { content: "\2190\00a0"; }
.back:hover { color: var(--ink); }
.file-head { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 8px 28px; align-items: start; padding-bottom: 24px; border-bottom: 3px double var(--rule-ink); }
.file-head .av.big { grid-row: 1 / span 2; border-color: var(--rule-2); }
.file-no { font-family: var(--mono); font-size: .8125rem; color: var(--muted); letter-spacing: .02em; }
.file-no b { color: var(--ink); font-weight: 700; letter-spacing: .08em; }
.file-head .display { font-size: clamp(2.2rem, 5vw, 3.5rem); overflow-wrap: anywhere; margin-top: 4px; }
.file-line { color: var(--ink-2); margin-top: 8px; }
.file-line .sep { color: var(--faint); padding: 0 6px; }
@media (max-width: 720px) { .file-line { display: grid; gap: 1px; margin-top: 6px; } .file-line .sep { display: none; } }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.file-stamp { justify-self: end; text-align: right; font-family: var(--mono); }
.file-stamp .clr { display: inline-block; padding: 3px 10px; border: 2px solid var(--tc, var(--ink)); color: var(--tc, var(--ink)); font-size: 1.1rem; font-weight: 700; letter-spacing: .12em; }
.file-stamp small { display: block; margin-top: 6px; font-size: .72rem; color: var(--muted); letter-spacing: .02em; }
@media (max-width: 720px) {
  .file-head { grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; }
  .file-head .av.big { width: 76px; height: 76px; font-size: 1.2rem; grid-row: auto; }
  .file-stamp { grid-column: 1 / -1; justify-self: start; text-align: left; display: flex; align-items: center; gap: 12px; }
  .file-stamp small { margin-top: 0; }
  .file-head .file-id { grid-column: 2; }
}

/* Service record: one ledger line of figures */
.record { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); border-bottom: 1px solid var(--rule); }
.record > div { padding: 14px 16px 16px 0; }
.record > div + div { padding-left: 16px; border-left: 1px solid var(--rule); }
.record dt { font-size: .8125rem; color: var(--muted); }
.record dd { font-family: var(--serif); font-weight: 700; font-size: clamp(1.6rem, 3vw, 2.1rem); line-height: 1.1; font-variant-numeric: tabular-nums lining-nums; margin-top: 4px; }
.record dd.txt { font-size: clamp(1.05rem, 1.6vw, 1.25rem); padding-top: .35em; }
@media (max-width: 720px) {
  .record { grid-template-columns: 1fr 1fr; grid-auto-flow: row; }
  .record > div { padding: 12px 12px 14px 0; }
  .record > div + div { border-left: 0; padding-left: 0; }
  .record > div:nth-child(even) { padding-left: 12px; border-left: 1px solid var(--rule); }
  .record > div:nth-child(n+3) { border-top: 1px solid var(--rule); }
}
.pro-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 64px; }
@media (min-width: 1080px) { .pro-grid { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; } }

/* Career: the ladder strip and the stint ledger */
.strip { display: flex; gap: 2px; height: 34px; margin: 2px 0 22px; overflow: hidden; }
.strip i { display: flex; align-items: center; justify-content: center; flex: 1 1 0; min-width: 16px; overflow: hidden;
  background: color-mix(in srgb, var(--tc) 22%, var(--paper)); border-bottom: 2px solid var(--tc);
  color: var(--ink); font-family: var(--mono); font-size: .7rem; font-style: normal; }
.strip i.cur { background: var(--tc); color: var(--paper); }
.stints { border-top: 1px solid var(--rule); }
.stint { display: grid; grid-template-columns: 210px minmax(0, 1fr) auto; gap: 2px 18px; align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--rule); }
.stint .node { display: none; }
.stint .when { font-family: var(--mono); font-size: .75rem; color: var(--muted); white-space: nowrap; }
.stint h3 { margin: 0; font-size: 1rem; font-weight: 700; color: var(--ink); }
.stint h3 .chip.now { margin-left: 8px; vertical-align: 1px; }
.stint p { color: var(--muted); font-size: .8125rem; }
.s-side { text-align: right; white-space: nowrap; }
.s-side b { display: block; font-weight: 400; font-size: .9375rem; color: var(--ink); }
.s-side span { color: var(--muted); font-size: .8125rem; }
.stint.joined h3 { font-weight: 400; color: var(--ink-2); }
@media (max-width: 760px) {
  .stint { grid-template-columns: minmax(0, 1fr) auto; }
  .stint .when { grid-column: 1 / -1; }
}

.awards { display: grid; }
.awards li { padding: 8px 0; border-bottom: 1px solid var(--rule); cursor: default; }
.awards li::before { content: "\2014\00a0"; color: var(--sage); }
.awards-block h3:first-of-type { margin-top: 0; }
.details { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 0 28px; }
.details > div { padding: 10px 0 11px; border-bottom: 1px solid var(--rule); }
.details dt { color: var(--muted); font-size: .8125rem; }
.details dd { margin-top: 1px; }
.details small { display: block; color: var(--muted); font-size: .8125rem; }
@media (min-width: 1080px) { .pro-side .details { grid-template-columns: 1fr; } }

/* ---------- Events ---------- */
.events-grid, .market-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 64px; align-items: start; }
@media (min-width: 980px) { .events-grid, .market-grid { grid-template-columns: minmax(0, 1fr) 340px; } }
.evs li.ev { display: grid; grid-template-columns: 76px minmax(0, 1fr) auto; gap: 4px 20px; align-items: start; padding: 16px 0 18px; border-bottom: 1px solid var(--rule); }
.ev-date { display: grid; justify-items: start; line-height: 1; }
.ev-date b { font-family: var(--serif); font-size: 2.25rem; font-weight: 700; font-variant-numeric: lining-nums; }
.ev-date span { margin-top: 6px; color: var(--muted); font-variant-caps: all-small-caps; letter-spacing: .08em; font-size: .9rem; }
.ev.live .ev-date b { color: var(--sage-ink); }
.ev-main h3 { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; line-height: 1.25; color: var(--ink); margin: 2px 0 6px; }
.ev-meta { display: flex; flex-wrap: wrap; gap: 2px 18px; color: var(--muted); font-size: .875rem; }
.ev-meta a { color: var(--ink-2); text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.ev-meta a:hover { color: var(--ink); }
.ev-desc { margin-top: 8px; color: var(--ink-2); max-width: 64ch; }
@media (max-width: 560px) {
  .evs li.ev { grid-template-columns: 52px minmax(0, 1fr); gap: 4px 14px; }
  .ev-date b { font-size: 1.75rem; }
  .evs li.ev > .chip { grid-column: 2; justify-self: start; }
}

.cal { padding: 14px 0 0; border-top: 2px solid var(--rule-ink); }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.cal-head h3 { margin: 0; font-family: var(--serif); font-size: 1.125rem; font-weight: 700; color: var(--ink); }
.icon-btn { width: 32px; height: 32px; border-radius: var(--r); border: 1px solid var(--rule-2); background: var(--sheet); cursor: pointer; font-size: 1.05rem; color: var(--ink-2); }
.icon-btn:hover { border-color: var(--ink-2); color: var(--ink); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; border-left: 1px solid var(--rule); border-top: 1px solid var(--rule); }
.cal-name, .cal-day, .cal-pad { border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule); }
.cal-name { color: var(--muted); font-size: .72rem; padding: 4px 0; background: var(--well); }
.cal-day { position: relative; aspect-ratio: 1; display: flex; align-items: flex-start; justify-content: flex-start; padding: 4px 5px; font-size: .78rem; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.cal-day b { font-weight: 400; }
.cal-day.today b { color: var(--ink); font-weight: 700; text-decoration: underline; text-decoration-color: var(--sage); text-decoration-thickness: 2px; text-underline-offset: 3px; }
.cal-day i { position: absolute; left: 5px; right: 5px; bottom: 5px; height: 3px; background: var(--rule-2); }
.cal-day.has-up { background: var(--sage-wash); color: var(--ink); }
.cal-day.has-up i { background: var(--sage); }
.cal-key { display: flex; gap: 16px; margin-top: 10px; color: var(--muted); font-size: .75rem; }
.cal-key i { display: inline-block; width: 12px; height: 3px; margin-right: 6px; vertical-align: 3px; }
.k-up { background: var(--sage); } .k-past { background: var(--rule-2); }
.past li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.past time { grid-column: 1 / -1; font-family: var(--mono); font-size: .72rem; color: var(--muted); }
.past span { color: var(--ink-2); font-size: .9375rem; }
.past a { text-decoration: underline; text-decoration-color: var(--rule-2); text-underline-offset: 3px; }
.past b { grid-row: 2; grid-column: 2; font-weight: 400; color: var(--ink); font-variant-numeric: tabular-nums; font-size: .875rem; }

/* ---------- Market: a price list ---------- */
.shop { display: grid; }
.shop .item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: baseline; gap: 4px 24px; padding: 16px 0 18px; border-bottom: 1px solid var(--rule); }
.shop .item.sold .item-top h3, .shop .item.sold p { color: var(--muted); }
.item-top { display: contents; }
.item-top h3 { grid-column: 1; grid-row: 1; margin: 0; font-family: var(--serif); font-size: 1.25rem; font-weight: 700; line-height: 1.25; color: var(--ink); }
.price { grid-column: 2; grid-row: 1; justify-self: end; font-family: var(--serif); font-size: 1.375rem; font-weight: 700; color: var(--ink); white-space: nowrap; font-variant-numeric: tabular-nums lining-nums; }
.price small { font-family: var(--sans); font-size: .75rem; font-weight: 400; color: var(--muted); margin-left: 5px; }
.shop .item p { grid-column: 1 / -1; grid-row: 2; color: var(--ink-2); max-width: 64ch; }
.item-facts { grid-column: 1 / -1; grid-row: 3; display: flex; flex-wrap: wrap; gap: 4px 22px; margin-top: 6px; font-size: .8125rem; }
.item-facts dt { display: inline; color: var(--muted); }
.item-facts dt::after { content: " "; }
.item-facts dd { display: inline; color: var(--ink); }
.item-facts .out { color: var(--bad); }
.shop .empty { padding: 16px 0; }
.board li { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 0 12px; padding: 9px 0; border-bottom: 1px solid var(--rule); align-items: baseline; }
.board .pos { font-family: var(--mono); font-size: .75rem; color: var(--muted); }
.board a { font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.board a:hover { text-decoration: underline; text-underline-offset: 3px; }
.board small { grid-column: 2; color: var(--muted); font-size: .8125rem; }
.board b { grid-row: 1; grid-column: 3; font-family: var(--serif); font-size: 1.0625rem; font-variant-numeric: tabular-nums lining-nums; color: var(--ink); }

/* ---------- Handbook ---------- */
.doc-frame { margin-top: 24px; border: 1px solid var(--rule-2); background: #fff; }
.doc-frame iframe { display: block; width: 100%; height: calc(100vh - var(--bar-h) - 220px); min-height: 520px; border: 0; }
.doc-open { margin-top: 14px; }
.ladder { columns: 3 280px; column-gap: 44px; }
.rung-group { break-inside: avoid; padding-bottom: 22px; }
.rung-group h3 { margin-top: 0; }
.rung-group li { display: grid; grid-template-columns: 30px minmax(0, 1fr) auto; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--rule); }
.rung-group .num { font-family: var(--mono); font-size: .8125rem; color: var(--tc); }
.dept h3 { color: var(--ink); font-size: 1rem; }
.dept ol { list-style: decimal; padding-left: 22px; color: var(--ink-2); }
.dept li { padding: 3px 0; }
.dept li::marker { font-family: var(--mono); font-size: .8em; color: var(--muted); }
.award-list > div { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 18px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.award-list dt { font-weight: 700; color: var(--ink); }
.award-list dd { color: var(--ink-2); }
.award-list > div.is-locked dt { color: var(--ink-2); }
@media (max-width: 560px) { .award-list > div { grid-template-columns: 1fr; gap: 2px; } }

/* ---------- Leadership links page ---------- */
.tools-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 0 32px; margin-top: 28px; }
.tool { display: flex; flex-direction: column; gap: 8px; padding: 18px 0; border-top: 2px solid var(--rule-ink); }
.tool h2 { font-family: var(--serif); font-weight: 700; font-size: 1.4rem; }
.tool p { color: var(--ink-2); }
.tool-open { margin-top: auto; padding-top: 8px; color: var(--sage-ink); font-weight: 700; }
.tool-open::after { content: "\2197"; margin-left: 6px; font-size: .85em; }

/* ---------- Sign in, account, accounts ---------- */
.auth { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px 72px; }
@media (min-width: 900px) {
  .auth.split { grid-template-columns: minmax(0, 1fr) minmax(320px, 420px); align-items: start; }
  .auth.split .auth-card { grid-column: 2; grid-row: 1 / span 3; margin-top: 8px; }
}
.auth-intro { max-width: 52ch; }
.auth-intro p { color: var(--ink-2); margin-top: 14px; }
.auth .auth-card, .acct-form form { display: grid; gap: 16px; max-width: 420px; margin-top: 28px; }
.auth .auth-card { padding: 22px 22px 24px; border: 1px solid var(--rule-2); background: var(--sheet); }
.auth-card label, .acct-form label { display: grid; gap: 6px; color: var(--ink-2); font-size: .875rem; }
.auth-card input, .acct-form input:not([type="checkbox"]), .acct-form select {
  height: 42px; padding: 0 12px; border-radius: var(--r); border: 1px solid var(--rule-2); background: var(--paper);
  color: var(--ink); font: inherit; font-size: 1rem; outline: none;
}
.auth-card input:focus, .acct-form input:focus, .acct-form select:focus { border-color: var(--ink-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--sage) 30%, transparent); }
.acct-form input[readonly] { color: var(--muted); }
.acct-form label.check { display: flex; align-items: center; gap: 10px; color: var(--ink); }
.acct-form label.check input { width: 18px; height: 18px; accent-color: var(--sage); }
.auth-card .btn, .acct-form .btn { min-height: 42px; justify-content: center; }
.auth-msg { color: var(--bad); min-height: 1.2em; font-size: .875rem; }
.auth-msg:empty { min-height: 0; }
.acct-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; margin-top: 28px; }
.acct-grid { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 48px; margin-top: 28px; align-items: start; }
.acct-form h2, .gmode h2 { font-family: var(--serif); font-weight: 700; font-size: 1.375rem; border-top: 2px solid var(--rule-ink); padding-top: 10px; }
.acct-form form { margin-top: 14px; }
.row-btns { display: flex; gap: 10px; }
.acct-list { display: grid; border-top: 2px solid var(--rule-ink); }
.acct-row { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.3fr) 168px 210px; gap: 8px 16px; align-items: center; padding: 13px 0; border-bottom: 1px solid var(--rule); }
.acct-row > div > span:not(.stag) { display: block; overflow-wrap: anywhere; color: var(--muted); font-size: .8125rem; }
.acct-who b { font-weight: 700; }
.acct-btns { display: flex; flex-wrap: wrap; gap: 4px 14px; justify-content: flex-end; }
.acct-row .auth-msg { grid-column: 1 / -1; }
.issued { display: grid; grid-template-columns: 1fr auto; gap: 8px 16px; align-items: center; margin-top: 24px; padding: 16px 18px; max-width: 640px;
  border: 1px solid color-mix(in srgb, var(--sage) 60%, transparent); border-left-width: 4px; border-left-color: var(--sage); background: var(--sage-wash); }
.issued code { grid-column: 1; font-family: var(--mono); font-size: 1.25rem; color: var(--ink); user-select: all; }
.issued p { grid-column: 1 / -1; color: var(--ink-2); font-size: .875rem; }
.issued > div { grid-column: 1 / -1; }
.issued .linkish { grid-column: 1 / -1; justify-self: start; }
.gmode { margin-top: 48px; display: grid; gap: 10px; justify-items: start; }
.gmode h2 { justify-self: stretch; }
.gmode p { color: var(--ink-2); }
@media (max-width: 760px) {
  .acct-grid { grid-template-columns: 1fr; gap: 28px; }
  .acct-row { grid-template-columns: 1fr 1fr; }
  .acct-status { grid-column: 1 / -1; }
  .acct-btns { grid-column: 1 / -1; justify-content: flex-start; }
}
.human-check { min-height: 65px; }
body.app-mode main { padding-bottom: 0; }

/* ---------- Not found ---------- */
.nf { padding-top: clamp(40px, 8vw, 96px); max-width: 640px; }
.nf .file-no { margin-bottom: 10px; }
.nf h1 { font-family: var(--serif); font-size: clamp(2rem, 4vw, 2.75rem); font-weight: 700; line-height: 1.1; }
.nf p { color: var(--ink-2); margin-top: 12px; }
.nf code { font-family: var(--mono); font-size: .9em; padding: 0 4px; background: var(--well); }
.nf .acct-actions { margin-top: 24px; }

/* ---------- Dialogs: credits, leave without saving ---------- */
.cr-back, .leave-dlg { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 16px; background: var(--scrim); }
.cr-box, .leave-box { width: min(400px, 100%); display: grid; gap: 10px; padding: 22px 22px 20px; background: var(--sheet); border: 1px solid var(--rule-2); border-top: 3px solid var(--rule-ink); border-radius: var(--r); box-shadow: var(--shadow); }
.cr-box h2, .leave-box h2 { font-family: var(--serif); font-size: 1.375rem; font-weight: 700; margin: 0; }
.cr-sub { color: var(--muted); font-size: .875rem; margin-bottom: 4px; }
.cr-dev { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.cr-dev:hover b { text-decoration: underline; text-underline-offset: 3px; }
.cr-dev b { display: block; font-weight: 700; }
.cr-dev small { color: var(--muted); font-size: .8125rem; }
.cr-av { width: 36px; height: 36px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: var(--r-sm); font-family: var(--serif); font-weight: 700; color: var(--on-sage); background: var(--sage); }
.cr-close { margin-top: 8px; justify-self: start; }
.cr-legal { margin-top: 4px; color: var(--muted); font-size: .8125rem; line-height: 1.5; }
.cr-more { display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; padding: 10px 0; border: 0; border-bottom: 1px solid var(--rule);
  background: none; color: var(--ink-2); font: inherit; font-size: .875rem; cursor: pointer; text-align: left; }
.cr-more:hover { color: var(--ink); }
.cr-more span { font-size: 1.1rem; line-height: 1; color: var(--muted); }
.cr-backbtn { justify-self: start; display: inline-flex; align-items: center; gap: 6px; padding: 2px 0; border: 0; background: none; color: var(--sage-ink); font: inherit; font-size: .875rem; cursor: pointer; }
.cr-orig { display: grid; }
.cr-orig li { display: flex; flex-direction: column; gap: 1px; padding: 9px 0; border-bottom: 1px solid var(--rule); }
.cr-orig b { font-weight: 700; }
.cr-orig small { color: var(--muted); font-size: .8125rem; }
.leave-box p { margin: 0 0 12px; color: var(--ink-2); }
.leave-row { display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.leave-go { border-color: var(--bad-line); color: var(--bad); }
.leave-go:hover { border-color: var(--bad); }

/* ---------- Site text (Settings ▸ Site text) ---------- */
.site-text { max-width: 72ch; color: var(--ink-2); line-height: 1.6; }
.site-text > * + * { margin-top: .7em; }
.site-text h2, .site-text h3, .site-text h4 { color: var(--ink); font-family: var(--serif); font-weight: 700; line-height: 1.2; }
.site-text h2 { font-size: 1.375rem; } .site-text h3 { font-size: 1.15rem; } .site-text h4 { font-size: 1rem; }
.site-text ul, .site-text ol { padding-left: 1.4em; }
.site-text ul { list-style: square; } .site-text ol { list-style: decimal; }
.site-text li::marker { color: var(--sage); }
.site-text li + li { margin-top: .25em; }
.site-text blockquote { padding: 2px 0 2px 14px; border-left: 3px solid var(--sage); color: var(--ink-2); font-family: var(--serif); font-style: italic; }
.site-text hr { border: 0; border-top: 1px solid var(--rule); margin: 1em 0; }
.site-text strong { color: var(--ink); }
.home-id .site-text { font-size: 1.0625rem; }
.site-text.lead-note { color: var(--ink-2); margin-top: 12px; }

/* ---------- Waiting for the server ----------
   The page's own frame at once; bars where the records will go, faded in only if the wait
   is long enough to notice (loading.js). */
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.sk-fill { pointer-events: none; animation: sk-in .3s ease .35s both, sk-pulse 1.8s ease-in-out .65s infinite; }
@keyframes sk-in { from { opacity: 0; } }
@keyframes sk-pulse { 50% { opacity: .55; } }
:root { --sk: var(--well); }
:root[data-theme="dark"] { --sk: #22221f; }
.sk-bar { display: block; height: .75rem; margin: .5rem 0; max-width: 100%; background: var(--sk); }
.sk-bar.sm { height: .55rem; margin: .4rem 0; }
.sk-bar.h { height: 1rem; margin: .45rem 0 .6rem; }
.sk-bar.lg { height: 1.15rem; margin: .45rem 0 .65rem; }
.sk-bar.num { height: 1.6rem; margin: .15rem 0 .5rem; }
.sk-bar.serif { height: .85rem; margin: .62rem 0; }
.sk-bar.name { height: clamp(1.9rem, 4.2vw, 2.7rem); margin: .55rem 0 .8rem; }
.sk-title { grid-column: 2; }
.sk-title .sk-bar { height: clamp(2rem, 4.4vw, 3.4rem); margin: .3rem 0 0; }
.find.sk-fill { align-items: stretch; }
.sk-field { display: block; flex: 1; height: 44px; max-width: 560px; border: 1px solid var(--rule); background: var(--sheet); }
.sk-btn { display: block; flex: none; width: 92px; height: 44px; background: var(--sk); }
.next-ev.sk-fill { min-height: 132px; }
.sk-tierbar { display: block; height: 10px; margin-top: 22px; background: var(--sk); }
.sk-chart { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 4px; align-items: end;
  height: 150px; margin: 24px 0 52px; border-bottom: 1px solid var(--rule-ink); }
.sk-chart i { display: block; background: var(--sk); }
.sk-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: start; padding: 9px 0 10px; border-bottom: 1px solid var(--rule); }
.sk-side { width: 56px; }
.dateline.sk-line { max-width: 320px; }
.sk-pills { display: flex; gap: 0 20px; padding: 14px 0 15px; overflow: hidden; }
.sk-pills i { display: block; flex: none; height: .7rem; background: var(--sk); }
.tools-in > .sk-fill { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.tools-in .sk-field { height: 40px; }
.group.sk-group { display: block; }
.group.sk-group .sk-bar { height: .9rem; margin: .2rem 0 .1rem; max-width: 220px; }
.list .row .who .sk-bar { margin: .3rem 0; }
.sk-ev { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 4px 20px; padding: 16px 0 18px; border-bottom: 1px solid var(--rule); }
.sk-ev > span:first-child .sk-bar.num { width: 44px !important; }
.sk-cal { display: block; aspect-ratio: 7 / 6.4; margin-top: 46px; border-top: 2px solid var(--rule-ink);
  border-right: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  background: linear-gradient(90deg, var(--rule) 1px, transparent 1px) 0 0 / calc(100% / 7) 100%,
              linear-gradient(var(--rule) 1px, transparent 1px) 0 0 / 100% calc(100% / 6); }
.sk-item { display: grid; grid-template-columns: minmax(0, 1fr) 96px; gap: 4px 24px; padding: 16px 0 18px; border-bottom: 1px solid var(--rule); }
.sk-strip { display: block; height: 34px; margin: 2px 0 22px; background: var(--sk); }
.ladder .rung-group > .sk-bar:first-child { margin-top: 0; }
.sk-career .stint .sk-bar { margin: .25rem 0; }
.sk-career .s-side { width: 64px; }
.record.sk-record > div { min-height: 84px; }
.file-head .av.big.sk-fill { border-color: var(--rule); }
@media (max-width: 560px) { .sk-ev { grid-template-columns: 52px minmax(0, 1fr); gap: 4px 14px; } }

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- Print: a member's file prints as a file ---------- */
/* Printing: a clean file on white paper, with the masthead's name and seal at the top
   (theme.js switches to the light inks for the print). */
@media print {
  @page { margin: 14mm 13mm; }
  :root { --paper: #fff; --sheet: #fff; --well: #f2f2f2; }
  .bar nav, .site-foot, .tools, .back, .e-side, .e-banners, .e-savebar, .e-undo, .adm-toast, .theme-sw, .find { display: none !important; }
  .bar { position: static; margin-bottom: 18px; }
  .bar-in { height: 46px; padding: 0; }
  body { background: #fff; color: #000; }
  main { padding: 0; }
  .wrap { max-width: none; padding: 0; }
  a { text-decoration: none; }
  .block > h2, .block-h, .e-head { break-after: avoid; }
  .stint, .record > div, .row, .ev, .gazette li, .e-card, tr { break-inside: avoid; }
}
