:root {
  color-scheme: light;
  --ink: #242727;
  --muted: #50595e;
  --link: #245274;
  --rule: #d9dddf;
  --field: #81898d;
  --wash: #f5f6f6;
  --serif: Georgia, "Times New Roman", serif;
  --mono: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font: 100%/1.55 "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #fff;
}
* { box-sizing: border-box; }
body, h1, h2, h3, h4, p, dl, dd { margin: 0; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button, summary { cursor: pointer; }
a, .text-button { color: var(--link); text-underline-offset: .18em; }
a:hover, .text-button:hover { text-decoration-thickness: .13em; }
:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }
[tabindex="-1"]:focus:not(:focus-visible) { outline: none; }
:where(h2, h3, summary, select) { scroll-margin-top: 1rem; }
.skip:where(:not(:focus)), .sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
.skip:focus { position: fixed; top: .6rem; left: .6rem; z-index: 1; padding: .4rem .7rem; background: white; }
.shell { width: min(52rem, calc(100% - 2.5rem)); margin-inline: auto; }

.site-header, .footer, nav, .masthead, .actions, .section-header,
.match-facts, .fit-switch, .library-selection, .library-pagination, .origin-row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
}
.site-header, .footer, .section-header, .library-selection, .library-pagination { justify-content: space-between; gap: .5rem 1.5rem; }
.site-header { padding-block: 1.2rem 1rem; border-bottom: 1px solid var(--rule); }
.masthead { gap: .25rem .65rem; }
.site-name { font: 600 1.24rem/1.3 var(--serif); color: var(--ink); text-decoration: none; }
.masthead span { font: italic .96rem/1.5 var(--serif); color: var(--muted); }
.masthead span a { color: inherit; }
nav { gap: .3rem 1.15rem; }
nav a { padding-block: .22rem; font-size: .91rem; }
nav a[aria-current="page"] { font-weight: 600; color: var(--ink); text-decoration: none; }

h1, h2, #setup-title, #form-title { font-family: var(--serif); font-weight: 500; line-height: 1.2; }
h1 { font-size: clamp(1.95rem, 1.5rem + 1.7vw, 2.65rem); letter-spacing: -.025em; }
h2 { font-size: 1.65rem; letter-spacing: -.015em; }
h3 { font-size: 1.08rem; line-height: 1.4; }
.introduction, .library-view { padding-top: clamp(1.7rem, 4vw, 3rem); }
.introduction { padding-bottom: 1.9rem; }
.intro-text, .library-intro { max-width: 64ch; margin-top: .7rem; }
.actions { gap: .55rem 1rem; align-items: center; margin-top: 1.1rem; }
.privacy, .status, .hint, .origin-note, .registry-scope, .footer { color: var(--muted); font-size: .9rem; }
.privacy { margin-top: .55rem; }
.btn, .copy {
  display: inline-block;
  max-width: 100%;
  border: 1px solid var(--field);
  border-radius: 3px;
  background: #fff;
  color: var(--ink);
  padding: .45rem .85rem;
  text-align: center;
  text-decoration: none;
  line-height: 1.4;
  font-size: .95rem;
}
.btn:hover, .copy:hover { background: var(--wash); }
.btn.primary { background: var(--link); color: white; border-color: var(--link); }
.btn.primary:hover { background: #193d58; }
.compact, .copy { font-size: .89rem; padding: .36rem .65rem; }
button:disabled { cursor: default; opacity: .6; }
.text-button { background: none; border: 0; padding: .25rem 0; text-decoration: underline; font-size: .94rem; }

.hardware-section, .guide-section { padding-block: 1.4rem 1.65rem; border-top: 1px solid var(--rule); }
.section-header { margin-bottom: .6rem; }
.status { font-style: italic; }
.metrics { display: grid; grid-template-columns: 11rem minmax(0, 1fr); }
.metrics > * { padding-block: .37rem; }
.metrics > :nth-child(n+3) { border-top: 1px solid #eceeef; }
.metrics dt { font-weight: 550; padding-inline-end: .65rem; }
.metrics dd { color: var(--muted); overflow-wrap: anywhere; }
.metrics .text-button { margin-inline-start: .4rem; padding-block: 0; }
.panel { margin-top: 1.6rem; padding-top: 1.35rem; border-top: 1px solid var(--rule); }
#form-title, #setup-title { font-size: 1.45rem; }
.panel > p, .lookup p { margin-top: .45rem; }
.fields, .catalog-filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr)); gap: .8rem 1rem; margin: 1.1rem 0 .55rem; }
.fields label, .catalog-filters label, .tag-picker, .library-search { display: grid; align-content: start; gap: .25rem; min-width: 0; font-size: .92rem; font-weight: 600; }
.fields input, select, .library-search input {
  width: 100%; min-width: 0; max-width: 100%; min-height: 2.45rem; padding: .4rem .55rem;
  border: 1px solid var(--field); border-radius: 3px; background-color: #fff; font-size: 1rem; font-weight: 400;
}
select {
  appearance: none; padding-inline-end: 2rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='12' viewBox='0 0 16 12'%3E%3Cpath d='m4 4 4 4 4-4' fill='none' stroke='%2350595e' stroke-width='1.5'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right .5rem center;
}
input[type="checkbox"] { width: 1rem; height: 1rem; margin: 0; accent-color: var(--link); vertical-align: -.12em; }
.lookup { margin-block: .8rem; }
summary { width: fit-content; max-width: 100%; color: var(--link); }
summary::marker { font-size: .78em; }
summary:hover { text-decoration: underline; text-underline-offset: .18em; }
.lookup h4 { margin: 1rem 0 .25rem; }
.file-label { display: flex; flex-wrap: wrap; align-items: baseline; gap: .35rem .7rem; margin-top: .65rem; }
.file-label input { max-width: 100%; font-size: .94rem; }
.gpu-hint { margin-bottom: 1rem; }

.origin-controls { margin-block: 1.1rem; }
.origin-controls fieldset { margin: 0; min-width: 0; padding: 0; border: 0; }
.origin-controls legend { padding: 0; font-size: .92rem; font-weight: 600; }
.origin-row { gap: .25rem 1rem; align-items: center; margin-block: .3rem; }
.origin-row label, .fit-switch label { display: inline-flex; align-items: center; gap: .45rem; font-size: .94rem; cursor: pointer; }
.origin-note { margin-top: .25rem; }
.comparison, .library-list { display: grid; column-gap: 1.5rem; margin-block: 1rem; }
.comparison { grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.library-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.option-card, .library-card {
  min-width: 0; display: flex; flex-direction: column; align-items: flex-start;
  border-top: 1px solid var(--rule); padding: .85rem 0 1.05rem; overflow-wrap: anywhere;
}
.option-card.selected { border-top: 2px solid var(--link); padding-top: calc(.85rem - 1px); }
.role, .library-card small, .publisher-info, .card-facts, .control-line, .speed-label, .footprint, .match-facts { font-size: .9rem; color: var(--muted); }
.option-card h3, .library-card h2 { font: 600 1.18rem/1.35 var(--serif); margin: .15rem 0; }
.card-facts, .control-line, .speed-label, .footprint { margin-top: .35rem; }
.tradeoffs { margin: .55rem 0 .15rem; font-size: .95rem; }
.tradeoffs dt { font-weight: 600; margin-top: .35rem; }
.tradeoffs dd { margin-bottom: .35rem; }
.option-card .btn, .library-card .btn { margin-top: .7rem; }
#expand-matches { display: inline-block; }
#install-guide { border-top: 1px solid var(--rule); margin-top: 1.25rem; padding-top: 1.25rem; }
#setup-title { overflow-wrap: anywhere; }
.match-facts { gap: .25rem 1.2rem; margin-top: .5rem; }
.install-step { margin-top: 1.3rem; }
.install-step > p, .command-details p { max-width: 72ch; margin: .35rem 0 .6rem; }
.command-details { margin-top: .6rem; }
.command { display: flex; gap: .7rem; justify-content: space-between; align-items: start; padding: .55rem .65rem; margin: .55rem 0; border: 1px solid var(--rule); border-radius: 2px; background: var(--wash); }
code { font-family: var(--mono); font-size: .92em; }
.command code { align-self: center; min-width: 0; overflow-wrap: anywhere; white-space: pre-wrap; }
.copy { flex: none; }

.guide-section h2 { margin-bottom: .5rem; }
.faq details { padding-block: .32rem; }
.faq p { max-width: 72ch; margin: .4rem 0 .5rem; }
.library-view { padding-bottom: 2rem; }
.registry-scope { max-width: 76ch; margin: .55rem 0 1.3rem; }
.library-search { max-width: 34rem; }
.fit-switch { align-items: center; gap: .25rem .75rem; margin-block: .9rem; font-size: .9rem; }
.tag-picker { width: 100%; margin-top: .65rem; }
.library-selection label { display: flex; align-items: baseline; gap: .6rem; }
.library-selection select { width: auto; }
.library-pagination { align-items: center; margin: .7rem 0 1.5rem; }
#catalog-page { font-size: .9rem; }
.footer { border-top: 1px solid var(--rule); padding-block: 1rem 1.5rem; }
.footer a { color: inherit; }

@media (max-width: 42rem) {
  .comparison, .library-list { grid-template-columns: 1fr; }
  .site-header { align-items: center; }
}
@media (max-width: 32rem) {
  .shell { width: calc(100% - 2rem); }
  .site-header { align-items: flex-start; flex-direction: column; gap: .4rem; padding-block: .85rem; }
  .section-header { gap: .2rem .65rem; }
  .metrics { grid-template-columns: minmax(6.5rem, 39%) minmax(0, 1fr); }
  .metrics .text-button { margin-inline-start: 0; }
  .library-pagination { justify-content: flex-start; gap: .45rem; }
}
@media (forced-colors: active) {
  select { appearance: auto; background-image: none; }
  .option-card.selected { border-color: Highlight; }
}
