:root {
  color-scheme: light;
  --paper: #f4f1e8;
  --surface: #fffdf6;
  --ink: #212b25;
  --muted: #526259;
  --rule: #c9c9b7;
  --green: #304f3b;
  --moss: #dfe7d6;
  --gold: #6c4f18;
  --gold-pale: #f2e6c5;
  --rust: #743b2e;
  --rust-pale: #f3e3dc;
  --title: Georgia, "Times New Roman", serif;
  --body: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --mono: "Cascadia Mono", "SFMono-Regular", Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 1rem/1.55 var(--body);
}

a { color: var(--green); text-underline-offset: .2em; }
a:hover { color: var(--ink); }
button, input, select { font: inherit; }
input, select { min-width: 0; }
p, h1, h2, h3, h4, dl, ul { margin: 0; }
ul { list-style: none; padding: 0; }

:focus-visible { outline: 3px solid #216554; outline-offset: 3px; }
.skip { position: fixed; top: .75rem; left: .75rem; padding: .5rem 1rem; background: var(--surface); transform: translateY(-200%); z-index: 2; }
.skip:focus { transform: none; }
.shell { width: min(74rem, calc(100% - 5rem)); margin-inline: auto; }
.masthead { border-bottom: 1px solid var(--rule); }
.masthead-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4rem; }
.masthead a { display: inline-flex; align-items: center; min-height: 2.75rem; text-decoration: none; }
.brand { font-weight: 700; color: var(--ink); }
.brand-mark { inline-size: .85rem; block-size: .85rem; border: 2px solid var(--green); border-top-color: transparent; border-radius: 50%; transform: rotate(-35deg); }
.brand-mark::after { content: ""; display: block; inline-size: .35rem; block-size: .12rem; background: var(--green); margin: .25rem 0 0 .4rem; }
.brand, .masthead nav { display: flex; gap: .6rem; }
.masthead nav { gap: 1.5rem; }
.masthead nav a { font-size: .9rem; font-weight: 650; }

.intro { display: grid; grid-template-columns: minmax(0, 1fr) minmax(13rem, 17rem); align-items: end; gap: clamp(1rem, 6vw, 6rem); padding-block: clamp(3rem, 7vw, 6rem) 3rem; }
.eyebrow { font: 650 .73rem/1.5 var(--mono); letter-spacing: .10em; text-transform: uppercase; color: var(--green); }
h1, h2 { font-family: var(--title); font-weight: 400; line-height: 1.04; }
h1 { max-width: 17ch; margin-block: .55rem .95rem; font-size: clamp(2.45rem, 5.7vw, 5.5rem); letter-spacing: -.055em; }
h2 { font-size: clamp(1.85rem, 3vw, 2.65rem); letter-spacing: -.027em; }
.lede { max-width: 54ch; color: var(--muted); font-size: clamp(1rem, 1.6vw, 1.125rem); }
.intro-note { border-top: 1px solid var(--green); padding-top: .75rem; color: var(--muted); font-size: .92rem; }
.intro-note strong { color: var(--ink); }
.intro-note p { margin-block: .25rem; }
.intro-note a { display: inline-flex; align-items: center; gap: .2rem; min-height: 2.75rem; font-weight: 650; }

.viewer { background: var(--surface); border: 1px solid var(--rule); border-top: 3px solid var(--green); }
.viewer-head { display: flex; align-items: center; justify-content: space-between; gap: .85rem 1.5rem; padding: 1.35rem clamp(1rem, 2.6vw, 2rem); }
.viewer-head p { margin-top: .35rem; color: var(--muted); font-size: .91rem; overflow-wrap: anywhere; }
.viewer-head > div { min-width: 0; }
.actions, .pager { display: flex; flex-wrap: wrap; gap: .55rem; }
button { min-height: 2.75rem; padding: .42rem .85rem; border: 1px solid var(--muted); background: var(--surface); color: var(--ink); border-radius: .18rem; font-size: .9rem; font-weight: 650; cursor: pointer; }
button:enabled:hover { background: var(--moss); border-color: var(--green); }
button[aria-pressed="true"] { background: var(--moss); border-color: var(--green); text-decoration: underline; text-underline-offset: .2em; }
button.primary { background: var(--green); color: var(--surface); border-color: var(--green); }
button.primary:enabled:hover { background: #253d2f; }
button:disabled { cursor: default; opacity: .5; }
.notice, .blank { color: var(--muted); padding: .85rem clamp(1rem, 2.6vw, 2rem); border-top: 1px solid var(--rule); }
.notice:empty { padding: 0; border: 0; }
.notice[data-error] { color: var(--rust); background: var(--rust-pale); }
.local-note { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }

.release-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); border-block: 1px solid var(--rule); background: #e9ebdf; }
.release-strip > div { display: grid; align-content: start; gap: .22rem; min-width: 0; padding: .8rem clamp(1rem, 2.6vw, 2rem); }
.release-strip > div + div { border-inline-start: 1px solid var(--rule); }
.release-strip dt { color: var(--muted); font-size: .77rem; font-weight: 650; }
.release-strip dd { margin: 0; font: 650 clamp(.9rem, 2vw, 1.2rem)/1.4 var(--mono); color: var(--green); overflow-wrap: anywhere; }
.group-impact { padding: .95rem clamp(1rem, 2.6vw, 2rem) .65rem; border-bottom: 1px solid var(--rule); background: #f7f6eb; }
.group-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .7rem 1rem; align-items: end; }
.group-head h3 { font-size: 1.05rem; }
.group-head p, .group-impact details p { margin-top: .2rem; color: var(--muted); font-size: .83rem; }
.group-head .filter-field { width: min(100%, 15rem); }
.group-id { margin-top: .75rem; overflow-wrap: anywhere; color: var(--green); font: 650 .82rem/1.5 var(--mono); }
.group-metrics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 .85rem; max-width: 40rem; margin-top: .3rem; }
.group-metrics > div { min-width: 0; padding: .45rem .65rem; border-top: 1px solid var(--rule); }
.group-metrics dt { color: var(--muted); font-size: .73rem; }
.group-metrics dd { margin: 0; overflow-wrap: anywhere; font-size: .85rem; }
.group-metrics dd strong { font-size: 1.18rem; font-weight: 650; }
.group-metrics dd span { display: block; margin-top: .1rem; color: var(--muted); font-size: .77rem; }
.group-impact details { margin-top: .2rem; }
.group-impact summary { cursor: pointer; width: fit-content; min-height: 2.75rem; padding-block: .55rem; color: var(--green); font-size: .84rem; font-weight: 650; }
.group-impact details dl { display: grid; grid-template-columns: minmax(6rem, 11rem) minmax(0, 1fr); gap: .3rem .65rem; margin: .55rem 0 .65rem; font-size: .79rem; }
.group-impact details dt { color: var(--muted); }
.group-impact details dd { margin: 0; overflow-wrap: anywhere; font-family: var(--mono); }
.filters { display: flex; flex-wrap: wrap; gap: .7rem 1.05rem; align-items: end; padding: .9rem clamp(1rem, 2.6vw, 2rem); }
.filter-field { display: grid; gap: .25rem; min-width: min(13rem, 100%); }
.filter-field label { font-size: .79rem; font-weight: 650; color: var(--muted); }
.filter-field input, .filter-field select { min-height: 2.75rem; border: 1px solid var(--muted); border-radius: .18rem; background: var(--surface); color: var(--ink); padding: .3rem .6rem; font-size: 1rem; }
.filter-field input::placeholder { color: var(--muted); }

.comparison { width: 100%; table-layout: fixed; border-collapse: collapse; overflow-wrap: anywhere; }
.comparison th, .comparison td { padding: .85rem clamp(.7rem, 1.65vw, 1.35rem); text-align: start; vertical-align: top; }
.comparison th:first-child, .comparison td:first-child { padding-inline-start: clamp(1rem, 2.6vw, 2rem); width: 21%; }
.comparison th:last-child, .comparison td:last-child { width: 17%; }
.comparison thead { background: var(--paper); color: var(--muted); font-size: .78rem; }
.comparison tr { border-top: 1px solid var(--rule); }
.comparison tbody tr:nth-child(even) { background: #faf8ef; }
.key, .accession, code { font-family: var(--mono); }
.key { font-size: .96rem; font-weight: 700; }
.row-meta, .match-detail, .candidate-label { margin-top: .18rem; color: var(--muted); font-size: .77rem; line-height: 1.45; }
.candidate-label { margin-top: .55rem; font-weight: 700; }
.pair-id { color: var(--green); font-size: .83rem; }
.pair-evidence-label { border-top: 1px solid var(--rule); margin-top: .25rem; padding-top: .4rem; }
.pair-evidence-label:not(:first-of-type) { margin-top: .7rem; }
.match-detail .accession { font-size: .74rem; }
.match + .match { margin-top: .45rem; }
.match strong { font-size: .94rem; }
.pill { display: inline-block; padding: .15rem .38rem; color: var(--green); background: var(--moss); border-radius: .15rem; font-size: .75rem; font-weight: 700; line-height: 1.35; }
.pill.review { color: var(--gold); background: var(--gold-pale); }
.pill.alert { color: var(--rust); background: var(--rust-pale); }
.pill.neutral { color: var(--muted); background: #eeece1; }
.indicators { display: flex; flex-direction: column; align-items: start; gap: .3rem; }
.state { margin-bottom: .4rem; }
.cell-label { display: none; }
.table-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; padding: .65rem clamp(1rem, 2.6vw, 2rem); border-top: 1px solid var(--rule); }
#row-range { color: var(--muted); font-size: .83rem; }
.provenance { padding: 0 clamp(1rem, 2.6vw, 2rem) .45rem; border-top: 1px solid var(--rule); }
.provenance summary { cursor: pointer; padding-block: .65rem; font-size: .92rem; font-weight: 650; min-height: 2.75rem; color: var(--green); }
.provenance dl { display: grid; grid-template-columns: minmax(8rem, 12.5rem) minmax(0, 1fr); gap: .4rem .8rem; padding-bottom: .75rem; }
.provenance dt { color: var(--muted); font-size: .78rem; }
.provenance dd { margin: 0; font: .77rem/1.55 var(--mono); overflow-wrap: anywhere; }

.guide { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.45fr); gap: 2rem clamp(2rem, 7vw, 6rem); padding-block: clamp(3rem, 7vw, 5.5rem); }
.guide h2 { margin-block: .35rem .75rem; }
.guide p { max-width: 65ch; color: var(--muted); }
.guide h3 { margin-bottom: .25rem; font-size: 1rem; }
.guide-content > section + section { margin-top: 1.35rem; padding-top: 1rem; border-top: 1px solid var(--rule); }
.guide-content p + p { margin-top: .5rem; }
pre { margin: .65rem 0 0; padding: .8rem; border: 1px solid var(--rule); background: var(--surface); font-size: .86rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.guide pre + p { margin-top: .5rem; }
.footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .35rem 1rem; padding-block: .9rem 1.2rem; border-top: 1px solid var(--rule); color: var(--muted); font-size: .82rem; }

@media (max-width: 48rem) {
  .shell { width: calc(100% - 2rem); }
  .masthead nav { gap: .75rem; }
  .intro { grid-template-columns: 1fr; padding-block: 2.4rem 1.65rem; }
  .intro-note { max-width: 43ch; }
  .viewer-head { flex-wrap: wrap; }
  .guide { grid-template-columns: 1fr; gap: 1.15rem; }
}

@media (max-width: 38rem) {
  .masthead-inner { gap: 0 .6rem; flex-wrap: wrap; }
  .masthead nav a, .masthead a.brand { font-size: .82rem; }
  .intro-note { display: none; }
  .local-note { position: static; width: auto; height: auto; padding: 0 1rem .7rem; clip-path: none; color: var(--muted); font-size: .79rem; }
  .release-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .release-strip > div:nth-child(3) { border-inline-start: 0; }
  .release-strip > div:nth-child(n + 3) { border-top: 1px solid var(--rule); }
  .filters { display: grid; }
  .group-metrics > div { padding-inline: 0; }
  .comparison, .comparison tbody { display: block; }
  .comparison thead { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); }
  .comparison tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .comparison tbody tr > td:first-child { grid-column: 1 / -1; width: auto; }
  .comparison tbody tr > td:last-child { grid-column: 1 / -1; width: auto; padding-top: .35rem; }
  .comparison td { padding: .65rem 1rem; }
  .comparison td:nth-child(2), .comparison td:nth-child(3) { padding-top: 0; padding-bottom: .35rem; }
  .cell-label { display: block; margin-bottom: .2rem; color: var(--muted); font-size: .71rem; font-weight: 650; }
  .provenance dl { grid-template-columns: 1fr; row-gap: .2rem; }
  .provenance dd + dt { margin-top: .35rem; }
}

@media (forced-colors: active) {
  :focus-visible { outline-color: Highlight; }
  button[aria-pressed="true"] { border-color: Highlight; }
  .pair-status { border: 1px solid currentColor; }
}
