/* =========================================================================
   addressable.wiki
   Hand-written, no framework. Tokens are documented in /design.md.

   Theming contract: the complete palette is defined on bare :root (light).
   Dark overrides only the tokens, twice — once under prefers-color-scheme for
   the default "system" state, once under [data-theme="dark"] so an explicit
   toggle wins in both directions. No colour is ever defined ONLY inside a
   media query.
   ========================================================================= */

:root {
  /* ── neutrals ─────────────────────────────────────────────────────── */
  --bg:            #fbfbfa;
  --bg-raised:     #ffffff;
  --bg-sunken:     #f4f4f2;
  --bg-hover:      #f0f0ee;
  --hairline:      #e4e4e0;
  --hairline-firm: #d2d2cc;

  --ink:           #16171a;
  --ink-soft:      #5b5f66;
  --ink-faint:     #6e747d;

  /* ── accent: drawn from an actual LED, used sparingly ─────────────── */
  --led-r:         #ff2d2d;
  --led-g:         #24d05a;
  --led-b:         #3d7bff;
  --accent:        #0f62d6;
  --accent-soft:   color-mix(in srgb, var(--accent) 12%, transparent);
  --accent-ink:    #ffffff;

  /* white-channel tints, so an RGBW chip shows its actual temperature */
  --w-warm:        #ffc98a;
  --w-neutral:     #fff3df;
  --w-cool:        #dcecff;

  /* ── LED package plastic (the header strip) ───────────────────────── */
  --fn-power:      #d62f2f;
  --fn-ground:     #5b5f66;
  --fn-data:       #0f62d6;
  --fn-clock:      #b35a00;
  --fn-backup:     #7a3fc4;
  --led-body:      #eceae5;
  --led-edge:      #c9c6c0;
  --led-pad:       #b0b4ba;
  --led-lens:      #b3b7ba;
  --led-lens-edge: #93989c;

  /* ── semantic ─────────────────────────────────────────────────────── */
  --ok:            #15803d;
  --warn:          #b45309;
  --danger:        #b91c1c;
  --muted-fill:    color-mix(in srgb, var(--ink) 8%, transparent);

  /* ── type ─────────────────────────────────────────────────────────── */
  --sans: "Inter var", "Inter", ui-sans-serif, system-ui, -apple-system,
          "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "IBM Plex Mono", ui-monospace, SFMono-Regular,
          "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;

  --t-xs:   11px;
  --t-sm:   12px;
  --t-base: 13.5px;
  --t-md:   15px;
  --t-lg:   19px;
  --t-xl:   26px;
  --t-2xl:  34px;

  /* ── space (4px base) ─────────────────────────────────────────────── */
  --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
  --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 64px;

  /* ── radii & elevation ────────────────────────────────────────────── */
  --r-sm: 3px; --r-md: 5px; --r-lg: 8px; --r-full: 999px;
  --shadow: 0 1px 2px rgb(0 0 0 / .05), 0 4px 12px rgb(0 0 0 / .05);

  /* ── table metrics ────────────────────────────────────────────────── */
  --row-h: 34px;
  --row-pad-y: 5px;

  color-scheme: light;
}

/* Dark by default when the reader has expressed no preference. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:            #0c0d10;
    --bg-raised:     #131519;
    --bg-sunken:     #090a0c;
    --bg-hover:      #1a1d23;
    --hairline:      #24272e;
    --hairline-firm: #333741;

    --ink:           #eceef2;
    --ink-soft:      #9aa1ad;
    --ink-faint:     #7b828f;

    --led-r:         #ff4d4d;
    --led-g:         #35e26c;
    --led-b:         #5b90ff;
    --accent:        #5b90ff;
    --accent-soft:   color-mix(in srgb, var(--accent) 16%, transparent);
    --accent-ink:    #08090b;

    --w-warm:        #ffb45c;
    --w-neutral:     #ffeccd;
    --w-cool:        #bcd9ff;

  --led-body:      #cfccc6;
  --led-edge:      #a5a29c;
  --led-pad:       #8b9096;
  --led-lens:      #8d9296;
  --led-lens-edge: #6e7378;

    --fn-power:      #ff6b6b;
    --fn-ground:     #9aa1ad;
    --fn-data:       #5b90ff;
    --fn-clock:      #f0a04b;
    --fn-backup:     #b58cff;
    --led-body:      #cfccc6;
    --led-edge:      #a5a29c;
    --led-pad:       #8b9096;
    --led-lens:      #8d9296;
    --led-lens-edge: #6e7378;

    --ok:            #4ade80;
    --warn:          #fbbf24;
    --danger:        #f87171;
    --muted-fill:    color-mix(in srgb, var(--ink) 10%, transparent);

    --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .3);
    color-scheme: dark;
  }
}

/* An explicit choice wins over the system preference, both ways. */
:root[data-theme="dark"] {
  --bg:            #0c0d10;
  --bg-raised:     #131519;
  --bg-sunken:     #090a0c;
  --bg-hover:      #1a1d23;
  --hairline:      #24272e;
  --hairline-firm: #333741;
  --ink:           #eceef2;
  --ink-soft:      #9aa1ad;
  --ink-faint:     #7b828f;
  --led-r:         #ff4d4d;
  --led-g:         #35e26c;
  --led-b:         #5b90ff;
  --accent:        #5b90ff;
  --accent-soft:   color-mix(in srgb, var(--accent) 16%, transparent);
  --accent-ink:    #08090b;
  --w-warm:        #ffb45c;
  --w-neutral:     #ffeccd;
  --w-cool:        #bcd9ff;
  --fn-power:      #ff6b6b;
  --fn-ground:     #9aa1ad;
  --fn-data:       #5b90ff;
  --fn-clock:      #f0a04b;
  --fn-backup:     #b58cff;
  --led-body:      #cfccc6;
  --led-edge:      #a5a29c;
  --led-pad:       #8b9096;
  --led-lens:      #8d9296;
  --led-lens-edge: #6e7378;
  --ok:            #4ade80;
  --warn:          #fbbf24;
  --danger:        #f87171;
  --muted-fill:    color-mix(in srgb, var(--ink) 10%, transparent);
  --shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px rgb(0 0 0 / .3);
  color-scheme: dark;
}

/* ── reset ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
/* Any author-level `display` beats the UA stylesheet's [hidden] rule, so an
   element given `display: flex` here would ignore el.hidden entirely. The JS
   toggles `hidden` on the chip bar, the filter-count badge and every row, so
   this has to win. */
[hidden] { display: none !important; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: var(--t-base)/1.5 var(--sans);
  font-feature-settings: "cv05" 1, "ss01" 1;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { margin: 0; font-weight: 590; letter-spacing: -0.015em; line-height: 1.2; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: var(--r-sm); }

.mono { font-family: var(--mono); font-size: 0.94em; font-variant-ligatures: none; }
/* Tabular figures everywhere a number sits in a column. */
.num, .num *, td.mono, th.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-faint); }

.skip {
  position: absolute; left: -9999px; top: var(--s-2);
  background: var(--accent); color: var(--accent-ink);
  padding: var(--s-2) var(--s-4); border-radius: var(--r-md); z-index: 100;
}
.skip:focus { left: var(--s-4); }

/* ── header ────────────────────────────────────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 40;
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--s-4);
  padding: var(--s-3) var(--s-5);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}
.wordmark {
  /* No gap: "addressable" and ".wiki" are one word, split only by colour.
     The 8px gap here was left over from the status dot that used to sit
     between them. */
  display: inline-flex; align-items: baseline;
  color: var(--ink); font-weight: 600; letter-spacing: -0.02em;
}
.wordmark:hover { text-decoration: none; }
.wordmark-tld { color: var(--ink-faint); font-weight: 450; }
/* The header LED strip, drawn as real 5050 packages.
   An unlit NeoPixel is not a black dot: it is a light plastic square with four
   grey solder pads and a slightly darker grey circular lens. Modelling that
   means the strip reads as a row of components when idle and as LEDs when lit,
   which is the whole joke. */
.pixels {
  display: flex; gap: 4px; align-items: center;
  padding: 5px 7px;
  background: var(--bg-sunken);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  cursor: crosshair;
}
.pixels .led {
  position: relative; flex: none;
  width: 15px; height: 15px;
  border-radius: 2px;
  background-color: var(--led-body);
  /* Four corner solder pads, painted rather than added as elements. */
  background-image:
    linear-gradient(var(--led-pad), var(--led-pad)),
    linear-gradient(var(--led-pad), var(--led-pad)),
    linear-gradient(var(--led-pad), var(--led-pad)),
    linear-gradient(var(--led-pad), var(--led-pad));
  background-size: 5px 3.5px;
  background-position: left top, right top, left bottom, right bottom;
  background-repeat: no-repeat;
  box-shadow: inset 0 0 0 1px var(--led-edge);
}
.pixels .led-lens {
  position: absolute;
  /* Explicit box rather than `inset`, so no stray margin from another rule can
     turn the lens into an oval — which is exactly what `.lens` in the table did. */
  top: 2.5px; left: 2.5px;
  width: 10px; height: 10px;
  margin: 0;
  border-radius: 50%;
  /* --lit is the eased brightness (see paint() in pixels.js); --glow is the
     raw one. Splitting them lets the lens colour saturate fast while the bloom
     still scales with actual output. */
  background:
    radial-gradient(circle at 38% 32%,
      color-mix(in srgb, #fff calc(var(--lit, 0) * 45%), transparent) 0%,
      transparent 55%),
    color-mix(in srgb,
      var(--c, #000) calc(var(--lit, 0) * 100%),
      var(--led-lens));
  box-shadow:
    inset 0 0 0 .5px var(--led-lens-edge),
    /* tight core */
    0 0 calc(5px * var(--glow, 0)) var(--c, transparent),
    /* wide bloom, the bit that makes it look like it is emitting */
    0 0 calc(14px * var(--glow, 0)) calc(3px * var(--glow, 0)) var(--c, transparent);
  transition: background 40ms linear;
}
@media (prefers-reduced-motion: reduce) { .pixels .led-lens { transition: none; } }
@media (max-width: 860px) { .pixels { display: none; } }
.site-nav { display: flex; align-items: center; gap: var(--s-4); }
.site-nav a { color: var(--ink-soft); font-size: var(--t-sm); }
.site-nav a:hover { color: var(--ink); }
.theme-toggle {
  display: grid; place-items: center;
  width: 30px; height: 30px; border-radius: var(--r-md);
  color: var(--ink-soft);
}
.theme-toggle:hover { background: var(--bg-hover); color: var(--ink); }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun,
:root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon,
:root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="dark"]) .theme-toggle .icon-moon { display: none; }
}

/* ── intro ─────────────────────────────────────────────────────────── */
main { max-width: 1440px; margin: 0 auto; padding: 0 var(--s-5); }
/* Two columns: the prose reads at a comfortable measure on the left, the
   trade-name map sits beside it rather than pushing the table down. Collapses
   to one column when there isn't room for both. */
.intro {
  padding: var(--s-7) 0 var(--s-6);
  display: grid; gap: var(--s-7);
  grid-template-columns: minmax(0, 60ch) minmax(300px, 1fr);
  align-items: start;
}
.intro-copy { max-width: 60ch; }
.intro-copy .lede + .lede { margin-top: var(--s-3); }
.intro h1 { font-size: var(--t-2xl); margin-bottom: var(--s-3); }
.lede { color: var(--ink-soft); font-size: var(--t-md); line-height: 1.6; }
.lede strong { color: var(--ink); font-weight: 550; }

.trade-names {
  display: grid; gap: var(--s-2);
  margin-top: 6px; /* optically aligns with the h1's cap height */
}
.trade-names li {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) var(--s-3);
  background: var(--bg-raised);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  font-size: var(--t-sm);
}
.tn-name { color: var(--ink-soft); }
.tn-arrow { color: var(--ink-faint); flex: none; }
.tn-part { font-weight: 600; }
.tn-note { color: var(--ink-faint); font-size: var(--t-xs); margin-left: auto; }

/* ── toolbar ───────────────────────────────────────────────────────── */
.toolbar {
  position: sticky; top: 53px; z-index: 30;
  display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap;
  padding: var(--s-3) 0;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.search-wrap { position: relative; flex: 1 1 260px; max-width: 420px; }
.search-icon {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  color: var(--ink-faint); pointer-events: none;
}
.search {
  width: 100%; padding: 7px 10px 7px 30px;
  background: var(--bg-raised); color: var(--ink);
  border: 1px solid var(--hairline-firm); border-radius: var(--r-md);
  font: var(--t-base) var(--sans);
}
.search::placeholder { color: var(--ink-faint); }
.search:focus { border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft); }
.toolbar-right { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }

.seg { display: inline-flex; background: var(--bg-sunken); border: 1px solid var(--hairline); border-radius: var(--r-md); padding: 2px; }
.seg button {
  padding: 4px 10px; font-size: var(--t-sm); color: var(--ink-soft);
  border-radius: 3px; white-space: nowrap;
}
.seg button.is-on { background: var(--bg-raised); color: var(--ink); box-shadow: 0 1px 2px rgb(0 0 0 / .08); }

.btn {
  padding: 6px 11px; font-size: var(--t-sm); color: var(--ink-soft);
  background: var(--bg-raised);
  border: 1px solid var(--hairline-firm); border-radius: var(--r-md);
}
.btn:hover { color: var(--ink); background: var(--bg-hover); }
.btn[aria-pressed="true"] { color: var(--ink); border-color: var(--hairline-firm); }
.btn-quiet { color: var(--accent); font-size: var(--t-sm); text-decoration: underline; text-underline-offset: 2px; }
.filters-open { display: none; }
.filter-count {
  display: inline-grid; place-items: center; min-width: 17px; height: 17px;
  margin-left: 4px; padding: 0 4px;
  background: var(--accent); color: var(--accent-ink);
  border-radius: var(--r-full); font-size: 10px; font-weight: 600;
}

/* ── layout ────────────────────────────────────────────────────────── */
.layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: var(--s-6); padding: var(--s-5) 0 var(--s-8); }

/* ── facets ────────────────────────────────────────────────────────── */
.facets { position: sticky; top: 108px; align-self: start; max-height: calc(100vh - 130px); overflow-y: auto; padding-right: var(--s-2); }
.facets-head { display: flex; align-items: center; gap: var(--s-2); margin-bottom: var(--s-3); }
.facets-head h2 { font-size: var(--t-sm); text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); }
.facets-head .btn-quiet { margin-left: auto; }
.facets-close { display: none; }

.facet { border-bottom: 1px solid var(--hairline); }
.facet summary {
  display: flex; align-items: center; gap: var(--s-2);
  padding: var(--s-2) 0; cursor: pointer;
  font-size: var(--t-sm); font-weight: 550; color: var(--ink-soft);
  list-style: none;
}
.facet summary::-webkit-details-marker { display: none; }
.facet summary::before {
  content: ""; width: 5px; height: 5px; flex: none;
  border-right: 1.4px solid currentColor; border-bottom: 1.4px solid currentColor;
  transform: rotate(-45deg); transition: transform .12s ease;
  opacity: .6;
}
.facet[open] summary::before { transform: rotate(45deg); }
.facet summary:hover { color: var(--ink); }
.facet-active {
  margin-left: auto; padding: 1px 6px;
  background: var(--accent-soft); color: var(--accent);
  border-radius: var(--r-full); font-size: 10px; font-weight: 600;
}
.facet ul { padding-bottom: var(--s-3); display: grid; gap: 1px; }
.facet label {
  display: flex; align-items: center; gap: var(--s-2);
  padding: 3px 4px; border-radius: var(--r-sm);
  font-size: var(--t-sm); color: var(--ink-soft); cursor: pointer;
}
.facet label:hover { background: var(--bg-hover); color: var(--ink); }
.facet label.is-empty { opacity: .38; cursor: default; }
.facet input { accent-color: var(--accent); margin: 0; }
.opt-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt-count { margin-left: auto; font-size: var(--t-xs); color: var(--ink-faint); font-variant-numeric: tabular-nums; }

/* ── chips ─────────────────────────────────────────────────────────── */
.chips { display: flex; flex-wrap: wrap; gap: var(--s-2); margin-bottom: var(--s-3); }
.chip-active {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 3px 6px 3px 9px;
  background: var(--accent-soft); color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  border-radius: var(--r-full); font-size: var(--t-xs);
}
.chip-active button { display: grid; place-items: center; width: 14px; height: 14px; border-radius: var(--r-full); opacity: .7; }
.chip-active button:hover { opacity: 1; background: color-mix(in srgb, var(--accent) 20%, transparent); }

.result-count { font-size: var(--t-sm); color: var(--ink-faint); margin-bottom: var(--s-3); }
.empty { padding: var(--s-7) var(--s-4); text-align: center; color: var(--ink-soft); font-size: var(--t-md); }
.downloads { margin-top: var(--s-5); font-size: var(--t-sm); color: var(--ink-faint); }
/* WCAG 1.4.1: a link inside a block of text must not be distinguished by
   colour alone. Accent-on-muted tops out around 1.2:1, so underline it. */
.downloads a, .site-footer li a, .site-footer p a, .caveat a,
.prose a, .block-note a, .term p a, .lib-note a { text-decoration: underline; text-underline-offset: 2px; }

/* ── the table ─────────────────────────────────────────────────────── */
/* `overflow` makes this the nearest scrollport, so a sticky thead inside it
   anchors to THIS box, not the viewport. Giving it a viewport-tied max-height
   makes it the vertical scroller too, which is what makes `top: 0` on the
   header actually stick while the rows scroll under it. */
.table-scroll {
  overflow: auto;
  max-height: calc(100vh - 190px);
  overscroll-behavior: contain;
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: var(--bg-raised);
}
/* Detail tables are short and shouldn't get their own scrollport. */
.detail .table-scroll { max-height: none; overflow: visible; overflow-x: auto; }
table.cat { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--t-sm); }

table.cat thead th {
  position: sticky; top: 0; z-index: 10;
  background: var(--bg-raised);
  padding: var(--s-2) var(--s-3);
  text-align: left; font-size: var(--t-xs); font-weight: 600;
  text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint);
  white-space: nowrap;
  border-bottom: 1px solid var(--hairline-firm);
}
table.cat thead th button { display: inline-flex; align-items: center; gap: 4px; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; }
table.cat thead th button:hover { color: var(--ink); }
.sort-ind { width: 8px; height: 8px; opacity: 0; transition: opacity .12s; }
th[aria-sort="ascending"] .sort-ind,
th[aria-sort="descending"] .sort-ind { opacity: 1; }
th[aria-sort] .sort-ind::after { content: ""; display: block; width: 0; height: 0; border-left: 3.5px solid transparent; border-right: 3.5px solid transparent; }
th[aria-sort="ascending"] .sort-ind::after { border-bottom: 5px solid currentColor; }
th[aria-sort="descending"] .sort-ind::after { border-top: 5px solid currentColor; }
th[aria-sort="ascending"], th[aria-sort="descending"] { color: var(--ink); }

table.cat td { padding: var(--row-pad-y) var(--s-3); border-bottom: 1px solid var(--hairline); vertical-align: middle; }
table.cat tbody tr.row:hover td { background: var(--bg-hover); }
table.cat tbody tr.row:last-child td { border-bottom: 0; }
table.cat tbody tr:target td { background: var(--accent-soft); }

/* Density */
[data-density="comfortable"] table.cat td { padding-top: 9px; padding-bottom: 9px; }

/* Column visibility. Every column is in the DOM; this is the only thing that
   changes when the reader switches column sets. */
table.cat .adv { display: none; }
table.cat.show-adv .adv { display: table-cell; }

.c-part { min-width: 190px; }
.glyph-wrap { display: inline-flex; vertical-align: middle; color: var(--ink-faint); margin-right: var(--s-2); }
.part-names { display: inline-flex; flex-direction: column; vertical-align: middle; line-height: 1.3; }
.order-code { font-weight: 600; }
.part-number { color: var(--ink-faint); font-size: var(--t-xs); }
.new-marker {
  margin-left: var(--s-2); padding: 1px 5px;
  background: color-mix(in srgb, var(--led-g) 18%, transparent);
  color: var(--ok); border-radius: var(--r-full);
  font-size: 10px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.c-aliases {
  max-width: 190px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.alias { display: inline-block; margin-right: 5px; color: var(--ink-soft); font-size: var(--t-xs); }
/* The separator is a real character in the markup (see cells.njk), not
   generated content — CSS ::after is not reliably exposed to screen readers or
   to text extraction, and the aliases ran together. */
.alias-sep { color: var(--ink-faint); }
.fam { display: block; color: var(--ink-faint); font-size: var(--t-xs); }

/* chips & badges */
.chip { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.swatch-rgb {
  display: inline-block; width: 15px; height: 11px;
  background: linear-gradient(to right,
    var(--led-r) 0 4px, transparent 4px 5.5px,
    var(--led-g) 5.5px 9.5px, transparent 9.5px 11px,
    var(--led-b) 11px 15px);
}
.swatch-w { width: 4px; height: 11px; border-radius: 1px; background: var(--w-neutral); }
.chip-ch[data-white="warm"] .swatch-w { background: var(--w-warm); }
.chip-ch[data-white="cool"] .swatch-w { background: var(--w-cool); }
.chip-k { color: var(--ink-faint); font-family: var(--mono); font-size: var(--t-xs); }

/* Library support. The first version rendered all three names with the level
   only in a data attribute and no CSS at all, so every row read as if FastLED,
   WLED and Adafruit all supported it. The level has to be visible. */
.c-libraries { white-space: nowrap; }
.lib-chip {
  display: inline-flex; align-items: center; gap: 3px;
  margin-right: 6px; font-size: var(--t-xs);
}
/* The dot is generated (::after) so each chip is one node, not three. The level
   is also in the title, and "none" is struck through, so it never relies on
   the dot alone. */
.lib-chip::after {
  content: ""; width: 6px; height: 6px; border-radius: var(--r-full);
  border: 1px solid currentColor; flex: none;
}
.lib-chip[data-level="native"]    { color: var(--ok); }
.lib-chip[data-level="native"]::after { background: currentColor; }
.lib-chip[data-level="via-alias"] { color: var(--warn); }
.lib-chip[data-level="via-alias"]::after { background: color-mix(in srgb, currentColor 45%, transparent); }
.lib-chip[data-level="generic"]   { color: var(--ink-soft); }
/* Not supported: struck through and faded, so it cannot be mistaken for a yes. */
.lib-chip[data-level="none"]      { color: var(--ink-faint); opacity: .55; text-decoration: line-through; }
.lib-chip[data-level="none"]::after  { border-style: dashed; }
.lib-chip[data-level="unknown"]   { color: var(--ink-faint); opacity: .7; }
.lib-chip[data-level="unknown"]::after { border-style: dotted; }

.badge-wires {
  display: inline-block; padding: 1px 6px; border-radius: var(--r-sm);
  font-size: var(--t-xs); font-weight: 550;
  border: 1px solid var(--hairline-firm); color: var(--ink-soft);
}
.badge-wires[data-wires="spi"] { border-color: color-mix(in srgb, var(--led-b) 45%, transparent); color: var(--led-b); }

.face-swatch {
  display: inline-block; width: 11px; height: 11px; border-radius: 2px;
  vertical-align: -1px; border: 1px solid var(--hairline-firm);
}
.face-swatch[data-face="white"] { background: #f7f7f5; }
.face-swatch[data-face="black"] { background: #1b1b1e; }
.face-swatch[data-face="other"] { background: linear-gradient(135deg, #d8d8d4 50%, #9a9a95 50%); }
.lens { color: var(--ink-soft); font-size: var(--t-xs); margin-left: 4px; }

.pill {
  display: inline-block; padding: 1px 7px; border-radius: var(--r-full);
  font-size: var(--t-xs); font-weight: 550; background: var(--muted-fill); color: var(--ink-soft);
}
.pill[data-status="active"] { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.pill[data-status="nrnd"], .pill[data-status="obsolete"] { background: color-mix(in srgb, var(--warn) 15%, transparent); color: var(--warn); }

/* Confidence dot next to a date: the catalogue never shows a date without
   showing how much to trust it. */
.ic-date { color: var(--ink-faint); white-space: nowrap; }
.ic-tag {
  padding: 0 4px; margin-right: 3px;
  background: var(--muted-fill); border-radius: var(--r-sm);
  font-size: 9px; text-transform: uppercase; letter-spacing: .04em;
}
.conf { display: inline-block; width: 5px; height: 5px; border-radius: var(--r-full); margin-left: 5px; vertical-align: 1px; }
.conf[data-conf="high"]   { background: var(--ok); }
.conf[data-conf="medium"] { background: var(--warn); opacity: .8; }
.conf[data-conf="low"]    { background: var(--ink-faint); opacity: .55; }
.ext { font-size: 9px; opacity: .6; }

/* Group rows */
tr.group th {
  position: sticky; left: 0; z-index: 6;
  padding: 0; background: var(--bg-sunken);
  border-bottom: 1px solid var(--hairline);
  border-top: 1px solid var(--hairline);
}
.group-inner {
  display: flex; align-items: center; gap: var(--s-2);
  width: 100%; padding: 3px var(--s-3);
  font-size: var(--t-xs); color: var(--ink-soft);
}
.group-inner:hover { background: var(--bg-hover); }
/* 26px square: below Lighthouse's 24px minimum a caret is a coin-flip to hit. */
.group-toggle {
  display: grid; place-items: center; flex: none;
  width: 26px; height: 26px; border-radius: var(--r-sm);
  color: var(--ink-soft);
}
.group-toggle:hover { background: var(--muted-fill); color: var(--ink); }
.caret { transition: transform .12s ease; opacity: .55; flex: none; }
.group-toggle[aria-expanded="true"] .caret { transform: rotate(90deg); }
.group-name { font-weight: 600; color: var(--ink); padding: 5px 2px; }
.group-meta { color: var(--ink-faint); }
.group-count {
  margin-left: auto; padding: 0 6px;
  background: var(--muted-fill); border-radius: var(--r-full);
  font-size: 10px; font-variant-numeric: tabular-nums;
}
tr.row[hidden], tr.group[hidden] { display: none; }

/* ── glossary ──────────────────────────────────────────────────────── */
.glossary { padding: var(--s-8) 0; border-top: 1px solid var(--hairline); }
.glossary h2 { font-size: var(--t-xl); margin-bottom: var(--s-5); }
.glossary-grid { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); }
.term h3 { font-size: var(--t-base); margin-bottom: var(--s-1); }
.term p { color: var(--ink-soft); font-size: var(--t-sm); line-height: 1.55; }
.term-link { display: inline-block; margin-top: var(--s-2); font-size: var(--t-xs); }

/* ── detail pages ──────────────────────────────────────────────────── */
.detail { max-width: 960px; margin: 0 auto; padding: var(--s-5) 0 var(--s-8); }
.crumbs { font-size: var(--t-sm); color: var(--ink-faint); margin-bottom: var(--s-5); display: flex; gap: var(--s-2); }
.hero { display: flex; align-items: center; gap: var(--s-5); margin-bottom: var(--s-5); }
.hero-glyph { flex: none; color: var(--ink-faint); padding: var(--s-3); background: var(--bg-raised); border: 1px solid var(--hairline); border-radius: var(--r-lg); }
.hero h1 { font-size: var(--t-2xl); }
.hero-sub { color: var(--ink-soft); font-size: var(--t-sm); margin-top: var(--s-1); display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.hero-aliases { margin-top: var(--s-2); font-size: var(--t-xs); color: var(--ink-faint); }

.stats {
  display: grid; gap: 1px; margin: var(--s-5) 0;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
  background: var(--hairline); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); overflow: hidden;
}
.stats > div { background: var(--bg-raised); padding: var(--s-3); }
.stats dt { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.stats dd { margin: 3px 0 0; font-size: var(--t-md); font-variant-numeric: tabular-nums; }

.prose { color: var(--ink-soft); line-height: 1.65; max-width: 68ch; }
.prose p + p { margin-top: var(--s-3); }
.block { margin-top: var(--s-7); }
.block h2 { font-size: var(--t-lg); margin-bottom: var(--s-2); }
.block h3 { font-size: var(--t-base); margin: var(--s-5) 0 var(--s-2); }
.block-note { color: var(--ink-soft); font-size: var(--t-sm); margin-bottom: var(--s-3); max-width: 70ch; line-height: 1.55; }

.callout {
  margin-top: var(--s-5); padding: var(--s-3) var(--s-4);
  background: var(--bg-raised);
  border: 1px solid var(--hairline); border-left: 3px solid var(--warn);
  border-radius: var(--r-md);
}
.callout h3 { margin: 0 0 var(--s-1); font-size: var(--t-sm); }
.callout p { color: var(--ink-soft); font-size: var(--t-sm); }

table.detail-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: var(--t-sm); }
table.detail-table th {
  padding: var(--s-2) var(--s-3); text-align: left;
  font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-faint); border-bottom: 1px solid var(--hairline-firm); white-space: nowrap;
}
table.detail-table td { padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--hairline); }
table.detail-table tr:target td { background: var(--accent-soft); }
tr.variant-note td, tr.timing-note td { padding-top: 0; color: var(--ink-faint); font-size: var(--t-xs); border-bottom: 1px solid var(--hairline); }
tr.is-preferred td { background: color-mix(in srgb, var(--accent) 5%, transparent); }
.src-tag { padding: 1px 6px; border-radius: var(--r-sm); font-size: var(--t-xs); font-weight: 550; background: var(--muted-fill); }
.src-tag[data-src="datasheet"] { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.src-tag[data-src="fastled"] { background: color-mix(in srgb, var(--led-b) 16%, transparent); color: var(--led-b); }

/* Cap the column: a single pinout stretched to the full 960px article width
   scales a 260-unit viewBox by ~3.7x, leaving the package marooned in dead
   space. Two side by side is also exactly the comparison you want when a part
   has more than one pinout. */
/* ── contribute form ── */
.form { margin-top: var(--s-5); display: grid; gap: var(--s-4); max-width: 620px; }
.hidden-field { position: absolute; left: -9999px; }
.field { display: grid; gap: 5px; }
.field label { font-size: var(--t-sm); font-weight: 550; }
.field .opt { font-weight: 400; color: var(--ink-faint); }
.field input, .field select, .field textarea {
  width: 100%; padding: 8px 10px;
  background: var(--bg-raised); color: var(--ink);
  border: 1px solid var(--hairline-firm); border-radius: var(--r-md);
  font: var(--t-base) var(--sans);
}
.field textarea { resize: vertical; min-height: 96px; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--accent); outline: none; box-shadow: 0 0 0 3px var(--accent-soft);
}
.field .hint { font-size: var(--t-xs); color: var(--ink-faint); line-height: 1.5; }
.form-actions { display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; }
.btn-primary {
  padding: 9px 20px; border-radius: var(--r-md);
  background: var(--accent); color: var(--accent-ink);
  font-size: var(--t-base); font-weight: 550;
}
.btn-primary:hover { filter: brightness(1.08); }
.form-actions .hint { font-size: var(--t-sm); color: var(--ink-faint); margin: 0; }

.gallery { display: grid; gap: var(--s-4); grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.shot { margin: 0; background: var(--bg-raised); border: 1px solid var(--hairline); border-radius: var(--r-lg); overflow: hidden; }
.shot img { display: block; width: 100%; height: auto; background: var(--bg-sunken); }
.shot figcaption { padding: var(--s-2) var(--s-3); font-size: var(--t-xs); color: var(--ink-faint); display: flex; gap: var(--s-2); flex-wrap: wrap; align-items: baseline; }
.shot-kind { padding: 1px 6px; background: var(--muted-fill); border-radius: var(--r-sm); color: var(--ink-soft); }
/* Credit is required by the schema, so it always has somewhere to sit. */
.shot-credit { margin-left: auto; }

.pinout-grid { display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(280px, 420px)); }
.pinout { margin: 0; padding: var(--s-4); background: var(--bg-raised); border: 1px solid var(--hairline); border-radius: var(--r-lg); }
.pinout figcaption { margin-bottom: var(--s-3); font-size: var(--t-xs); color: var(--ink-faint); display: flex; gap: 6px; flex-wrap: wrap; }
/* Several order codes share one pinout; separate them so they don't read as
   one long part number. */
.pinout figcaption span:not(:last-child)::after { content: ","; }
.sheet-links { display: inline-flex; gap: var(--s-2); }
.pinout-wrap { max-width: 400px; margin: 0 auto; }
.pinout-svg { color: var(--ink); display: block; }
.pinout-svg text { font-family: var(--mono); font-size: 10px; fill: currentColor; }
.pinout-svg .body { fill: var(--led-body); stroke: var(--led-edge); stroke-width: 1.2; }
.pinout-svg .lens { fill: var(--led-lens); stroke: var(--led-lens-edge); stroke-width: 1; }
.pinout-svg .pad, .pinout-svg .chip { stroke: var(--ink); stroke-opacity: .45; stroke-width: .6; }
.pinout-svg .ring-1 { fill: none; stroke: var(--ink); stroke-width: 1.6; }
.pinout-svg .leader { stroke: currentColor; opacity: .35; stroke-width: 1; }
.pinout-svg .dim path, .pinout-svg .pcb, .pinout-svg .brk { stroke: currentColor; fill: none; stroke-width: .8; opacity: .6; }
.pinout-svg .pcb { stroke-width: 1.6; opacity: .5; }
.pinout-svg .leg { stroke: var(--led-pad); stroke-width: 2.4; }
.pinout-svg .stub { fill: var(--led-pad); }
.pinout-svg .emit { stroke: var(--accent); fill: none; stroke-width: 1.3; }
.pinout-svg .dim-t { font-size: 8.5px; fill: var(--ink-soft); }
.pinout-svg .pn { font-weight: 700; }
.pinout-svg .pad-n { fill: var(--bg-raised); font-size: 10px; }
.pinout-svg .pf-sub { font-size: 8px; fill: var(--ink-faint); }
.pinout-svg .cap { font-family: var(--sans); font-size: 9px; fill: var(--ink-faint); }
.pinout-svg .mk { fill: var(--ink); stroke: var(--bg-raised); stroke-width: .6; }
.pinout-svg .mk-bar { stroke: var(--ink); stroke-width: 3; stroke-linecap: butt; fill: none; }
.pinout-svg .mk-notch { fill: var(--bg-raised); stroke: var(--led-edge); stroke-width: 1.2; }
.pinout-svg .pad-extra { fill: none; stroke: var(--ink); stroke-opacity: .55; stroke-width: .8; stroke-dasharray: 3 2; }
.fn-power { fill: var(--fn-power); --c: var(--fn-power); }
.fn-ground { fill: var(--fn-ground); --c: var(--fn-ground); }
.fn-data { fill: var(--fn-data); --c: var(--fn-data); }
.fn-clock { fill: var(--fn-clock); --c: var(--fn-clock); }
.fn-backup { fill: var(--fn-backup); --c: var(--fn-backup); }
.fn-nc { fill: var(--ink-faint); --c: var(--ink-faint); }
.pin-legend { display: flex; flex-wrap: wrap; gap: 4px var(--s-4); margin-top: var(--s-3); font-size: var(--t-xs); color: var(--ink-soft); justify-content: center; }
.pin-legend li { display: inline-flex; align-items: center; gap: 6px; }
.sw { width: 12px; height: 12px; border-radius: 2px; background: var(--c); border: 1px solid color-mix(in srgb, var(--ink) 35%, transparent); display: inline-block; }
.sw.ring { background: none; border: 2px solid var(--ink); }
.sw.mark { background: var(--ink); clip-path: polygon(0 100%, 0 20%, 80% 100%); }
.sw.mark-bar { clip-path: polygon(0 70%, 100% 70%, 100% 100%, 0 100%); }
.sw.mark-notch { clip-path: circle(35% at 50% 0); }
.sw.mark-block { clip-path: polygon(40% 40%, 100% 40%, 100% 100%, 40% 100%); }
.sw.cut { background: var(--led-body); clip-path: polygon(0 0, 100% 0, 100% 55%, 55% 100%, 0 100%); }
.pin-basis { margin: var(--s-2) 0 0; font-size: var(--t-xs); color: var(--ink-faint); text-align: center; }
.pin-basis[data-basis="datasheet"] { color: var(--ink-soft); }
.pin-list { margin-top: var(--s-3); display: grid; gap: 2px; font-size: var(--t-xs); max-width: 340px; margin-inline: auto; }
.pin-list li { display: flex; gap: var(--s-2); color: var(--ink-soft); }
.pin-n { color: var(--ink-faint); width: 1.2em; }
.pin-name { color: var(--ink); }
.pin-fn { color: var(--ink-faint); margin-left: auto; }

.waveform { margin: 0 0 var(--s-4); padding: var(--s-4); background: var(--bg-raised); border: 1px solid var(--hairline); border-radius: var(--r-lg); color: var(--ink); }
.wave-scroll { overflow-x: auto; }
.wave-svg { display: block; min-width: 640px; }
.wave-svg text { font-family: var(--mono); font-size: 10px; fill: currentColor; }
.wave-svg .wh { font-family: var(--sans); font-size: 12px; font-weight: 600; }
.wave-svg .wl { font-size: 10px; }
.wave-svg .wl-n { font-size: 8.5px; }
.wave-svg .wt, .wave-svg .wt-s { font-size: 9px; fill: var(--ink-soft); }
.wave-svg .wb { font-family: var(--sans); font-size: 12px; fill: var(--ink-soft); }
.wave-svg .wb2 { font-size: 9px; font-weight: 700; }
.wave-svg .trace { fill: none; stroke: var(--led-g); stroke-width: 2.2; stroke-linejoin: round; }
.wave-svg .trace.dash { stroke-dasharray: 4 4; opacity: .6; }
.wave-svg .trace.clk { stroke: var(--accent); }
.wave-svg .gl, .wave-svg .ax { stroke: currentColor; opacity: .3; stroke-width: .8; }
.wave-svg .guide { stroke: currentColor; opacity: .22; stroke-dasharray: 2 3; stroke-width: .7; fill: none; }
.wave-svg .tol { fill: var(--led-r); opacity: .16; }
.wave-svg .br path { stroke: currentColor; fill: none; stroke-width: .9; opacity: .65; }
.wave-svg .blk { fill: var(--bg-sunken); stroke: var(--hairline-firm); }
.wave-svg .wire { stroke: currentColor; fill: none; stroke-width: 1.2; }
.wave-svg .wire.dash { stroke-dasharray: 4 3; opacity: .7; }
.wave-svg .chan { fill: var(--muted-fill); stroke: var(--hairline-firm); }
.wave-svg .ch-R { fill: color-mix(in srgb, var(--led-r) 38%, transparent); }
.wave-svg .ch-G { fill: color-mix(in srgb, var(--led-g) 38%, transparent); }
.wave-svg .ch-B { fill: color-mix(in srgb, var(--led-b) 38%, transparent); }
.wave-svg .ch-W { fill: color-mix(in srgb, var(--ink) 18%, transparent); }
.wave-svg .ch-bright, .wave-svg .ch-led { fill: color-mix(in srgb, var(--accent) 24%, transparent); }
.wave-svg .ch-x0 { fill: color-mix(in srgb, var(--led-r) 22%, transparent); }
.wave-svg .ch-x1 { fill: color-mix(in srgb, var(--led-g) 22%, transparent); }
.wave-svg .ch-x2 { fill: color-mix(in srgb, var(--led-b) 22%, transparent); }
.waveform figcaption { margin-top: var(--s-2); font-family: var(--mono); font-size: var(--t-xs); color: var(--ink-faint); }
.waveform .src { color: var(--ink-faint); opacity: .8; }

.compat { display: grid; gap: var(--s-3); }
.compat-chip {
  display: inline-flex; align-items: center; gap: var(--s-2);
  padding: 4px 10px; border-radius: var(--r-full);
  border: 1px solid var(--hairline-firm); color: var(--ink); font-size: var(--t-sm);
}
.compat-chip:hover { text-decoration: none; background: var(--bg-hover); }
.compat-chip .rel { font-size: var(--t-xs); color: var(--ink-faint); text-transform: uppercase; letter-spacing: .05em; }
.compat-chip[data-rel="drop-in"] { border-color: color-mix(in srgb, var(--ok) 45%, transparent); }
.compat-chip[data-rel="drop-in"] .rel { color: var(--ok); }
.compat-chip[data-rel="near-clone"] { border-color: color-mix(in srgb, var(--warn) 45%, transparent); }
.compat-chip[data-rel="near-clone"] .rel { color: var(--warn); }
.compat-chip.is-inbound { border-style: dashed; }
.caveat { margin-top: var(--s-2); padding-left: var(--s-3); border-left: 2px solid var(--hairline-firm); color: var(--ink-soft); font-size: var(--t-sm); line-height: 1.55; max-width: 70ch; }

.evidence { display: grid; gap: var(--s-2); }
.evidence li { display: flex; align-items: baseline; gap: var(--s-3); flex-wrap: wrap; font-size: var(--t-sm); }
.ev-date { color: var(--ink); font-variant-numeric: tabular-nums; }
.ev-kind { padding: 1px 6px; border-radius: var(--r-sm); background: var(--muted-fill); color: var(--ink-soft); font-size: var(--t-xs); }
.ev-kind[data-kind="datasheet_revision"] { background: color-mix(in srgb, var(--ok) 15%, transparent); color: var(--ok); }
.ev-source { color: var(--ink-soft); }
.ev-prec { margin-left: auto; color: var(--ink-faint); font-size: var(--t-xs); }

.libs { display: grid; gap: var(--s-2); }
.libs > div { display: flex; gap: var(--s-3); font-size: var(--t-sm); }
.libs dt { min-width: 150px; color: var(--ink-faint); }
.libs dd { margin: 0; }
.libs code { padding: 1px 5px; background: var(--bg-sunken); border: 1px solid var(--hairline); border-radius: var(--r-sm); }
.lib-note { margin-top: var(--s-3); color: var(--ink-soft); font-size: var(--t-sm); max-width: 70ch; }

.part-links { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.part-links a { padding: 4px 10px; background: var(--bg-raised); border: 1px solid var(--hairline); border-radius: var(--r-md); font-size: var(--t-sm); }
.part-links a:hover { text-decoration: none; background: var(--bg-hover); }

.suppliers { display: grid; gap: var(--s-2); font-size: var(--t-sm); }
.suppliers li { display: flex; gap: var(--s-3); align-items: baseline; }
.sup-name { min-width: 90px; color: var(--ink-soft); }
.sup-checked { margin-left: auto; color: var(--ink-faint); font-size: var(--t-xs); }

/* ── footer ────────────────────────────────────────────────────────── */
.site-footer { border-top: 1px solid var(--hairline); margin-top: var(--s-8); padding: var(--s-7) var(--s-5) var(--s-8); background: var(--bg-sunken); }
.footer-cols { max-width: 1440px; margin: 0 auto; display: grid; gap: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.site-footer h2 { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .07em; color: var(--ink-faint); margin-bottom: var(--s-2); }
.site-footer p, .site-footer li { color: var(--ink-soft); font-size: var(--t-sm); line-height: 1.55; }
/* Footer links sat 15px tall and 3px apart — under the 24px tap-target
   minimum. Padding the links and spacing the rows fixes both at once. */
.site-footer li + li { margin-top: var(--s-2); }
.site-footer li a, .site-footer p a { display: inline-block; padding: 4px 0; }
.colophon { max-width: 1440px; margin: var(--s-5) auto 0; padding-top: var(--s-4); border-top: 1px solid var(--hairline); color: var(--ink-faint); font-size: var(--t-xs); }

/* ── votes and visit counter ───────────────────────────────────────── */
/* Slots are reserved up front and only fade in, so nothing shifts when the
   numbers arrive; if the API is unreachable they stay empty. */
.footer-meta { max-width: 1440px; margin: var(--s-5) auto 0; min-height: 36px; display: flex; align-items: center; gap: var(--s-4); flex-wrap: wrap; opacity: 0; transition: opacity 180ms; }
.footer-meta.is-ready { opacity: 1; }
.visit-count { color: var(--ink-faint); font-size: var(--t-xs); font-variant-numeric: tabular-nums; }
.vote-btn {
  display: inline-flex; align-items: center; gap: var(--s-2);
  min-height: 30px; padding: 0 var(--s-3); border-radius: var(--r-full);
  border: 1px solid var(--hairline-firm); background: var(--bg-raised);
  color: var(--ink-soft); font-size: var(--t-sm); cursor: pointer;
  transition: border-color 120ms, color 120ms, background 120ms;
}
.vote-btn:hover { color: var(--ink); border-color: var(--ink-faint); }
.vote-btn[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.vote-btn[aria-pressed="true"] .thumb { fill: currentColor; fill-opacity: .18; }
.vote-btn .thumb { transform-origin: 30% 90%; }
.vote-n { color: var(--ink-faint); font-size: var(--t-xs); }
.vote-btn-lg { min-height: 40px; padding: 0 var(--s-4); font-size: var(--t-base); position: relative; }
.useful { min-height: 112px; visibility: hidden; opacity: 0; transition: opacity 180ms; }
.useful.is-ready { visibility: visible; opacity: 1; }
.useful h2 { margin-bottom: var(--s-3); }
.useful-count { margin-top: var(--s-2); color: var(--ink-soft); font-size: var(--t-sm); }
.vote-btn.is-popping .thumb { animation: thumb-pop 520ms cubic-bezier(.3, 1.6, .5, 1); }
.vote-btn.is-popping::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit;
  border: 2px solid var(--accent); pointer-events: none;
  animation: vote-ring 600ms ease-out forwards;
}
@keyframes thumb-pop { 0% { transform: scale(1) rotate(0); } 35% { transform: scale(1.35) rotate(-18deg); } 100% { transform: scale(1) rotate(0); } }
@keyframes vote-ring { from { opacity: .7; transform: scale(1); } to { opacity: 0; transform: scale(1.35, 1.8); } }

/* ── responsive ────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .intro { grid-template-columns: 1fr; gap: var(--s-5); }
  .layout { grid-template-columns: 1fr; }
  .filters-open { display: inline-block; }
  .facets {
    position: fixed; inset: auto 0 0 0; z-index: 60; max-height: 78vh;
    padding: var(--s-4) var(--s-5) var(--s-7);
    background: var(--bg-raised);
    border-top: 1px solid var(--hairline-firm);
    border-radius: var(--r-lg) var(--r-lg) 0 0;
    box-shadow: var(--shadow);
    transform: translateY(101%); transition: transform .18s ease;
  }
  .facets.is-open { transform: none; }
  .facets-close { display: grid; place-items: center; width: 26px; height: 26px; border-radius: var(--r-md); color: var(--ink-soft); }
  .facets-head h2 { font-size: var(--t-md); text-transform: none; letter-spacing: 0; color: var(--ink); }
}

@media (max-width: 720px) {
  main { padding: 0 var(--s-4); }
  .intro { padding: var(--s-5) 0 var(--s-4); }
  .intro h1 { font-size: var(--t-xl); }
  .toolbar { top: 53px; }
  .table-scroll { max-height: calc(100vh - 150px); }
  /* Sticky first column so the part number stays visible while scrolling
     the wide spec columns sideways. */
  table.cat td.c-part, table.cat thead th[data-col="part"] {
    position: sticky; left: 0; z-index: 5;
    background: var(--bg-raised);
    box-shadow: 1px 0 0 var(--hairline);
  }
  table.cat tbody tr.row:hover td.c-part { background: var(--bg-hover); }
  .hero { flex-direction: column; align-items: flex-start; gap: var(--s-3); }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

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

/* =========================================================================
   addressable.wiki — site layer
   Everything that is not the catalogue table: navigation, the command
   palette, blog, home sections, part-page furniture and the compare view.
   Concatenated after catalogue.css into one hashed bundle. Uses ONLY the
   tokens defined there (no new colours), so the theming contract holds.
   ========================================================================= */

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

/* ── header additions ─────────────────────────────────────────────────── */
.site-nav a[aria-current="page"] { color: var(--ink); font-weight: 550; }
.search-trigger {
  display: inline-flex; align-items: center; gap: var(--s-2);
  height: 30px; padding: 0 var(--s-2) 0 var(--s-3);
  background: var(--bg-raised); color: var(--ink-soft);
  border: 1px solid var(--hairline-firm); border-radius: var(--r-md);
  font-size: var(--t-sm);
}
.search-trigger:hover { color: var(--ink); border-color: var(--ink-faint); }
.kbd {
  display: inline-block; min-width: 18px; padding: 0 5px;
  font: 500 var(--t-xs)/18px var(--mono); text-align: center;
  color: var(--ink-soft); background: var(--bg-sunken);
  border: 1px solid var(--hairline-firm); border-radius: var(--r-sm);
}
@media (max-width: 900px) {
  .nav-hide-sm { display: none; }
  .site-header { padding: var(--s-3) var(--s-4); }
  .site-nav { gap: var(--s-3); }
}
@media (max-width: 520px) {
  .search-trigger .st-label, .search-trigger .kbd { display: none; }
  .search-trigger { padding: 0; width: 30px; justify-content: center; }
}

/* ── generic page furniture ───────────────────────────────────────────── */
.page-head { padding: var(--s-7) 0 var(--s-5); max-width: 68ch; }
.page-head h1 { font-size: var(--t-2xl); margin-bottom: var(--s-3); }
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-4);
}
.section-head h2 { font-size: var(--t-xl); }
.section-head p { color: var(--ink-soft); font-size: var(--t-sm); max-width: 60ch; }
.section-more { font-size: var(--t-sm); white-space: nowrap; }
.band { padding: var(--s-7) 0; border-top: 1px solid var(--hairline); }

/* ── filter pills (blog, home family tabs) ────────────────────────────── */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-bottom: var(--s-5); }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  min-height: 30px; padding: 0 var(--s-3);
  border: 1px solid var(--hairline-firm); border-radius: var(--r-full);
  background: var(--bg-raised); color: var(--ink-soft); font-size: var(--t-sm);
}
.pill-btn:hover { color: var(--ink); border-color: var(--ink-faint); }
.pill-btn.is-on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.pill-btn .n { font: var(--t-xs) var(--mono); opacity: .7; }
.feed-link { margin-left: auto; font-size: var(--t-sm); }

/* ── category tag ─────────────────────────────────────────────────────── */
.cat-tag {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 1px 8px 1px 6px; border-radius: var(--r-full);
  background: var(--muted-fill); color: var(--ink);
  font-size: var(--t-xs); font-weight: 550;
}
.cat-tag::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%;
  background: var(--ink-faint);
}
.cat-tag[data-cat="guides"]::before { background: var(--led-b); }
.cat-tag[data-cat="troubleshooting"]::before { background: var(--led-r); }
.cat-tag[data-cat="explainers"]::before { background: var(--led-g); }

/* ── post cards ───────────────────────────────────────────────────────── */
.post-grid-cards, .post-strip {
  display: grid; gap: var(--s-4);
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.post-card {
  background: var(--bg-raised); border: 1px solid var(--hairline);
  border-radius: var(--r-lg); overflow: hidden;
  transition: border-color .15s ease, transform .15s ease;
}
.post-card:hover { border-color: var(--hairline-firm); transform: translateY(-1px); }
.post-card[hidden] { display: none; }
.pc-link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.pc-link:hover { text-decoration: none; }
.pc-link:hover .pc-title { color: var(--accent); }
.pc-art {
  aspect-ratio: 1200 / 520; background: var(--bg-sunken);
  border-bottom: 1px solid var(--hairline); overflow: hidden;
  display: grid; place-items: center;
}
.pc-art img, .pc-art svg { display: block; width: 100%; height: 100%; object-fit: cover; }
.pc-body { padding: var(--s-4); display: flex; flex-direction: column; gap: var(--s-2); flex: 1; }
.pc-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); font-size: var(--t-xs); color: var(--ink-faint); }
.pc-title { font-size: var(--t-md); line-height: 1.3; }
.pc-summary { color: var(--ink-soft); font-size: var(--t-sm); line-height: 1.55; }
@media (min-width: 900px) {
  .post-grid-cards .post-card.is-feature { grid-column: 1 / -1; }
  .post-grid-cards .is-feature .pc-link { flex-direction: row; }
  .post-grid-cards .is-feature .pc-art { flex: 0 0 46%; aspect-ratio: auto; border-bottom: 0; border-right: 1px solid var(--hairline); }
  .post-grid-cards .is-feature .pc-body { justify-content: center; padding: var(--s-6); }
  .post-grid-cards .is-feature .pc-title { font-size: var(--t-xl); }
  .post-grid-cards .is-feature .pc-summary { font-size: var(--t-md); }
}
.post-art { color: var(--led-body); }
.pa-body { fill: var(--led-body); stroke: var(--led-edge); stroke-width: 1; }
.pa-off { fill: var(--led-lens); }

/* ── a post ───────────────────────────────────────────────────────────── */
.post { padding: var(--s-5) 0 var(--s-8); }
.post-head { max-width: 760px; margin-bottom: var(--s-6); }
.post-head h1 { font-size: var(--t-2xl); line-height: 1.15; margin-bottom: var(--s-3); }
.post-summary { color: var(--ink-soft); font-size: var(--t-md); line-height: 1.6; }
.post-meta { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-4); font-size: var(--t-sm); color: var(--ink-faint); }
.post-grid { display: grid; gap: var(--s-7); grid-template-columns: minmax(0, 1fr); align-items: start; }
@media (min-width: 1080px) {
  .post-grid { grid-template-columns: minmax(0, 720px) 240px; justify-content: start; }
  .post-toc { position: sticky; top: 80px; }
}
@media (max-width: 1079px) { .post-toc { order: -1; } }
.post-toc {
  font-size: var(--t-sm); padding: var(--s-4);
  background: var(--bg-raised); border: 1px solid var(--hairline); border-radius: var(--r-lg);
}
.post-toc h2 { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); margin-bottom: var(--s-2); }
.post-toc ol { display: grid; gap: 2px; }
.post-toc a { display: block; padding: 3px 0; color: var(--ink-soft); line-height: 1.35; }
.post-toc a:hover { color: var(--ink); }
.post-toc a[aria-current="true"] { color: var(--accent); font-weight: 550; }
.toc-l3 a { padding-left: var(--s-3); font-size: var(--t-xs); }
.toc-meta { margin-top: var(--s-3); padding-top: var(--s-3); border-top: 1px solid var(--hairline); font-size: var(--t-xs); color: var(--ink-faint); }
.post-hero { margin: 0 0 var(--s-5); }
.post-hero img { width: 100%; height: auto; border-radius: var(--r-lg); border: 1px solid var(--hairline); }

.prose-long { font-size: 15.5px; line-height: 1.7; color: var(--ink); }
.prose-long > * + * { margin-top: var(--s-4); }
.prose-long h2 { font-size: var(--t-xl); margin-top: var(--s-7); scroll-margin-top: 80px; }
.prose-long h3 { font-size: var(--t-md); margin-top: var(--s-5); scroll-margin-top: 80px; }
.prose-long h2 + *, .prose-long h3 + * { margin-top: var(--s-3); }
.prose-long p, .prose-long li { color: var(--ink); }
.prose-long ul, .prose-long ol { list-style: revert; padding-left: var(--s-5); }
.prose-long li + li { margin-top: var(--s-2); }
.prose-long a { text-decoration: underline; text-underline-offset: 2px; text-decoration-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.prose-long a:hover { text-decoration-color: currentColor; }
.prose-long code { font: .9em var(--mono); padding: 1px 5px; background: var(--muted-fill); border-radius: var(--r-sm); }
.prose-long strong { font-weight: 600; }
.prose-long .table-scroll { margin: var(--s-5) 0; max-height: none; }
.prose-long table th[scope="row"] { text-align: left; font-weight: 550; color: var(--ink-soft); text-transform: none; letter-spacing: 0; font-size: var(--t-sm); }
.prose-long table { font-size: var(--t-sm); width: 100%; border-collapse: separate; border-spacing: 0; }
.prose-long table th, .prose-long table td { padding: var(--s-2) var(--s-3); border-bottom: 1px solid var(--hairline); text-align: left; vertical-align: top; }
.prose-long table thead th { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); border-bottom-color: var(--hairline-firm); }
.h-anchor { margin-left: .4em; font-weight: 400; color: var(--ink-faint); opacity: 0; text-decoration: none !important; }
h2:hover .h-anchor, h3:hover .h-anchor, .h-anchor:focus { opacity: 1; }

/* figures */
.post-fig {
  margin: var(--s-5) 0; padding: var(--s-4);
  background: var(--bg-raised); border: 1px solid var(--hairline); border-radius: var(--r-lg);
}
.post-fig figcaption { margin-top: var(--s-3); font-size: var(--t-sm); color: var(--ink-soft); }
.fig-title { font-weight: 550; color: var(--ink); }
.fig-svg { display: block; width: 100%; height: auto; color: var(--ink); }
.fig-label { font: 11px var(--sans); fill: var(--ink-soft); }
.fig-strong { fill: var(--ink); font-weight: 600; }
.fig-faint { fill: var(--ink-faint); }
.fig-value { fill: var(--ink); font-family: var(--mono); }
.fig-high { fill: var(--led-g); }
.fig-low { fill: var(--muted-fill); stroke: var(--hairline-firm); stroke-width: 1; }
.fig-num { font: 600 10.5px var(--mono); fill: var(--bg); }
.fig-num-low { fill: var(--ink-soft); }
.fig-tick { stroke: var(--hairline-firm); stroke-width: 1; }
.fig-bar { fill: var(--led-b); opacity: .85; }
.fig-bar-hot { fill: var(--led-r); opacity: .9; }
.fig-node rect { fill: var(--bg-sunken); stroke: var(--hairline-firm); stroke-width: 1; }
.fig-node-key rect { stroke: var(--accent); stroke-width: 1.5; }
.fig-node-warn rect { stroke: var(--warn); stroke-width: 1.5; }
.fig-edge { fill: none; stroke: var(--ink-faint); stroke-width: 1.3; }
.fig-edge-dash { stroke-dasharray: 4 3; }
.fig-arrowhead { fill: var(--ink-faint); }
.fig-lane { font: 600 10px var(--sans); letter-spacing: .08em; fill: var(--ink-faint); }

/* related + prev/next */
.post-related { margin-top: var(--s-8); padding-top: var(--s-5); border-top: 1px solid var(--hairline); }
.post-related h2 { font-size: var(--t-lg); margin-bottom: var(--s-2); }
.related-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.rel-card {
  display: flex; align-items: center; gap: var(--s-3); height: 100%;
  padding: var(--s-3); color: var(--ink);
  background: var(--bg-raised); border: 1px solid var(--hairline); border-radius: var(--r-md);
}
.rel-card:hover { border-color: var(--ink-faint); text-decoration: none; }
.rel-glyph { flex: none; width: 52px; height: 52px; display: grid; place-items: center; color: var(--ink-faint); background: var(--bg-sunken); border-radius: var(--r-md); }
.rel-proto { font-size: var(--t-sm); font-weight: 600; color: var(--ink-soft); }
.rel-text { display: grid; gap: 2px; min-width: 0; font-size: var(--t-xs); color: var(--ink-faint); }
.rel-text strong { font-size: var(--t-base); color: var(--ink); }
.post-pn { display: grid; gap: var(--s-3); grid-template-columns: 1fr 1fr; margin-top: var(--s-7); }
.pn-card { display: grid; gap: 2px; padding: var(--s-3) var(--s-4); background: var(--bg-raised); border: 1px solid var(--hairline); border-radius: var(--r-md); color: var(--ink); }
.pn-card:hover { border-color: var(--ink-faint); text-decoration: none; }
.pn-next { text-align: right; grid-column: 2; }
.pn-dir { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.pn-title { font-weight: 550; line-height: 1.3; }
@media (max-width: 600px) { .post-pn { grid-template-columns: 1fr; } .pn-next { grid-column: 1; text-align: left; } }

/* ── command palette ──────────────────────────────────────────────────── */
dialog.palette {
  padding: 0; border: 1px solid var(--hairline-firm); border-radius: var(--r-lg);
  background: var(--bg-raised); color: var(--ink); box-shadow: var(--shadow);
  width: min(620px, calc(100vw - 24px)); max-height: min(560px, 80vh);
  margin: 12vh auto auto; overflow: hidden;
}
dialog.palette::backdrop { background: rgb(0 0 0 / .45); backdrop-filter: blur(2px); }
.pal-box { display: flex; flex-direction: column; max-height: inherit; }
.pal-field { display: flex; align-items: center; gap: var(--s-3); padding: var(--s-3) var(--s-4); border-bottom: 1px solid var(--hairline); color: var(--ink-faint); }
.pal-input { flex: 1; min-width: 0; border: 0; background: none; color: var(--ink); font: var(--t-md) var(--sans); }
.pal-input:focus { outline: none; }
.pal-input::placeholder { color: var(--ink-faint); }
.pal-chips { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); padding: var(--s-3) var(--s-4); }
.pal-hint { font-size: var(--t-xs); color: var(--ink-faint); text-transform: uppercase; letter-spacing: .06em; margin-right: var(--s-1); }
.pal-list { overflow-y: auto; padding: var(--s-1) var(--s-2) var(--s-2); }
.pal-group { padding: var(--s-2) var(--s-2) var(--s-1); font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.pal-item a { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-3); padding: 7px var(--s-2); border-radius: var(--r-md); color: var(--ink); }
.pal-item a:hover { text-decoration: none; }
.pal-item[aria-selected="true"] a { background: var(--accent-soft); }
.pal-title { font-weight: 550; }
.pal-sub { color: var(--ink-faint); font-size: var(--t-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-status { padding: 0 var(--s-4) var(--s-2); font-size: var(--t-xs); color: var(--ink-faint); }
.pal-foot { display: flex; gap: var(--s-4); padding: var(--s-2) var(--s-4); border-top: 1px solid var(--hairline); background: var(--bg-sunken); font-size: var(--t-xs); color: var(--ink-faint); }
.pal-foot a { margin-left: auto; }
.pal-foot span { display: inline-flex; align-items: center; gap: 4px; }

/* ── fixes and polish ─────────────────────────────────────────────────── */
/* `1fr` lets a wide table force the whole page wider than the viewport. */
@media (max-width: 1080px) { .layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 720px) {
  .page-head { padding-top: var(--s-5); }
  .hero-search .hs-text { font-size: var(--t-base); }
}
.site-footer a { text-decoration: underline; text-underline-offset: 2px; }
.btn { cursor: pointer; }
a:focus-visible, button:focus-visible, summary:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
dialog.palette :focus-visible { outline-offset: -2px; }
.toolbar-right { flex-wrap: wrap; }

/* ── home: start block, quick pick, makers, FAQ ──────────────────────── */
.start { padding: 0 0 var(--s-6); }
.hero-search {
  display: flex; align-items: center; gap: var(--s-3); width: 100%; max-width: 760px;
  padding: 0 var(--s-4); height: 52px; text-align: left;
  background: var(--bg-raised); color: var(--ink-soft);
  border: 1px solid var(--hairline-firm); border-radius: var(--r-lg);
  box-shadow: var(--shadow); font-size: var(--t-md);
}
.hero-search:hover { border-color: var(--ink-faint); color: var(--ink); }
.hs-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chips-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-3); }
.tiles { display: grid; gap: var(--s-3); margin-top: var(--s-5); grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.tile {
  display: grid; gap: 4px; align-content: start; height: 100%; padding: var(--s-4);
  background: var(--bg-raised); border: 1px solid var(--hairline); border-radius: var(--r-lg);
  color: var(--ink); transition: border-color .15s ease, transform .15s ease;
}
.tile:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.tile-ico { color: var(--accent); margin-bottom: var(--s-2); }
.tile-t { font-weight: 600; font-size: var(--t-md); }
.tile-d { color: var(--ink-soft); font-size: var(--t-sm); line-height: 1.5; }

/* capability badges */
.cap {
  display: inline-flex; align-items: center; padding: 1px 8px;
  border-radius: var(--r-full); border: 1px solid var(--hairline-firm);
  font-size: var(--t-xs); font-weight: 550; color: var(--ink-soft); white-space: nowrap;
}
.cap-yes { color: var(--ink); border-color: color-mix(in srgb, var(--ok) 55%, var(--hairline)); background: color-mix(in srgb, var(--ok) 14%, transparent); }
.cap-hi { color: var(--ink); border-color: color-mix(in srgb, var(--warn) 55%, var(--hairline)); background: color-mix(in srgb, var(--warn) 14%, transparent); }
.cap-no { color: var(--ink-faint); border-style: dashed; }
.cap-diff { color: var(--ink); border-color: var(--accent); background: var(--accent-soft); }

.pick-table th[scope="row"] { text-align: left; font-size: var(--t-sm); text-transform: none; letter-spacing: 0; color: var(--ink); white-space: nowrap; }
.pk-parts { display: block; font-size: var(--t-xs); color: var(--ink-faint); font-weight: 400; }
.pk-best { color: var(--ink-soft); min-width: 22ch; }
.pick-table tr[hidden] { display: none; }
.pick-note { margin-top: var(--s-3); }
.pick-scroll { max-height: none; }
/* The long tail of protocols is in the page but folded until asked for. */
.pick-collapsed tr[data-extra] { display: none; }
.pick-more-row { display: flex; align-items: center; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-3); font-size: var(--t-sm); }
.pick-more[hidden], .pick-shown[hidden] { display: none; }

/* manufacturers */
.mfr-grid { display: grid; gap: var(--s-3); grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
.mfr-tile {
  display: grid; grid-template-columns: 40px 1fr; column-gap: var(--s-3); align-items: center;
  padding: var(--s-3); color: var(--ink);
  background: var(--bg-raised); border: 1px solid var(--hairline); border-radius: var(--r-lg);
}
.mfr-tile:hover { border-color: var(--ink-faint); text-decoration: none; }
.mfr-mark {
  grid-row: 1 / 3; width: 40px; height: 40px; display: grid; place-items: center;
  background: var(--bg-sunken); border: 1px solid var(--hairline); border-radius: var(--r-md);
  font: 600 var(--t-sm) var(--mono); color: var(--ink-soft);
}
.mfr-all { margin-top: var(--s-4); }
.mfr-all summary { cursor: pointer; font-weight: 600; font-size: var(--t-sm); padding: var(--s-2) 0; }
.mfr-list {
  list-style: none; margin: var(--s-3) 0 0; padding: 0; display: grid; gap: 2px var(--s-5);
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); font-size: var(--t-sm);
}
.mfr-list li { display: flex; justify-content: space-between; gap: var(--s-2); padding: 3px 0; border-bottom: 1px solid var(--hairline); }
.mfr-name { font-weight: 600; }
.mfr-meta { font-size: var(--t-xs); color: var(--ink-faint); }

/* FAQ */
.faq-list { max-width: 820px; border-top: 1px solid var(--hairline); }
.faq-item { border-bottom: 1px solid var(--hairline); }
.faq-item summary {
  display: flex; justify-content: space-between; gap: var(--s-4); align-items: center;
  padding: var(--s-4) 0; cursor: pointer; list-style: none; font-weight: 550; font-size: var(--t-md);
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "+"; font: 400 20px var(--mono); color: var(--ink-faint); transition: transform .15s ease; }
.faq-item[open] summary::after { transform: rotate(45deg); }
.faq-item p { padding: 0 var(--s-6) var(--s-4) 0; color: var(--ink-soft); line-height: 1.65; max-width: 70ch; }
.faq-item p a { text-decoration: underline; text-underline-offset: 2px; }

/* ── part page: hero, section nav, at-a-glance, similar ───────────────── */
.part-page { max-width: 1040px; }
.hero-part { align-items: stretch; gap: var(--s-6); }
.hero-part .hero-text { flex: 1; min-width: 0; align-self: center; }
.pkg-art { margin: 0; flex: none; width: 220px; }
.pkg-stage {
  display: grid; place-items: center; aspect-ratio: 1; color: var(--ink-faint);
  background:
    linear-gradient(var(--hairline) 1px, transparent 1px) 0 0 / 20px 20px,
    linear-gradient(90deg, var(--hairline) 1px, transparent 1px) 0 0 / 20px 20px,
    var(--bg-raised);
  border: 1px solid var(--hairline); border-radius: var(--r-lg);
}
.pkg-stage svg { max-width: 70%; height: auto; }
.pkg-caption { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: var(--s-2); font-size: var(--t-xs); color: var(--ink-soft); }
.pkg-sep { color: var(--ink-faint); }
.hero-badges { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-3); }
.cmp-form { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-4); font-size: var(--t-sm); color: var(--ink-soft); }
.cmp-form select {
  max-width: 220px; height: 30px; padding: 0 var(--s-2);
  background: var(--bg-raised); color: var(--ink);
  border: 1px solid var(--hairline-firm); border-radius: var(--r-md); font: var(--t-sm) var(--sans);
}
@media (max-width: 640px) {
  .hero-part { flex-direction: column; gap: var(--s-4); }
  .pkg-art { width: 100%; max-width: 220px; }
}

.section-nav {
  position: sticky; top: 53px; z-index: 20;
  display: flex; gap: var(--s-1); overflow-x: auto; scrollbar-width: none;
  margin: 0 calc(var(--s-5) * -1); padding: var(--s-2) var(--s-5);
  background: color-mix(in srgb, var(--bg) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--hairline);
}
.section-nav::-webkit-scrollbar { display: none; }
.section-nav a {
  flex: none; padding: 4px var(--s-3); border-radius: var(--r-full);
  color: var(--ink-soft); font-size: var(--t-sm);
}
.section-nav a:hover { color: var(--ink); background: var(--bg-hover); text-decoration: none; }
.section-nav a[aria-current="true"] { color: var(--ink); background: var(--muted-fill); font-weight: 550; }
.part-page .block { scroll-margin-top: 110px; }
.part-page #overview { scroll-margin-top: 110px; }

.glance {
  display: grid; gap: var(--s-3); margin: var(--s-5) 0;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
}
.g-card { padding: var(--s-3) var(--s-4); background: var(--bg-raised); border: 1px solid var(--hairline); border-radius: var(--r-lg); }
.g-wide { grid-column: span 2; }
.g-card dt { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.g-card dd { margin: 4px 0 0; font-size: var(--t-md); display: grid; gap: 2px; justify-items: start; }
.g-card small { font: var(--t-xs) var(--sans); color: var(--ink-faint); }
.g-libs { display: flex !important; flex-wrap: wrap; gap: var(--s-2); }
@media (max-width: 520px) { .g-wide { grid-column: auto; } }

.sim-item { display: flex; flex-direction: column; gap: 4px; }
.inline-cmp { font-size: var(--t-xs); padding-left: var(--s-1); }
@media (max-width: 720px) { .section-nav { margin: 0 calc(var(--s-4) * -1); padding: var(--s-2) var(--s-4); } }

/* ── compare view ─────────────────────────────────────────────────────── */
.cmp-pick { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s-3); margin-bottom: var(--s-5); }
.cmp-col { display: grid; gap: 4px; flex: 1 1 240px; max-width: 340px; }
.cmp-col label { font-size: var(--t-xs); text-transform: uppercase; letter-spacing: .06em; color: var(--ink-faint); }
.cmp-pick select {
  height: 36px; padding: 0 var(--s-3); width: 100%;
  background: var(--bg-raised); color: var(--ink);
  border: 1px solid var(--hairline-firm); border-radius: var(--r-md); font: var(--t-base) var(--sans);
}
.cmp-swap { height: 36px; min-width: 40px; }
.cmp-summary { margin-bottom: var(--s-3); color: var(--ink-soft); font-size: var(--t-sm); }
.cmp-scroll { max-height: none; max-width: 880px; }
.cmp-table { width: 100%; font-size: var(--t-sm); }
.cmp-table th[scope="row"] { text-align: left; font-weight: 550; color: var(--ink-soft); text-transform: none; letter-spacing: 0; width: 28%; }
.cmp-table thead th { font-size: var(--t-md); text-transform: none; letter-spacing: 0; color: var(--ink); }
.cmp-table tr.is-diff td { background: var(--accent-soft); }
.cmp-table tr.is-diff th[scope="row"] { color: var(--ink); }
.cmp-table tr.is-diff th[scope="row"]::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 8px; border-radius: 50%; background: var(--accent); }
.cmp-ideas-h { font-size: var(--t-lg); margin-bottom: var(--s-3); }
.cmp-ideas { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.cmp-ideas a { display: inline-block; padding: 4px var(--s-3); border: 1px solid var(--hairline-firm); border-radius: var(--r-full); background: var(--bg-raised); font-size: var(--t-sm); }

/* ── "Datasheets disagree" panel, the check-the-datasheet note, the ≠ badge ──
   Built only from the existing tokens, so light and dark both follow the
   theme contract in catalogue.css. The accent is --warn used as a thin edge
   and a faint tint: informative, not an error state. Meaning never rests on
   colour alone: every marker carries the glyph and a text label. */

.check-sheet {
  margin: var(--s-4) 0 0; padding: var(--s-3) var(--s-4);
  background: var(--bg-sunken); border: 1px solid var(--hairline); border-radius: var(--r-md);
  color: var(--ink-soft); font-size: var(--t-sm); line-height: 1.55; max-width: 80ch;
}
.check-sheet strong { color: var(--ink); }
.check-sheet a { text-decoration: underline; text-underline-offset: 2px; }

.disagree {
  padding: var(--s-4) var(--s-4) var(--s-3);
  background: color-mix(in srgb, var(--warn) 6%, var(--bg-raised));
  border: 1px solid color-mix(in srgb, var(--warn) 35%, var(--hairline));
  border-left: 4px solid var(--warn);
  border-radius: var(--r-md);
}
.part-page .disagree, .detail .disagree { margin-top: var(--s-5); }
.disagree > h2 { display: flex; align-items: center; gap: var(--s-2); }
.dis-ico {
  display: inline-grid; place-items: center; width: 1.5em; height: 1.5em;
  border: 1.5px solid var(--warn); border-radius: var(--r-full);
  color: var(--warn); font: 600 .8em/1 var(--mono);
}
.dis-group + .dis-group { margin-top: var(--s-4); }
.dis-scope { margin-top: var(--s-3) !important; padding-top: var(--s-3); border-top: 1px solid var(--hairline); }
.dis-group:first-of-type .dis-scope { border-top: 0; padding-top: 0; }
.dis-item { margin-top: var(--s-4); }
.dis-item h4 { font-size: var(--t-base); margin: 0 0 var(--s-1); color: var(--ink); }
.dis-sum { color: var(--ink-soft); font-size: var(--t-sm); line-height: 1.55; max-width: 75ch; margin-bottom: var(--s-2); }
.dis-src { background: var(--bg-raised); }
.dis-src td, .dis-src th { vertical-align: top; }
.dis-src td:first-child { overflow-wrap: anywhere; }
.dis-sheet { font-size: var(--t-xs); }
.dis-res { margin-top: var(--s-2); color: var(--ink-soft); font-size: var(--t-sm); line-height: 1.55; max-width: 75ch; }
.dis-res strong { color: var(--ink); }
.disagree a { text-decoration: underline; text-underline-offset: 2px; }

.footer-check { margin-top: var(--s-3); }
.footer-check strong { color: var(--ink); }

/* the small marker on a spec cell, a glance card or a stat */
.dis-badge {
  display: inline-grid; place-items: center; width: 1.45em; height: 1.45em; margin-left: .4em;
  vertical-align: middle;
  border: 1px solid color-mix(in srgb, var(--warn) 55%, transparent); border-radius: var(--r-full);
  background: color-mix(in srgb, var(--warn) 10%, transparent); color: var(--warn);
  font: 600 var(--t-xs)/1 var(--mono); text-decoration: none !important;
}
.dis-badge:hover, .dis-badge:focus-visible { background: color-mix(in srgb, var(--warn) 22%, transparent); }
.dis-badge:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
dt .dis-badge { text-transform: none; letter-spacing: 0; }

/* /accuracy/ */
.accuracy .prose h2 { margin-top: var(--s-6); }
.accuracy .basis-table td:first-child { white-space: nowrap; }
.acc-list { display: grid; gap: var(--s-2); margin: var(--s-3) 0 0; padding: 0; list-style: none; }
.acc-list li { padding: var(--s-2) var(--s-3); border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-raised); font-size: var(--t-sm); }
.acc-list .acc-fields { color: var(--ink-faint); }
