/* CodeNav Registry: docs/design/02-interface.md */
:root {
  --ink: #16202e;
  --ink-2: #3c4757;
  --muted: #5b6676;
  --paper: #fff;
  --ground: #f2f3f5;
  --rule: #c5cbd4;
  --rule-soft: #e4e7eb;
  --band: #1b2d55;
  --band-2: #24396a;
  --head: #eef0f3;
  --link: #1d3f8a;
  --link-hover: #0f2763;
  --accent: #b45309;
  --for: #1b2d55;
  --against: #b45309;
  --pending: #d5dae1;
  --ok: #1f6b3a;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "IBM Plex Sans", Arial, Helvetica, sans-serif;
  --mono: "IBM Plex Mono", Consolas, "Courier New", monospace;
}
*,
*::before,
*::after {
  box-sizing: border-box;
}
html {
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  color: var(--ink);
  font: 13px/1.45 var(--sans);
  background: var(--paper);
}
table {
  border-collapse: collapse;
  width: 100%;
}
h1,
h2,
h3 {
  margin: 0;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.n {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.mono {
  font-family: var(--mono);
  font-size: 12px;
}
.muted {
  color: var(--muted);
}
.small {
  font-size: 12px;
}
.warn {
  color: var(--accent);
}
.scroll {
  overflow-x: auto;
}

/* Links */
a {
  color: var(--link);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-decoration-color: rgb(29 63 138 / 0.35);
}
a:hover {
  color: var(--link-hover);
  text-decoration-color: currentColor;
}
a:focus-visible,
.btn:focus-visible,
.input:focus-visible {
  outline: 2px solid var(--link);
  outline-offset: 2px;
}

/* Controls */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  font: 500 13px/1 var(--sans);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
  cursor: pointer;
  white-space: nowrap;
  transition:
    background-color 0.12s,
    border-color 0.12s;
}
.btn:hover {
  background: var(--head);
  border-color: #a9b1bd;
}
.btn:active {
  background: #e3e6ea;
}
.btn:disabled {
  color: #8a93a0;
  background: var(--head);
  border-color: var(--rule-soft);
  cursor: not-allowed;
}
.btn-primary {
  color: #fff;
  background: var(--band);
  border-color: var(--band);
}
.btn-primary:hover {
  background: var(--band-2);
  border-color: var(--band-2);
}
.btn-primary:disabled {
  color: #c9cfd9;
  background: #5d6a85;
  border-color: #5d6a85;
}
.btn-small {
  height: 24px;
  padding: 0 8px;
  font-size: 12px;
  margin-left: 6px;
}
.btn-dark {
  color: #fff;
  background: transparent;
  border-color: rgb(255 255 255 / 0.45);
}
.btn-dark:hover {
  background: rgb(255 255 255 / 0.1);
  border-color: #fff;
}
.input {
  height: 30px;
  padding: 0 8px;
  font: 13px var(--sans);
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: 3px;
}
.input-dark {
  color: #fff;
  background: rgb(255 255 255 / 0.08);
  border-color: rgb(255 255 255 / 0.35);
  width: 240px;
  max-width: 100%;
}
.input-dark::placeholder {
  color: #b8c2d6;
}

/* Tables */
table.grid th,
table.grid td {
  padding: 5px 8px;
  border-bottom: 1px solid var(--rule-soft);
  text-align: left;
  vertical-align: top;
}
table.grid th {
  font-weight: 600;
  font-size: 12px;
  color: var(--ink-2);
  background: var(--head);
  border-bottom: 1px solid var(--rule);
  white-space: nowrap;
}
table.grid .n {
  text-align: right;
}
table.grid td.wrap {
  white-space: normal;
}
table.grid tfoot td {
  font-weight: 600;
  border-top: 1px solid var(--rule);
  border-bottom: none;
}
table.grid.compact td,
table.grid.compact th {
  padding: 4px 8px;
}
table.kv td {
  white-space: normal;
}
table.fin {
  font-variant-numeric: tabular-nums;
}
table.fin th {
  font-size: 12px;
  font-weight: 600;
  padding: 4px 8px;
  border-bottom: 2px solid var(--ink);
  text-align: left;
  white-space: nowrap;
}
table.fin th.n {
  text-align: right;
}
table.fin td {
  padding: 4px 8px;
  border-bottom: 1px solid var(--rule-soft);
}
table.fin tr.sec td {
  font-weight: 600;
  padding-top: 12px;
  border-bottom: none;
  color: var(--ink-2);
}
table.fin tr.line td:first-child {
  padding-left: 22px;
}
table.fin tr.sub td {
  font-weight: 600;
  border-top: 1px solid var(--ink);
}
table.fin tr.tot td {
  font-weight: 700;
  border-top: 1px solid var(--ink);
  border-bottom: 3px double var(--ink);
}
caption.cap {
  caption-side: top;
  text-align: left;
  font-weight: 600;
  padding: 14px 0 6px;
}

/* Key figures (B) */
.kpis {
  display: flex;
  flex-wrap: wrap;
  margin: 0 0 20px;
  border: 1px solid var(--rule);
  background: var(--paper);
}
.kpi {
  padding: 8px 14px;
  border-right: 1px solid var(--rule-soft);
  min-width: 140px;
  flex: 1 1 140px;
}
.kpi:last-child {
  border-right: none;
}
.kpi dt {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.kpi dd {
  margin: 0;
}
.kpi-value {
  font-size: 18px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.kpi-value.sm {
  font-size: 14px;
}
.kpi-sub {
  font-size: 11px;
  color: var(--muted);
}

/* Record (A) */
.mast {
  background: var(--band);
  color: #fff;
}
.mast-inner,
.menu-inner {
  max-width: 1152px;
  margin: 0 auto;
  padding: 0 16px;
}
.mast-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: center;
  justify-content: space-between;
  padding-top: 10px;
  padding-bottom: 10px;
}
.mast-name {
  display: flex;
  gap: 14px;
  align-items: baseline;
  flex-wrap: wrap;
  color: #fff;
  text-decoration: none;
}
.mast-name:hover {
  color: #fff;
}
.mast-co {
  font: 700 19px/1.2 var(--serif);
  letter-spacing: 0.03em;
}
.mast-sub {
  font: 13px var(--serif);
  font-variant: small-caps;
  letter-spacing: 0.06em;
  color: #d3dae8;
}
.mast-search {
  display: flex;
  gap: 6px;
  align-items: center;
}
.menu {
  background: #e8eaee;
  border-bottom: 1px solid var(--rule);
}
.menu-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 0 4px;
}
.menu a {
  display: block;
  padding: 8px 10px 6px;
  color: var(--ink-2);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  font-weight: 500;
}
.menu a:hover {
  color: var(--ink);
  background: #dfe2e7;
}
.menu a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}
.menu .menu-end {
  margin-left: auto;
}
.page {
  max-width: 1152px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}
.record .page {
  font-size: 14px;
}
.foot {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 12px;
  padding-bottom: 28px;
  border-top: 1px solid var(--rule);
  font-size: 12px;
  color: var(--muted);
}
.doc-head {
  border-bottom: 3px double var(--ink);
  padding-bottom: 12px;
  margin-bottom: 16px;
}
.title {
  font: 700 26px/1.2 var(--serif);
}
.lede {
  font: 15px/1.5 var(--serif);
  color: var(--ink-2);
  margin: 6px 0 0;
  max-width: 70ch;
}
.crumb {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 12px;
}
.flag {
  display: inline-block;
  border: 1px solid var(--accent);
  color: var(--accent);
  padding: 0 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 18px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: flex-end;
  margin: 0 0 12px;
}
.filters label {
  display: flex;
  flex-direction: column;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
}
.filters-end {
  margin-left: auto;
  align-self: center;
}
.header-block {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  border: 1px solid var(--rule);
  margin-bottom: 22px;
}
.header-block > div {
  padding: 12px 16px;
}
.header-block > div + div {
  border-left: 1px solid var(--rule);
}
.label {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.form-type {
  font: 700 20px/1.3 var(--serif);
  margin: 2px 0 8px;
}
.facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 3px 14px;
  margin: 0;
  font-size: 13px;
}
.facts dt {
  color: var(--muted);
}
.facts dd {
  margin: 0;
}
.h-small {
  font: 600 15px/1.3 var(--serif);
  margin: 0 0 8px;
}
.item {
  font: 700 18px/1.3 var(--serif);
  margin: 30px 0 10px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--rule);
}
.grid.docs {
  margin-bottom: 8px;
}
.report {
  margin-top: 28px;
}
.cover {
  border-top: 3px double var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 18px 0;
  text-align: center;
  margin-bottom: 24px;
  font-family: var(--serif);
}
.cover h1 {
  font-size: 30px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 6px 0;
}
.cover-co {
  font-size: 13px;
  letter-spacing: 0.1em;
}
.cover-title {
  font-size: 16px;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  margin-bottom: 6px;
}
.stmt-head {
  text-align: center;
  font-family: var(--serif);
  font-size: 14px;
  margin: 6px 0 10px;
}
.prose {
  font: 15px/1.6 var(--serif);
  max-width: 80ch;
  margin: 0 0 10px;
}
.note b {
  font-weight: 600;
}
.two {
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin: 22px 0 0;
  align-items: flex-start;
}
.wide {
  flex: 999 1 520px;
  min-width: 0;
}
.narrow {
  flex: 1 1 340px;
  min-width: 0;
}
figure {
  margin: 0;
}
figcaption {
  font: 600 15px/1.3 var(--serif);
  margin: 6px 0 10px;
}
.figbox {
  border: 1px solid var(--rule);
  padding: 14px 12px 4px;
}
.checks {
  list-style: none;
  margin: 0 0 8px;
  padding: 0;
  font-size: 13px;
}
.checks li {
  padding: 3px 0;
}
.checks .ok span {
  color: var(--ok);
  font-weight: 700;
}
.checks .no span {
  color: var(--accent);
  font-weight: 700;
}

/* Chart */
.bars-wrap {
  display: flex;
  gap: 6px;
}
.bars-axis {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  font-size: 10px;
  color: var(--muted);
  text-align: right;
  width: 26px;
  transform: translateY(5px);
}
.bars-main {
  flex: 1 1 auto;
  min-width: 0;
}
.bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 0 6px;
  border-bottom: 1px solid var(--ink);
  background: repeating-linear-gradient(
    to top,
    transparent 0 calc(25% - 1px),
    var(--rule-soft) calc(25% - 1px) 25%
  );
}
.bar-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  height: 100%;
  min-width: 0;
}
.bar {
  width: 100%;
  max-width: 40px;
  background: var(--band);
  border-radius: 2px 2px 0 0;
}
.bar-col:hover .bar {
  background: var(--band-2);
}
.bar-value {
  font-size: 10px;
  color: var(--ink-2);
  margin-bottom: 2px;
  white-space: nowrap;
}
.bars-labels {
  display: flex;
  gap: 8px;
  padding: 4px 6px 6px;
}
.bars-labels span {
  flex: 1 1 0;
  text-align: center;
  font-size: 11px;
  color: var(--muted);
}

/* Desk (B) */
.desk {
  background: var(--ground);
}
.deskbar {
  background: var(--band);
  color: #d3dae8;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  align-items: center;
  justify-content: space-between;
  padding: 9px 16px;
}
.deskbar-name {
  display: flex;
  gap: 14px;
  align-items: baseline;
  flex-wrap: wrap;
  color: #fff;
  text-decoration: none;
}
.deskbar-name:hover {
  color: #fff;
}
.deskbar a {
  color: #fff;
  text-decoration-color: rgb(255 255 255 / 0.4);
}
.desk-body {
  display: flex;
  flex-wrap: wrap;
  min-height: calc(100vh - 44px);
}
.sidenav {
  flex: 1 1 180px;
  max-width: 210px;
  background: #1f2a3c;
  padding: 8px 0 20px;
}
.sidenav-title {
  color: #8a97ab;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  padding: 12px 14px 4px;
}
.sidenav a {
  display: block;
  padding: 6px 14px;
  color: #d5dbe4;
  text-decoration: none;
  border-left: 3px solid transparent;
}
.sidenav a:hover {
  background: #28354a;
  color: #fff;
}
.sidenav a[aria-current="page"] {
  background: #28354a;
  color: #fff;
  border-left-color: var(--accent);
}
.desk-main {
  flex: 999 1 640px;
  min-width: 0;
  padding: 14px 16px 32px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.desk-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  justify-content: space-between;
  align-items: flex-end;
}
.eyebrow {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--muted);
}
.desk-title {
  font: 700 22px/1.25 var(--serif);
  margin-top: 2px;
}
.actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.kpis.boxed {
  margin: 0;
}
.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-start;
}
.grow {
  flex: 999 1 460px;
  min-width: 0;
}
.side {
  flex: 1 1 280px;
  min-width: 0;
}
.stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.panel {
  background: var(--paper);
  border: 1px solid var(--rule);
}
.panel-head {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.02em;
  background: var(--head);
  border-bottom: 1px solid var(--rule);
}
.panel-aside {
  font-weight: 400;
  color: var(--muted);
}
.pad {
  padding: 8px 10px;
  margin: 0;
}
.plain {
  list-style: none;
}
.plain li {
  padding: 2px 0;
}
.plain-ol {
  padding-left: 28px;
}
.plain-ol li {
  padding: 2px 0;
}
.callout {
  margin: 12px 0 0;
  padding: 8px 10px;
  background: var(--head);
  border: 1px solid var(--rule-soft);
  line-height: 1.5;
}
.resolution-text {
  font: 15px/1.6 var(--serif);
}
.check {
  font-weight: 600;
  white-space: nowrap;
}
.check.ok {
  color: var(--ok);
}
.check.no {
  color: var(--accent);
}

/* Tally */
.tally {
  margin: 6px 0 2px;
}
.tallybar {
  position: relative;
  display: flex;
  gap: 2px;
  height: 20px;
  background: var(--paper);
}
.seg-for {
  background: var(--for);
}
.seg-out {
  background: repeating-linear-gradient(45deg, #e6e9ee 0 4px, #cfd5dd 4px 6px);
}
.seg-against {
  background: var(--against);
}
.tallybar .threshold {
  position: absolute;
  top: -6px;
  bottom: -6px;
  border-left: 2px solid var(--accent);
  box-shadow: 0 0 0 1px var(--paper);
}
.tally-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  margin-top: 10px;
  font-size: 12px;
}
.key {
  display: inline-block;
  width: 10px;
  height: 10px;
  vertical-align: -1px;
}
.key-threshold {
  width: 2px;
  background: var(--ink);
}

@media (max-width: 640px) {
  .header-block > div + div {
    border-left: none;
    border-top: 1px solid var(--rule);
  }
  .bar-value {
    display: none;
  }
  .sidenav {
    max-width: none;
  }
  .menu .menu-end {
    margin-left: 0;
  }
}
@media print {
  .mast-search,
  .menu,
  .filters {
    display: none;
  }
  .mast {
    background: none;
    color: var(--ink);
    border-bottom: 2px solid var(--ink);
  }
  .mast-name,
  .mast-sub {
    color: var(--ink);
  }
}
.whatif {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}
.whatif label {
  font-weight: 600;
}
.whatif .input {
  width: 120px;
}
td.mono {
  white-space: nowrap;
}

/* ── Desk: states, forms, notices ─────────────────────────────────────── */
.sidenav-off {
  display: block;
  padding: 6px 14px 6px 17px;
  color: #7d8899;
  cursor: default;
}
.flash {
  margin: 0 0 12px;
  padding: 8px 12px;
  border: 1px solid;
  border-left-width: 4px;
  line-height: 1.45;
}
.flash-error {
  background: #fdf3ea;
  border-color: #e7c9a8;
  border-left-color: var(--accent);
  color: #6b3105;
}
.flash-notice {
  background: #eef5f0;
  border-color: #c4dccb;
  border-left-color: var(--ok);
  color: #18432a;
}
.state {
  display: inline-block;
  padding: 1px 7px;
  border: 1px solid var(--rule);
  border-radius: 2px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
  background: var(--paper);
  color: var(--ink-2);
}
.state-circulated {
  border-color: var(--band);
  color: var(--band);
}
.state-passed {
  border-color: var(--ok);
  background: #eef5f0;
  color: var(--ok);
}
.state-failed,
.state-lapsed,
.state-withdrawn {
  border-color: #c9a27c;
  background: #fbf4ec;
  color: #7a3d0a;
}
.form {
  display: grid;
  gap: 14px;
  padding: 14px;
}
.field {
  display: grid;
  gap: 5px;
}
.field > span:first-child,
.field legend {
  font-weight: 600;
  color: var(--ink-2);
}
.field .hint {
  color: var(--muted);
  font-size: 12px;
}
fieldset.field {
  margin: 0;
  padding: 0;
  border: 0;
}
.input.block,
textarea.input,
select.input {
  width: 100%;
}
textarea.input {
  min-height: 120px;
  padding: 7px 8px;
  font: 14px/1.55 var(--serif);
  resize: vertical;
}
.choice {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 7px 9px;
  border: 1px solid var(--rule-soft);
  background: var(--paper);
  cursor: pointer;
}
.choice:has(input:checked) {
  border-color: var(--band);
  background: #f1f4fa;
}
.choice input {
  margin: 3px 0 0;
}
.choice b {
  display: block;
}
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.confirm {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 9px 11px;
  border: 1px solid #e7c9a8;
  background: #fdf8f2;
  line-height: 1.45;
}
.confirm input {
  margin: 3px 0 0;
}
.empty {
  padding: 22px 14px;
  text-align: center;
  color: var(--muted);
}
.empty b {
  display: block;
  margin-bottom: 4px;
  color: var(--ink-2);
}
.digest {
  font-family: var(--mono);
  font-size: 11.5px;
  word-break: break-all;
}
.receipt {
  padding: 10px 12px;
  border: 1px solid #c4dccb;
  background: #eef5f0;
  line-height: 1.6;
}
.vote-buttons {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 8px;
}
.inline-form {
  display: inline;
}
.verify-box {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
}
.verify-box .input {
  flex: 1 1 380px;
  min-width: 0;
  font-family: var(--mono);
}
.result-ok {
  border-left: 4px solid var(--ok);
  padding: 8px 12px;
  background: #eef5f0;
}
.result-none {
  border-left: 4px solid var(--accent);
  padding: 8px 12px;
  background: #fdf3ea;
}
.desk .report {
  background: var(--paper);
  border: 1px solid var(--rule);
  padding: 0 24px 24px;
}
.desk-title .state {
  margin-left: 6px;
  vertical-align: 4px;
  font-family: var(--sans);
}
.nowrap {
  white-space: nowrap;
}
