/* Visual language matched to govern.staratlas.com (Lockers / Treasury / Proposals):
   tokens use the same names and values as that site (canvas / label / border / action),
   both of its themes follow the OS setting exactly as govern does,
   cards carry its 6/6/40/6 cut corner and buttons its chamfered bottom-right edge.

   Fonts: govern uses licensed faces (Tungsten, Industry, Roobert). This site ships free
   lookalikes and lists the brand names first, so if the DAO hosts it with licensed font
   files (add @font-face rules for those family names), they are used automatically. */
:root {
  /* govern light theme */
  --canvas-primary: rgb(255, 255, 255);
  --canvas-secondary: rgb(250, 250, 250);
  --canvas-tertiary: rgb(232, 231, 227);
  --canvas-quaternary: rgb(203, 201, 194);
  --label-primary: rgb(58, 58, 64);
  --label-secondary: rgb(93, 93, 96);
  --label-tertiary: rgb(139, 139, 141);
  --headline-primary: rgb(38, 39, 43);
  --border-primary: rgb(204, 204, 204);
  --border-secondary: rgb(223, 223, 223);
  --border-tertiary: rgb(240, 240, 240);
  --action-primary: rgb(233, 80, 69);
  --action-secondary: rgb(241, 141, 134);
  --universal-brand: rgb(233, 80, 69);
  --green-primary: rgb(115, 142, 60);
  --red-primary: rgb(226, 107, 67);
  --yellow-text: rgb(150, 128, 20);
  --purple-primary: rgb(130, 99, 216);
  --atlas-text: rgb(4, 214, 235);   /* govern: same in both themes; used for chart marks only */
  --usdc-text: rgb(39, 117, 202);
  --address: rgb(255, 137, 98);     /* Solana addresses, both themes */

  /* roles used by the page */
  --bg: var(--canvas-tertiary);
  --surface: var(--canvas-primary);
  --surface-2: var(--canvas-secondary);
  --ink: var(--label-primary);
  --ink-head: var(--headline-primary);
  --ink-2: var(--label-secondary);
  --muted: var(--label-tertiary);
  --line: var(--border-tertiary);
  --line-strong: var(--border-primary);
  --accent: var(--action-primary);
  --accent-ink: var(--action-primary);
  --accent-soft: color-mix(in srgb, var(--action-primary) 12%, transparent);
  --good: var(--green-primary);
  --warn: var(--yellow-text);
  --crit: var(--red-primary);
  --info: var(--purple-primary);
  --good-soft: color-mix(in srgb, var(--good) 14%, transparent);
  --warn-soft: color-mix(in srgb, var(--warn) 16%, transparent);
  --crit-soft: color-mix(in srgb, var(--crit) 14%, transparent);
  --info-soft: color-mix(in srgb, var(--info) 14%, transparent);
  /* Editor-only elements (visible after Editor sign-in): a blue tint marks what visitors don't see. */
  --editor: var(--usdc-text);
  /* Pages or sections still being built ("Under development"): red, their figures are not to be relied on yet. */
  --dev: var(--crit);
  /* A budget used beyond its cap (e.g. the Foundation's yearly budget). */
  --over-budget: var(--usdc-text);
  --editor-soft: color-mix(in srgb, var(--editor) 16%, var(--surface));
  --series-1: var(--atlas-text);
  --series-2: var(--usdc-text);
  --series-3: var(--action-primary);
  --series-4: var(--purple-primary);
  --yes: var(--green-primary);
  --no: var(--red-primary);
  --abstain: var(--label-tertiary);
  --shadow: none;

  --f-display: "Tungsten", "tungstenBook", "Barlow Condensed", "Arial Narrow", sans-serif;
  --f-head: "Industry", "industryMedium", "Saira", "Segoe UI", sans-serif;
  --f-body: "Roobert", "roobertTrialRegular", "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --radius: 6px;          /* standard corner radius */
  --chamfer: 12px;        /* bottom-right cut on cards, panels, tables */
  --chamfer-sm: 10px;     /* stat tiles, member cards, portraits */
  --chamfer-xs: 8px;      /* small boxes (tooltip, conflict notice) */
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    /* govern dark theme */
    --canvas-primary: rgb(45, 45, 55);
    --canvas-secondary: rgb(36, 36, 46);
    --canvas-tertiary: rgb(27, 27, 36);
    --canvas-quaternary: rgb(22, 22, 29);
    --label-primary: rgb(241, 245, 252);
    --label-secondary: rgb(196, 196, 210);
    --label-tertiary: rgb(147, 147, 165);
    --headline-primary: rgb(255, 255, 255);
    --border-primary: rgb(62, 62, 75);
    --border-secondary: rgb(55, 55, 68);
    --border-tertiary: rgb(49, 49, 61);
    --action-primary: rgb(245, 192, 98);
    --action-secondary: rgb(203, 161, 88);
    --universal-brand: rgb(50, 254, 255);
    --green-primary: rgb(192, 222, 133);
    --red-primary: rgb(255, 137, 98);
    --yellow-text: rgb(242, 232, 138);
    --purple-primary: rgb(178, 151, 250);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
/* Always reserve the scrollbar's space, so short pages (Overview) and long ones don't shift
   the centred column sideways when switching tabs. */
html { -webkit-text-size-adjust: 100%; scrollbar-gutter: stable; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font: 14px/1.5 var(--f-body); -webkit-font-smoothing: antialiased;
}
.wrap { max-width: 1180px; margin-inline: auto; padding-inline: 20px; }
a { color: var(--accent-ink); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
a:focus-visible, button:focus-visible, select:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px;
}
h1, h2, h3 { text-wrap: balance; line-height: 1.15; margin: 0; color: var(--ink-head); font-weight: 400; }
p { margin: 0; }
.mono { font-variant-numeric: tabular-nums; }  /* govern sets addresses and dates in the body face */
.addr, a.addr { color: var(--address); white-space: nowrap; }
.copy { display: inline-flex; vertical-align: -2px; margin-left: 4px; padding: 1px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.copy:hover { color: var(--ink); }
.copy.done { color: var(--good); }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
/* Containers: standard radius on three corners, a 45° chamfer at the bottom right.
   clip-path cuts the corner off (border included); a 1px line along the cut is painted as part of
   the background, so the frame stays closed and the line stays put inside scrolling tables.
   Components set background-color only (not the background shorthand), which would erase it. */
.panel, .tbl, .kpi, .member, .avatar, .ed-conflict, .tip {
  --cut: var(--chamfer);
  --cut-line: var(--line);
  border-radius: var(--radius);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
  background-image: linear-gradient(to top left, transparent 50%, var(--cut-line) 50%, var(--cut-line) calc(50% + 1px), transparent calc(50% + 1px));
  background-size: var(--cut) var(--cut);
  background-position: bottom right;
  background-repeat: no-repeat;
  background-origin: border-box;
}
.kpi, .member, .avatar { --cut: var(--chamfer-sm); }
.tip, .ed-conflict { --cut: var(--chamfer-xs); }

.eyebrow { font: 500 12px/1 var(--f-head); letter-spacing: .12em; text-transform: uppercase; color: var(--accent); }

/* Header: canvas bar, gold (dark) / red (light) underline on the active tab, as on govern */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; background: var(--canvas-primary); border-bottom: 1px solid var(--border-primary); }
.top-inner { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding-block: 16px 10px; }
.brand { display: flex; align-items: center; gap: 12px; color: inherit; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-text { display: flex; flex-direction: column; }
.brand h1 { font: 400 clamp(32px, 4.4vw, 44px)/1 var(--f-display); text-transform: uppercase; letter-spacing: .035em; margin-top: 6px; }
/* Star Atlas DAO mark, coloured exactly as govern's header logo: label colour + brand colour */
.logo { width: clamp(40px, 5vw, 52px); height: auto; aspect-ratio: 1; flex: none; }
/* Wide screens: pin the mark to the far left edge, vertically centred on the title row
   (.top-row is the full-width positioned box around that row; the tab bar is outside it).
   Below this width the content column reaches the edge, so the mark stays beside the title. */
.top-row { position: relative; }
@media (min-width: 1320px) {
  /* 68px, anchored at the top-left corner the former 56px centred mark had (top = middle - 28px). */
  .logo { position: absolute; left: 24px; top: calc(50% - 28px); width: 68px; }
}
.logo .svgMainFillColor { fill: var(--label-primary); }
.logo .svgSecondaryFillColor { fill: var(--universal-brand); }
.stamp { font: 12px/1.4 var(--f-body); color: var(--muted); text-align: right; }
.tabs { border-top: 1px solid var(--border-tertiary); }
.tabs-inner { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; }
.tabs-inner::-webkit-scrollbar { display: none; }
.tabs a {
  position: relative; flex: none; padding: 13px 16px 14px; text-decoration: none; color: var(--ink-2);
  font: 500 13px/1 var(--f-body); white-space: nowrap;
}
.tabs a:hover { color: var(--ink); text-decoration: none; }
.tabs a[aria-current="page"] { color: var(--accent); }
.tabs a[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: var(--accent); }

main { padding-block: 28px 44px; display: flex; flex-direction: column; gap: 30px; }
main:focus { outline: none; }
#notice { padding-top: 20px; }

/* Section headings: Tungsten-style page title, Industry-style uppercase section heads */
.sec { display: flex; flex-direction: column; gap: 14px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.sec-head h2 { font: 400 clamp(30px, 3.6vw, 40px)/1.05 var(--f-display); text-transform: uppercase; letter-spacing: .035em; }
.sec-head h3 { font: 500 clamp(16px, 1.8vw, 19px)/1.25 var(--f-head); text-transform: uppercase; letter-spacing: .05em; }
.lede { color: var(--ink-2); max-width: 78ch; font-size: 14px; }
.src { font: 12px/1.4 var(--f-body); color: var(--muted); }

/* KPI tiles: label on top, big condensed figure, small unit (govern stat style) */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; }
.kpi { background-color: var(--surface); border: 1px solid var(--line); padding: 14px 16px 16px; display: flex; flex-direction: column; gap: 2px; }
.kpi .k { font: 300 13px/1.3 var(--f-body); color: var(--ink-2); }
.kpi .v { font: 400 38px/1.05 var(--f-display); font-variant-numeric: tabular-nums; letter-spacing: .02em; color: var(--ink-head); }
.kpi .v small { font: 400 13px var(--f-body); color: var(--muted); margin-left: 6px; letter-spacing: 0; }
.kpi .s { font-size: 12.5px; color: var(--ink-2); }

/* Header right side: data stamp + editor sign-in */
.top-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.editbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; justify-content: flex-end; }
/* Short status left of the editor buttons: a fixed slot, reserved when empty, so nothing in the header moves. */
.ed-note { display: inline-flex; align-items: center; justify-content: flex-end; gap: 5px; width: 220px; font-size: 12.5px; color: var(--muted); white-space: nowrap; overflow: hidden; cursor: default; }
.ed-note.err { color: var(--crit); }
.ed-note:empty { cursor: auto; }
.ed-note .info-i { flex: none; width: 13px; height: 13px; }
.editbar:empty { display: none; }

/* Buttons: govern's chamfered bottom-right edge */
/* Buttons and dropdowns get the same chamfer + cut line as containers; --cut-line follows the
   border colour of each state (normal, hover, primary, danger). */
.btn, select, input[type="search"] {
  --cut: 7px;
  --cut-line: var(--border-secondary);
  clip-path: polygon(0 0, 100% 0, 100% calc(100% - var(--cut)), calc(100% - var(--cut)) 100%, 0 100%);
  background-image: linear-gradient(to top left, transparent 50%, var(--cut-line) 50%, var(--cut-line) calc(50% + 1px), transparent calc(50% + 1px));
  background-size: var(--cut) var(--cut);
  background-position: bottom right;
  background-repeat: no-repeat;
  background-origin: border-box;
}
.btn {
  font: 500 12.5px/1.2 var(--f-body); color: var(--accent); background-color: var(--surface);
  border: 1px solid var(--cut-line); border-radius: 4px; padding: 6px 14px 7px; cursor: pointer;
}
.btn:hover { --cut-line: var(--action-secondary); }
.btn.primary { --cut-line: var(--accent); background-color: var(--accent); color: var(--canvas-primary); }
.btn.danger { --cut-line: color-mix(in srgb, var(--crit) 45%, transparent); color: var(--crit); }
.btn.danger:hover { --cut-line: var(--crit); }
.btn.sm { font-size: 11.5px; padding: 3px 10px 4px; margin-left: 6px; }
/* Buttons that belong together (e.g. a formatting toolbar group) sit close; groups keep the row's gap. */
.btn-group { display: inline-flex; gap: 2px; }
.btn-group .btn.sm { margin-left: 0; }
.btn svg { width: 13px; height: 13px; vertical-align: -2px; }
.btn:disabled { opacity: .5; cursor: progress; }

/* Editor forms */
.edform { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); gap: 10px 14px; margin-top: 10px; max-width: 760px; }
.edform .wide { grid-column: 1 / -1; }
.edform label { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--ink-2); }
.edform label.chk { flex-direction: row; align-items: center; gap: 8px; font-size: 13px; }
.edform input:not([type="checkbox"]), .edform textarea, .edform select {
  font: 13px var(--f-body); color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong);
  border-radius: 4px; padding: 7px 9px; width: 100%; clip-path: none; background-image: none;
}
.edform textarea { resize: vertical; }
.edact { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 4px 0 0; }
.ed-err { color: var(--crit); font-size: 12.5px; }
.ed-ok { color: var(--good); font-size: 12.5px; }
.ed-conflict { --cut-line: color-mix(in srgb, var(--warn) 45%, transparent); border: 1px solid var(--cut-line); background-color: var(--warn-soft); padding: 10px 12px; font-size: 13px; color: var(--ink); display: flex; flex-direction: column; gap: 6px; }
/* Editor panels and the buttons that open editing actions carry the editor tint. */
.panel.edpanel { background-color: var(--editor-soft); --cut-line: color-mix(in srgb, var(--editor) 50%, var(--line)); border-color: var(--cut-line); }
.btn.ed-btn { background-color: var(--editor-soft); --cut-line: color-mix(in srgb, var(--editor) 45%, var(--line)); }
.btn.ed-btn:hover { --cut-line: var(--editor); }
.kpi.ed-only, .panel.ed-only { background-color: var(--editor-soft); --cut-line: color-mix(in srgb, var(--editor) 50%, var(--line)); border-color: var(--cut-line); }
tr.detail.ed-only > td { background-color: var(--editor-soft); }
.ed-zone { display: block; background-color: var(--editor-soft); border-radius: var(--radius); padding: 12px 16px 14px; }
.editbar .ed-zone { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 0; background-color: transparent; }
.tabs a.ed-only { background-color: var(--editor-soft); }
.tabs a.all-clear { background-color: var(--good-soft); }
.tabs a.has-critical { background-color: var(--crit-soft); }
tr.ed-only > td { background-color: var(--editor-soft); }
.preview-info { display: flex; flex-direction: column; gap: 10px; }
.preview-info ul { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; color: var(--ink-2); max-width: 90ch; }
.preview-info p { color: var(--ink-2); max-width: 90ch; }

/* Council members */
.members { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 12px; }
.member { background-color: var(--surface); border: 1px solid var(--line); padding: 14px 16px; display: flex; gap: 14px; align-items: center; }
.avatar { --cut-line: var(--line-strong); position: relative; flex: none; width: 60px; height: 60px; overflow: hidden; background-color: var(--surface-2); border: 1px solid var(--line-strong); display: grid; place-items: center; }
/* The portrait covers the background, so the cut line is drawn on top of it here. */
.avatar::after { content: ""; position: absolute; right: -1px; bottom: -1px; width: var(--cut); height: var(--cut); z-index: 1; pointer-events: none; background: linear-gradient(to top left, transparent 50%, var(--cut-line) 50%, var(--cut-line) calc(50% + 1px), transparent calc(50% + 1px)); }
.avatar span { font: 400 24px/1 var(--f-display); letter-spacing: .04em; color: var(--muted); }
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.who { display: flex; flex-direction: column; gap: 3px; min-width: 0; align-items: flex-start; }
.who .nm { font: 500 16px/1.25 var(--f-body); color: var(--ink-head); overflow-wrap: anywhere; }
.who .rl { font-size: 12.5px; color: var(--ink-2); }
.who .links { font-size: 12px; color: var(--muted); }
.who .links:empty { display: none; }

/* Past Councils: one card per term with a compact roster */
.terms { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 330px), 1fr)); gap: 14px; }
.term { display: flex; flex-direction: column; gap: 10px; }
.term-head { display: flex; flex-direction: column; gap: 6px; }
.term-label { font: 400 28px/1 var(--f-display); text-transform: uppercase; letter-spacing: .035em; color: var(--ink-head); }
.roster { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.roster li { display: flex; align-items: center; gap: 10px; }
.roster .avatar { --cut: 7px; width: 36px; height: 36px; border-radius: 4px; }
.roster .avatar span { font-size: 15px; }
.roster .who { gap: 0; }
.roster .who .nm { font-size: 13.5px; }
.roster .who .rl, .roster .who .links { font-size: 11.5px; }

/* Panels: govern card (canvas, hairline border, 6/6/40/6 cut corner) */
.panel { background-color: var(--surface); border: 1px solid var(--line); padding: 18px 20px 24px; }
.panel.flush { padding: 0 0 18px; overflow: hidden; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 460px), 1fr)); gap: 16px; }

/* Tables inside a card frame */
.tbl { overflow-x: auto; border: 1px solid var(--line); background-color: var(--surface); padding-bottom: 12px; }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
thead th { font: 500 11px/1.3 var(--f-body); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: transparent; border-bottom: 1px solid var(--line-strong); white-space: nowrap; }
/* Table headers stay pinned under the page header while their table scrolls past. That needs the
   table to lay out in the page, not in a sideways scroller, so app.js marks a table that does not
   fit its width with .scroll: that one scrolls sideways as before and its header is not pinned.
   --top-h is the page header's exact (fractional) height (app.js); the header tucks 1px under the
   page header's bottom border so no strip of rows shows between them. The shadow redraws the
   bottom line, since a collapsed border does not travel with a pinned cell. */
.tbl:not(.scroll) { overflow-x: visible; }
.tbl:not(.scroll) thead th { position: sticky; top: calc(var(--top-h, 1px) - 1px); z-index: 1; background-color: var(--surface); box-shadow: inset 0 -1px 0 var(--line-strong); }
/* Every table row, on every page: rows are separated by a strip of page background, and the row
   under the mouse lights up so its buttons are easy to place. */
tbody td { border-bottom: 2px solid var(--bg); }
/* A table's total row. The table frame's 12px bottom padding reads as part of the last row, so the
   text is moved down to sit in the middle of both; its label is plain grey text. */
tbody tr.total > td { padding-top: 16px; padding-bottom: 4px; }
tbody tr.total .total-label { color: var(--ink-2); }
tbody tr:not(.detail):not(.total):hover > td { background-color: var(--surface-2); }
tbody tr.ed-only:not(.detail):hover > td { background-color: color-mix(in srgb, var(--editor) 24%, var(--surface)); }
tbody tr:last-child td { border-bottom: 0; }
/* A row that continues in the next one (tr.lead + its follower) reads and hovers as one entry. */
tbody tr.lead > td { border-bottom: 0; padding-bottom: 2px; }
tbody tr.lead + tr > td { padding-top: 2px; }
tbody tr.lead:has(+ tr:hover) > td { background-color: var(--surface-2); }
tbody tr.lead:hover + tr > td { background-color: var(--surface-2); }
td.r, th.r { text-align: right; }
td.n { font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
td.pipc { font-weight: 500; white-space: nowrap; }
tr.click { cursor: pointer; }
/* Movements list: match chips on their own line, the row's buttons below them. */
.mline { display: block; }
.mline:not(:last-child) { margin-bottom: 6px; }
/* Keep a row's chips and buttons on one line; the Why column wraps instead. */
td.mcell { white-space: nowrap; }
.mline + .btn.sm { margin-left: 0; }
.nw { white-space: nowrap; }
.dy { display: block; white-space: nowrap; }
/* A matched PIP and its match chip ("PIP-29  matches sheet"). */
a.mono + .chip { margin-left: 5px; }
/* A tag after a name in a table cell (e.g. Multisig on a wallet). */
td > strong + .chip { margin-left: 10px; }
tr.detail td { background: var(--surface-2); padding: 14px 16px 18px; }
.sub { font-size: 12px; color: var(--muted); }
.blank { color: var(--muted); font-style: italic; }

/* Chips */
.chip { display: inline-block; font: 500 11px/1.6 var(--f-body); padding: 0 8px; border-radius: 4px; white-space: nowrap; border: 1px solid var(--line-strong); background: transparent; color: var(--ink-2); }
.chip.good { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.chip.warn { background: var(--warn-soft); color: var(--warn); border-color: color-mix(in srgb, var(--warn) 40%, transparent); }
.chip.crit { background: var(--crit-soft); color: var(--crit); border-color: color-mix(in srgb, var(--crit) 40%, transparent); }
.chip.dev  { background: color-mix(in srgb, var(--dev) 16%, transparent); color: var(--dev); border-color: color-mix(in srgb, var(--dev) 45%, transparent); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
.sec-head .title-row { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.dev-note { color: var(--dev); font-weight: 500; }
/* A projected balance below zero. */
.short { color: var(--crit); }
.chip.acc  { background: var(--info-soft); color: var(--info); border-color: color-mix(in srgb, var(--info) 40%, transparent); }

/* Progress bar */
.bar { position: relative; height: 4px; border-radius: 2px; background: var(--line-strong); overflow: hidden; min-width: 70px; }
.bar > span { position: absolute; inset: 0 auto 0 0; background: var(--accent); }
.bar.done > span { background: var(--good); }
.bar.over > span { background: var(--over-budget); }
span.over { color: var(--over-budget); }

/* Vote split bar */
.split { display: flex; height: 6px; border-radius: 3px; overflow: hidden; background: var(--line-strong); min-width: 120px; }
.split > span { display: block; height: 100%; }
/* Inside a table row the bar sits centred on the first text line. */
td > .split { margin-block: calc((1lh - 6px) / 2); }
/* Proposal titles: every row is as tall as a two-line title, so lists of PIPs keep an even rhythm. */
.t2 { min-height: 2lh; }

/* Controls: chamfered bottom-right corner like govern's buttons */
.controls { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
/* A filter field that takes the room its row leaves. */
.controls .grow { flex: 1 1 220px; min-width: 0; }
select, input[type="search"] {
  --cut: 8px;
  font: 500 12.5px var(--f-body); color: var(--accent); background-color: var(--surface); border: 1px solid var(--cut-line);
  border-radius: 4px; padding: 7px 26px 8px 12px;
}
select:hover { --cut-line: var(--action-secondary); }
/* A text field sits 2px lower than a select with the same padding; this evens out a row of controls. */
input[type="search"] { padding-block: 8px 9px; }
input[type="search"]::placeholder { color: var(--muted); }
button.link { font: inherit; color: var(--accent); background: none; border: 0; padding: 0; cursor: pointer; }
/* Meeting minutes (Discord markdown) */
.md { font-size: 13px; line-height: 1.55; color: var(--ink); max-width: 80ch; margin-top: 6px; }
/* The Help page: the manual uses the full width of the page. */
.md.manual { max-width: none; font-size: 14px; }
.manual-ch .sec-head h3 { color: var(--accent); }
.md.manual .note { max-width: none; margin: 4px 0 12px; font-size: 14px; color: var(--ink); }
.md.manual .note > :last-child { margin-bottom: 0; }
.note.warn { border-left-color: var(--warn); background: var(--warn-soft); }
.md p, .md ul, .md ol, .md blockquote, .md pre { margin: 0 0 8px; }
.md h4, .md h5, .md h6 { font-family: var(--f-body); font-weight: 500; color: var(--ink-head); margin: 14px 0 4px; }
.md h4 { font-size: 17px; }
.md h5 { font-size: 15px; }
.md h6 { font-size: 13px; }
.md ul, .md ol { padding-left: 20px; }
.md li > ul, .md li > ol { margin: 0; }
.md blockquote { padding-left: 10px; border-left: 3px solid var(--line-strong); color: var(--ink-2); }
.md code { font-family: ui-monospace, Consolas, monospace; font-size: 12px; background-color: var(--surface); padding: 1px 4px; border-radius: 3px; }
.md pre { background-color: var(--surface); padding: 8px 10px; overflow-x: auto; }
.md pre code { padding: 0; background: none; }
.md .spoiler { background-color: var(--line-strong); color: transparent; border-radius: 3px; cursor: pointer; }
.md .spoiler:hover, .md .spoiler:focus { background-color: var(--surface); color: inherit; }
button.link:hover { text-decoration: underline; text-underline-offset: 2px; }
button.link.muted { color: var(--muted); }
/* An Overview card that opens its page. */
.kpi[data-go] { cursor: pointer; }
.kpi[data-go]:hover { border-color: var(--line-strong); }

/* Charts */
.chart { width: 100%; }
.chart svg { display: block; width: 100%; height: auto; overflow: visible; }
.chart .axis text, .chart .lbl { font: 11px var(--f-body); fill: var(--muted); }
.chart .grid line { stroke: var(--line); stroke-width: 1; }
.chart .base { stroke: var(--line-strong); }
.chart .marker line { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .marker text { font: 11px var(--f-body); fill: var(--ink-2); }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--ink-2); margin-top: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 2px; margin-right: 6px; vertical-align: -1px; }
.tip { --cut-line: var(--line-strong); position: fixed; z-index: 50; pointer-events: none; background-color: var(--canvas-primary); color: var(--ink); border: 1px solid var(--line-strong); font: 12px/1.45 var(--f-body); padding: 8px 10px; max-width: 280px; }

/* Health list */
.flags { display: flex; flex-direction: column; }
/* Data health rows: same separator and hover as table rows. */
.flag { display: grid; grid-template-columns: 88px 92px 1fr; gap: 12px; padding: 11px 16px; border-top: 2px solid var(--bg); align-items: start; }
.flag:hover { background-color: var(--surface-2); }
.ed-only .flag:hover { background-color: color-mix(in srgb, var(--editor) 24%, var(--surface)); }
.flag:first-child { border-top: 0; }
.flag p { color: var(--ink-2); font-size: 13px; }

.note { border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 0 6px 6px 0; padding: 11px 14px; font-size: 13px; color: var(--ink-2); max-width: 90ch; }

.foot { border-top: 1px solid var(--line-strong); padding-block: 18px 40px; font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; }
.foot .mono { word-break: break-all; }

@media (max-width: 640px) {
  .flag { grid-template-columns: 1fr; gap: 4px; }
  .stamp { text-align: left; }
  .top-right { align-items: flex-start; }
  .editbar { justify-content: flex-start; }
  .ed-note { width: auto; justify-content: flex-start; }
  th, td { padding: 8px 9px; }
  .kpi .v { font-size: 32px; }
}
/* A section reached by its anchor or the section navigation stops below the sticky header. */
.sec, .sec-head { scroll-margin-top: calc(var(--top-h, 0px) + 12px); }
/* A linked table row lands below the page header and the table's pinned column headers. */
tr[id] { scroll-margin-top: calc(var(--top-h, 0px) + 48px); }
/* A link that reads as plain text until hovered (e.g. a meeting's date, its direct link). */
a.plain { color: inherit; }
a.plain:hover { color: var(--accent-ink); }
/* Section navigation beside the page, only where the screen leaves room right of the content. */
.toc { display: none; }
@media (min-width: 1560px) {
  .toc:not([hidden]) { display: flex; flex-direction: column; gap: 2px; position: fixed; z-index: 5; top: calc(var(--top-h, 0px) + 24px); left: calc(50% + 606px); width: min(220px, calc(50% - 622px)); max-height: calc(100vh - var(--top-h, 0px) - 48px); overflow-y: auto; border-left: 1px solid var(--line); }
}
.toc-link { display: block; font: 400 13px/1.35 var(--f-body); color: var(--ink-2); text-decoration: none; border-left: 2px solid transparent; margin-left: -1px; padding: 4px 0 4px 12px; }
.toc-link.toc-top { color: var(--ink); font-weight: 500; }
.toc-link:hover { color: var(--accent); }
.toc-link.on { color: var(--accent); border-left-color: var(--accent); }
/* A video player opened in a table's detail row. */
.video-frame { display: block; width: 100%; max-width: 960px; aspect-ratio: 16 / 9; border: 0; margin-inline: auto; }
/* A status that is still running pulses slowly. */
.pulse { animation: pulse 2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .35; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }
