:root {
  color-scheme: light;
  --ink: #111815;
  --ink-soft: #26312b;
  --muted: #5c665f;
  --paper: #f4f6f3;
  --surface: #ffffff;
  --surface-alt: #edf1ed;
  --line: #cbd2cc;
  --line-strong: #89958d;
  --teal: #0c6674;
  --teal-dark: #084852;
  --orange: #c8542b;
  --orange-dark: #8d351d;
  --green: #167258;
  --green-soft: #e2f1eb;
  --red: #a33b35;
  --red-soft: #f7e6e3;
  --amber: #8a641b;
  --amber-soft: #f7efd9;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
  --sans: Inter, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.5;
}

button,
input,
textarea {
  color: inherit;
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

button,
.offer a {
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  background: var(--surface);
  cursor: pointer;
  display: inline-flex;
  font-family: var(--mono);
  font-size: 0.74rem;
  font-weight: 750;
  justify-content: center;
  letter-spacing: 0;
  min-height: 44px;
  padding: 0.7rem 0.9rem;
  text-align: center;
  text-decoration: none;
}

button:hover,
.offer a:hover {
  border-color: var(--teal);
  color: var(--teal-dark);
}

button:focus-visible,
a:focus-visible,
textarea:focus-visible,
input:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

button.primary {
  border-color: var(--teal-dark);
  background: var(--teal-dark);
  color: white;
}

button.primary:hover {
  background: var(--teal);
  color: white;
}

.skip-link {
  background: var(--ink);
  color: white;
  left: 1rem;
  padding: 0.7rem 1rem;
  position: fixed;
  top: -5rem;
  z-index: 30;
}

.skip-link:focus {
  top: 1rem;
}

.site-header {
  align-items: center;
  background: var(--ink);
  color: white;
  display: flex;
  justify-content: space-between;
  min-height: 68px;
  padding: 0.8rem 4rem;
}

.brand {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 0.75rem;
  text-decoration: none;
}

.brand span {
  align-items: center;
  background: white;
  color: var(--ink);
  display: inline-flex;
  font-family: var(--mono);
  font-size: 0.83rem;
  font-weight: 800;
  height: 34px;
  justify-content: center;
  width: 42px;
}

.brand b {
  font-family: var(--mono);
  font-size: 0.78rem;
  white-space: nowrap;
}

.site-header nav,
.site-footer nav {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 1.1rem;
}

.site-header nav a,
.site-footer a {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 750;
  text-decoration: none;
}

.site-header nav a[aria-current="page"] {
  border-bottom: 2px solid #61c1cd;
  padding-bottom: 0.25rem;
}

main {
  margin: 0 auto;
  max-width: 1480px;
  overflow: hidden;
}

.intro {
  align-items: end;
  display: grid;
  gap: 6rem;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  min-height: 455px;
  padding: 6.5rem 5rem 4.5rem;
}

.intro-title,
.intro-copy,
.audit-grid > *,
.section-header > * {
  min-width: 0;
}

.eyebrow {
  color: var(--teal);
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 800;
  margin: 0 0 1rem;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  font-size: 4.25rem;
  font-weight: 730;
  line-height: 1.02;
  margin: 0;
  max-width: 16ch;
}

.intro-copy > p {
  color: var(--muted);
  font-size: 1.06rem;
  margin: 0 0 2rem;
  max-width: 57ch;
}

.intro-copy dl {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.intro-copy dl div {
  min-width: 0;
  padding: 1.15rem 0.75rem;
}

.intro-copy dl div + div {
  border-left: 1px solid var(--line);
}

.intro-copy dt {
  font-family: var(--mono);
  font-size: 1.5rem;
  font-weight: 800;
}

.intro-copy dd {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.64rem;
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
}

.audit-lab {
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
}

.section-header {
  align-items: end;
  display: grid;
  gap: 3rem;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 0.7fr);
  padding: 2.2rem 4rem;
}

.section-header h2,
.method-band h2,
.commercial-band h2,
.boundaries h2 {
  font-size: 2.45rem;
  line-height: 1.1;
  margin: 0;
}

.section-header > p {
  color: var(--muted);
  margin: 0;
  max-width: 60ch;
}

.audit-grid {
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
}

.input-pane,
.result-pane {
  min-width: 0;
  padding: 2.25rem;
}

.input-pane {
  background: var(--surface-alt);
  border-right: 1px solid var(--line);
}

.pane-header {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  min-height: 48px;
}

.pane-header > div {
  align-items: center;
  display: flex;
  gap: 0.7rem;
  min-width: 0;
}

.pane-header span,
.pane-header > strong {
  color: var(--teal);
  font-family: var(--mono);
  font-size: 0.68rem;
}

.pane-header h3 {
  font-family: var(--mono);
  font-size: 0.82rem;
  margin: 0;
  overflow-wrap: anywhere;
}

.input-pane > label {
  align-items: center;
  display: flex;
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 750;
  justify-content: space-between;
  margin: 1rem 0 0.5rem;
}

.input-pane > label b {
  color: var(--muted);
  font-weight: 600;
}

textarea {
  background: #101815;
  border: 1px solid #101815;
  border-radius: 3px;
  color: #e8f2ec;
  display: block;
  font-family: var(--mono);
  font-size: 0.76rem;
  height: 260px;
  line-height: 1.55;
  max-width: 100%;
  padding: 1rem;
  resize: vertical;
  width: 100%;
}

textarea::placeholder {
  color: #8b9990;
}

.field-note,
.selection-summary {
  color: var(--muted);
  font-size: 0.78rem;
  margin: 0.65rem 0 0;
}

.compact-actions,
.file-actions,
.run-actions,
.export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.input-divider {
  border-top: 1px solid var(--line);
  margin: 2rem 0 1.25rem;
}

.file-header {
  margin-bottom: 0.8rem;
}

.file-drop {
  background: var(--surface);
  border: 1px dashed var(--line-strong);
  border-radius: 3px;
  min-height: 176px;
  padding: 1.4rem;
}

.file-drop[data-dragging="true"] {
  border-color: var(--teal);
  box-shadow: inset 0 0 0 2px var(--teal);
}

.file-drop > p {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.35rem;
}

.file-drop > span {
  color: var(--muted);
  display: block;
  font-size: 0.8rem;
  max-width: 50ch;
}

.input-error {
  background: var(--red-soft);
  border-left: 3px solid var(--red);
  color: var(--red);
  font-size: 0.82rem;
  margin: 1rem 0 0;
  padding: 0.8rem;
}

.run-actions {
  border-top: 1px solid var(--line);
  justify-content: flex-end;
  margin-top: 1.4rem;
  padding-top: 1.2rem;
}

.run-actions .primary {
  min-width: 185px;
}

.state-seal {
  border: 1px solid var(--line-strong);
  color: var(--muted) !important;
  min-width: 92px;
  padding: 0.45rem 0.65rem;
  text-align: center;
}

body[data-state="working"] .state-seal {
  border-color: var(--teal);
  color: var(--teal) !important;
}

body[data-state="match"] .state-seal {
  border-color: var(--green);
  color: var(--green) !important;
}

body[data-state="failure"] .state-seal,
body[data-state="invalid"] .state-seal {
  border-color: var(--red);
  color: var(--red) !important;
}

body[data-state="incomplete"] .state-seal {
  border-color: var(--amber);
  color: var(--amber) !important;
}

.result-summary {
  color: var(--muted);
  margin: 1rem 0 1.25rem;
  min-height: 48px;
}

.progress {
  background: var(--surface-alt);
  border: 1px solid var(--line);
  margin-bottom: 1rem;
  padding: 0.8rem;
}

.progress > div {
  display: flex;
  font-family: var(--mono);
  font-size: 0.68rem;
  justify-content: space-between;
  margin-bottom: 0.55rem;
}

.progress > span {
  background: var(--line);
  display: block;
  height: 6px;
  overflow: hidden;
}

.progress i {
  background: var(--teal);
  display: block;
  height: 100%;
  transform-origin: left center;
  width: 0;
}

.result-stats {
  border: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 0;
}

.result-stats > div {
  min-width: 0;
  padding: 1rem 0.75rem;
}

.result-stats > div + div {
  border-left: 1px solid var(--line);
}

.result-stats dt {
  font-family: var(--mono);
  font-size: 1.55rem;
  font-weight: 800;
}

.result-stats dd {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.61rem;
  margin: 0.2rem 0 0;
  overflow-wrap: anywhere;
}

[data-stat="match"] dt {
  color: var(--green);
}

[data-stat="mismatch"] dt,
[data-stat="missing"] dt {
  color: var(--red);
}

[data-stat="uncovered"] dt {
  color: var(--amber);
}

.standard-result {
  align-items: center;
  background: #101815;
  color: white;
  display: grid;
  gap: 0.6rem;
  grid-template-columns: 155px minmax(0, 1fr);
  margin-top: 1rem;
  padding: 0.85rem 1rem;
}

.standard-result span {
  color: #9fb0a6;
  font-family: var(--mono);
  font-size: 0.62rem;
}

.standard-result code {
  font-family: var(--mono);
  font-size: 0.74rem;
  overflow-wrap: anywhere;
}

.result-table-wrap {
  border: 1px solid var(--line);
  margin-top: 1rem;
  max-height: 450px;
  overflow: auto;
}

table {
  border-collapse: collapse;
  table-layout: fixed;
  width: 100%;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 0.72rem;
  text-align: left;
  vertical-align: top;
}

th {
  background: var(--surface-alt);
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.62rem;
  position: sticky;
  top: 0;
  z-index: 2;
}

th:nth-child(1) {
  width: 52%;
}

th:nth-child(2) {
  width: 18%;
}

td {
  font-family: var(--mono);
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

td[data-row-state="match"] {
  color: var(--green);
}

td[data-row-state="mismatch"],
td[data-row-state="missing"],
td[data-row-state="error"] {
  color: var(--red);
}

.pager {
  align-items: center;
  display: flex;
  font-family: var(--mono);
  font-size: 0.7rem;
  gap: 0.7rem;
  justify-content: flex-end;
  margin-top: 0.7rem;
}

.pager button {
  font-size: 1rem;
  height: 38px;
  min-height: 38px;
  padding: 0;
  width: 42px;
}

.export-boundary {
  border-top: 1px solid var(--line);
  margin-top: 1rem;
  padding-top: 1rem;
}

.export-boundary label {
  align-items: flex-start;
  color: var(--muted);
  display: flex;
  font-size: 0.76rem;
  gap: 0.55rem;
}

.export-boundary input {
  flex: 0 0 auto;
  height: 18px;
  margin: 0;
  width: 18px;
}

.export-actions button {
  flex: 1 1 155px;
}

.method-band {
  background: var(--ink-soft);
  color: white;
  padding: 4rem;
}

.method-band .eyebrow,
.commercial-band .eyebrow {
  color: #6bc2cc;
}

.method-band header {
  max-width: 700px;
}

.method-band ol {
  border-top: 1px solid #536059;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  list-style: none;
  margin: 2.5rem 0 0;
  padding: 0;
}

.method-band li {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: 32px minmax(0, 1fr);
  min-width: 0;
  padding: 1.5rem 1.1rem 0;
}

.method-band li + li {
  border-left: 1px solid #536059;
}

.method-band li > span {
  color: #6bc2cc;
  font-family: var(--mono);
  font-size: 0.68rem;
}

.method-band h3 {
  font-family: var(--mono);
  font-size: 0.75rem;
  margin: 0 0 0.5rem;
}

.method-band li p {
  color: #c5cec8;
  font-size: 0.82rem;
  margin: 0;
}

.commercial-band {
  align-items: center;
  background: #e9ece8;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 5rem;
  grid-template-columns: minmax(0, 1fr) 320px;
  padding: 4.5rem 4rem;
}

.commercial-band > div:first-child > p:last-child {
  color: var(--muted);
  margin: 1.2rem 0 0;
  max-width: 72ch;
}

.offer {
  border-left: 4px solid var(--orange);
  display: grid;
  gap: 0.55rem;
  padding: 0.4rem 0 0.4rem 1.4rem;
}

.offer span,
.offer small {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.66rem;
}

.offer strong {
  font-family: var(--mono);
  font-size: 2.1rem;
}

.offer a {
  border-color: var(--orange-dark);
  background: var(--orange-dark);
  color: white;
  margin-top: 0.5rem;
}

.offer a:hover {
  background: var(--orange);
  color: white;
}

.boundaries {
  background: var(--surface);
  padding: 4rem;
}

.boundaries > div:first-child {
  max-width: 760px;
}

.boundaries dl {
  border-bottom: 1px solid var(--line);
  border-top: 1px solid var(--line);
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin: 2.5rem 0 0;
}

.boundaries dl div {
  padding: 1.25rem;
}

.boundaries dl div + div {
  border-left: 1px solid var(--line);
}

.boundaries dt {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 800;
}

.boundaries dd {
  color: var(--muted);
  font-size: 0.82rem;
  margin: 0.55rem 0 0;
}

.source-note {
  align-items: center;
  color: var(--muted);
  display: flex;
  font-size: 0.76rem;
  gap: 1rem;
  justify-content: space-between;
  margin: 1.2rem 0 0;
}

.source-note a {
  color: var(--teal-dark);
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 800;
}

.site-footer {
  align-items: center;
  background: var(--ink);
  color: white;
  display: flex;
  font-family: var(--mono);
  font-size: 0.68rem;
  justify-content: space-between;
  min-height: 90px;
  padding: 1.4rem 4rem;
}

@media (max-width: 1100px) {
  .site-header,
  .site-footer {
    padding-left: 2rem;
    padding-right: 2rem;
  }

  .intro {
    gap: 3rem;
    padding: 5rem 3rem 3.5rem;
  }

  h1 {
    font-size: 3.4rem;
  }

  .section-header,
  .method-band,
  .commercial-band,
  .boundaries {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
  }

  .audit-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .input-pane {
    border-bottom: 1px solid var(--line);
    border-right: 0;
  }

  .method-band ol,
  .boundaries dl {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .method-band li:nth-child(3),
  .boundaries dl div:nth-child(3) {
    border-left: 0;
  }

  .method-band li:nth-child(n + 3),
  .boundaries dl div:nth-child(n + 3) {
    border-top: 1px solid #536059;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
  }

  .boundaries dl div:nth-child(n + 3) {
    border-top-color: var(--line);
  }
}

@media (max-width: 760px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.8rem;
    padding: 0.8rem 1rem;
  }

  .site-header nav {
    flex-wrap: nowrap;
    max-width: 100%;
    overflow-x: auto;
    padding-bottom: 0.3rem;
    width: 100%;
  }

  .site-header nav a {
    flex: 0 0 auto;
  }

  .intro {
    display: block;
    min-height: 0;
    padding: 3.5rem 1rem 2.5rem;
  }

  h1 {
    font-size: 2.45rem;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .intro-copy {
    margin-top: 2rem;
  }

  .intro-copy dl {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .intro-copy dt {
    font-size: 1.15rem;
  }

  .section-header {
    display: block;
    padding: 1.6rem 1rem;
  }

  .section-header > p {
    margin-top: 1rem;
  }

  .section-header h2,
  .method-band h2,
  .commercial-band h2,
  .boundaries h2 {
    font-size: 1.75rem;
  }

  .input-pane,
  .result-pane {
    padding: 1rem;
  }

  .pane-header {
    align-items: flex-start;
  }

  textarea {
    height: 220px;
  }

  .compact-actions button,
  .file-actions button,
  .run-actions button,
  .export-actions button {
    flex: 1 1 100%;
    width: 100%;
  }

  .result-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .result-stats > div:nth-child(3) {
    border-left: 0;
  }

  .result-stats > div:nth-child(n + 3) {
    border-top: 1px solid var(--line);
  }

  .standard-result {
    grid-template-columns: minmax(0, 1fr);
  }

  .result-table-wrap {
    max-height: 360px;
  }

  th:nth-child(1) {
    width: 48%;
  }

  th:nth-child(2) {
    width: 24%;
  }

  .method-band,
  .commercial-band,
  .boundaries {
    padding: 3rem 1rem;
  }

  .method-band ol,
  .boundaries dl {
    grid-template-columns: minmax(0, 1fr);
  }

  .method-band li,
  .method-band li:nth-child(3),
  .boundaries dl div,
  .boundaries dl div:nth-child(3) {
    border-left: 0;
  }

  .method-band li + li,
  .boundaries dl div + div {
    border-top: 1px solid #536059;
    margin-top: 1rem;
    padding-top: 1.5rem;
  }

  .boundaries dl div + div {
    border-top-color: var(--line);
  }

  .commercial-band {
    display: block;
  }

  .offer {
    margin-top: 2rem;
  }

  .source-note,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .site-footer {
    gap: 1rem;
    padding: 1.4rem 1rem;
  }

  .site-footer nav {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.65rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    transition: none !important;
  }
}
