/*
  Library (subscriber) theme. Sits on top of Bootstrap 5.3 and re-points its variables at the Marquis navy and gold.
  Accessibility targets: WCAG 2.2 AA contrast (text >= 4.5:1, controls >= 3:1), 16px minimum body text,
  44px minimum targets, a visible focus ring everywhere, reduced motion and Windows high-contrast support.
*/
/*
  Palette: deep library navy with antique gold, on warm ivory "paper" surfaces.
  Gold is decorative on light backgrounds (rules, markers) and only carries text in its darker --mww-gold-text form.
*/
:root {
  --mww-brand-950: #08111f;
  --mww-brand-900: #0e1b30;   /* header */
  --mww-brand-800: #152843;   /* banners, primary buttons: 14.8:1 on white */
  --mww-brand-700: #1d3961;   /* links: 11.4:1 on white */
  --mww-brand-100: #e9e2d0;
  --mww-brand-50: #f6f2e8;
  --mww-gold: #c9a44c;        /* on navy: 7.6:1 */
  --mww-gold-soft: #e2c77f;
  --mww-gold-text: #80611c;   /* gold that has to be read on light: 5.4:1 on white */

  --mww-bg: #f4f1ea;          /* warm ivory page, less glare than pure white */
  --mww-surface: #fffdf9;
  --mww-text: #1a1d26;        /* 16.4:1 on surface */
  --mww-muted: #514c43;       /* 8.3:1 on surface */
  --mww-border: #ddd5c4;
  --mww-border-strong: #8a8270; /* form control borders: 3.7:1 on surface */
  --mww-focus: #1b62d6;
  --mww-focus-on-dark: var(--mww-gold-soft);
  --mww-highlight: #fff1a8;
  --mww-header-from: #13233d;
  --mww-header-to: var(--mww-brand-900);
  --mww-header-rule: rgba(201, 164, 76, .55);
  --mww-on-header-muted: #c9cfdb;
  --mww-banner: var(--mww-brand-800);
  --mww-heading: var(--mww-brand-900);
  --mww-link: var(--mww-brand-700);
  --mww-link-hover: var(--mww-brand-950);
  --mww-label: var(--mww-gold-text);        /* small uppercase section labels */
  --mww-marker: var(--mww-gold);            /* active tab / nav / sidebar markers */
  --mww-accent: var(--mww-brand-800);       /* filled buttons, checked boxes */
  --mww-accent-hover: var(--mww-brand-900);
  --mww-accent-active: var(--mww-brand-950);
  --mww-on-accent: #ffffff;
  --mww-tint: var(--mww-brand-50);
  --mww-tint-strong: var(--mww-brand-100);
  --mww-placeholder: #6e675a;               /* 5.4:1 on surface */
  --mww-danger: #b42318;
  --mww-danger-bg: #fef3f2;
  --mww-danger-text: #7a1a12;
  --mww-warn-border: #b54708;
  --mww-warn-bg: #fffaeb;
  --mww-warn-text: #5c2a04;
  --mww-mark-edge: #e0b400;
  --mww-radius: .625rem;
  /* Book face for headings and the brand; body text stays sans for legibility. Installed fonts only, nothing downloaded. */
  --mww-serif: "Palatino Linotype", Palatino, "Book Antiqua", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --mww-shadow: 0 1px 2px rgba(8, 17, 31, .06), 0 2px 8px rgba(8, 17, 31, .05);

  --bs-body-font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --bs-body-font-size: 1rem;
  --bs-body-line-height: 1.6;
  --bs-body-color: var(--mww-text);
  --bs-body-bg: var(--mww-bg);
  --bs-secondary-color: var(--mww-muted);
  --bs-border-color: var(--mww-border);
  --bs-primary: var(--mww-brand-800);
  --bs-primary-rgb: 21, 40, 67;
  --bs-link-color: var(--mww-link);
  --bs-link-hover-color: var(--mww-link-hover);
  --bs-heading-color: var(--mww-heading);
  --bs-emphasis-color: var(--mww-text);
  --bs-border-radius: .5rem;
}

/* Dark theme: picked with the header toggle (remembered per browser) or, until then, the system setting.
   Night-time reading room: navy surfaces, gold links and buttons. */
[data-bs-theme="dark"] {
  color-scheme: dark;
  --mww-bg: #08111f;
  --mww-surface: #101c31;
  --mww-text: #eee9dd;
  --mww-muted: #bcb6a7;
  --mww-border: #24365a;
  --mww-border-strong: #7f8aa3;
  --mww-focus: #8fb6ff;
  --mww-highlight: #5a4800;
  --mww-shadow: 0 1px 2px rgba(0, 0, 0, .45), 0 2px 8px rgba(0, 0, 0, .35);
  --mww-header-from: #0f1d33;
  --mww-header-to: #070e1a;
  --mww-banner: #152843;
  --mww-heading: #f2e6c6;
  --mww-link: #dcbf72;
  --mww-link-hover: #f1dca2;
  --mww-label: #d4b766;
  --mww-marker: #d4b05a;
  --mww-accent: #c9a44c;
  --mww-accent-hover: #d7b762;
  --mww-accent-active: #b8933c;
  --mww-on-accent: #0e1b30;
  --mww-tint: #15243f;
  --mww-tint-strong: #1d3152;
  --mww-placeholder: #939cb0;
  --mww-danger: #f97066;
  --mww-danger-bg: #3a1714;
  --mww-danger-text: #ffb4ab;
  --mww-warn-border: #f79009;
  --mww-warn-bg: #33260b;
  --mww-warn-text: #fedf89;
  --mww-mark-edge: #c9a400;
  --bs-body-bg: var(--mww-bg);
  --bs-body-color: var(--mww-text);
  --bs-secondary-color: var(--mww-muted);
  --bs-border-color: var(--mww-border);
  --bs-heading-color: var(--mww-heading);
  --bs-emphasis-color: var(--mww-text);
  --bs-link-color: var(--mww-link);
  --bs-link-hover-color: var(--mww-link-hover);
  --bs-primary-rgb: 201, 164, 76;
}
[data-bs-theme="dark"] .form-check-input { background-color: var(--mww-surface); }
[data-bs-theme="dark"] .form-check-input:checked { background-color: var(--mww-accent); }

html { font-size: 100%; scroll-padding-top: 1rem; }
body { display: flex; flex-direction: column; min-height: 100vh; background: var(--mww-bg); color: var(--mww-text); }
body > .page { flex: 1 0 auto; }
main:focus { outline: none; }

a { text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }

/* ---------- Focus: always visible, never colour-only ---------- */
:focus-visible { outline: 3px solid var(--mww-focus); outline-offset: 2px; border-radius: 2px; }
.btn:focus-visible, .form-control:focus, .form-select:focus, .form-check-input:focus {
  outline: 3px solid var(--mww-focus); outline-offset: 2px; box-shadow: none;
}
.form-control:focus, .form-select:focus { border-color: var(--mww-focus); }

.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 1000;
  padding: .75rem 1rem; background: var(--mww-surface); color: var(--mww-heading); font-weight: 600;
  border-radius: var(--mww-radius); box-shadow: var(--mww-shadow);
}
.skip-link:focus { top: 1rem; }

/* ---------- Header ---------- */
.site-header { background: linear-gradient(180deg, var(--mww-header-from), var(--mww-header-to)); color: #fff; border-bottom: 1px solid var(--mww-header-rule); }
.site-header :focus-visible { outline-color: var(--mww-focus-on-dark); }
.site-header .container { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1.5rem; min-height: 4.5rem; padding-block: .75rem; }

.brand { display: inline-flex; flex-direction: column; line-height: 1; color: #fff; text-decoration: none; margin-right: auto; }
.brand:hover { color: #fff; text-decoration: none; }
.brand-kicker { font: 700 .75rem/1 var(--mww-serif); letter-spacing: .28em; text-transform: uppercase; color: var(--mww-gold); }
.brand-name { font: 700 1.75rem/1.1 var(--mww-serif); letter-spacing: -.01em; }
.brand-product { font-size: .8125rem; font-weight: 500; letter-spacing: .04em; color: var(--mww-on-header-muted); margin-top: .375rem; padding-top: .3rem; border-top: 1px solid var(--mww-header-rule); }

.site-nav { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0; padding: 0; list-style: none; }
.site-nav a {
  display: inline-flex; align-items: center; min-height: 2.75rem; padding: .5rem .875rem; border-radius: .5rem;
  color: #fff; text-decoration: none; font-weight: 500;
}
.site-nav a:hover { background: rgba(255, 255, 255, .08); color: var(--mww-gold-soft); }
.site-nav a[aria-current="page"] { background: rgba(255, 255, 255, .1); color: var(--mww-gold-soft); box-shadow: inset 0 -3px 0 var(--mww-gold); }

.account { display: flex; align-items: center; gap: .75rem; font-size: .9375rem; }
.account-name { color: var(--mww-on-header-muted); }
.account-name strong { font-weight: 600; color: #fff; }
@media (max-width: 767.98px) {
  .site-header .container { gap: .5rem 1rem; padding-block: .625rem; }
  .brand-name { font-size: 1.375rem; }
  .brand-product { display: none; }
  .site-header nav { order: 2; flex-basis: 100%; }
  .account { font-size: .875rem; }
  .account-name { display: none; }
  .site-nav { margin-inline: -.625rem; }
  .site-nav a { padding: .375rem .625rem; }
}
.btn-on-dark {
  --bs-btn-color: var(--mww-gold-soft); --bs-btn-border-color: rgba(201, 164, 76, .7);
  --bs-btn-hover-color: #0e1b30; --bs-btn-hover-bg: var(--mww-gold); --bs-btn-hover-border-color: var(--mww-gold);
  --bs-btn-active-color: #0e1b30; --bs-btn-active-bg: var(--mww-gold-soft);
}

/* ---------- Layout ---------- */
.page { padding-block: 2rem 3rem; }
.page-grid { display: grid; gap: 2rem; }
@media (min-width: 992px) {
  .page-grid { grid-template-columns: 17rem minmax(0, 1fr); align-items: start; }
}

.surface { background: var(--mww-surface); border: 1px solid var(--mww-border); border-radius: var(--mww-radius); box-shadow: var(--mww-shadow); }
.surface-body { padding: 1.5rem; }
@media (min-width: 768px) { .surface-body { padding: 2rem; } }

.page-title { font-family: var(--mww-serif); font-size: 1.875rem; font-weight: 700; color: var(--mww-heading); margin-bottom: .5rem; }
/* Short gold rule under the main headings, like a title page. */
.page-title::after, .welcome h1::after { content: ""; display: block; width: 3rem; height: 2px; margin-top: .625rem; background: var(--mww-marker); }
.welcome h1::after { margin-inline: auto; }
.page-lead { color: var(--mww-muted); margin-bottom: 1.5rem; }
h1, h2, h3 { color: var(--mww-heading); }

/* ---------- Sidebar ---------- */
.sidebar { display: grid; gap: 1.25rem; }
.sidebar-block { padding: 1.25rem; }
.sidebar-title { font-size: .8125rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--mww-label); margin-bottom: .75rem; }
.sidebar-list { list-style: none; margin: 0; padding: 0; }
.sidebar-list a {
  display: flex; align-items: center; min-height: 2.75rem; padding: .5rem .75rem; margin-inline: -.75rem;
  border-radius: .5rem; color: var(--mww-text); text-decoration: none; line-height: 1.3;
}
.sidebar-list a:hover { background: var(--mww-tint); color: var(--mww-heading); }
.sidebar-list a[aria-current="page"] { background: var(--mww-tint-strong); color: var(--mww-heading); font-weight: 600; box-shadow: inset 3px 0 0 var(--mww-marker); }
.sidebar-list .ext::after { content: " ↗"; speak: never; }
@media (max-width: 991.98px) {
  /* On small screens the search forms come first; the navigator follows. */
  .sidebar { order: 2; }
}

/* ---------- Search type tabs (links between pages, not ARIA tabs) ---------- */
.search-tabs { display: flex; gap: .25rem; margin: 0 0 -1px; padding: 0; list-style: none; position: relative; z-index: 1; }
.search-tabs a {
  display: inline-flex; align-items: center; min-height: 3rem; padding: .625rem 1.25rem;
  border: 1px solid transparent; border-bottom: 0; border-radius: var(--mww-radius) var(--mww-radius) 0 0;
  color: var(--mww-link); font-weight: 600; font-size: 1.0625rem; text-decoration: none;
}
.search-tabs a:hover { background: var(--mww-tint); }
.search-tabs a[aria-current="page"] {
  background: var(--mww-surface); border-color: var(--mww-border); color: var(--mww-heading);
  box-shadow: inset 0 3px 0 var(--mww-marker);
}
.search-panel { border-top-left-radius: 0; }

/* ---------- Forms ---------- */
.form-label, .field-label { font-weight: 600; margin-bottom: .375rem; }
.form-control, .form-select { min-height: 2.75rem; border-color: var(--mww-border-strong); font-size: 1rem; background-color: var(--mww-surface); color: var(--mww-text); }
.form-control::placeholder { color: var(--mww-placeholder); opacity: 1; }
.form-text { color: var(--mww-muted); font-size: .9375rem; }
.form-check { min-height: 1.75rem; padding-left: 1.875rem; margin-bottom: .25rem; }
.form-check-input { width: 1.25rem; height: 1.25rem; margin-top: .2rem; margin-left: -1.875rem; border-color: var(--mww-border-strong); }
.form-check-input:checked { background-color: var(--mww-accent); border-color: var(--mww-accent); }
.form-check-label { cursor: pointer; }

.btn { min-height: 2.75rem; padding-inline: 1.25rem; font-weight: 600; border-radius: .5rem; }
.btn-lg { min-height: 3rem; padding-inline: 2rem; font-size: 1.0625rem; }
.btn-sm { min-height: 2.25rem; padding-inline: .875rem; }
.btn-primary {
  --bs-btn-color: var(--mww-on-accent); --bs-btn-hover-color: var(--mww-on-accent); --bs-btn-active-color: var(--mww-on-accent);
  --bs-btn-bg: var(--mww-accent); --bs-btn-border-color: var(--mww-accent);
  --bs-btn-hover-bg: var(--mww-accent-hover); --bs-btn-hover-border-color: var(--mww-accent-hover);
  --bs-btn-active-bg: var(--mww-accent-active); --bs-btn-active-border-color: var(--mww-accent-active);
  --bs-btn-disabled-bg: var(--mww-accent); --bs-btn-disabled-border-color: var(--mww-accent);
}
.btn-outline-primary {
  --bs-btn-color: var(--mww-link); --bs-btn-border-color: var(--mww-link);
  --bs-btn-hover-color: var(--mww-on-accent); --bs-btn-hover-bg: var(--mww-accent); --bs-btn-hover-border-color: var(--mww-accent);
  --bs-btn-active-color: var(--mww-on-accent); --bs-btn-active-bg: var(--mww-accent-active); --bs-btn-active-border-color: var(--mww-accent-active);
}
.btn-outline-secondary {
  --bs-btn-color: var(--mww-text); --bs-btn-border-color: var(--mww-border-strong);
  --bs-btn-hover-color: var(--mww-heading); --bs-btn-hover-bg: var(--mww-tint); --bs-btn-hover-border-color: var(--mww-link);
  --bs-btn-active-color: var(--mww-heading); --bs-btn-active-bg: var(--mww-tint-strong); --bs-btn-active-border-color: var(--mww-link);
}
.btn-link { --bs-btn-color: var(--mww-link); text-decoration: underline; text-underline-offset: .2em; }

.validation-summary-valid { display: none; }
.field-error { display: block; margin-top: .375rem; color: var(--mww-danger-text); font-weight: 600; font-size: .9375rem; }
.field-error:empty { display: none; }
.field-error::before { content: "⚠ "; speak: never; }
.input-validation-error { border-color: var(--mww-danger); border-width: 2px; }
.validation-summary-errors {
  padding: .875rem 1rem; margin-bottom: 1.5rem; border: 1px solid var(--mww-danger); border-left-width: 4px; border-radius: .5rem;
  background: var(--mww-danger-bg); color: var(--mww-danger-text);
}
.validation-summary-errors ul { margin: 0; padding-left: 1.25rem; }

/* Grouped form: legend on the left, fields on the right (from md). A legend can't be a grid item, so this floats it. */
.form-group-row { padding-block: 1.5rem; border-top: 1px solid var(--mww-border); margin: 0; min-width: 0; }
.form-group-row::after { content: ""; display: table; clear: both; }
.form-group-row:first-of-type { border-top: 0; padding-top: 0; }
.form-group-row > legend { float: left; width: 100%; font-size: 1.0625rem; font-weight: 700; color: var(--mww-heading); margin: 0 0 .75rem; padding: 0; line-height: 1.4; }
.form-group-row > legend .hint { display: block; font-size: .875rem; font-weight: 400; color: var(--mww-muted); margin-top: .125rem; }
@media (min-width: 768px) {
  .form-group-row > legend { width: 11rem; margin: 0; }
  .form-group-row > legend + * { clear: none; margin-left: 13rem; }
  .form-group-row > legend + .row { margin-left: calc(13rem - .5 * var(--bs-gutter-x)); }
}
.range-pair { display: flex; align-items: center; gap: .5rem; }
.range-pair .form-control { max-width: 7.5rem; }

.form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem 1rem; padding-top: 1.5rem; border-top: 1px solid var(--mww-border); }
.form-actions .btn-primary { order: 0; }

/* Quick search */
.quick-grid { display: grid; gap: 2rem; }
@media (min-width: 1200px) { .quick-grid { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); } }
.slice-list { clear: both; display: grid; gap: .125rem 1.5rem; margin-top: .5rem; }
.slice-fieldset { padding: 1.25rem 1.25rem 1rem; border: 1px solid var(--mww-border); border-radius: var(--mww-radius); background: var(--mww-tint); margin: 0; min-width: 0; }
.slice-fieldset > legend { float: left; width: 100%; font-size: 1.0625rem; font-weight: 700; color: var(--mww-heading); margin: 0; padding: 0; }
.slice-tools { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: .75rem; }

/* Database picker */
.db-grid { display: grid; gap: 1rem; list-style: none; padding: 0; margin: 0; }
@media (min-width: 768px) { .db-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.db-card {
  position: relative; display: flex; flex-direction: column; gap: .25rem; height: 100%; padding: 1.125rem 2.75rem 1.125rem 1.25rem;
  border: 1px solid var(--mww-border); border-radius: var(--mww-radius); background: var(--mww-surface);
  color: var(--mww-text); text-decoration: none; transition: border-color .15s, box-shadow .15s;
}
.db-card::after { content: "→"; position: absolute; right: 1.125rem; top: 1.05rem; color: var(--mww-link); font-weight: 700; }
.db-card:hover { border-color: var(--mww-link); box-shadow: var(--mww-shadow); color: var(--mww-text); }
.db-card-name { font-weight: 700; color: var(--mww-link); font-size: 1.0625rem; text-decoration: underline; text-decoration-color: transparent; }
.db-card:hover .db-card-name { text-decoration-color: currentColor; }
.db-card-desc { color: var(--mww-muted); font-size: .9375rem; }

/* ---------- Toolbar (results / profile actions) ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: 1.25rem; }
.toolbar .spacer { flex: 1 1 auto; }

/* ---------- Results ---------- */
.criteria { display: flex; flex-wrap: wrap; gap: .5rem; margin: .5rem 0 0; padding: 0; list-style: none; }
.criteria li { padding: .25rem .75rem; border-radius: 999px; background: var(--mww-tint); border: 1px solid var(--mww-tint-strong); font-size: .9375rem; }
.criteria .k { font-weight: 600; color: var(--mww-heading); }
.result-count { font-size: 1.125rem; margin: 0; }
.notice { padding: .875rem 1rem; border-radius: .5rem; border: 1px solid; border-left-width: 4px; margin-top: 1rem; }
.notice-warn { background: var(--mww-warn-bg); border-color: var(--mww-warn-border); color: var(--mww-warn-text); }
.notice-info { background: var(--mww-tint); border-color: var(--mww-link); color: var(--mww-text); }
.notice-error { background: var(--mww-danger-bg); border-color: var(--mww-danger); color: var(--mww-danger-text); }

/* Friendly "something went wrong" panel (_OopsPanel). Calm, not alarming: brand colours, a warm icon, a clear next step. */
.oops { display: flex; gap: 1.25rem; align-items: flex-start; padding: 1.75rem 1.5rem; border-top: 3px solid var(--mww-marker); }
.oops-icon { flex: none; display: grid; place-items: center; width: 3.25rem; height: 3.25rem; border-radius: 50%; background: var(--mww-warn-bg); color: var(--mww-warn-border); border: 1px solid var(--mww-tint-strong); }
.oops-body { min-width: 0; }
.oops-title { font-family: var(--mww-serif); font-size: 1.5rem; color: var(--mww-heading); margin: .25rem 0 .75rem; }
.oops-body p { margin: 0 0 .5rem; color: var(--mww-text); }
.oops-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1.25rem 0; }
.oops-ref { font-size: .9375rem; color: var(--mww-muted) !important; padding-top: 1rem; border-top: 1px solid var(--mww-border); }
.oops-ref code { font-size: .9375rem; color: var(--mww-heading); background: var(--mww-tint); border: 1px solid var(--mww-tint-strong); border-radius: .25rem; padding: .05rem .35rem; letter-spacing: .08em; }
.profile-message .oops { border: 0; box-shadow: none; padding: 0; background: transparent; }
@media (max-width: 575.98px) { .oops { flex-direction: column; gap: .75rem; padding: 1.25rem 1rem; } }

.surface > .table-responsive { overflow-y: hidden; }
.results-table { margin: 0; --bs-table-bg: transparent; --bs-table-striped-bg: var(--mww-tint); }
.results-table th { background: var(--mww-surface); color: var(--mww-muted); font-size: .8125rem; letter-spacing: .06em; text-transform: uppercase; border-bottom: 2px solid var(--mww-border); white-space: nowrap; padding: .875rem .75rem; }
.results-table th a { color: inherit; text-decoration: none; }
.results-table th a:hover { color: var(--mww-link); text-decoration: underline; }
.results-table th[aria-sort] { color: var(--mww-heading); }
.results-table td { padding: .75rem; vertical-align: middle; }
.results-table td:first-child a { font-weight: 600; }
.results-table tbody tr:hover { --bs-table-bg-state: var(--mww-tint-strong); }

.pagination { --bs-pagination-color: var(--mww-link); --bs-pagination-active-color: var(--mww-on-accent); --bs-pagination-active-bg: var(--mww-accent); --bs-pagination-active-border-color: var(--mww-accent); --bs-pagination-bg: var(--mww-surface); --bs-pagination-hover-bg: var(--mww-tint); --bs-pagination-hover-color: var(--mww-heading); --bs-pagination-disabled-bg: var(--mww-surface); --bs-pagination-disabled-border-color: var(--mww-border); --bs-pagination-border-color: var(--mww-border); --bs-pagination-padding-x: .875rem; --bs-pagination-padding-y: .5rem; gap: .25rem; }
.pagination .page-link { border-radius: .5rem !important; min-width: 2.75rem; min-height: 2.75rem; display: inline-flex; align-items: center; justify-content: center; }
.pagination .disabled .page-link { color: var(--mww-placeholder); }

/* ---------- History ---------- */
.history-list { list-style: none; margin: 0; padding: 0; counter-reset: h; }
.history-list > li { display: flex; flex-wrap: wrap; gap: .75rem 1.5rem; align-items: center; padding: 1.25rem 1.5rem; border-top: 1px solid var(--mww-border); counter-increment: h; }
.history-list > li:first-child { border-top: 0; }
.history-list > li::before { content: counter(h); display: inline-grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--mww-tint); box-shadow: inset 0 0 0 1px var(--mww-marker); color: var(--mww-heading); font-weight: 700; flex: none; }
.history-list .body { flex: 1 1 20rem; min-width: 0; }

/* ---------- Profile ---------- */
.profile-card { overflow: hidden; }
.profile-banner { padding: 1.25rem 1.5rem; background: var(--mww-banner); color: #fff; border-bottom: 2px solid var(--mww-gold); }
.profile-banner h1 { color: var(--mww-gold-soft); font-size: 1.125rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; margin: 0; }
.profile { padding: 0 1.5rem 1.5rem; }
@media (min-width: 768px) { .profile { padding: 0 2rem 2rem; } }
.profile-head { margin: 0 -1.5rem 1rem; padding: 1.5rem; background: var(--mww-tint); border-bottom: 1px solid var(--mww-tint-strong); color: var(--mww-muted); }
@media (min-width: 768px) { .profile-head { margin-inline: -2rem; padding-inline: 2rem; } }
.profile-name { font-family: var(--mww-serif); font-size: 1.875rem; font-weight: 700; line-height: 1.2; color: var(--mww-heading); margin-bottom: .375rem; }
.profile-section { display: grid; gap: .25rem 2rem; padding: 1rem 0; border-bottom: 1px solid var(--mww-border); line-height: 1.65; }
.profile-section:last-child { border-bottom: 0; }
.profile-section h2 { font-size: .8125rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--mww-label); margin: .2rem 0 0; }
@media (min-width: 992px) {
  .profile-section { grid-template-columns: 11rem minmax(0, 1fr); }
  .profile-section > :not(h2) { grid-column: 2; }
  .profile-section:not(:has(h2)) > * { grid-column: 1 / -1; }
}
.profile-section > div + div { margin-top: .25rem; }
.profile-sources details { margin-top: .25rem; }
.profile-sources summary { cursor: pointer; font-weight: 600; color: var(--mww-link); min-height: 2rem; display: list-item; }
.profile-sources details > div { padding-left: 1.25rem; color: var(--mww-muted); }
.profile mark { padding: 0 .15em; background: var(--mww-highlight); color: inherit; border-radius: 2px; box-shadow: inset 0 -2px 0 var(--mww-mark-edge); }
.profile-message { padding: 1.5rem 2rem; }

/* ---------- Sign-in page ---------- */
.welcome { text-align: center; margin: 1rem auto 2.5rem; max-width: 46rem; }
.welcome h1 { font-family: var(--mww-serif); font-size: clamp(1.875rem, 3vw, 2.5rem); font-weight: 700; }
.welcome p { color: var(--mww-muted); font-size: 1.125rem; margin: 0; }
.signin-grid { display: grid; gap: 1.5rem; max-width: 60rem; margin-inline: auto; }
@media (min-width: 768px) { .signin-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.signin-grid .surface { display: flex; flex-direction: column; }
.signin-grid .surface, .signin-narrow .surface { border-top: 3px solid var(--mww-marker); }
.signin-narrow { max-width: 30rem; margin-inline: auto; }
.panel-title { font-family: var(--mww-serif); font-size: 1.375rem; font-weight: 700; margin: 0; padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--mww-border); }
.feature-list { list-style: none; margin: 0 0 1.5rem; padding: 0; display: grid; gap: 1rem; }
.feature-list li { display: grid; grid-template-columns: 2.5rem minmax(0, 1fr); gap: .875rem; align-items: start; }
.feature-icon { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; background: var(--mww-brand-900); color: #f3dc96; box-shadow: 0 0 0 1px var(--mww-marker); }
.feature-icon svg { width: 1.375rem; height: 1.375rem; }
.feature-list strong { display: block; color: var(--mww-heading); }
.feature-list li > div > span { color: var(--mww-muted); }
.signin-help { margin-top: auto; padding: 1rem 1.5rem; background: var(--mww-tint); border-top: 1px solid var(--mww-border); font-size: .9375rem; color: var(--mww-muted); border-radius: 0 0 var(--mww-radius) var(--mww-radius); }

/* ---------- Help pages ---------- */
.prose-page { max-width: 60rem; }
.prose { max-width: 46rem; line-height: 1.7; }
.prose h2 { font-family: var(--mww-serif); font-size: 1.5rem; font-weight: 700; margin: 2.5rem 0 .75rem; padding-top: 1.5rem; border-top: 1px solid var(--mww-border); }
.prose section:first-child > h2 { margin-top: 1rem; padding-top: 0; border-top: 0; }
.prose h3 { font-size: 1.0625rem; font-weight: 700; margin: 1.5rem 0 .375rem; }
.prose ul, .prose ol { padding-left: 1.375rem; }
.prose li + li { margin-top: .375rem; }
.prose .lead-text { font-size: 1.125rem; }
.prose kbd { padding: .05rem .4rem; border-radius: .3rem; background: var(--mww-tint-strong); color: var(--mww-heading); font: 600 .9375em/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; box-shadow: none; white-space: nowrap; }
@media (min-width: 768px) { .columns-2 { columns: 2; column-gap: 2.5rem; } .columns-2 li { break-inside: avoid; } }
.toc { margin-bottom: 1.5rem; padding: 1rem 1.25rem; border-radius: var(--mww-radius); background: var(--mww-tint); border: 1px solid var(--mww-border); }
.toc-title { font-size: .8125rem; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: var(--mww-label); margin: 0 0 .5rem; }
.toc ul { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; margin: 0; padding: 0; list-style: none; }
.toc a { display: inline-block; padding-block: .375rem; }
.help-table { margin: .5rem 0 1rem; --bs-table-bg: transparent; --bs-table-color: var(--mww-text); border-color: var(--mww-border); }
.help-table caption { caption-side: top; color: var(--mww-muted); font-size: .9375rem; padding-top: 0; }
.help-table th { color: var(--mww-heading); font-size: .9375rem; }
.help-dl dt { font-weight: 700; color: var(--mww-heading); margin-top: 1rem; }
.help-dl dd { margin: .125rem 0 0; }
.sample { margin-top: 1.5rem; }
.sample h3 { margin-top: 0; }
.sample-notes { color: var(--mww-muted); font-size: .9375rem; }

.letter-nav ul { display: flex; flex-wrap: wrap; gap: .25rem; margin: 0 0 1.5rem; padding: 0; list-style: none; }
.letter-nav a { display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; border-radius: .5rem; border: 1px solid var(--mww-border); background: var(--mww-surface); font-weight: 700; text-decoration: none; }
.letter-nav a:hover { background: var(--mww-tint); border-color: var(--mww-link); }
.abbr-filter { max-width: 28rem; margin-bottom: 1.25rem; }
.abbr-group { padding-top: 1rem; border-top: 1px solid var(--mww-border); margin-top: 1rem; }
.abbr-group-head { display: flex; justify-content: space-between; align-items: baseline; }
.abbr-group h2 { font-family: var(--mww-serif); font-size: 1.5rem; font-weight: 700; margin: 0 0 .5rem; }
.abbr-list { display: grid; margin: 0; }
.abbr-list > div { display: grid; grid-template-columns: minmax(7rem, 14rem) minmax(0, 1fr); gap: 1rem; padding: .5rem .75rem; border-radius: .375rem; }
.abbr-list > div:nth-child(odd) { background: var(--mww-tint); }
.abbr-list dt { font-weight: 700; color: var(--mww-heading); word-break: break-word; }
.abbr-list dd { margin: 0; }
@media (max-width: 575.98px) { .abbr-list > div { grid-template-columns: 1fr; gap: 0; } }

.contact-grid { display: grid; gap: 1.25rem; }
.contact-grid { grid-template-columns: repeat(auto-fit, minmax(min(100%, 24rem), 1fr)); }
.contact-card { padding: 1.25rem 1.5rem; border: 1px solid var(--mww-border); border-radius: var(--mww-radius); background: var(--mww-tint); }
.contact-card h2 { font-family: var(--mww-serif); font-size: 1.25rem; font-weight: 700; margin: 0; }
.contact-note { color: var(--mww-muted); font-size: .9375rem; margin: 0 0 .75rem; }
.contact-card dl { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: .375rem 1rem; margin: 0; }
.contact-card dt { font-weight: 600; color: var(--mww-muted); }
.contact-card dd { margin: 0; overflow-wrap: anywhere; }

/* ---------- Theme toggle ---------- */
.theme-toggle { display: inline-flex; align-items: center; gap: .5rem; }
.theme-toggle svg { width: 1.125rem; height: 1.125rem; }
.theme-toggle .when-dark { display: none; }
[data-bs-theme="dark"] .theme-toggle .when-dark { display: inline; }
[data-bs-theme="dark"] .theme-toggle .when-light { display: none; }
@media (max-width: 767.98px) { .theme-toggle .label { display: none; } }

/* ---------- Footer ---------- */
.site-footer { background: var(--mww-surface); border-top: 2px solid var(--mww-marker); color: var(--mww-muted); font-size: .9375rem; padding-block: 1.5rem; }
.site-footer ul { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem 1.5rem; list-style: none; margin: 0 0 .5rem; padding: 0; }
.site-footer a { color: var(--mww-link); }
.site-footer p { text-align: center; margin: 0; }

/* ---------- Preferences ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media (forced-colors: active) {
  .site-nav a[aria-current="page"], .search-tabs a[aria-current="page"], .sidebar-list a[aria-current="page"] { outline: 2px solid CanvasText; }
  .btn { border: 1px solid ButtonText; }
  .profile mark { forced-color-adjust: none; background: Mark; color: MarkText; }
}

/* ---------- Print: just the biography ---------- */
@media print {
  :root, [data-bs-theme="dark"] {
    --mww-bg: #fff; --mww-surface: #fff; --mww-text: #000; --mww-muted: #333; --mww-heading: #000; --mww-link: #000;
    --mww-border: #bbb; --mww-tint: #fff; --mww-tint-strong: #eee; --mww-highlight: #fff1a8;
  }
  .site-header, .site-footer, .sidebar, .no-print, .skip-link, .toc, .letter-nav, .abbr-filter { display: none !important; }
  body { background: #fff; }
  .page { padding: 0; }
  .page-grid { display: block; }
  .surface { border: 0; box-shadow: none; }
  .profile-banner { background: none; color: #000; padding: 0 0 .5rem; }
  .profile-banner h1 { color: #000; }
  .profile-head { background: none; margin-inline: 0; padding-inline: 0; }
  .profile-sources details > * { display: block; }
  a { color: #000; }
}
