/* The member site: the public site's palette, with the furniture a signed-in
   page needs -- tiles, panels, tables, charts, forms. One file, no build. */

:root {
  color-scheme: light dark;
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-2: #f3f1ea;
  --border: #e4e1d8;
  --ink: #1a1f36;
  --ink-muted: #565c72;
  --ink-faint: #8a8f9f;
  --brand: #1b2a4a;
  --brand-ink: #f5f3ec;
  --accent: #e9a23b;
  --accent-ink: #1c1608;
  --link: #164e8c;
  --ok-bg: #e7f2ec;
  --ok-border: #9cc3b0;
  --warn-bg: #fdf3e0;
  --warn-border: #e0c48a;
  --danger: #b45b5b;
  --viz-1: #2a78d6;
  --viz-grid: #ececea;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Helvetica, Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --radius: 10px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1420;
    --surface: #161c2b;
    --surface-2: #1c2334;
    --border: #2a3247;
    --ink: #e9e7e1;
    --ink-muted: #aab0c0;
    --ink-faint: #7b8195;
    --brand: #131b30;
    --brand-ink: #f1efe8;
    --accent: #f0b04e;
    --link: #8fb8ea;
    --ok-bg: #1d2f27;
    --ok-border: #3f6b56;
    --warn-bg: #33291a;
    --warn-border: #6b552c;
    --danger: #d97a7a;
    --viz-1: #3987e5;
    --viz-grid: #2b2e33;
  }
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--sans); font-size: 16px; line-height: 1.5; color: var(--ink); background: var(--bg); }
a { color: var(--link); text-underline-offset: 2px; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; letter-spacing: -0.01em; margin: 0 0 0.5em; }
h1 { font-size: clamp(1.8rem, 3.5vw, 2.5rem); }
h2 { font-size: 1.25rem; }
p { margin: 0 0 1em; }
p:last-child { margin-bottom: 0; }
.lead { font-size: 1.1rem; color: var(--ink-muted); max-width: 66ch; }
.muted { color: var(--ink-muted); }
.small { font-size: 0.9rem; }
.eyebrow { font-size: 0.75rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-muted); margin: 0 0 0.5em; }
.basis { color: var(--ink-faint); font-size: 0.85rem; line-height: 1.4; margin-top: 0.75rem; }
.count { color: var(--ink-muted); font-size: 0.9rem; margin: 0 0 0.75rem; }
code { font-family: var(--mono); font-size: 0.92em; background: var(--surface-2); padding: 0.1em 0.35em; border-radius: 4px; }
.skip { position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink); padding: 0.5rem 1rem; z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 1.25rem; }
main.wrap { padding-top: 1.5rem; padding-bottom: 3rem; }
.narrow { max-width: 34rem; margin: 2rem auto; }
.page-head { margin: 0.5rem 0 1.5rem; }

/* --- header ----------------------------------------------------------- */
.top { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.top .wrap { display: flex; align-items: center; gap: 0.75rem 1.4rem; flex-wrap: wrap; padding-top: 0.7rem; padding-bottom: 0.7rem; }
.logo { display: inline-flex; align-items: center; gap: 0.55rem; color: var(--ink); text-decoration: none; font-family: var(--serif); font-weight: 600; font-size: 1.1rem; }
.logo svg { width: 28px; height: 28px; flex: none; }
.nav { display: flex; flex-wrap: wrap; gap: 0.2rem 1rem; align-items: center; }
.nav a { color: var(--ink-muted); text-decoration: none; padding: 0.25rem 0; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); box-shadow: inset 0 -2px 0 var(--accent); }
.nav a.button { color: var(--accent-ink); box-shadow: none; }
.signout { margin-left: auto; display: flex; align-items: center; gap: 0.75rem; }
.who { color: var(--ink-muted); font-size: 0.92rem; }

/* --- buttons and forms ------------------------------------------------ */
button, .button { display: inline-block; padding: 0.55rem 1.05rem; border-radius: 999px; background: var(--accent); color: var(--accent-ink); font: inherit; font-weight: 650; text-decoration: none; border: 2px solid transparent; cursor: pointer; line-height: 1.2; }
button:hover, .button:hover { filter: brightness(1.05); text-decoration: none; }
button.secondary, .button.secondary { background: var(--surface); color: var(--ink); border-color: var(--border); }
button.danger { background: var(--danger); color: #fff; }
button.link { background: none; border: none; color: var(--ink-muted); padding: 0; font-weight: 500; }
button.link:hover { color: var(--ink); text-decoration: underline; filter: none; }
.button.small { padding: 0.35rem 0.8rem; font-size: 0.9rem; }
input, select, textarea { font: inherit; padding: 0.45rem 0.6rem; border: 1px solid var(--border); border-radius: 8px; background: var(--surface); color: var(--ink); width: 100%; }
input[type="checkbox"] { width: auto; }
.stacked { display: flex; flex-direction: column; gap: 0.85rem; align-items: flex-start; }
.stacked label { display: flex; flex-direction: column; gap: 0.3rem; width: 100%; font-size: 0.9rem; color: var(--ink-muted); }
.stacked textarea { width: 100%; }
.inline-check { display: inline-flex; flex-direction: row !important; align-items: center; gap: 0.5rem; color: var(--ink) !important; font-size: 1rem !important; }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin: 0 0 1rem; }
.filters input[type="search"] { flex: 1 1 260px; }
.filters select { width: auto; }
.actions { margin-top: 0.9rem; }
.error { color: var(--danger); font-weight: 600; }
.danger label { color: var(--ink-muted); }

/* --- tiles, panels, cards ------------------------------------------- */
.tiles { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); margin-bottom: 1.25rem; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.1rem; }
.tile .figure { font-family: var(--serif); font-size: 2.1rem; font-weight: 600; line-height: 1.05; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.tile .label { color: var(--ink-muted); margin-top: 0.25rem; }
.tile .note { color: var(--ink-faint); font-size: 0.8rem; margin-top: 0.3rem; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.panel h2 { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.grid { display: grid; gap: 1.25rem; align-items: stretch; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); }
.grid.loose { align-items: start; }
.grid .panel { margin-bottom: 0; }
.links { display: grid; gap: 0.75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.card { display: block; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius); padding: 0.9rem 1rem; color: inherit; text-decoration: none; }
.card:hover { border-color: var(--accent); }
.card strong { display: block; margin-bottom: 0.2rem; }
.card .muted { display: block; font-size: 0.9rem; }
.notice { border-left: 4px solid var(--warn-border); background: var(--warn-bg); padding: 0.8rem 1rem; border-radius: 0 var(--radius) var(--radius) 0; margin: 0 0 1.25rem; }
.notice.ok { border-color: var(--ok-border); background: var(--ok-bg); }
.pill { display: inline-block; padding: 0.05rem 0.55rem; border-radius: 999px; font-size: 0.75rem; font-weight: 600; font-family: var(--sans); letter-spacing: 0; background: var(--surface-2); border: 1px solid var(--border); color: var(--ink-muted); vertical-align: middle; }
.pill.ok { background: var(--ok-bg); border-color: var(--ok-border); color: var(--ink); }
.tabs { display: flex; flex-wrap: wrap; gap: 0.25rem; margin-bottom: 1.25rem; }
.tabs a { padding: 0.3rem 0.8rem; border-radius: 999px; color: var(--ink-muted); text-decoration: none; font-size: 0.92rem; border: 1px solid transparent; }
.tabs a:hover { color: var(--ink); }
.tabs a.on { background: var(--accent); color: var(--accent-ink); font-weight: 650; }

/* --- tables ---------------------------------------------------------- */
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--ink-faint); font-weight: 600; padding: 0.4rem 0.5rem; border-bottom: 1px solid var(--border); }
td { padding: 0.45rem 0.5rem; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.listing.compact td, .listing.compact th { padding: 0.3rem 0.5rem; font-size: 0.92rem; }
.listing.edit td:first-child { white-space: nowrap; padding-top: 0.7rem; }
.listing.edit input { min-width: 12rem; }
.split { display: flex; flex-wrap: wrap; gap: 1.5rem; align-items: flex-start; }
.split > * { flex: 1 1 22rem; min-width: 0; }
.split table { flex: 0 1 18rem; }
dl.facts { display: grid; grid-template-columns: max-content 1fr; gap: 0.45rem 1.2rem; margin: 0; }
dl.facts dt { color: var(--ink-muted); }
dl.facts dd { margin: 0; }

/* --- charts ---------------------------------------------------------- */
.chart { width: 100%; height: auto; display: block; }
.chart-grid { stroke: var(--viz-grid); stroke-width: 1; }
.chart-tick { fill: var(--ink-faint); font-size: 11px; font-variant-numeric: tabular-nums; }
.chart-label { fill: var(--ink-muted); font-size: 12px; }
.chart-value { fill: var(--ink); font-size: 12px; font-variant-numeric: tabular-nums; }
.viz-1 { fill: var(--viz-1); }

/* --- people ---------------------------------------------------------- */
.people { display: grid; gap: 0.9rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.person { display: grid; grid-template-columns: 44px 1fr; gap: 0.8rem; align-items: start; background: var(--surface); }
.person > span:last-child { display: grid; gap: 0.15rem; }
.person .pill { justify-self: start; margin-top: 0.2rem; }
.avatar { width: 44px; height: 44px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); display: grid; place-items: center; font-family: var(--serif); font-weight: 600; font-size: 1.05rem; }
.avatar.large { width: 76px; height: 76px; font-size: 1.7rem; }
.profile-head { display: grid; grid-template-columns: 76px 1fr; gap: 1.2rem; align-items: center; margin: 0.5rem 0 1.5rem; }
.profile-head h1 { margin-bottom: 0.15em; }
.profile-head .lead { margin: 0; }
.pager { display: flex; gap: 1rem; align-items: center; margin-top: 1.25rem; font-size: 0.92rem; }

/* --- footer ---------------------------------------------------------- */
.footer { border-top: 1px solid var(--border); background: var(--surface); padding: 1.5rem 0 2.5rem; color: var(--ink-muted); font-size: 0.9rem; }
.footer a { color: var(--ink-muted); }
.footer .fine { color: var(--ink-faint); font-size: 0.82rem; max-width: 70ch; }

@media (max-width: 640px) {
  .signout { margin-left: 0; }
  dl.facts { grid-template-columns: 1fr; gap: 0.1rem 0; }
  dl.facts dd { margin-bottom: 0.5rem; }
  .listing.edit { display: block; overflow-x: auto; }
}
