:root {
  color-scheme: light dark;

  --bg: #ffffff;
  --bg-soft: #f6f7f9;
  --surface: #ffffff;
  --ink: #0e1116;
  --ink-2: #353b45;
  --muted: #5d6573;
  --faint: #8a919e;
  --line: #e4e7ec;
  --line-strong: #cfd4dc;
  --accent: #1d4ed8;
  --accent-ink: #1e40af;
  --accent-soft: #eef3ff;
  --on-accent: #ffffff;
  --match: #b42318;
  --match-soft: #fef3f2;
  --match-line: #f9c7c1;
  --stale: #a15c07;
  --stale-soft: #fff8eb;
  --ok: #18794e;
  --code-bg: #f6f7f9;
  --code-ink: #1f2937;
  --tok-key: #1d4ed8;
  --tok-str: #0f766e;
  --tok-num: #b45309;
  --tok-lit: #7c3aed;
  --tok-comment: #8a919e;
  --focus: 0 0 0 3px rgb(29 78 216 / 28%);
  --shadow: 0 1px 2px rgb(16 24 40 / 5%);

  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --radius: 10px;
  --radius-sm: 7px;
  --wrap: 1040px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b0d11;
    --bg-soft: #11141a;
    --surface: #12151b;
    --ink: #eceef2;
    --ink-2: #c9ced6;
    --muted: #a0a7b3;
    --faint: #6f7785;
    --line: #232832;
    --line-strong: #323946;
    --accent: #7ea3ff;
    --accent-ink: #a8c1ff;
    --accent-soft: #172038;
    --on-accent: #0b0d11;
    --match: #ff9285;
    --match-soft: #2a1514;
    --match-line: #5b2622;
    --stale: #f0b35a;
    --stale-soft: #2a2010;
    --ok: #5fcf98;
    --code-bg: #0f1217;
    --code-ink: #d7dbe2;
    --tok-key: #8fb0ff;
    --tok-str: #6fd3c1;
    --tok-num: #f2b46b;
    --tok-lit: #c4a5ff;
    --tok-comment: #6f7785;
    --focus: 0 0 0 3px rgb(126 163 255 / 35%);
    --shadow: none;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: 76px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 var(--font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  line-height: 1.2;
  letter-spacing: -0.015em;
  font-weight: 650;
}

p {
  margin: 0;
}

a {
  color: var(--accent);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

code,
pre,
kbd {
  font-family: var(--mono);
  font-size: 0.875em;
}

:focus-visible {
  outline: none;
  box-shadow: var(--focus);
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 24px;
}

.mono {
  font-family: var(--mono);
  font-size: 0.875em;
}

.muted {
  color: var(--muted);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* top bar */

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 60px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 650;
  font-size: 17px;
  letter-spacing: -0.02em;
}

.brand:hover {
  text-decoration: none;
}

.brand svg {
  flex: none;
}

.mark-frame {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
}

.mark-line {
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  opacity: 0.45;
}

.mark-hit {
  stroke: var(--accent);
  stroke-width: 2.2;
  stroke-linecap: round;
}

.nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav a {
  color: var(--muted);
  font-size: 14.5px;
  padding: 6px 10px;
  border-radius: 6px;
}

.nav a:hover,
.nav a[aria-current="page"] {
  color: var(--ink);
  text-decoration: none;
}

.nav .btn {
  margin-left: 8px;
}

@media (max-width: 720px) {
  .nav .nav-section {
    display: none;
  }
}

/* buttons and fields */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 40px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: 550 15px/1 var(--font);
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.12s, border-color 0.12s, color 0.12s;
}

.btn:hover {
  border-color: var(--faint);
  text-decoration: none;
}

.btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.btn-primary {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--bg);
}

.btn-primary:hover {
  background: var(--ink-2);
  border-color: var(--ink-2);
}

.btn-small {
  height: 32px;
  padding: 0 12px;
  font-size: 14px;
}

.btn-link {
  height: auto;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font-weight: 500;
}

.btn-link:hover {
  text-decoration: underline;
}

.btn[aria-busy="true"]::before {
  content: "";
  width: 14px;
  height: 14px;
  border: 2px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

label,
.label {
  display: block;
  margin-bottom: 6px;
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 550;
}

input[type="text"],
input[type="password"],
input[type="date"],
input:not([type]),
select {
  display: block;
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
  font: 16px var(--font);
  transition: border-color 0.12s, box-shadow 0.12s;
}

input::placeholder {
  color: var(--faint);
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus);
}

select {
  appearance: none;
  padding-right: 36px;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 18px, calc(100% - 13px) 18px;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: var(--muted);
  font-size: 13.5px;
  font-weight: 450;
  cursor: pointer;
}

.check input {
  margin: 0;
  accent-color: var(--accent);
}

.hint {
  color: var(--muted);
  font-size: 13.5px;
}

/* key panel */

.key-panel {
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
}

.key-panel .wrap {
  padding-top: 18px;
  padding-bottom: 18px;
}

.key-form .row {
  display: flex;
  gap: 8px;
  max-width: 560px;
}

.key-form .hint {
  margin-top: 8px;
  max-width: 640px;
}

.key-active {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  font-size: 14.5px;
}

.key-active .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--ok);
}

/* hero */

.hero {
  padding: 64px 0 28px;
}

.eyebrow {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(32px, 5vw, 48px);
  letter-spacing: -0.03em;
  line-height: 1.08;
}

.lede {
  max-width: 660px;
  margin-top: 18px;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.facts-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin-top: 22px;
  padding: 0;
  list-style: none;
  color: var(--ink-2);
  font-size: 14px;
}

.facts-row li {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.facts-row li::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

/* sections and cards */

.section {
  padding: 28px 0 40px;
}

.section + .section {
  border-top: 1px solid var(--line);
  padding-top: 56px;
}

.section-head {
  max-width: 680px;
  margin-bottom: 22px;
}

.section-head h2 {
  font-size: 26px;
  letter-spacing: -0.02em;
}

.section-head p {
  margin-top: 8px;
  color: var(--muted);
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* search form */

.search-card {
  padding: 24px;
}

.search-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr;
  gap: 16px;
  margin-top: 16px;
}

.name-input {
  height: 50px !important;
  font-size: 18px !important;
}

.label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 21px;
  margin-bottom: 6px;
}

.label-row label:first-child {
  margin: 0;
}

.form-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.form-foot .btn {
  min-width: 128px;
}

@media (max-width: 760px) {
  .search-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-foot {
    flex-direction: column-reverse;
    align-items: stretch;
  }
}

/* alerts */

.alert {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--match-line);
  border-radius: var(--radius-sm);
  background: var(--match-soft);
  color: var(--ink);
  font-size: 15px;
}

.alert-meta {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.alert .btn-link {
  margin-top: 8px;
}

.notice {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg-soft);
  font-size: 14.5px;
}

/* result */

.result {
  margin-top: 20px;
  overflow: hidden;
}

.result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 14px;
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
}

.result-head h3 {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
}

.result-head h3::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--faint);
}

.result-head.is-match {
  background: var(--match-soft);
  border-bottom-color: var(--match-line);
}

.result-head.is-match h3 {
  color: var(--match);
}

.result-head.is-match h3::before {
  background: var(--match);
}

.result-query {
  color: var(--muted);
  font-size: 14.5px;
  overflow-wrap: anywhere;
}

.result-meta {
  margin-left: auto;
  color: var(--muted);
  font-size: 13.5px;
  white-space: nowrap;
}

.matches {
  margin: 0;
  padding: 0;
  list-style: none;
}

.match {
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
}

.match-top {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.match-list {
  color: var(--muted);
  font-size: 13.5px;
}

.match-list strong {
  color: var(--ink-2);
  font-weight: 600;
}

.match-name {
  margin-top: 4px;
  font-size: 19px;
  overflow-wrap: anywhere;
}

.match-alias {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.score {
  flex: none;
  min-width: 76px;
  text-align: right;
}

.score-num {
  display: block;
  font-size: 30px;
  font-weight: 650;
  line-height: 1;
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.score-label {
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.score-bar {
  height: 4px;
  margin-top: 8px;
  border-radius: 2px;
  background: var(--line);
  overflow: hidden;
}

.score-bar span {
  display: block;
  height: 100%;
  background: var(--match);
}

.facts {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 12px 24px;
  margin: 18px 0 0;
}

.facts dt {
  color: var(--faint);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.facts dd {
  margin: 2px 0 0;
  font-size: 14.5px;
  overflow-wrap: anywhere;
}

.reasons {
  width: 100%;
  margin-top: 18px;
  border-collapse: collapse;
  font-size: 14px;
}

.reasons td {
  padding: 8px 0;
  border-top: 1px solid var(--line);
  vertical-align: top;
}

.reasons td:first-child {
  width: 110px;
  color: var(--muted);
}

.reasons td:nth-child(2) {
  width: 56px;
  padding-right: 12px;
  font-family: var(--mono);
  font-size: 13px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.reasons td:last-child {
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink-2);
  overflow-wrap: anywhere;
}

.match-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 20px;
  margin-top: 14px;
  font-size: 14px;
}

.match-foot a {
  font-weight: 550;
  white-space: nowrap;
}

.entry-id {
  min-width: 0;
  color: var(--faint);
  font-size: 13px;
}

.entry-id code {
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font-size: 12.5px;
  overflow-wrap: anywhere;
}

.receipt {
  padding: 20px 24px 22px;
  background: var(--bg-soft);
  font-size: 14px;
}

.receipt h4 {
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.receipt-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 12px 24px;
  margin: 0;
}

.receipt-grid .wide {
  grid-column: span 2;
}

.receipt-grid dt {
  color: var(--faint);
  font-size: 12.5px;
}

.receipt-grid dd {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 2px 0 0;
  overflow-wrap: anywhere;
}

.copy {
  flex: none;
  height: 24px;
  white-space: nowrap;
  padding: 0 8px;
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  background: var(--surface);
  color: var(--muted);
  font: 500 12px var(--font);
  cursor: pointer;
}

.copy:hover {
  color: var(--ink);
}

.receipt details {
  margin-top: 16px;
}

.receipt summary {
  color: var(--ink-2);
  font-weight: 550;
  cursor: pointer;
}

.receipt .disclaimer {
  margin-top: 16px;
  color: var(--muted);
}

/* tables */

.table-wrap {
  overflow-x: auto;
}

.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14.5px;
}

.table th {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

.table tr:last-child td {
  border-bottom: 0;
}

.table .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table .sub {
  display: block;
  color: var(--faint);
  font-family: var(--mono);
  font-size: 12.5px;
}

.table .sub-text {
  display: block;
  color: var(--faint);
  font-size: 12.5px;
}

.table .nowrap {
  white-space: nowrap;
}

.table-compact th,
.table-compact td {
  padding: 7px 12px 7px 0;
  font-size: 13px;
}

.table-compact td {
  font-family: var(--mono);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 550;
  white-space: nowrap;
}

.badge::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--faint);
}

.badge-current::before {
  background: var(--ok);
}

.badge-stale {
  color: var(--stale);
  background: var(--stale-soft);
}

.badge-stale::before {
  background: var(--stale);
}

.badge-unavailable {
  color: var(--match);
  background: var(--match-soft);
}

.badge-unavailable::before {
  background: var(--match);
}


@media (max-width: 640px) {
  .hide-narrow,
  .table .hide-narrow {
    display: none;
  }
}

/* upload */

.upload-card {
  padding: 24px;
}

.drop {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 168px;
  margin: 0;
  padding: 24px;
  border: 1.5px dashed var(--line-strong);
  border-radius: var(--radius);
  background: var(--bg-soft);
  text-align: center;
  cursor: pointer;
  transition: border-color 0.12s, background-color 0.12s;
}

.drop:hover,
.drop.is-over {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.drop:focus-within {
  box-shadow: var(--focus);
}

.drop input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.drop-title {
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
}

.drop-sub {
  max-width: 520px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 400;
}

.file-line {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px 16px;
}

.file-name {
  font-size: 17px;
  font-weight: 600;
  overflow-wrap: anywhere;
}

.mapping {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin-top: 18px;
}

@media (max-width: 760px) {
  .mapping {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 440px) {
  .mapping {
    grid-template-columns: 1fr;
  }
}

.sample {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
}

.sample .table td,
.sample .table th {
  padding: 8px 12px;
  font-size: 13.5px;
}

.sample .table td {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.upload-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-top: 20px;
}

.limits {
  margin-top: 16px;
}

progress {
  display: block;
  width: 100%;
  height: 8px;
  margin: 4px 0 12px;
  border: 0;
  border-radius: 4px;
  background: var(--line);
  overflow: hidden;
  appearance: none;
}

progress::-webkit-progress-bar {
  background: var(--line);
}

progress::-webkit-progress-value {
  background: var(--accent);
  transition: width 0.2s;
}

progress::-moz-progress-bar {
  background: var(--accent);
}

.progress-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}

.summary-line {
  font-size: 17px;
  font-weight: 600;
}

.counts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 14.5px;
  font-variant-numeric: tabular-nums;
}

.counts strong {
  color: var(--ink);
}

.counts .is-match strong {
  color: var(--match);
}

/* api section */

.api-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr);
  gap: 40px;
  align-items: start;
}

.api-grid h2 {
  font-size: 26px;
  letter-spacing: -0.02em;
}

.api-grid > div > p {
  margin-top: 10px;
  color: var(--muted);
}

.points {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.points li {
  padding: 9px 0;
  border-top: 1px solid var(--line);
  font-size: 15px;
}

.points li:last-child {
  border-bottom: 1px solid var(--line);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 22px;
}

@media (max-width: 860px) {
  .api-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }
}

/* code */

pre {
  margin: 0;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--code-bg);
  color: var(--code-ink);
  font-size: 13.5px;
  line-height: 1.6;
  overflow-x: auto;
  tab-size: 2;
}

pre code {
  font-size: inherit;
}

:not(pre) > code {
  padding: 1px 5px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--code-bg);
  font-size: 0.85em;
  overflow-wrap: anywhere;
}

.tok-key {
  color: var(--tok-key);
}

.tok-str {
  color: var(--tok-str);
}

.tok-num {
  color: var(--tok-num);
}

.tok-lit {
  color: var(--tok-lit);
}

.tok-comment {
  color: var(--tok-comment);
}

.code-block {
  position: relative;
}

.code-block .copy {
  position: absolute;
  top: 10px;
  right: 10px;
  opacity: 0;
  transition: opacity 0.12s;
}

.code-block:hover .copy,
.code-block .copy:focus-visible {
  opacity: 1;
}

@media (hover: none) {
  .code-block .copy {
    opacity: 1;
  }
}

/* footer */

.footer {
  margin-top: 40px;
  padding: 36px 0 48px;
  border-top: 1px solid var(--line);
  background: var(--bg-soft);
  color: var(--muted);
  font-size: 14px;
}

.footer-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 20px 40px;
}

.footer .disclaimer {
  max-width: 560px;
}

.footer .disclaimer strong {
  color: var(--ink);
}

.footer nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}

.footer nav a {
  color: var(--muted);
}

.footer nav a:hover {
  color: var(--ink);
}

.footer .legal {
  margin-top: 20px;
  color: var(--faint);
  font-size: 13px;
}

/* docs */

.docs {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 56px;
  padding-top: 40px;
  padding-bottom: 40px;
}

.toc {
  position: sticky;
  top: 84px;
  align-self: start;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  font-size: 14.5px;
}

.toc p {
  margin-bottom: 8px;
  color: var(--faint);
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.toc ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.toc a {
  display: block;
  padding: 5px 0 5px 12px;
  border-left: 1px solid var(--line);
  color: var(--muted);
}

.toc a:hover {
  color: var(--ink);
  text-decoration: none;
  border-left-color: var(--faint);
}

.toc a.is-active {
  color: var(--ink);
  border-left-color: var(--accent);
  font-weight: 550;
}

.doc {
  min-width: 0;
  max-width: 760px;
}

.doc > section {
  padding-bottom: 48px;
}

.doc > section + section {
  padding-top: 48px;
  border-top: 1px solid var(--line);
}

.doc h1 {
  font-size: clamp(30px, 4vw, 38px);
  letter-spacing: -0.03em;
}

.doc h2 {
  font-size: 26px;
  letter-spacing: -0.02em;
}

.doc h3 {
  margin-top: 32px;
  font-size: 18px;
}

.doc p,
.doc ul,
.doc ol,
.doc .table-wrap,
.doc .code-block,
.doc dl {
  margin-top: 14px;
}

.doc ul,
.doc ol {
  padding-left: 22px;
}

.doc li + li {
  margin-top: 6px;
}

.doc .lede {
  font-size: 18px;
}

.doc .table-wrap {
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.doc .table th,
.doc .table td {
  padding: 9px 14px;
  font-size: 14px;
}

.doc .table td code {
  white-space: nowrap;
}

.anchor {
  margin-left: 8px;
  color: var(--faint);
  font-weight: 400;
  opacity: 0;
}

h2:hover .anchor,
h3:hover .anchor,
.anchor:focus-visible {
  opacity: 1;
  text-decoration: none;
}

.endpoint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 14px;
}

.method {
  padding: 2px 7px;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 12px;
  font-weight: 700;
}

.err-list {
  margin-top: 20px;
}

.err {
  padding: 16px 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 80px;
}

.err:target {
  margin: 0 -16px;
  padding: 16px;
  border-radius: var(--radius-sm);
  border-top-color: transparent;
  background: var(--accent-soft);
}

.err h3 {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 12px;
  margin: 0;
  font-size: 16px;
}

.err h3 code {
  padding: 0;
  border: 0;
  background: none;
  font-size: 15px;
}

.err-meta {
  color: var(--muted);
  font-size: 13px;
  font-weight: 450;
  font-family: var(--mono);
}

.err p {
  margin-top: 6px;
  font-size: 15px;
}

.callout {
  margin-top: 16px;
  padding: 14px 16px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--bg-soft);
  font-size: 15px;
}

.callout-warn {
  border-left-color: var(--match);
}

.changelog dt {
  margin-top: 14px;
  font-family: var(--mono);
  font-size: 14px;
  font-weight: 600;
}

.changelog dd {
  margin: 4px 0 0;
}

@media (max-width: 900px) {
  .docs {
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
    padding-top: 24px;
  }

  .toc {
    position: static;
    max-height: none;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
  }

  .toc ol {
    columns: 2;
    column-gap: 16px;
  }

  .toc a {
    padding: 4px 0;
    border-left: 0;
  }
}

@media (max-width: 520px) {
  .wrap {
    padding: 0 16px;
  }

  .hero {
    padding-top: 40px;
  }

  .lede {
    font-size: 16.5px;
  }

  .search-card,
  .upload-card {
    padding: 18px;
  }

  .result-head,
  .match,
  .receipt {
    padding-left: 18px;
    padding-right: 18px;
  }

  .match-top {
    gap: 12px;
  }

  .score-num {
    font-size: 26px;
  }

  .receipt-grid .wide {
    grid-column: 1 / -1;
  }

  .reasons td:first-child {
    width: 84px;
  }

  .table th,
  .table td {
    padding-left: 12px;
    padding-right: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
