:root {
  font-family: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #182323;
  background: #f7f9f8;
  --ink: #182323;
  --muted: #526361;
  --line: #dce5e2;
  --teal: #08786e;
  --surface: #fff;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, textarea, select { font: inherit; }
a { color: var(--teal); }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: default; opacity: .48; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #08786e; outline-offset: 3px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: 36px; line-height: 1.15; overflow-wrap: anywhere; }
h2 { font-size: 17px; }
h3 { font-size: 14px; }
.topbar { background: white; border-bottom: 1px solid var(--line); }
.top-inner, .shell { width: min(1440px, 100%); margin: auto; padding-inline: 40px; }
.top-inner { min-height: 66px; display: flex; align-items: center; gap: 40px; }
.brand { display: flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); font-weight: 750; white-space: nowrap; }
.brand img { flex-shrink: 0; }
nav { display: flex; align-self: stretch; gap: 24px; }
nav a { display: flex; align-items: center; color: var(--muted); text-decoration: none; border-bottom: 2px solid transparent; font-size: 14px; font-weight: 650; white-space: nowrap; padding-block: 10px 8px; }
nav a[aria-current] { color: var(--teal); border-color: var(--teal); }
.export { margin-left: auto; }
.shell { padding-block: 32px; }
.heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; margin-bottom: 22px; }
.heading .muted { margin-top: 8px; }
.eyebrow { margin-bottom: 7px; color: var(--teal); font-size: 11px; font-weight: 800; text-transform: uppercase; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.button { min-height: 38px; padding: 8px 12px; display: inline-flex; align-items: center; justify-content: center; gap: 7px; border: 1px solid #cbdad6; border-radius: 6px; background: #fff; color: var(--ink); text-decoration: none; font-size: 13px; font-weight: 700; white-space: nowrap; }
.button:hover:not(:disabled) { background: #eaf4f1; }
.button.primary { color: #fff; background: var(--teal); border-color: var(--teal); }
.button.primary:hover:not(:disabled) { background: #05665e; }
.button.compact { min-height: 31px; padding: 5px 9px; font-size: 12px; }
.admin-login { display: grid; gap: 12px; width: min(100%, 350px); margin-top: 20px; }
.stats { margin-bottom: 20px; border-block: 1px solid var(--line); display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.stat { padding: 14px; min-height: 63px; display: flex; gap: 8px; align-items: center; border-inline-end: 1px solid var(--line); color: var(--muted); font-size: 13px; }
.stat:first-child { padding-inline-start: 0; }
.stat:last-child { border-inline-end: 0; }
.stat strong { margin-left: auto; color: var(--ink); font-size: 23px; font-variant-numeric: tabular-nums; }
.stat-link { color: var(--teal); text-decoration: none; }
.stat-link span:not(.stat-mark) { text-decoration: underline; text-underline-offset: 2px; }
.stat-link:hover { background: #edf5f2; }
.stat-mark, .dot { flex: none; display: inline-block; width: 9px; height: 9px; border-radius: 3px; }
.stat-mark.teal { background: #1b9b87; }
.stat-mark.blue { background: #4b78b8; }
.stat-mark.violet { background: #8365ab; }
.stat-mark.amber { background: #d18b27; }
.map-layout { display: grid; grid-template-columns: minmax(0, 1fr) 280px; background: white; border: 1px solid var(--line); border-radius: 8px; }
.map-main { min-width: 0; display: flex; flex-direction: column; }
.panel-header { min-height: 64px; padding: 13px 16px; display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.panel-header h2 { margin-bottom: 4px; }
.muted { color: var(--muted); font-size: 13px; }
.map-canvas { background: #fcfefd; border-block: 1px solid #eef3f0; }
.map-canvas svg { width: 100%; display: block; }
.grid { stroke: #e6edeb; stroke-width: 1; fill: none; }
.axis { stroke: #c2d1cd; stroke-width: 1.1; fill: none; }
.axis-label { font-size: 11px; fill: #546562; }
.point { opacity: .84; cursor: pointer; stroke: #fff; stroke-width: .8; }
.point:hover, .point.selected-point { r: 6px; stroke: #142623; stroke-width: 1.5; opacity: 1; }
.map-tooltip {
  position: fixed; top: 0; left: 0; z-index: 2; pointer-events: none;
  width: max-content; max-width: min(23rem, calc(100vw - 24px));
  padding: 9px 12px; border: 1px solid #cbdad6; border-radius: 6px;
  background: var(--surface); color: var(--ink); box-shadow: 0 4px 16px #18232325;
  font-size: 13px; overflow-wrap: anywhere;
}
.map-tooltip p { margin-top: 4px; }
.map-tooltip .keywords {
  display: block; max-height: max(4em, calc(100dvh - 140px)); overflow: hidden;
}
.chart-footer { display: flex; justify-content: space-between; flex-wrap: wrap; padding: 12px 16px; color: var(--muted); font-size: 12px; gap: 8px; }
.map-side { padding: 15px 16px; border-left: 1px solid var(--line); min-width: 0; }
label { display: grid; gap: 6px; color: #344744; font-size: 13px; font-weight: 650; }
.map-side label, .map-side > button { margin-top: 10px; }
input, select, textarea { width: 100%; min-width: 0; padding: 8px; color: var(--ink); background: #fff; border: 1px solid #cbdad6; border-radius: 5px; font-size: 13px; }
textarea { resize: vertical; }
.side-section { margin-top: 13px; border-top: 1px solid var(--line); padding-top: 12px; }
.legend { list-style: none; margin: 6px 0 0; padding: 0; }
.legend button { width: 100%; text-align: left; border: 0; background: transparent; padding: 4px; border-radius: 4px; display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; align-items: center; gap: 6px; font-size: 12px; }
.legend button span { overflow-wrap: anywhere; }
.legend button:hover, .legend button[aria-pressed="true"] { background: #edf5f2; }
.legend small { color: var(--muted); }
.color-0 { background: #078778; fill: #078778; }
.color-1 { background: #3a6cac; fill: #3a6cac; }
.color-2 { background: #a85a2d; fill: #a85a2d; }
.color-3 { background: #8057a6; fill: #8057a6; }
.color-4 { background: #c55077; fill: #c55077; }
.color-5 { background: #71932a; fill: #71932a; }
.color-6 { background: #c78619; fill: #c78619; }
.color-7 { background: #256e87; fill: #256e87; }
.color-8 { background: #b0434e; fill: #b0434e; }
.color-9 { background: #6289c6; fill: #6289c6; }
.color-10 { background: #8d5d53; fill: #8d5d53; }
.color-11 { background: #319c52; fill: #319c52; }
.color-12 { background: #a2649b; fill: #a2649b; }
.color-13 { background: #5e7671; fill: #5e7671; }
.color-14 { background: #7c6acf; fill: #7c6acf; }
.color-15 { background: #af821c; fill: #af821c; }
.color-16 { background: #78413d; fill: #78413d; }
.color-17 { background: #a246b1; fill: #a246b1; }
.color-18 { background: #465b32; fill: #465b32; }
.color-19 { background: #275baa; fill: #275baa; }
.color-20 { background: #df6527; fill: #df6527; }
.color-21 { background: #896426; fill: #896426; }
.color-22 { background: #426b50; fill: #426b50; }
.color-23 { background: #685076; fill: #685076; }
.cluster-overlay { pointer-events: none; }
.cluster-overlay rect { fill: #fff; fill-opacity: .58; }
.cluster-overlay text { fill: #172b28; }
.checkbox { display: inline-flex; align-items: center; gap: 6px; }
.checkbox input { margin: 0; flex: none; width: auto; accent-color: var(--teal); }
.settings-form { max-width: 950px; }
.admin-section { max-width: 650px; border-block: 1px solid var(--line); padding-block: 16px; }
.admin-section + .admin-section { border-top: 0; }
.admin-section-header, .map-job-label { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.admin-section-header { flex-wrap: wrap; }
.admin-note { max-width: 65ch; line-height: 1.5; }
.map-job { display: grid; gap: 8px; margin-top: 16px; }
.map-job-label span { color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.map-job progress { display: block; width: 100%; height: 16px; accent-color: var(--teal); }
.admin-section > p { margin-top: 12px; }
.settings-form fieldset { min-width: 0; border: 0; border-top: 1px solid var(--line); margin: 0 0 18px; padding: 13px 0 0; }
.settings-form legend { padding: 0 9px 0 0; font-size: 17px; font-weight: 750; }
.settings-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
.settings-wide { grid-column: 1 / -1; }
.settings-form .muted { font-weight: 400; }
#settings-error:not(:empty) { margin-bottom: 10px; }
.detail-heading, .dialog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.side-section p { margin-block: 8px; font-size: 13px; }
.keywords { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.5; }
.side-section .keywords { max-height: 150px; overflow: auto; }
.chip { display: inline-flex; padding: 4px 8px; border-radius: 5px; font-size: 12px; font-weight: 650; line-height: 1.25; font-variant-numeric: tabular-nums; }
.chip.neutral { background: #edf1ef; color: #445954; }
.chip.teal { background: #e0f4ec; color: #086251; }
.chip.amber { background: #fff1d5; color: #815014; }
.chip.red { background: #fae6e3; color: #8c2f2a; }
.run-status { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); font-size: 13px; }
.run-status:not(:empty) { margin-top: 10px; }
.draft-notice { margin-top: 11px; font-size: 12px; color: var(--muted); }
.directory { border: 1px solid var(--line); border-radius: 8px; background: #fff; }
.search-label { width: min(320px, 68%); }
.table-wrap { overflow: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13px; text-align: left; }
th, td { padding: 11px 15px; border-top: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
th { background: #f2f7f4; color: #425652; }
td:first-child { min-width: 180px; }
td:last-child { min-width: 80px; }
td small { display: block; color: var(--muted); margin-block: 4px; max-width: 260px; }
td .button { margin-top: 3px; }
td .flag-select { min-width: 145px; }
.reviewer-cell { min-width: 116px; }
.review-exclusions { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.review-exclusions li { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
.person-name { font-weight: 700; }
.keyword-preview {
  display: grid; grid-template-columns: minmax(0, 1fr) 26px; align-items: start;
  gap: 4px; max-width: 650px;
}
.keyword-preview:not(.keywords-expanded) .keywords { max-height: 3em; overflow: hidden; }
.keyword-toggle {
  display: grid; place-items: center; width: 26px; height: 24px;
  border: 0; border-radius: 4px; background: transparent; color: var(--teal);
}
.keyword-toggle:hover { background: #edf5f2; }
.keyword-toggle::before {
  content: ""; width: 7px; height: 7px; border: solid currentColor; border-width: 0 2px 2px 0;
  transform: translateY(-2px) rotate(45deg);
}
.keyword-toggle[aria-expanded="true"]::before { transform: translateY(2px) rotate(225deg); }
.committee-research { max-width: 760px; margin-bottom: 20px; }
.committee-research .keywords { margin-top: 5px; font-size: 14px; }
.flagged-row { background: #fffaf0; }
.pagination { min-height: 48px; display: flex; align-items: center; justify-content: flex-end; gap: 8px; padding: 7px 12px; border-top: 1px solid var(--line); font-size: 13px; }
.breadcrumb { display: inline-block; margin-bottom: 12px; font-size: 13px; }
dialog { width: min(530px, calc(100% - 24px)); padding: 21px; color: var(--ink); border: 1px solid var(--line); border-radius: 8px; }
dialog::backdrop { background: #132b285c; }
dialog label { margin-top: 15px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 17px; }
.icon-button { border: 1px solid var(--line); background: #fff; border-radius: 5px; width: 29px; height: 29px; flex: none; line-height: 1; font-size: 19px; }
.error { color: #992923; font-size: 13px; }
#edit-error:not(:empty) { margin-top: 10px; }
#notice { position: fixed; bottom: 16px; right: 16px; max-width: calc(100% - 32px); padding: 10px 13px; background: #154740; color: #fff; border-radius: 6px; font-size: 14px; }
#notice.error-notice { background: #842f29; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
@media (max-width: 1000px) {
  .top-inner { flex-wrap: wrap; gap: 0 10px; padding-top: 8px; }
  nav { order: 3; width: 100%; column-gap: clamp(10px, 3vw, 20px); flex-wrap: wrap; }
}
@media (max-width: 850px) {
  .top-inner, .shell { padding-inline: 18px; }
  .map-layout { grid-template-columns: minmax(0, 1fr) 230px; }
}
@media (max-width: 650px) {
  .shell { padding-block: 20px; }
  .heading { align-items: flex-start; flex-direction: column; }
  h1 { font-size: 29px; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stat { padding: 8px; min-height: 49px; }
  .stat:nth-child(2) { border-inline-end: 0; }
  .stat:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
  .stat:nth-child(3) { padding-inline-start: 0; }
  .map-layout { grid-template-columns: minmax(0, 1fr); }
  .map-side { border-left: 0; border-top: 1px solid var(--line); }
  .settings-fields { grid-template-columns: minmax(0, 1fr); }
  td:first-child { min-width: 122px; }
  th, td { padding: 8px; }
}
