:root {
  color-scheme: light;
  --bg: #f4f5f6;
  --panel: #ffffff;
  --ink: #202b3c;
  --muted: #536277;
  --line: #cbd3df;
  --soft: #edf1f6;
  --accent: #31548c;
  --accent-soft: #eaf0f8;
  --green: #28604c;
  --amber: #805212;
  --amber-soft: #fff4de;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #111720;
  --panel: #19212e;
  --ink: #edf1f8;
  --muted: #adb9cb;
  --line: #435067;
  --soft: #222d3e;
  --accent: #b5cefa;
  --accent-soft: #273850;
  --green: #9bddbe;
  --amber: #f2cb8c;
  --amber-soft: #3c301c;
}
* {
  box-sizing: border-box;
}
[hidden] {
  display: none !important;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--bg);
  font:
    14px/1.55 ui-sans-serif,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
}
button,
input,
select,
textarea {
  font: inherit;
}
button,
input,
select,
a {
  -webkit-tap-highlight-color: transparent;
}
button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px 14px;
  color: var(--ink);
  background: var(--panel);
  cursor: pointer;
  font-weight: 600;
  font-size: 13px;
}
button:hover {
  background: var(--soft);
}
button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
a {
  color: var(--accent);
  text-underline-offset: 3px;
}
input,
select,
textarea {
  width: 100%;
  min-width: 0;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 10px;
  color: var(--ink);
  background: var(--panel);
}
input::placeholder {
  color: var(--muted);
}
:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
h1,
h2,
h3,
p {
  margin: 0;
}
h1 {
  font-size: 28px;
  font-weight: 650;
  letter-spacing: -0.6px;
  line-height: 1.25;
}
h2 {
  font-size: 21px;
  font-weight: 650;
  letter-spacing: -0.3px;
  line-height: 1.3;
}
h3 {
  font-size: 15px;
}
p {
  overflow-wrap: anywhere;
}
.shell {
  max-width: 1376px;
  margin: auto;
  padding: 0 36px;
}
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-size: 14px;
  letter-spacing: 1px;
  text-decoration: none;
}
.brand b {
  font-weight: 750;
}
.brand img {
  width: 30px;
  height: 30px;
}
.header-actions,
.toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.header-actions a {
  padding: 10px 4px;
  font-size: 13px;
}
.icon-button {
  min-width: 44px;
  padding: 4px;
  font-size: 22px;
}
.quiet {
  background: transparent;
  border-color: transparent;
  color: var(--accent);
}
.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--panel);
}
.primary:hover {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--panel);
}
.full {
  width: 100%;
}
.wrap {
  flex-wrap: wrap;
}
.muted {
  color: var(--muted);
}
.workspace-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  padding: 28px 0;
}
.workspace-bar .toolbar {
  flex-wrap: wrap;
}
.intake-section {
  padding: 24px;
  border: 1px solid var(--line);
  background: var(--panel);
  scroll-margin-top: 20px;
}
.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
}
.source-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.source-card {
  padding: 20px;
  min-width: 0;
  border-right: 1px solid var(--line);
}
.source-card:first-child {
  padding-left: 0;
}
.source-card:last-child {
  padding-right: 0;
  border-right: 0;
}
.source-top {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 4px 12px;
  margin-bottom: 16px;
}
.source-top > span {
  color: var(--muted);
  font-size: 12px;
}
.source-file {
  font:
    600 12px/1.7 ui-monospace,
    Consolas,
    monospace;
  overflow-wrap: anywhere;
  margin-bottom: 4px;
}
.source-status {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 12px;
}
.source-card.ready .source-status {
  color: var(--green);
}
.source-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.source-card .upload {
  border-color: var(--accent);
  color: var(--accent);
}
.source-card .template {
  display: block;
  margin-top: 8px;
  padding: 8px 0;
  border-color: transparent;
  color: var(--muted);
  background: transparent;
  font-weight: 400;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.run-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-top: 20px;
}
.run-bar strong {
  font-size: 14px;
  font-weight: 600;
}
.run-bar p {
  font-size: 12px;
  margin-top: 6px;
}
.run-bar .toolbar {
  align-items: flex-end;
  flex-shrink: 0;
}
.tolerance {
  display: block;
  color: var(--muted);
  font-size: 12px;
  width: 130px;
}
.tolerance input {
  margin-top: 5px;
  font-variant-numeric: tabular-nums;
}
.run-bar .primary {
  white-space: nowrap;
}
.field-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  margin-top: 12px;
}
#results {
  margin-top: 32px;
  scroll-margin-top: 24px;
}
#results-title {
  scroll-margin-top: 24px;
}
.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-block: 1px solid var(--line);
  background: var(--panel);
}
.metric {
  padding: 16px 24px;
  border-right: 1px solid var(--line);
}
.metric:last-child {
  border-right: 0;
}
.metric > span {
  font-size: 13px;
  color: var(--muted);
}
.metric > strong {
  display: block;
  font-size: 32px;
  font-weight: 600;
  line-height: 1.3;
  margin: 4px 0;
  font-variant-numeric: tabular-nums;
}
.metric p {
  font-size: 12px;
  color: var(--muted);
}
.metric:nth-child(2) > strong {
  color: var(--accent);
}
.metric:nth-child(3) > strong {
  color: var(--amber);
}
.review-overview {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 24px;
  padding: 20px 0;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.review-overview #review-progress {
  font-size: 13px;
  margin-top: 8px;
  font-variant-numeric: tabular-nums;
}
.review-overview .field-note {
  max-width: 680px;
}
.review-overview .toolbar {
  max-width: 325px;
  flex-shrink: 0;
}
.report-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
}
.report-layout > * {
  min-width: 0;
}
.findings-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 12px;
}
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.filters button {
  border-color: transparent;
  background: transparent;
  color: var(--muted);
  padding: 9px 10px;
}
.filters button[aria-pressed="true"] {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--panel);
}
.search-label {
  flex: 1;
  min-width: 180px;
  max-width: 260px;
}
.review-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 16px;
}
.review-filter select {
  max-width: 220px;
}
.finding {
  background: var(--panel);
  padding: 20px;
  border: 1px solid var(--line);
  margin-bottom: 12px;
}
.finding-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.finding-head > div {
  min-width: 0;
}
.finding-icon {
  color: var(--accent);
  font-size: 22px;
  font-weight: 600;
  line-height: 1;
}
.finding.review .finding-icon {
  color: var(--amber);
}
.finding h3 {
  font-size: 15px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}
.finding-head p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}
.finding-id {
  margin-left: auto;
  font:
    11px/1.8 ui-monospace,
    Consolas,
    monospace;
  color: var(--muted);
  white-space: nowrap;
}
.compare {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding: 16px 0;
  margin-top: 16px;
  border-block: 1px solid var(--line);
}
.compare > div {
  min-width: 0;
}
.compare span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 5px;
}
.compare strong {
  display: block;
  font:
    600 14px/1.6 ui-monospace,
    Consolas,
    monospace;
  overflow-wrap: anywhere;
}
summary {
  cursor: pointer;
  min-height: 44px;
  padding: 12px 0;
  color: var(--accent);
  font-size: 13px;
}
.finding details > p {
  color: var(--muted);
  font-size: 13px;
  margin: 0 0 14px;
}
.evidence-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.evidence-links button {
  font-size: 12px;
  padding: 9px 10px;
}
.finding-review {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}
.review-badge {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}
.review-badge.follow_up {
  color: var(--amber);
}
.review-note {
  white-space: pre-wrap;
  color: var(--muted);
  font-size: 13px;
  margin-top: 12px;
}
.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 16px;
}
.pagination > span {
  color: var(--muted);
  font-size: 12px;
}
.panel {
  border: 1px solid var(--line);
  padding: 20px;
  background: var(--panel);
}
.coverage h3 {
  font-size: 17px;
  margin-bottom: 16px;
}
.coverage dl {
  margin: 0;
}
.coverage-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  font-size: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.coverage dt {
  color: var(--muted);
}
.coverage dd {
  margin: 0;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}
.coverage .quiet {
  margin-top: 12px;
  text-align: left;
  padding-inline: 0;
}
.limits-note {
  padding: 20px 0;
}
.limits-note p {
  color: var(--muted);
  font-size: 12px;
  margin-top: 8px;
  line-height: 1.7;
}
.bottom-note {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  border-top: 1px solid var(--line);
  margin-top: 32px;
  padding: 20px 0;
}
.bottom-note strong {
  min-width: 130px;
  font-size: 13px;
}
.bottom-note p {
  max-width: 820px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}
footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-top: 1px solid var(--line);
  padding: 20px 0;
  font-size: 12px;
}
footer > div {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px 20px;
}
footer a {
  padding: 10px 0;
}
.link-button {
  padding: 8px 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
}
.notice {
  padding: 14px 16px;
  margin-bottom: 20px;
  border-left: 3px solid var(--accent);
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 13px;
  line-height: 1.7;
  overflow-wrap: anywhere;
}
.warning {
  border-color: var(--amber);
  color: var(--amber);
  background: var(--amber-soft);
}
.empty-findings {
  padding: 30px 20px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}
.empty-findings strong {
  display: block;
  color: var(--ink);
  margin-bottom: 8px;
}
.skip {
  position: fixed;
  top: 12px;
  left: 16px;
  z-index: 50;
  background: var(--panel);
  padding: 12px;
  border: 1px solid var(--accent);
}
.skip:not(:focus),
.sr-only {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
  white-space: nowrap;
  padding: 0;
  border: 0;
}
dialog {
  width: min(740px, calc(100% - 32px));
  max-height: calc(100dvh - 32px);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 24px;
  background: var(--panel);
  color: var(--ink);
}
dialog::backdrop {
  background: #0b1420aa;
}
.dialog-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}
.dialog-heading > div {
  min-width: 0;
}
.dialog-heading h2 {
  overflow-wrap: anywhere;
}
.dialog-heading .icon-button {
  flex-shrink: 0;
}
.mapping-fields {
  margin: 24px 0;
}
.mapping-group {
  min-width: 0;
  margin: 0 0 24px;
  padding: 0;
  border: 0;
}
.mapping-group legend {
  width: 100%;
  padding: 0 0 10px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
  font-weight: 600;
}
.mapping-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}
.mapping-grid label {
  min-width: 0;
  font-size: 12px;
}
.mapping-grid select {
  display: block;
  margin-top: 6px;
  font-size: 13px;
}
.wide-dialog {
  width: min(1100px, calc(100% - 32px));
}
.table-scroll {
  overflow: auto;
  max-height: 55dvh;
  margin-top: 16px;
  border: 1px solid var(--line);
}
table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font:
    12px/1.6 ui-monospace,
    Consolas,
    monospace;
}
th,
td {
  border-bottom: 1px solid var(--line);
  padding: 10px 12px;
  max-width: 340px;
  overflow-wrap: anywhere;
}
th {
  background: var(--soft);
  font-weight: 600;
  position: sticky;
  top: 0;
  white-space: nowrap;
}
td {
  min-width: 100px;
  white-space: pre-wrap;
}
.help-copy h3 {
  margin: 22px 0 8px;
}
.help-copy p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
  margin-bottom: 12px;
}
#confirm-dialog {
  max-width: 480px;
}
#confirm-copy {
  color: var(--muted);
  margin: 16px 0 24px;
}
#confirm-dialog .toolbar {
  flex-wrap: wrap;
}
.review-history-section {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 24px;
}
.review-history-section article {
  border-left: 2px solid var(--line);
  padding-left: 14px;
  margin-top: 18px;
}
.review-history-section strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}
.review-history-section small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 5px;
}
.review-history-section p {
  white-space: pre-wrap;
  font-size: 13px;
  margin-top: 8px;
}
#review-fields {
  border: 0;
  padding: 0;
  min-width: 0;
}
#review-fields label {
  display: block;
  font-size: 13px;
  margin: 18px 0;
}
#review-fields input,
#review-fields textarea,
#review-fields select {
  display: block;
  margin-top: 6px;
}
#review-fields textarea {
  resize: vertical;
}
#review-fields .primary {
  margin-top: 16px;
}
#cancel-restore {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 5;
}
.csv-guide {
  margin: 16px 0 32px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  scroll-margin-top: 24px;
}
.csv-guide a {
  font-size: 13px;
}
.guide-intro {
  max-width: 900px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 24px;
}
.guide-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 40px;
}
.guide-grid article {
  min-width: 0;
}
.guide-grid h3 {
  margin-bottom: 12px;
}
.guide-grid p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.8;
}
.guide-grid p + p {
  margin-top: 12px;
}
@media (max-width: 1000px) {
  .shell {
    padding: 0 24px;
  }
  .run-bar {
    flex-wrap: wrap;
  }
  .run-bar .toolbar {
    margin-left: auto;
  }
  .review-overview {
    flex-direction: column;
    align-items: flex-start;
  }
  .review-overview .toolbar {
    max-width: none;
  }
  .report-layout {
    grid-template-columns: minmax(0, 1fr) 260px;
    gap: 16px;
  }
  .source-card {
    padding: 16px;
  }
}
@media (max-width: 760px) {
  .workspace-bar {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }
  .report-layout {
    grid-template-columns: 1fr;
  }
  .report-layout aside {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  #results > .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 16px;
  }
  .source-grid {
    grid-template-columns: 1fr;
  }
  .source-card,
  .source-card:first-child,
  .source-card:last-child {
    padding: 16px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .source-card:last-child {
    border-bottom: 0;
  }
  .source-top {
    margin-bottom: 12px;
  }
  .source-card .template {
    display: inline-block;
    margin-top: 4px;
  }
  .guide-grid {
    grid-template-columns: 1fr;
  }
  footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
}
@media (max-width: 480px) {
  .shell {
    padding: 0 16px;
  }
  header {
    gap: 8px;
    flex-wrap: wrap;
    padding: 12px 0;
  }
  .brand {
    font-size: 12px;
    letter-spacing: 0.3px;
    gap: 6px;
  }
  .brand img {
    width: 26px;
    height: 26px;
  }
  .header-actions {
    gap: 2px;
    margin-left: auto;
  }
  .header-actions .quiet {
    padding: 8px;
    font-size: 12px;
  }
  .header-actions a {
    font-size: 12px;
  }
  h1 {
    font-size: 25px;
  }
  h2 {
    font-size: 20px;
  }
  .workspace-bar {
    padding: 24px 0;
  }
  .workspace-bar .toolbar {
    gap: 8px;
  }
  .workspace-bar button {
    font-size: 12px;
    padding-inline: 10px;
  }
  .intake-section {
    padding: 16px;
  }
  .section-heading {
    gap: 12px;
  }
  .section-heading .quiet {
    font-size: 12px;
    padding: 8px 0;
  }
  .run-bar .toolbar {
    width: 100%;
    flex-wrap: wrap;
    margin: 0;
    gap: 12px;
  }
  .tolerance {
    width: 100%;
  }
  .tolerance input {
    max-width: 130px;
  }
  .run-bar .primary {
    flex-grow: 1;
  }
  .metrics {
    grid-template-columns: 1fr 1fr;
  }
  .metric {
    padding: 16px;
  }
  .metric:first-child {
    grid-column: 1/-1;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
  }
  .metric:first-child strong {
    grid-column: 2;
    grid-row: 1/3;
    margin: 0;
  }
  .metric:first-child p {
    grid-column: 1;
  }
  .filters {
    gap: 0;
    width: 100%;
    justify-content: space-between;
  }
  .filters button {
    padding-inline: 7px;
    font-size: 12px;
  }
  .search-label {
    max-width: none;
  }
  .review-filter select {
    max-width: 180px;
  }
  .finding {
    padding: 16px;
  }
  .finding-head {
    flex-wrap: wrap;
    gap: 8px;
  }
  .finding-head > div {
    flex: 1;
  }
  .finding-id {
    flex-basis: 100%;
    margin-left: 22px;
  }
  .compare {
    gap: 12px;
  }
  .compare strong {
    font-size: 13px;
  }
  .report-layout aside {
    grid-template-columns: 1fr;
    gap: 0;
  }
  .bottom-note {
    flex-direction: column;
    gap: 8px;
  }
  .csv-guide .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }
  dialog {
    padding: 18px;
  }
  .mapping-grid {
    grid-template-columns: 1fr;
  }
}
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
    scroll-behavior: auto !important;
  }
}
