/* ==========================================================================
   Board Hub design system
   Charcoal workspace, soft white text, quiet navy actions, gold for brand only.
   One typeface (Inter), generous spacing, quiet structure.
   ========================================================================== */

@font-face {
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/inter-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  /* Latin Extended: te reo Māori macrons (ā ē ī ō ū) and Pacific names */
  font-family: "Inter"; font-style: normal; font-weight: 100 900; font-display: swap;
  src: url("/static/fonts/inter-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  color-scheme: dark;
  /* Colour: charcoal workspace, soft white text, quiet navy for actions, gold for brand details only */
  --bg: #1b1d22;            /* workspace */
  --chrome: #22252b;        /* sidebar and top bar */
  --surface: #23262c;       /* cards */
  --surface-2: #2b2f36;     /* hover, quiet fills */
  --text: #eef0f3;          /* 14.9:1 on --surface */
  --text-2: #a8aeb8;        /* secondary text: 7.4:1 on --surface, 8.0:1 on --bg */
  --border: #33373f;
  --border-strong: #464b55;
  --input-border: #6a707b;  /* form controls: 3.3:1 against --surface */
  --navy: #a9c1ea;          /* accent for links, focus and selection on dark: 9.3:1 */
  --navy-hover: #c8d7f2;
  --navy-tint: #1b2335;     /* selected nav item, selected row */
  --primary: #1a2438;       /* primary button */
  --primary-hover: #223050;
  --primary-border: #2f3d5c;
  --gold: #c9a45c;          /* brand details only, never body text */

  --ok: #93d3a9;     --ok-bg: #1f3428;
  --warn: #e9c27a;   --warn-bg: #3a2f19;
  --bad: #f2a29c;    --bad-bg: #3e2322;
  --info: #b7c8e6;   --info-bg: #263044;
  --neutral: #c9ced6; --neutral-bg: #353a43;

  /* Shape */
  --r-sm: 6px;
  --r: 8px;
  --r-lg: 12px;
  --shadow-1: none;
  --shadow-2: 0 12px 32px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3);

  /* Type */
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --fs-body: 1rem;          /* 16px */
  --fs-small: .875rem;      /* 14px: the smallest size used anywhere */
  --fs-h1: 1.75rem;         /* 28px */
  --fs-h2: 1.0625rem;       /* 17px */
  --fs-h3: 1rem;

  /* Space (4px scale) */
  --s1: .25rem; --s2: .5rem; --s3: .75rem; --s4: 1rem; --s5: 1.5rem; --s6: 2rem; --s7: 3rem;

  --sidebar: 240px;
  --focus: 0 0 0 3px rgba(169, 193, 234, .35);
  --ease: cubic-bezier(.2, .7, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 var(--fs-body)/1.6 var(--font);
  font-feature-settings: "cv11", "ss01"; /* Inter: single-storey a off, open digits */
  -webkit-font-smoothing: antialiased;
}
a { color: var(--navy); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--navy-hover); }
:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 4px; }
[tabindex="-1"]:focus { outline: none; }
h1, h2, h3 { color: var(--text); margin: 0; line-height: 1.3; letter-spacing: -.01em; }
h1 { font-size: var(--fs-h1); font-weight: 650; }
h2 { font-size: var(--fs-h2); font-weight: 600; }
h3 { font-size: var(--fs-h3); font-weight: 600; }
p { margin: 0 0 var(--s4); max-width: 70ch; }
ul, ol { margin: 0; }
code { font-size: .9em; background: var(--surface-2); padding: .05rem .3rem; border-radius: 4px; }
.sr-only, .skip:not(:focus) { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip:focus { position: fixed; left: 1rem; top: 1rem; z-index: 50; background: var(--surface); padding: .6rem 1rem; border-radius: var(--r); box-shadow: var(--shadow-2); }
.muted { color: var(--text-2); }
.small { font-size: var(--fs-small); }
.nowrap { white-space: nowrap; }
.num { font-variant-numeric: tabular-nums; }
.stack > * + * { margin-top: var(--s4); }
.pre { white-space: pre-wrap; }

/* ----------------------------------------------------------------- icons */
.icon { width: 18px; height: 18px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.icon.sm { width: 16px; height: 16px; }

/* ----------------------------------------------------------------- shell */
.shell {
  display: grid; grid-template-columns: var(--sidebar) minmax(0, 1fr); min-height: 100vh;
  /* the sidebar colour runs the full height of long pages */
  background: linear-gradient(to right, var(--chrome) calc(var(--sidebar) - 1px), var(--border) calc(var(--sidebar) - 1px), var(--border) var(--sidebar), var(--bg) var(--sidebar));
}
.sidebar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto;
  background: var(--chrome); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; padding: var(--s6) var(--s4) var(--s4); align-self: start;
}
.brand { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s3) var(--s5); text-decoration: none; color: var(--text); }
.brand-mark {
  width: 34px; height: 34px; border-radius: var(--r); background: var(--navy); color: #fff;
  display: grid; place-items: center; font-weight: 650; font-size: .82rem; letter-spacing: .02em; position: relative; flex: none;
}
.brand-mark::after { content: ""; position: absolute; left: 9px; right: 9px; bottom: 6px; height: 2px; border-radius: 2px; background: var(--gold); }
.brand-name { font-weight: 600; line-height: 1.25; font-size: .95rem; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: var(--s3); min-height: 42px; padding: 0 var(--s3);
  border-radius: var(--r); color: var(--text-2); text-decoration: none; font-weight: 500;
  transition: background-color .12s var(--ease), color .12s var(--ease);
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--navy-tint); color: #fff; font-weight: 600; }
.nav a[aria-current="page"] .icon { color: #fff; }
.nav-sep { height: 1px; background: var(--border); margin: var(--s3) var(--s3); }
.nav-group { margin-top: var(--s2); }
.nav-items { display: flex; flex-direction: column; gap: 2px; }
.nav-label { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); list-style: none; cursor: pointer; user-select: none;
  font-size: .7rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--text-2); padding: var(--s2) var(--s3); border-radius: var(--r-sm); }
.nav-label::-webkit-details-marker { display: none; }
.nav-label:hover { color: var(--text); background: var(--surface-2); }
.nav-label .icon { transition: transform .15s ease; opacity: .8; }
.nav-group[open] .nav-label .icon { transform: rotate(90deg); }
.nav-group[open] .nav-label { margin-bottom: 2px; }
@media (prefers-reduced-motion: reduce) { .nav-label .icon { transition: none; } }
.sidebar-foot { margin-top: auto; padding: var(--s4) var(--s3) 0; font-size: var(--fs-small); color: var(--text-2); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  display: flex; align-items: center; gap: var(--s4); justify-content: space-between;
  padding: var(--s3) var(--s6); border-bottom: 1px solid var(--border); background: var(--chrome); min-height: 62px;
  position: sticky; top: 0; z-index: 20;
}
.search { flex: 1; max-width: 480px; position: relative; }
.search .icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-2); pointer-events: none; }
.search input { padding-left: 38px; background: var(--surface); }
.top-actions { display: flex; align-items: center; gap: var(--s2); }
.icon-link { position: relative; display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: var(--r); color: var(--text-2); }
.icon-link:hover { background: var(--surface-2); color: var(--text); }
.icon-link .badge { position: absolute; top: 5px; right: 4px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--gold); color: #1b1d22; font-size: .72rem; font-weight: 600; display: grid; place-items: center; line-height: 1; }
.avatar { flex: none; object-fit: cover; width: 34px; height: 34px; border-radius: 50%; background: var(--surface-2); color: var(--text); border: 1px solid var(--border-strong); display: grid; place-items: center; font-weight: 600; font-size: .8rem; }
.content { width: 100%; max-width: 1160px; padding: var(--s6) var(--s6) var(--s7); }
.content.narrow { max-width: 820px; }
.demo-note { padding: var(--s2) var(--s6); background: var(--warn-bg); color: var(--warn); font-size: var(--fs-small); border-bottom: 1px solid #5e4c26; }
.demo-note a { color: inherit; font-weight: 600; }
.mobile-bar { display: none; }

/* ----------------------------------------------------------------- page header */
.page-head { display: flex; flex-wrap: wrap; gap: var(--s4); align-items: flex-start; justify-content: space-between; margin-bottom: var(--s6); }
.page-head .lede { color: var(--text-2); margin: var(--s2) 0 0; max-width: 62ch; }
.page-head .meta-line { display: flex; flex-wrap: wrap; gap: var(--s2) var(--s3); align-items: center; margin-top: var(--s3); color: var(--text-2); font-size: var(--fs-small); }
.crumbs { font-size: var(--fs-small); color: var(--text-2); margin-bottom: var(--s2); display: flex; gap: var(--s2); align-items: center; }
.crumbs a { color: var(--text-2); text-decoration: none; }
.crumbs a:hover { color: var(--navy); text-decoration: underline; }
.head-actions { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }

/* ----------------------------------------------------------------- buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s2);
  min-height: 44px; padding: 0 var(--s4); border-radius: var(--r);
  font: 600 .95rem/1 var(--font); letter-spacing: 0; text-decoration: none; white-space: nowrap; cursor: pointer;
  border: 1px solid var(--primary-border); background: var(--primary); color: var(--text);
  transition: background-color .12s var(--ease), border-color .12s var(--ease), box-shadow .12s var(--ease);
}
.btn:hover { background: var(--primary-hover); border-color: #3d4e73; color: #fff; }
.btn:focus-visible { outline: none; box-shadow: var(--focus); }
.btn.secondary { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn.secondary:hover { border-color: var(--text-2); background: var(--surface-2); color: var(--text); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--navy); padding: 0 var(--s3); }
.btn.ghost:hover { background: var(--surface-2); color: var(--navy-hover); }
.btn.danger { background: transparent; color: var(--bad); border-color: #6b3a37; }
.btn.danger:hover { background: var(--bad-bg); color: var(--bad); }
.btn.sm { min-height: 36px; padding: 0 var(--s3); font-size: var(--fs-small); }
.btn[aria-busy="true"] { opacity: .75; cursor: progress; }
.btn[aria-busy="true"]::before { content: ""; width: 14px; height: 14px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.inline { display: inline; margin: 0; }
.linklike { background: none; border: 0; padding: 0; font: inherit; color: var(--navy); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

/* ----------------------------------------------------------------- discreet menu ("More") */
.menu { position: relative; display: inline-block; }
.menu > summary { list-style: none; }
.menu > summary::-webkit-details-marker { display: none; }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); z-index: 30; min-width: 230px;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--shadow-2);
  padding: var(--s1); animation: pop .12s var(--ease);
}
.menu-pop a, .menu-pop button {
  display: flex; width: 100%; align-items: center; gap: var(--s3); min-height: 42px; padding: 0 var(--s3);
  border: 0; background: none; border-radius: var(--r-sm); color: var(--text); text-decoration: none; text-align: left;
  font: 500 .95rem/1.3 var(--font); cursor: pointer;
}
.menu-pop a:hover, .menu-pop button:hover { background: var(--surface-2); }
.menu-pop .danger { color: var(--bad); }
.menu-pop hr { border: 0; height: 1px; background: var(--border); margin: var(--s1) 0; }
.menu-pop form { margin: 0; }
@keyframes pop { from { opacity: 0; transform: translateY(-4px); } }

/* ----------------------------------------------------------------- forms */
label, .label { display: block; font-weight: 550; font-size: .95rem; color: var(--text); margin-bottom: var(--s2); }
.hint { display: block; font-weight: 400; color: var(--text-2); font-size: var(--fs-small); margin-top: 2px; }
input, select, textarea {
  width: 100%; min-height: 44px; padding: .55rem .75rem; border-radius: var(--r-sm);
  border: 1px solid var(--input-border); background: #1d2025; color: var(--text);
  font: 400 1rem/1.4 var(--font); transition: border-color .12s var(--ease), box-shadow .12s var(--ease);
}
input:hover, select:hover, textarea:hover { border-color: #858b96; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--navy); box-shadow: var(--focus); }
textarea { min-height: 7rem; resize: vertical; line-height: 1.55; }
select[multiple] { padding: .35rem; }
input[type="checkbox"], input[type="radio"] { width: 20px; height: 20px; min-height: 0; margin: 0; accent-color: var(--navy); flex: none; }
.field { margin-bottom: var(--s5); }
.field.error input, .field.error select, .field.error textarea { border-color: var(--bad); }
.field .err { display: flex; gap: var(--s1); align-items: center; color: var(--bad); font-size: var(--fs-small); margin-top: var(--s2); }
.grid2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 var(--s5); }
.grid3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 var(--s5); }
/* Side-by-side fields: when one label wraps to two lines, keep every box on the same line. */
.grid2 > .field, .grid3 > .field { display: flex; flex-direction: column; }
.grid2 > .field > input, .grid2 > .field > select, .grid2 > .field > textarea,
.grid3 > .field > input, .grid3 > .field > select, .grid3 > .field > textarea { margin-top: auto; }
.check { display: flex; gap: var(--s3); align-items: flex-start; font-weight: 400; margin-bottom: var(--s3); cursor: pointer; }
.check input { margin-top: 2px; }
fieldset { border: 1px solid var(--border); border-radius: var(--r); padding: var(--s4) var(--s5) var(--s2); margin: 0 0 var(--s5); }
legend { font-weight: 600; padding: 0 var(--s2); margin-left: calc(-1 * var(--s2)); }
.form-actions { display: flex; gap: var(--s3); align-items: center; flex-wrap: wrap; padding-top: var(--s2); }
.form-panel { max-width: 760px; }

/* ----------------------------------------------------------------- surfaces & sections */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-1); }
.section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s5); margin-bottom: var(--s5); box-shadow: var(--shadow-1); }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s4); margin-bottom: var(--s4); }
.section-head .aside { font-size: var(--fs-small); }
.section > :last-child { margin-bottom: 0; }
.plain-section { margin-bottom: var(--s6); }
.plain-section > .section-head { margin-bottom: var(--s3); }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: var(--s5); align-items: start; }
.layout.wide-side { grid-template-columns: minmax(0, 1fr) 360px; }
.dash { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: var(--s5); align-items: start; }

/* key/value facts */
dl.facts { display: grid; grid-template-columns: minmax(110px, max-content) 1fr; gap: var(--s3) var(--s5); margin: 0; }
dl.facts dt { color: var(--text-2); }
dl.facts dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }

/* ----------------------------------------------------------------- lists */
.list { list-style: none; padding: 0; margin: 0; }
.list > li { display: flex; gap: var(--s4); justify-content: space-between; align-items: flex-start; padding: var(--s3) 0; border-top: 1px solid var(--border); }
.list > li:first-child { border-top: 0; padding-top: 0; }
.list > li:last-child { padding-bottom: 0; }
.list .primary { font-weight: 550; color: var(--text); text-decoration: none; }
.list a.primary:hover { color: var(--navy); text-decoration: underline; }
.list .secondary { color: var(--text-2); font-size: var(--fs-small); margin-top: 2px; }
.list .end { text-align: right; flex: none; display: flex; flex-direction: column; gap: var(--s1); align-items: flex-end; }
.date-block { flex: none; width: 52px; text-align: center; border: 1px solid var(--border); border-radius: var(--r); padding: 6px 0 5px; line-height: 1.1; }
.date-block .m { display: block; font-size: var(--fs-small); color: var(--text-2); }
.date-block .d { display: block; font-size: 1.3rem; font-weight: 650; }
.row-with-date { display: flex; gap: var(--s4); align-items: flex-start; min-width: 0; }

/* ----------------------------------------------------------------- summary strip (dashboard) */
.summary { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); margin-bottom: var(--s6); box-shadow: var(--shadow-1); }
.summary a { display: flex; gap: var(--s3); align-items: center; padding: var(--s4) var(--s5); text-decoration: none; color: var(--text); border-left: 1px solid var(--border); transition: background-color .12s var(--ease); }
.summary a:first-child { border-left: 0; border-radius: var(--r-lg) 0 0 var(--r-lg); }
.summary a:last-child { border-radius: 0 var(--r-lg) var(--r-lg) 0; }
.summary a:hover { background: var(--surface-2); }
.summary .n { font-size: 1.6rem; font-weight: 650; font-variant-numeric: tabular-nums; min-width: 1.4ch; }
.summary .t { line-height: 1.3; }
.summary .t small { display: block; color: var(--text-2); font-size: var(--fs-small); }
.summary .n.bad { color: var(--bad); }
.summary .n.warn { color: var(--warn); }

/* ----------------------------------------------------------------- toolbar & tables */
.toolbar { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; margin-bottom: var(--s4); }
.toolbar .grow { flex: 1 1 280px; position: relative; }
.toolbar .grow .icon { position: absolute; left: 12px; bottom: 13px; color: var(--text-2); pointer-events: none; }
.toolbar .grow input { padding-left: 38px; }
.toolbar .field { margin: 0; min-width: 170px; }
.toolbar label { font-size: var(--fs-small); color: var(--text-2); font-weight: 500; }
.filters-more { flex-basis: 100%; }
.filters-more > summary { display: inline-flex; align-items: center; gap: var(--s2); cursor: pointer; color: var(--navy); font-weight: 550; min-height: 36px; list-style: none; }
.filters-more > summary::-webkit-details-marker { display: none; }
.filters-more[open] > summary { margin-bottom: var(--s3); }
.filters-more .panel-inner { display: flex; flex-wrap: wrap; gap: var(--s3); align-items: flex-end; padding: var(--s4); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); }
.result-note { color: var(--text-2); font-size: var(--fs-small); margin: 0 0 var(--s3); }
.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r); overflow: hidden; background: var(--surface); }
.segmented a { padding: 0 var(--s4); min-height: 42px; display: inline-flex; align-items: center; gap: var(--s2); text-decoration: none; color: var(--text-2); font-weight: 550; border-left: 1px solid var(--border); }
.segmented a:first-child { border-left: 0; }
.segmented a[aria-current="page"] { background: var(--navy-tint); color: var(--navy); }

.table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); overflow-x: auto; box-shadow: var(--shadow-1); }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th { text-align: left; font-weight: 550; font-size: var(--fs-small); color: var(--text-2); padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); }
td { padding: var(--s4); border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background-color .1s var(--ease); }
tbody tr:hover { background: #272a31; }
tbody tr.is-open { background: var(--navy-tint); }
td.num, th.num { text-align: right; }
.cell-title { font-weight: 550; color: var(--text); text-decoration: none; }
a.cell-title:hover { color: var(--navy); text-decoration: underline; }
.cell-sub { color: var(--text-2); font-size: var(--fs-small); margin-top: 2px; }
.ref { color: var(--text-2); font-weight: 500; white-space: nowrap; }

/* ----------------------------------------------------------------- status labels */
.status { display: inline-flex; align-items: center; gap: 6px; padding: 1px 8px; border-radius: 5px; font-size: var(--fs-small); font-weight: 500; line-height: 1.55; white-space: nowrap; background: var(--neutral-bg); color: var(--neutral); }
.status.ok { background: var(--ok-bg); color: var(--ok); }
.status.warn { background: var(--warn-bg); color: var(--warn); }
.status.bad { background: var(--bad-bg); color: var(--bad); }
.status.info { background: var(--info-bg); color: var(--info); }
.status.lock { background: transparent; color: var(--text-2); border: 1px solid var(--border-strong); padding: 1px 9px 1px 7px; }
.status.lock::before { content: none; }
.status .icon { width: 14px; height: 14px; }

/* ----------------------------------------------------------------- progress */
.progress { display: flex; align-items: center; gap: var(--s3); }
.bar { flex: 1; height: 6px; background: #353a43; border-radius: 99px; overflow: hidden; min-width: 60px; }
.bar > span { display: block; height: 100%; background: var(--navy); border-radius: 99px; }
.bar.ok > span { background: var(--ok); }
.progress .pct { font-size: var(--fs-small); color: var(--text-2); font-variant-numeric: tabular-nums; min-width: 3.5ch; text-align: right; }

/* ----------------------------------------------------------------- tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 0 var(--s1); border-bottom: 1px solid var(--border); margin-bottom: var(--s5); }
.tabs a { padding: var(--s3) var(--s3); margin-bottom: -1px; border-bottom: 2px solid transparent; color: var(--text-2); text-decoration: none; font-weight: 550; white-space: nowrap; }
.tabs a:hover { color: var(--text); }
.tabs a[aria-current="page"] { color: var(--navy); border-bottom-color: var(--navy); }
.tabs .count { color: var(--text-2); font-weight: 500; margin-left: 4px; }

/* ----------------------------------------------------------------- disclosure */
details.reveal > summary { display: inline-flex; align-items: center; gap: var(--s2); min-height: 40px; cursor: pointer; color: var(--navy); font-weight: 550; list-style: none; }
details.reveal > summary::-webkit-details-marker { display: none; }
details.reveal > summary .chev { transition: transform .15s var(--ease); }
details.reveal[open] > summary .chev { transform: rotate(90deg); }
details.reveal[open] > summary { margin-bottom: var(--s3); }
.reveal-body { padding: var(--s4) var(--s5); background: var(--surface-2); border-radius: var(--r); }

/* ----------------------------------------------------------------- record (resolution wording) */
.wording { font-size: 1.125rem; line-height: 1.75; color: var(--text); white-space: pre-wrap; max-width: 66ch; margin: 0; padding-left: var(--s5); border-left: 3px solid var(--navy); }
.lock-note { display: flex; gap: var(--s3); align-items: flex-start; color: var(--text-2); font-size: var(--fs-small); margin-top: var(--s5); padding-top: var(--s4); border-top: 1px solid var(--border); }
.lock-note .icon { margin-top: 2px; }
.correction { padding: var(--s4) 0; border-top: 1px solid var(--border); }
.correction .wording { font-size: 1rem; border-left-color: var(--border-strong); }

/* ----------------------------------------------------------------- side panel */
.with-panel { display: grid; grid-template-columns: minmax(0, 1fr) 420px; gap: var(--s5); align-items: start; }
.side-panel {
  position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  animation: slide-in .18s var(--ease);
}
.side-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--s3); padding: var(--s5) var(--s5) var(--s4); border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.side-panel-head h2 { font-size: 1.15rem; }
.side-panel-body { padding: var(--s5); }
.side-panel-body > section + section { margin-top: var(--s5); padding-top: var(--s5); border-top: 1px solid var(--border); }
.side-panel-body h3 { margin-bottom: var(--s3); }
.side-panel-foot { padding: var(--s4) var(--s5) var(--s5); border-top: 1px solid var(--border); display: flex; gap: var(--s3); background: var(--surface); }
.close { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--r); color: var(--text-2); flex: none; }
.close:hover { background: var(--surface-2); color: var(--text); }
.panel-backdrop { display: none; }
@keyframes slide-in { from { opacity: 0; transform: translateX(12px); } }

/* ----------------------------------------------------------------- documents */
.doc { display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) 0; border-top: 1px solid var(--border); }
.doc:first-child { border-top: 0; padding-top: 0; }
.doc .doc-icon { width: 36px; height: 36px; border-radius: var(--r); background: var(--navy-tint); color: var(--navy); display: grid; place-items: center; flex: none; }
.doc .doc-meta { color: var(--text-2); font-size: var(--fs-small); }
.callout { display: flex; gap: var(--s3); align-items: flex-start; background: var(--surface); border: 1px solid var(--border); border-left: 3px solid var(--navy); border-radius: var(--r); padding: var(--s4) var(--s5); margin-bottom: var(--s5); color: var(--text); }
.callout.warn { border-left-color: var(--warn); background: #2a2519; }
.callout .icon { margin-top: 3px; color: var(--navy); }
.callout.warn .icon { color: var(--warn); }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }

/* ----------------------------------------------------------------- feedback */
.toast {
  display: flex; gap: var(--s3); align-items: flex-start; padding: var(--s3) var(--s4); border-radius: var(--r);
  margin-bottom: var(--s5); border: 1px solid; background: var(--surface); box-shadow: var(--shadow-1); animation: pop .18s var(--ease);
}
.toast .icon { margin-top: 3px; }
.toast.ok { border-color: #2f5a40; color: var(--ok); }
.toast.error { border-color: #6b3a37; color: var(--bad); background: #2a1f1f; }
.toast.warn { border-color: #5e4c26; color: var(--warn); }
.toast .msg { color: var(--text); }
.toast .dismiss { margin-left: auto; background: none; border: 0; color: var(--text-2); cursor: pointer; width: 32px; height: 32px; border-radius: var(--r-sm); display: grid; place-items: center; }
.toast .dismiss:hover { background: var(--surface-2); }

.empty { text-align: center; padding: var(--s6) var(--s5); }
.empty .empty-icon { width: 44px; height: 44px; margin: 0 auto var(--s3); border-radius: 50%; background: var(--surface-2); color: var(--text-2); display: grid; place-items: center; }
.empty h3 { margin-bottom: var(--s2); }
.empty p { color: var(--text-2); margin: 0 auto var(--s4); max-width: 46ch; }
.empty.compact { text-align: left; padding: var(--s2) 0; }
.empty.compact p { margin: 0; }

/* ----------------------------------------------------------------- kanban */
.board { display: grid; grid-template-columns: repeat(5, minmax(210px, 1fr)); gap: var(--s4); overflow-x: auto; padding-bottom: var(--s2); }
.lane { background: var(--surface-2); border-radius: var(--r-lg); padding: var(--s3); min-height: 240px; }
.lane-head { display: flex; justify-content: space-between; align-items: center; padding: var(--s1) var(--s2) var(--s3); font-weight: 600; }
.lane-head .muted { font-weight: 500; }
.task-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); padding: var(--s3) var(--s4); margin-bottom: var(--s3); box-shadow: var(--shadow-1); }
.task-card .cell-title { display: block; margin: 2px 0 var(--s2); }
.task-card .meta { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; color: var(--text-2); font-size: var(--fs-small); }
.task-card form { display: flex; gap: var(--s2); margin-top: var(--s3); }
.task-card select { min-height: 36px; padding: .3rem .5rem; font-size: var(--fs-small); }

/* ----------------------------------------------------------------- agenda */
.agenda { list-style: none; padding: 0; margin: 0; counter-reset: item; }
.agenda > li { counter-increment: item; position: relative; padding: var(--s4) 0 var(--s4) 48px; border-top: 1px solid var(--border); }
.agenda > li:first-child { border-top: 0; padding-top: 0; }
.agenda > li:first-child::before { top: 0; }
.agenda > li::before {
  content: counter(item); position: absolute; left: 0; top: var(--s4); width: 32px; height: 32px; border-radius: 50%;
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: var(--fs-small); display: grid; place-items: center;
}
.agenda .item-title { font-weight: 600; }
.agenda .item-meta { color: var(--text-2); font-size: var(--fs-small); margin-top: 2px; }
.minutes-text { white-space: pre-wrap; line-height: 1.7; background: var(--surface-2); border-radius: var(--r); padding: var(--s3) var(--s4); margin-top: var(--s3); }
.stepper { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; margin-bottom: var(--s4); padding: 0; list-style: none; }
.stepper li { display: inline-flex; align-items: center; gap: var(--s2); color: var(--text-2); font-size: var(--fs-small); font-weight: 550; }
.stepper li + li::before { content: ""; width: 24px; height: 1px; background: var(--border-strong); margin-right: var(--s1); }
.stepper .dot { width: 22px; height: 22px; border-radius: 50%; border: 1.5px solid var(--border-strong); display: grid; place-items: center; font-size: .75rem; }
.stepper .done .dot { background: var(--navy); border-color: var(--navy); color: #1b1d22; }
.stepper .now { color: var(--navy); }
.stepper .now .dot { border-color: var(--navy); color: var(--navy); }

/* ----------------------------------------------------------------- sign in */
.auth { min-height: 100vh; display: grid; place-items: center; padding: var(--s6) var(--s4); background: var(--bg); }
.auth-card { width: 100%; max-width: 440px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s6); box-shadow: var(--shadow-2); }
.auth-card .brand { padding: 0 0 var(--s5); }
.auth-card h1 { margin-bottom: var(--s2); }
.persona { display: flex; width: 100%; gap: var(--s3); align-items: center; text-align: left; padding: var(--s3) var(--s4); margin-bottom: var(--s2);
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r); cursor: pointer; font: inherit; color: var(--text);
  transition: border-color .12s var(--ease), background-color .12s var(--ease); }
.persona:hover { border-color: var(--navy); background: var(--navy-tint); }
.persona .who { flex: 1; }
.persona .who small { display: block; color: var(--text-2); font-size: var(--fs-small); }

/* ----------------------------------------------------------------- responsive */
@media (max-width: 1180px) {
  .with-panel { grid-template-columns: minmax(0, 1fr); }
  .side-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(440px, 100%); max-height: none; border-radius: 0; z-index: 40; border-width: 0 0 0 1px; }
  .panel-backdrop { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 39; }
}
@media (max-width: 980px) {
  .layout, .layout.wide-side, .dash { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); background: var(--bg); }
  .sidebar { display: none; }
  .mobile-bar { display: block; background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 25; }
  .mobile-bar > summary { list-style: none; display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding: var(--s2) var(--s4); min-height: 56px; cursor: pointer; }
  .mobile-bar > summary::-webkit-details-marker { display: none; }
  .mobile-bar .brand { padding: 0; }
  .mobile-bar .menu-btn { display: inline-flex; align-items: center; gap: var(--s2); border: 1px solid var(--border-strong); border-radius: var(--r); padding: 0 var(--s3); min-height: 40px; font-weight: 550; }
  .mobile-bar .nav { padding: 0 var(--s3) var(--s3); }
  .topbar { position: static; padding: var(--s3) var(--s4); }
  .search { max-width: none; }
  .content { padding: var(--s5) var(--s4) var(--s7); }
  .demo-note { padding: var(--s2) var(--s4); }
  h1 { font-size: 1.4rem; }
  .grid2, .grid3 { grid-template-columns: minmax(0, 1fr); }
  .summary { grid-template-columns: minmax(0, 1fr); }
  .summary a { border-left: 0; border-top: 1px solid var(--border); border-radius: 0 !important; }
  .summary a:first-child { border-top: 0; }
  .page-head { margin-bottom: var(--s5); }
  .head-actions { width: 100%; }
  .head-actions .btn:not(.ghost) { flex: 1; }
  .section { padding: var(--s4); }
  dl.facts { grid-template-columns: minmax(0, 1fr); gap: 0; }
  dl.facts dt { margin-top: var(--s3); font-size: var(--fs-small); }
  .wording { font-size: 1.05rem; padding-left: var(--s4); }
  .board { grid-template-columns: minmax(0, 1fr); }
  .toolbar .field { flex: 1 1 140px; min-width: 0; }
  /* tables become stacked rows */
  table.stack thead { display: none; }
  table.stack, table.stack tbody, table.stack tr, table.stack td { display: block; width: 100%; }
  table.stack tr { padding: var(--s3) var(--s4); border-bottom: 1px solid var(--border); }
  table.stack tbody tr:last-child { border-bottom: 0; }
  table.stack td { border: 0; padding: 2px 0; }
  table.stack td[data-label] { display: flex; gap: var(--s3); align-items: center; }
  table.stack td[data-label]::before { content: attr(data-label); color: var(--text-2); font-size: var(--fs-small); min-width: 110px; }
  .list > li { flex-wrap: wrap; }
  .list .end { align-items: flex-start; text-align: left; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
@media print {
  .sidebar, .topbar, .mobile-bar, .head-actions, .demo-note, form, .tabs, .menu { display: none !important; }
  .shell { display: block; } .content { padding: 0; max-width: none; }
  :root { color-scheme: light; --bg: #fff; --surface: #fff; --surface-2: #f4f4f4; --text: #111; --text-2: #444; --border: #ccc; --navy: #1e3a5f; }
  body { background: #fff; } .section, .table-wrap { box-shadow: none; }
}

/* ---------- governance */
.list.checklist > li { justify-content: flex-start; align-items: center; }
.list.checklist > li .status { min-width: 6.5rem; justify-content: center; }
.answer-row { display: flex; flex-wrap: wrap; gap: var(--s2); margin: var(--s2) 0 var(--s3); }
.answer-row label { display: inline-flex; align-items: center; gap: .4rem; border: 1px solid var(--border); border-radius: 999px; padding: .35rem .85rem; cursor: pointer; background: var(--surface); }
.answer-row label:has(input:checked) { border-color: var(--navy); background: var(--surface-2); font-weight: 600; }
.answer-row input { margin: 0; }
.question { padding: var(--s4) 0; border-top: 1px solid var(--border); }
.question:first-child { border-top: 0; padding-top: 0; }
.question .qcode { font-variant-numeric: tabular-nums; color: var(--text-2); font-size: var(--fs-small); margin-right: .5rem; }
.question .qtext { font-weight: 550; }
.counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: var(--s3); margin: 0; }
.counts div { background: var(--surface-2); border-radius: var(--r); padding: var(--s3); }
.counts dt { font-size: var(--fs-small); color: var(--text-2); }
.counts dd { margin: 0; font-size: 1.4rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.disclaimer { font-size: var(--fs-small); color: var(--text-2); border-left: 3px solid var(--border); padding-left: var(--s3); margin: var(--s3) 0; }

/* ---------- dark workspace layout (wordmark, account block, dashboard) */
.brand.wordmark { flex-direction: column; align-items: flex-start; gap: 4px; padding: 0 var(--s3) var(--s6); }
.wordmark .wm-1 { font-weight: 700; font-size: 1.2rem; letter-spacing: .08em; color: var(--text); line-height: 1.1; }
.wordmark .wm-2 { font-weight: 500; font-size: .75rem; letter-spacing: .2em; text-transform: uppercase; color: var(--text-2); line-height: 1.2; }
.nav a { min-height: 44px; }
.sidebar-foot { margin-top: auto; padding: var(--s4) var(--s2) 0; border-top: 1px solid var(--border); }
.account > summary { list-style: none; display: flex; align-items: center; gap: var(--s3); padding: var(--s2); border-radius: var(--r); cursor: pointer; }
.account > summary::-webkit-details-marker { display: none; }
.account > summary:hover { background: var(--surface-2); }
.account .who { min-width: 0; line-height: 1.3; }
.account .who strong { display: block; font-weight: 550; font-size: .95rem; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account .who span { display: block; font-size: var(--fs-small); color: var(--text-2); }
.account .menu-pop { top: auto; bottom: calc(100% + 6px); left: 0; right: auto; }
.workspace-label { color: var(--text-2); font-size: var(--fs-small); white-space: nowrap; }
.pill { display: inline-flex; align-items: center; gap: var(--s2); border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px 12px; font-size: var(--fs-small); color: var(--text-2); white-space: nowrap; }
.pill a { color: var(--text); font-weight: 550; }
.search input { background: #1d2025; border-color: var(--border-strong); min-height: 38px; }
.eyebrow { font-size: var(--fs-small); letter-spacing: .14em; text-transform: uppercase; color: var(--text-2); font-weight: 500; margin: 0 0 var(--s2); }
.btn.quiet { background: var(--primary); border-color: transparent; }
.btn.quiet:hover { background: var(--primary-hover); }

.stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); padding: var(--s2) 0 var(--s5); margin-bottom: var(--s6); border-bottom: 1px solid var(--border); }
.stats a { display: block; padding: 0 var(--s5); border-left: 1px solid var(--border); text-decoration: none; color: var(--text); }
.stats a:first-child { padding-left: 0; border-left: 0; }
.stats a:hover .v { color: #fff; }
.stats .k { color: var(--text-2); font-size: var(--fs-small); }
.stats .v { display: block; font-size: 2.1rem; font-weight: 400; line-height: 1.25; margin: var(--s2) 0 var(--s1); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.stats .v.bad { color: var(--bad); }
.stats .s { color: var(--text-2); font-size: var(--fs-small); display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s4) var(--s5) var(--s5); margin-bottom: var(--s5); }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: var(--s3); padding-bottom: var(--s3); margin-bottom: var(--s4); border-bottom: 1px solid var(--border); }
.panel-head h2 { font-size: var(--fs-h2); }
.panel-head .more-link { font-size: var(--fs-small); color: var(--text-2); text-decoration: none; white-space: nowrap; }
.panel-head .more-link:hover { color: var(--text); text-decoration: underline; }
.panel .list > li { padding: var(--s4) 0; }
.panel .list > li:first-child { padding-top: 0; }
.panel .list > li:last-child { padding-bottom: 0; }
.panel .list .primary { font-weight: 500; }
.task-row { display: flex; gap: var(--s3); align-items: flex-start; min-width: 0; }
.tick { flex: none; width: 20px; height: 20px; margin-top: 3px; border-radius: 4px; border: 1.5px solid var(--input-border); background: #2e3239; padding: 0; cursor: pointer; display: grid; place-items: center; color: transparent; }
.tick:hover { border-color: var(--text); color: var(--text-2); }
.tick:focus-visible { outline: none; box-shadow: var(--focus); }
a.tick { text-decoration: none; }
.coming { border-left: 2px solid var(--gold); padding-left: var(--s4); }
.coming .when { font-size: var(--fs-small); color: var(--text-2); letter-spacing: .04em; text-transform: uppercase; }
.coming .title { display: block; font-size: 1.15rem; font-weight: 650; margin: var(--s2) 0 var(--s1); color: var(--text); text-decoration: none; line-height: 1.35; }
.coming .where { font-size: var(--fs-small); color: var(--text-2); margin-bottom: var(--s4); }
.foot-note { color: var(--text-2); font-size: var(--fs-small); margin-top: var(--s5); }
@media (max-width: 760px) {
  .stats { grid-template-columns: minmax(0, 1fr); padding-bottom: var(--s3); }
  .stats a { padding: var(--s3) 0; border-left: 0; border-top: 1px solid var(--border); }
  .stats a:first-child { border-top: 0; }
  .workspace-label { display: none; }
  .mobile-bar { background: var(--chrome); }
}
@media (max-width: 760px) {
  .topbar { flex-wrap: wrap; row-gap: var(--s2); }
  .topbar .search { order: 2; flex: 1 1 100%; }
  .top-actions { width: 100%; justify-content: space-between; }
}

/* ---------- logo */
.brand.wordmark { flex-direction: row; align-items: center; gap: var(--s3); }
.brand-logo { width: 40px; height: 40px; flex: none; display: block; }
.wm-text { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.auth-logo { display: flex; flex-direction: column; align-items: center; gap: var(--s2); padding-bottom: var(--s5); margin-bottom: var(--s5); border-bottom: 1px solid var(--border); }
.auth-logo img { width: 180px; height: auto; display: block; }
.auth-logo span { font-size: .75rem; letter-spacing: .3em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.auth-logo .ids { display: flex; flex-wrap: wrap; justify-content: center; column-gap: 1.25em; row-gap: .25em; letter-spacing: .18em; }
.auth-logo .ids span { white-space: nowrap; letter-spacing: inherit; }
@media (max-width: 760px) { .brand-logo { width: 34px; height: 34px; } }

/* people */
.avatar.sm { width: 28px; height: 28px; font-size: .7rem; }
.avatar.lg { width: 64px; height: 64px; font-size: 1.2rem; }
.avatar.xl { width: 144px; height: 144px; font-size: 2.4rem; }
.person-cell { display: flex; align-items: center; gap: .6rem; min-width: 0; }
.person-cell > div { min-width: 0; }
.region-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--s4); }
.region-card { display: block; padding: 1.25rem; color: inherit; text-decoration: none; }
.region-card h2 { font-size: 1.15rem; margin: 0 0 .75rem; }
.region-card:hover { border-color: var(--border-strong); }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: var(--s4); }
.person-card { display: flex; gap: var(--s3); align-items: center; padding: var(--s4); border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: inherit; text-decoration: none; }
.person-card:hover { border-color: var(--border-strong); }
.person-card .who { min-width: 0; }
.person-card .who strong { display: block; }
.person-card .who span { display: block; font-size: var(--fs-small); color: var(--text-2); }
.profile-head { display: flex; gap: var(--s5); align-items: center; flex-wrap: wrap; }
@media (max-width: 600px) { .avatar.xl { width: 104px; height: 104px; } }

.upload-row { display: flex; gap: var(--s2); align-items: center; flex-wrap: wrap; }
.upload-row input[type=file] { flex: 1; min-width: 200px; }
ol.steps { margin: 0; padding-left: 1.25rem; display: grid; gap: var(--s2); }
/* Installed app on phones: keep clear of the notch and home bar. */
@media (display-mode: standalone) { body { padding-top: env(safe-area-inset-top); padding-bottom: env(safe-area-inset-bottom); } }

/* funds requisitions */
.auth-card.wide { max-width: 860px; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }
.req-line { display: grid; grid-template-columns: 2.2fr 1fr 1.6fr 1.2fr; gap: var(--s2) var(--s3); align-items: end; border-top: 1px solid var(--border); padding: var(--s3) 0 0; margin: 0 0 var(--s3); }
.req-line-label { grid-column: 1 / -1; font-size: var(--fs-small); color: var(--text-2); font-weight: 600; }
@media (max-width: 720px) { .req-line { grid-template-columns: 1fr; } }
.req-conditions { margin: 0 0 var(--s4); padding-left: 1.2rem; color: var(--warn); font-weight: 600; display: grid; gap: var(--s1); }

/* licensing */
.req-item { border-top: 1px solid var(--border); padding: var(--s3) 0; }
.req-item:first-child { border-top: 0; padding-top: 0; }
.req-item .answer { margin-top: var(--s2); padding: var(--s2) var(--s3); border-left: 3px solid var(--gold); background: var(--surface-2); border-radius: 4px; }
.pay-facts dd .ref { font-size: 1rem; }

/* inviting other groups and people to a meeting */
.invite-group { border: 0; padding: 0; margin: 0 0 1rem; }
.invite-group legend { font-weight: 600; margin-bottom: .4rem; }
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .15rem 1rem; }

/* ---------------------------------------------------------------- help chat */
dialog.help-chat { position: fixed; inset: auto 20px 20px auto; margin: 0; width: min(420px, calc(100vw - 24px)); height: min(640px, calc(100dvh - 40px));
  padding: 0; border: 1px solid var(--border-strong); border-radius: var(--r-lg); background: var(--chrome); color: var(--text); box-shadow: var(--shadow-2); overflow: hidden; }
dialog.help-chat[open] { display: flex; animation: help-in .18s ease-out; }
dialog.help-chat::backdrop { background: rgba(10, 11, 14, .35); }
@keyframes help-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { dialog.help-chat[open] { animation: none; } }
@media (max-width: 640px) {
  dialog.help-chat { inset: 0; width: 100%; height: 100dvh; max-width: none; max-height: none; border: 0; border-radius: 0;
    padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
}
.help-chat.inline { display: flex; height: min(620px, 72vh); border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--chrome); overflow: hidden; margin-bottom: 1.5rem; }
.help-chat-inner { display: flex; flex-direction: column; width: 100%; min-height: 0; }
.help-head { display: flex; align-items: center; gap: .75rem; padding: .85rem .9rem .85rem 1rem; border-bottom: 1px solid var(--border); }
.help-badge { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; border: 1px solid var(--gold); color: var(--gold); }
.help-titles { flex: 1; min-width: 0; }
.help-titles h2 { margin: 0; font-size: var(--fs-h2); }
.help-titles p { margin: 0; font-size: var(--fs-small); color: var(--text-2); }
.help-icon-btn { display: grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: var(--r); background: transparent; color: var(--text-2); cursor: pointer; }
.help-icon-btn:hover { background: var(--surface-2); color: var(--text); }
.help-icon-btn[hidden] { display: none; }
.help-log { flex: 1; min-height: 0; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .75rem; overscroll-behavior: contain; }
.help-msg { max-width: 88%; padding: .65rem .85rem; border-radius: 14px; line-height: 1.5; overflow-wrap: anywhere; }
.help-msg p { margin: 0 0 .5rem; } .help-msg p:last-child, .help-msg ol:last-child, .help-msg ul:last-child { margin-bottom: 0; }
.help-msg ol, .help-msg ul { margin: 0 0 .5rem; padding-left: 1.3rem; } .help-msg li { margin: .2rem 0; }
.help-msg.bot { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 4px; }
.help-msg.me { align-self: flex-end; background: var(--primary); border: 1px solid var(--primary-border); border-bottom-right-radius: 4px; white-space: pre-wrap; }
.help-msg.err { align-self: flex-start; background: var(--bad-bg); color: var(--bad); }
.help-msg a { color: var(--navy); }
.help-typing { display: inline-flex; gap: 4px; padding: .2rem 0; }
.help-typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--text-2); animation: help-dot 1.2s infinite ease-in-out; }
.help-typing span:nth-child(2) { animation-delay: .15s; } .help-typing span:nth-child(3) { animation-delay: .3s; }
@keyframes help-dot { 0%, 80%, 100% { opacity: .3; transform: none; } 40% { opacity: 1; transform: translateY(-3px); } }
.help-suggest { display: flex; flex-wrap: wrap; gap: .5rem; }
.help-suggest button { font: inherit; font-size: var(--fs-small); padding: .45rem .75rem; border-radius: 999px; border: 1px solid var(--border-strong); background: transparent; color: var(--text); cursor: pointer; text-align: left; }
.help-suggest button:hover { border-color: var(--gold); }
.help-form { display: flex; align-items: flex-end; gap: .5rem; padding: .75rem; border-top: 1px solid var(--border); }
.help-form textarea { flex: 1; resize: none; min-height: 44px; max-height: 140px; padding: .65rem .8rem; border-radius: var(--r); border: 1px solid var(--input-border); background: var(--bg); color: var(--text); font: inherit; line-height: 1.4; }
.help-send { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: var(--r); border: 1px solid var(--primary-border); background: var(--primary); color: var(--text); cursor: pointer; }
.help-send:hover { background: var(--primary-hover); }
.help-send:disabled { opacity: .5; cursor: default; }
.help-foot { margin: 0; padding: 0 .9rem .75rem; font-size: .75rem; line-height: 1.4; color: var(--text-2); }
.help-suggest[hidden] { display: none; }

/* ---------------------------------------------------------------- events */
.programme-day + .programme-day { margin-top: var(--s5); }
.programme-day h3 { margin: 0 0 var(--s3); font-size: var(--fs-small); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.programme-time { flex: none; width: 5.5rem; color: var(--text-2); font-variant-numeric: tabular-nums; }
.list > li.programme-highlight .primary { color: var(--gold); }
.programme-day .list > li { flex-wrap: nowrap; align-items: center; }
@media (max-width: 640px) { .programme-time { width: 4.6rem; font-size: var(--fs-small); } }

/* ---------------------------------------------------------------- budgets */
.budget-h { margin: var(--s5) 0 var(--s2); font-size: var(--fs-small); letter-spacing: .08em; text-transform: uppercase; color: var(--gold); font-weight: 600; }
.budget-row { display: grid; grid-template-columns: 1fr 9rem; gap: var(--s3); align-items: end; }
.budget-row.three { grid-template-columns: 12rem 1fr 9rem; }
@media (max-width: 640px) { .budget-row, .budget-row.three { grid-template-columns: 1fr; gap: 0; } }

/* electronic voting */
.check-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: .35rem 1rem; margin-bottom: .75rem; }
fieldset.ballot { border: 1px solid var(--border); border-radius: 8px; padding: .75rem 1rem; margin: 0; display: flex; flex-direction: column; gap: .5rem; }
fieldset.ballot legend { padding: 0 .35rem; color: var(--text-2); }
fieldset.ballot .check { font-size: 1.05rem; padding: .35rem 0; }
[data-filter-row][hidden] { display: none !important; }

/* A meeting's resolutions: reference, title, status and actions in aligned columns. */
.res-rows { display: grid; }
.res-row { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr) 6.5rem 14.5rem; gap: .75rem 1rem; align-items: center; padding: .8rem 0; border-top: 1px solid var(--border); }
.res-row:first-child { border-top: 0; }
.res-row .ref { white-space: nowrap; }
.res-row .res-title { font-weight: 600; line-height: 1.35; }
.res-row .res-actions { display: flex; gap: .5rem; justify-content: flex-end; white-space: nowrap; }
@media (max-width: 760px) {
  .res-row { grid-template-columns: 1fr auto; }
  .res-row .ref { grid-column: 1; } .res-row .res-status { grid-column: 2; justify-self: end; }
  .res-row .res-title { grid-column: 1 / -1; } .res-row .res-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* The ministers' roll: the three buttons always in the same place on every row. */
.list li.roll-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: .75rem; }
.roll-row .status { display: inline-block; margin: .3rem 0 0 0 !important; white-space: normal; }
.roll-row > span:first-child { min-width: 0; }
.roll-actions { display: grid; grid-template-columns: 5.4rem 5.4rem 4rem; gap: .35rem; }
.roll-actions form { display: block; margin: 0; }
.roll-actions .btn { width: 100%; justify-content: center; padding-left: .4rem; padding-right: .4rem; }
@media (max-width: 600px) { .list li.roll-row { grid-template-columns: 1fr; } .roll-actions { justify-content: start; } }
.roll-actions .btn.is-on { background: var(--ok-bg); color: var(--ok); border-color: transparent; cursor: default; }
.roll-actions .btn.is-on.warn { background: var(--warn-bg); color: var(--warn); }

/* Tracked changes */
.diff-del { color: var(--bad); text-decoration: line-through; background: var(--bad-bg); }
.diff-ins { color: var(--ok); text-decoration: underline; background: var(--ok-bg); }

.super-strip { display: flex; align-items: center; gap: .4rem; margin: 0 0 1rem; padding: .45rem .75rem; border-radius: var(--r-sm); background: var(--warn-bg); color: var(--warn); }
.super-strip .linklike { color: inherit; text-decoration: underline; }

/* The resolution process: eight steps, from prepared to recorded */
.res-steps{list-style:none;margin:0 0 1rem;padding:0;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:.5rem}
.res-steps > li{display:flex;gap:.55rem;align-items:flex-start;padding:.55rem .6rem;border:1px solid var(--border);border-radius:8px;background:var(--surface);color:var(--text-2);font-size:.82rem;line-height:1.3;min-width:0}
.res-steps .dot{flex:none;width:1.6rem;height:1.6rem;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:.75rem;font-weight:700;border:1.5px solid var(--border-strong);color:var(--text-2)}
.res-steps .txt{min-width:0}
.res-steps .nm{display:block;font-weight:600;overflow-wrap:anywhere}
.res-steps .d{display:block;font-size:.72rem;opacity:.8;margin-top:.1rem}
.res-steps > li.done .dot{background:var(--gold);border-color:var(--gold);color:#15171D}
.res-steps > li.now{border-color:var(--gold);color:var(--text);box-shadow:0 0 0 1px var(--gold) inset}
.res-steps > li.now .dot{border-color:var(--gold);color:var(--gold)}
@media (max-width:720px){.res-steps{grid-template-columns:repeat(2,minmax(0,1fr))}}
.process-next{background:var(--surface-2);border:1px solid var(--border);border-radius:8px;padding:1rem 1.1rem;margin-top:.5rem}
.process-next h3{margin:0 0 .35rem;font-size:1rem}
.amend{border-top:1px solid var(--border);padding:.7rem 0}

/* Settings, Modules: the protected switch and its confirmation */
.module-row{display:flex;gap:1rem;align-items:flex-start;flex-wrap:wrap}
.module-switch{display:flex;gap:.6rem;align-items:center}
.switch{position:relative;display:inline-block;width:46px;height:26px;border-radius:13px;background:var(--border-strong);border:1px solid var(--border-strong);transition:background .15s}
.switch::after{content:"";position:absolute;top:2px;left:2px;width:20px;height:20px;border-radius:50%;background:var(--text);transition:left .15s}
.switch.on{background:var(--gold);border-color:var(--gold)}
.switch.on::after{left:22px;background:#15171D}
.switch:focus-visible{outline:2px solid var(--gold);outline-offset:2px}
dialog.confirm-dlg{max-width:min(620px,calc(100vw - 32px));width:100%;border:1px solid var(--border);border-radius:12px;background:var(--surface);color:var(--text);padding:1.25rem 1.4rem}
dialog.confirm-dlg::backdrop{background:rgba(10,11,14,.55)}
dialog.confirm-dlg[open]:not(:modal){position:relative;margin:1rem 0;display:block}
dialog.confirm-dlg h2{margin:0 0 .5rem}
.impact{margin:.5rem 0 1rem;padding-left:1.1rem}.impact li{margin:.2rem 0}
.card-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(260px,1fr));gap:.75rem;margin-bottom:1rem}
a.card{display:block;padding:1rem 1.1rem;color:inherit;text-decoration:none}a.card:hover{border-color:var(--gold)}

/* Certificates and letters of commission: the download buttons, in two groups. */
.cert-make { display: flex; flex-wrap: wrap; gap: .75rem 2rem; }
.cert-make > div { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.cert-make .small-head { width: 100%; margin: 0; font-size: .8rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted, #5B5F69); }

/* Licence certificate and letter of commission registers. */
.doc-actions { display: flex; flex-wrap: wrap; gap: .4rem .6rem; align-items: flex-start; margin: .35rem 0; }
.doc-actions .reveal, td .reveal { margin: 0; }
.doc-actions .reveal > summary, td .reveal > summary { font-size: .85rem; }
.stack-form { display: grid; gap: .5rem; max-width: 22rem; margin-top: .4rem; }
.stack-form .field { margin: 0; }
.doc-register td[data-label="Actions"] { min-width: 13rem; }
.doc-old { border-top: 1px dashed var(--border); margin-top: .6rem; padding-top: .6rem; opacity: .85; }
.sig-row { display: grid; grid-template-columns: minmax(0, 18rem) 1fr; gap: 1rem 1.5rem; align-items: start; }
.sig-preview { min-height: 5.5rem; display: flex; align-items: center; justify-content: center; padding: .75rem; border: 1px solid var(--border); border-radius: 8px; background: #FBF7EF; }
.sig-preview img { max-width: 100%; max-height: 5rem; }
@media (max-width: 640px) { .sig-row { grid-template-columns: 1fr; } }

/* An action written inline beside a status ("No sign-in yet · Invite"). */
.signin-status form.inline { display: inline; margin: 0; }
.link-action { background: none; border: 0; padding: 0; font: inherit; font-weight: 600; color: var(--navy); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.link-action:hover { color: var(--navy-hover); }
.link-action:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; border-radius: 2px; }

/* National calendar: a month grid (a day-by-day list on phones) or a week list. */
.cal-bar { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s3); margin-bottom: var(--s3); }
.cal-nav { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.cal-nav select { min-height: 42px; }
.cal-title { margin: 0 var(--s2); font-size: 1.25rem; min-width: 9.5rem; text-align: center; }
.cal-key { display: flex; flex-wrap: wrap; gap: var(--s4); color: var(--text-2); margin: 0 0 var(--s3); }
.cal-key > span { display: inline-flex; align-items: center; gap: 6px; }
.cal-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--gold); }
.cal-dot.event { background: var(--navy); }
.cal-dot.meeting { background: var(--ok); }
.cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; background: var(--border); gap: 1px; }
.cal-head { background: var(--surface-2); padding: var(--s2); font-size: var(--fs-small); font-weight: 600; color: var(--text-2); text-align: center; }
.cal-day { background: var(--surface); min-height: 7.5rem; padding: 6px; display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.cal-day.out { background: var(--bg); }
.cal-day.out .cal-num { color: var(--text-2); opacity: .6; }
.cal-num { align-self: flex-end; font-size: var(--fs-small); font-weight: 600; color: var(--text-2); text-decoration: none; width: 1.8rem; height: 1.8rem; display: inline-flex; align-items: center; justify-content: center; border-radius: 50%; }
.cal-num:hover { background: var(--surface-2); color: var(--text); }
.cal-day.today .cal-num { background: var(--navy); color: var(--surface); }
.cal-chip { display: block; font-size: .8125rem; line-height: 1.3; padding: 2px 6px; border-radius: var(--r-sm); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-decoration: none; color: var(--text); border-left: 3px solid var(--gold); background: var(--warn-bg); }
.cal-chip.event { border-left-color: var(--navy); background: var(--info-bg); }
.cal-chip.meeting { border-left-color: var(--ok); background: var(--ok-bg); }
a.cal-chip:hover { filter: brightness(1.15); }
.cal-more { font-size: .8125rem; color: var(--text-2); padding-left: 6px; }
.cal-agenda { display: none; }
.cal-agenda-day h3, .cal-week-day h3 { font-size: 1rem; margin: var(--s4) 0 var(--s2); }
.cal-agenda-day h3.today, .cal-week-day.today h3 { color: var(--navy); }
.cal-week { display: grid; gap: var(--s2); }
.cal-week-day { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: var(--s2) var(--s4) var(--s3); }
.cal-week-day.today { border-color: var(--navy); }
.cal-week-day h3 { margin-top: var(--s2); }
.cal-row { display: flex; align-items: flex-start; gap: var(--s3); }
.cal-row > .cal-dot { margin-top: .45rem; }
@media (max-width: 760px) {
  .cal-grid { display: none; }
  .cal-agenda { display: block; }
  .cal-title { min-width: 0; font-size: 1.125rem; }
}

/* Board Overview: four headline numbers, resolution follow-through and meeting readiness. */
.stats.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stats .v.warn { color: var(--warn); }
.ok-text { color: var(--ok); }
.bad-text { color: var(--bad); }
@media (max-width: 1100px) and (min-width: 761px) {
  .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--s4); }
  .stats.four a:nth-child(3) { padding-left: 0; border-left: 0; }
}
.ft-lede { margin: 0 0 var(--s3); color: var(--text-2); }
.ft-lede strong { color: var(--text); font-size: 1.25rem; font-weight: 600; margin-right: 2px; }
.ft-bar { display: flex; gap: 3px; height: 14px; border-radius: 999px; overflow: hidden; background: var(--surface-2); }
.ft-seg { display: block; min-width: 6px; }
.ft-seg:hover { filter: brightness(1.2); }
.ft-seg.completed, .ft-dot.completed { background: var(--ok); }
.ft-seg.in_progress, .ft-dot.in_progress { background: var(--info); }
.ft-seg.not_started, .ft-dot.not_started { background: var(--neutral-bg); box-shadow: inset 0 0 0 1px var(--border-strong); }
.ft-seg.overdue, .ft-dot.overdue { background: var(--bad); }
.ft-key { list-style: none; margin: var(--s3) 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s1) var(--s4); }
.ft-key a { display: flex; align-items: center; gap: var(--s2); color: var(--text-2); text-decoration: none; padding: 4px 0; font-size: var(--fs-small); }
.ft-key a:hover { color: var(--text); }
.ft-key strong { margin-left: auto; color: var(--text); font-variant-numeric: tabular-nums; }
.ft-dot { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.ready-list { list-style: none; margin: 0 0 var(--s4); padding: 0; display: grid; gap: 6px; font-size: var(--fs-small); color: var(--text-2); }
.ready-list li { display: flex; gap: var(--s2); align-items: baseline; }
.rd-mark { width: 1.1rem; flex: none; text-align: center; font-weight: 700; color: var(--text-2); }
.ready-list li.ok .rd-mark { color: var(--ok); }
.ready-list li.warn .rd-mark { color: var(--warn); }
.followup { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4); margin-bottom: var(--s5); }
@media (max-width: 760px) { .followup { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .stats.four { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--s4); }
  .stats.four .v { font-size: 1.75rem; }
}
