:root {
  color-scheme: light;
  --ink: #202b38;
  --muted: #526171;
  --blue: #285a83;
  --line: #d5dce3;
  --surface: #fff;
  --canvas: #f4f6f8
}

* {
  box-sizing: border-box
}

body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.6 Arial,system-ui,sans-serif
}

.shell {
  width: min(1020px,calc(100% - 48px));
  margin: auto
}

a {
  color: #245c86;
  text-decoration: underline;
  text-underline-offset: 3px
}

a:hover {
  color: #183c59
}

a:focus-visible,button:focus-visible,input:focus-visible,summary:focus-visible {
  outline: 3px solid #5594cb;
  outline-offset: 3px
}

.topbar {
  background: #e9eef2;
  border-bottom: 1px solid #cbd5de
}

.topbar-inner {
  min-height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #425668;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .06em
}

.intro {
  padding: 50px 0 34px
}

.eyebrow {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .09em;
  color: #456985;
  margin: 0 0 9px
}

h1,h2,h3,p {
  margin-top: 0
}

h1,h2,h3 {
  line-height: 1.3
}

h1 {
  max-width: 820px;
  font-size: 32px;
  letter-spacing: -.02em;
  margin-bottom: 12px
}

h2 {
  font-size: 21px;
  margin-bottom: 8px
}

h3 {
  font-size: 17px;
  margin-bottom: 4px
}

.author {
  font-size: 14px;
  color: var(--muted);
  margin-bottom: 30px
}

.author span {
  margin: 0 6px
}

.objective {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  max-width: 75ch
}

.objective h2 {
  font-size: 16px;
  margin-bottom: 5px
}

.objective p {
  margin: 0
}

.workspace,.results,.empty-results,.result-error {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 28px 30px
}

.section-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start
}

.section-heading p:not(.eyebrow) {
  color: var(--muted);
  margin: 0
}

.step {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap
}

.documents {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-top: 26px
}

.document-card {
  border: 1px solid var(--line);
  background: #fafbfc;
  padding: 18px;
  min-width: 0
}

.document-card label {
  display: block;
  font-weight: 700
}

.document-card p {
  font-size: 13px;
  color: var(--muted);
  margin: 3px 0 14px
}

.document-card input {
  max-width: 100%;
  font: 13px Arial,sans-serif;
  color: var(--ink)
}

.document-card input::file-selector-button {
  border: 1px solid #9baebd;
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  font-weight: 700;
  padding: 8px 10px;
  margin-right: 8px;
  cursor: pointer
}

.form-bottom {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 24px;
  padding: 24px 0
}

.threshold label {
  display: block;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 6px
}

.threshold input {
  width: 78px;
  border: 1px solid #9baebd;
  border-radius: 3px;
  padding: 8px;
  color: var(--ink);
  font: 15px Arial,sans-serif
}

.threshold div span,.threshold small {
  font-size: 13px;
  color: var(--muted);
  margin-left: 8px
}

.threshold small {
  display: block;
  margin: 5px 0 0
}

.form-action {
  text-align: right
}

button {
  border: 1px solid #285a83;
  border-radius: 3px;
  background: #285a83;
  color: #fff;
  padding: 11px 18px;
  font: 700 14px Arial,sans-serif;
  cursor: pointer
}

button:hover {
  background: #1e4768
}

button:disabled {
  opacity: .55;
  cursor: wait
}

.htmx-indicator {
  display: none!important;
  color: var(--muted);
  font-size: 13px;
  margin-top: 6px
}

.htmx-request .htmx-indicator,.htmx-request.htmx-indicator {
  display: block!important
}

.workspace-foot {
  border-top: 1px solid var(--line);
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--muted);
  font-size: 12px
}

.empty-results,.results,.result-error {
  margin: 24px 0
}

.empty-results p:not(.eyebrow) {
  color: var(--muted);
  margin-bottom: 10px
}

.result-error,.network-error {
  border: 1px solid #dcb9ad;
  background: #fff8f5;
  color: #723c2e
}

.network-error {
  padding: 16px;
  margin: 24px 0
}

.summary-docs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 25px 0
}

.summary-docs>div {
  display: flex;
  align-items: start;
  gap: 12px;
  background: #f4f7f9;
  padding: 13px;
  min-width: 0
}

.doc-number {
  font-weight: 700;
  color: var(--blue)
}

.summary-docs strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 14px
}

.summary-docs small {
  display: block;
  color: var(--muted);
  font-size: 12px
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4,1fr);
  border: 1px solid var(--line)
}

.metric {
  padding: 16px;
  border-right: 1px solid var(--line);
  min-width: 0
}

.metric:last-child {
  border: 0
}

.metric.primary {
  background: #eff4f7
}

.metric>span,.match-meta,.match-pair span {
  font-size: 11px;
  font-weight: 700;
  color: #52677a
}

.metric strong {
  display: block;
  font-size: 25px;
  line-height: 1.3;
  margin: 9px 0 3px;
  font-variant-numeric: tabular-nums
}

.metric strong small {
  font-size: 15px
}

.metric p {
  font-size: 12px;
  color: var(--muted);
  margin: 0
}

.disclaimer {
  font-size: 13px;
  color: var(--muted);
  margin: 15px 0 22px
}

.warnings {
  background: #f7f8f9;
  border: 1px solid var(--line);
  padding: 14px 16px;
  font-size: 13px;
  margin-bottom: 24px
}

.warnings ul {
  margin: 5px 0 0;
  padding-left: 19px
}

.match-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  border-top: 1px solid var(--line);
  padding-top: 22px;
  margin-bottom: 12px;
  gap: 15px
}

.match-heading p {
  font-size: 13px;
  color: var(--muted);
  margin: 0
}

.match-heading>span {
  color: var(--muted);
  font-size: 12px
}

.match {
  border: 1px solid var(--line);
  margin: 12px 0
}

.match-meta {
  display: flex;
  justify-content: space-between;
  background: #f4f7f9;
  padding: 10px 14px
}

.match-meta strong {
  color: var(--blue)
}

.match-pair {
  display: grid;
  grid-template-columns: 1fr 1fr
}

.match-pair>div {
  padding: 16px;
  min-width: 0
}

.match-pair>div+div {
  border-left: 1px solid var(--line)
}

.match-pair p {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  margin: 8px 0 0
}

.no-matches {
  color: var(--muted);
  padding: 16px;
  background: #f4f7f9
}

.guide {
  padding: 34px 0 44px;
  max-width: 76ch
}

.guide p {
  margin-bottom: 14px
}

.formula {
  background: #e9eff3;
  padding: 13px 16px;
  overflow-wrap: anywhere
}

.guide details {
  border-top: 1px solid var(--line);
  padding-top: 14px
}

.guide summary {
  cursor: pointer;
  font-weight: 700
}

.guide details p,.samples {
  font-size: 13px;
  margin: 12px 0
}

.footer {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-top: 1px solid var(--line);
  padding: 20px 0 30px;
  color: var(--muted);
  font-size: 12px
}

@media(max-width:700px) {
  .shell {
    width: calc(100% - 32px)
  }

  .topbar-inner {
    flex-wrap: wrap;
    padding: 12px 0;
    font-size: 10px
  }

  .intro {
    padding: 35px 0 26px
  }

  h1 {
    font-size: 26px
  }

  .workspace,.results,.empty-results,.result-error {
    padding: 22px 18px
  }

  .documents,.summary-docs,.match-pair {
    grid-template-columns: 1fr
  }

  .form-bottom,.workspace-foot,.section-heading,.match-heading {
    align-items: start;
    flex-direction: column
  }

  .form-action {
    text-align: left
  }

  .metrics {
    grid-template-columns: 1fr 1fr
  }

  .metric:nth-child(2) {
    border-right: 0
  }

  .metric:nth-child(-n+2) {
    border-bottom: 1px solid var(--line)
  }

  .match-pair>div+div {
    border-left: 0;
    border-top: 1px solid var(--line)
  }

  .footer {
    flex-wrap: wrap
  }


}

@media(prefers-reduced-motion:reduce) {
  *,*::before,*::after {
    scroll-behavior: auto!important;
    animation-duration: .01ms!important;
    transition-duration: .01ms!important
  }


}
