/*
 * Claudemods registry — paper-and-ink styling.
 * Direction: the Claude / Anthropic language. Matte warm paper, charcoal ink, warm hairlines instead of shadows or
 * heavy boxes. A system serif owns only the wordmark and h1; every other name, label and control is native sans;
 * monospace is reserved for IDs, commands and SHAs. Clay (the brand orange) is an accent for links, selection and
 * the current state only. Clay itself is too light for white text, so the primary button is charcoal and --accent is
 * a deeper clay that holds 4.5:1 for small text and for white-on-accent. Warn (ochre) and danger (crimson) are
 * separate hues from clay so state is never confused with brand.
 * Tokens come in three blocks: light (default and explicit), explicit dark, and dark for "auto". CSS cannot share a
 * block between a media query and an attribute selector, so the dark set is written twice; it is authored warm, not
 * inverted. No gradients, no glass, no shadows, no animation beyond short colour transitions.
 * No inline styles anywhere (CSP): everything the server renders is styled from this file.
 */

:root,
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #faf9f5;
  --chrome: #faf9f5;
  --surface: #fffefb;
  --surface-2: #f1efe7;
  --line: #e6e3d8;
  --line-strong: #8f8c80;
  --text: #141413;
  --muted: #5e5d59;
  --clay: #d97757;
  --on-clay: #141413;
  --accent: #a8431c;
  --accent-strong: #8c3414;
  --accent-weak: #f4e4db;
  --on-accent: #ffffff;
  --primary: #141413;
  --primary-hover: #3d3d3a;
  --on-primary: #faf9f5;
  --focus: #a8431c;
  --ok-fg: #3f6a24;
  --ok-bg: #e8eedb;
  --warn-fg: #6b4a00;
  --warn-bg: #f7edc8;
  --danger-fg: #a3203d;
  --danger-bg: #fae4e6;
  --radius: 10px;
  --radius-sm: 6px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Noto Sans", system-ui, sans-serif;
  --font-serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Songti SC", "Noto Serif CJK SC", "Noto Serif SC", "Source Han Serif SC", "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #1a1918;
  --chrome: #1a1918;
  --surface: #232220;
  --surface-2: #2c2a27;
  --line: #373531;
  --line-strong: #74716a;
  --text: #f0eee6;
  --muted: #a9a69b;
  --clay: #d97757;
  --on-clay: #141413;
  --accent: #ec9570;
  --accent-strong: #f4ab8b;
  --accent-weak: #3b2a21;
  --on-accent: #1a1918;
  --primary: #f0eee6;
  --primary-hover: #ffffff;
  --on-primary: #1a1918;
  --focus: #f4ab8b;
  --ok-fg: #a9c985;
  --ok-bg: #27301b;
  --warn-fg: #e6c25a;
  --warn-bg: #352b0d;
  --danger-fg: #f28e9b;
  --danger-bg: #3c1c22;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #1a1918;
    --chrome: #1a1918;
    --surface: #232220;
    --surface-2: #2c2a27;
    --line: #373531;
    --line-strong: #74716a;
    --text: #f0eee6;
    --muted: #a9a69b;
    --clay: #d97757;
    --on-clay: #141413;
    --accent: #ec9570;
    --accent-strong: #f4ab8b;
    --accent-weak: #3b2a21;
    --on-accent: #1a1918;
    --primary: #f0eee6;
    --primary-hover: #ffffff;
    --on-primary: #1a1918;
    --focus: #f4ab8b;
    --ok-fg: #a9c985;
    --ok-bg: #27301b;
    --warn-fg: #e6c25a;
    --warn-bg: #352b0d;
    --danger-fg: #f28e9b;
    --danger-bg: #3c1c22;
  }
}

/* ---- base ---------------------------------------------------------------- */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  accent-color: var(--accent);
  scrollbar-color: var(--line-strong) var(--bg);
  scroll-padding-top: 1rem;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  line-height: 1.55;
  caret-color: var(--accent);
  font-variant-numeric: tabular-nums;
  overflow-wrap: break-word;
}

::selection { background: var(--clay); color: var(--on-clay); }

main { flex: 1 0 auto; width: 100%; outline: none; }

h1, h2, h3, h4, p, ul, ol, dl, dd, figure { margin: 0; }
h1, h2, h3, h4 { text-wrap: balance; line-height: 1.3; }
h1 { font-family: var(--font-serif); font-size: clamp(1.75rem, 1.35rem + 1.6vw, 2.375rem); font-weight: 500; line-height: 1.15; letter-spacing: -0.015em; }
h2 { font-size: 1.125rem; font-weight: 600; letter-spacing: -0.005em; }
h3 { font-size: 1rem; font-weight: 600; }
h4 { font-size: 0.9375rem; font-weight: 600; }
:lang(zh) h1 { letter-spacing: 0; line-height: 1.25; }
ul, ol { padding: 0; list-style: none; }

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 0.2em; transition: color 0.12s ease-out; }
a:hover { color: var(--accent-strong); text-decoration-thickness: 2px; }

code, kbd {
  font-family: var(--font-mono);
  font-size: 0.85em;
}
code {
  background: var(--surface-2);
  border-radius: 4px;
  padding: 0.08em 0.35em;
  overflow-wrap: anywhere;
}

:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 4px; }
:focus:not(:focus-visible) { outline: none; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}
.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.icon { flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; vertical-align: -0.2em; }
.muted { color: var(--muted); }
.warn-text { color: var(--warn-fg); }
.breakable { overflow-wrap: anywhere; word-break: break-all; }
.pad { padding: 0.25rem 0 0.75rem 1.1rem; }
.fineprint { color: var(--muted); font-size: 0.8125rem; margin-top: 0.6rem; max-width: 70ch; }

.skip-link {
  position: absolute;
  left: 0.75rem;
  top: -4rem;
  z-index: 20;
  background: var(--primary);
  color: var(--on-primary);
  padding: 0.5rem 0.9rem;
  border-radius: var(--radius-sm);
  transition: top 0.12s ease-out;
}
.skip-link:focus { top: 0.75rem; color: var(--on-primary); }

/* ---- chrome -------------------------------------------------------------- */

.topbar { background: var(--chrome); border-bottom: 1px solid var(--line); }
.topbar-inner {
  max-width: 76rem;
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; color: var(--text); text-decoration: none; }
.brand .icon { width: 1.35rem; height: 1.35rem; color: var(--clay); }
.brand-name { font-family: var(--font-serif); font-size: 1.3125rem; font-weight: 500; letter-spacing: -0.01em; line-height: 1.2; overflow-wrap: anywhere; }
.brand:hover { color: var(--text); }
.nav { display: flex; flex-wrap: wrap; gap: 0.15rem; margin-right: auto; }
.nav a { color: var(--muted); text-decoration: none; padding: 0.3rem 0.65rem; border-radius: var(--radius-sm); transition: background-color 0.12s ease-out, color 0.12s ease-out; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--surface-2); color: var(--text); font-weight: 600; }
.topbar-tools { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; }

.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 8px; overflow: hidden; background: var(--surface); }
.seg a, .seg button {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.1rem;
  min-height: 2rem;
  padding: 0 0.65rem;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.8125rem;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s ease-out, color 0.12s ease-out;
}
.seg a + a, .seg button + button { border-left: 1px solid var(--line); }
.seg a:hover, .seg button:hover { background: var(--surface-2); color: var(--text); }
.seg [aria-current="true"], .seg [aria-pressed="true"] { background: var(--surface-2); color: var(--text); font-weight: 650; box-shadow: inset 0 -2px 0 var(--clay); }
.seg :focus-visible { outline-offset: -2px; }

.footer { border-top: 1px solid var(--line); margin-top: 3.5rem; background: var(--chrome); }
.footer-inner { max-width: 76rem; margin: 0 auto; padding: 1.25rem; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.5rem 2rem; color: var(--muted); font-size: 0.8125rem; }
.footer-inner p { max-width: 70ch; }
.footer-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.25rem; }
.footer-nav a { color: var(--muted); text-decoration-color: var(--line-strong); }
.footer-nav a:hover, .footer-nav a[aria-current="page"] { color: var(--text); }

/* ---- page frame ---------------------------------------------------------- */

.page { max-width: 76rem; margin: 0 auto; padding: 2rem 1.25rem 0.5rem; }
.page.narrow { max-width: 44rem; }
.page.narrow-wide { max-width: 54rem; }
.page-head { margin-bottom: 1.5rem; }
.page-head h1 { margin-bottom: 0.5rem; }
.lede { color: var(--muted); font-size: 1.0625rem; line-height: 1.5; max-width: 62ch; text-wrap: pretty; }

/* ---- controls ------------------------------------------------------------ */

input[type="text"], input[type="search"], select {
  width: 100%;
  height: 2.5rem;
  padding: 0 0.75rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background-color: var(--surface);
  color: var(--text);
  font: inherit;
  transition: border-color 0.12s ease-out;
}
input[type="text"], input[type="search"] { appearance: none; }
select { padding-right: 0.5rem; }
input::placeholder { color: var(--muted); opacity: 1; }
input:hover, select:hover { border-color: var(--text); }
input:focus-visible, select:focus-visible { outline: 2px solid var(--focus); outline-offset: 1px; border-color: var(--focus); border-radius: 8px; }
input[type="search"]::-webkit-search-cancel-button { filter: grayscale(1); }

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 2.5rem;
  padding: 0 1rem;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  font: inherit;
  font-weight: 550;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.12s ease-out, border-color 0.12s ease-out, color 0.12s ease-out;
}
.btn:hover { background: var(--surface-2); border-color: var(--text); color: var(--text); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--on-primary); }
.btn-small { min-height: 2rem; padding: 0 0.7rem; font-size: 0.8125rem; }
.btn-quiet { border-color: transparent; background: transparent; color: var(--accent); }
.btn-block { display: flex; width: 100%; margin-top: 0.75rem; }
.btn.is-disabled { opacity: 0.6; cursor: not-allowed; pointer-events: none; }

.icon-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: background-color 0.12s ease-out, color 0.12s ease-out;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.is-copied { color: var(--ok-fg); }

.field { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.field label { font-size: 0.8125rem; font-weight: 550; color: var(--muted); }

.badge {
  display: inline-block;
  max-width: 100%;
  padding: 0.05rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 4px;
  background: var(--surface-2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 600;
  line-height: 1.5;
  vertical-align: 0.1em;
  overflow-wrap: anywhere;
  margin-left: 0.4rem;
}
.badge-accent { background: var(--accent-weak); border-color: transparent; color: var(--accent); }
.badge-ok { background: var(--ok-bg); border-color: transparent; color: var(--ok-fg); }
.badge-warn { background: var(--warn-bg); border-color: transparent; color: var(--warn-fg); }
.badge-danger { background: var(--danger-bg); border-color: transparent; color: var(--danger-fg); }
h1 .badge { font-family: var(--font-sans); font-size: 0.8125rem; letter-spacing: 0; vertical-align: 0.3em; }

.notice {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  padding: 0.75rem 1rem;
  margin-bottom: 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface-2);
}
.notice .icon { margin-top: 0.2rem; }
.notice-info .icon { color: var(--accent); }
.notice-warn { background: var(--warn-bg); border-color: color-mix(in srgb, var(--warn-fg) 30%, transparent); color: var(--warn-fg); }
.notice-danger { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger-fg) 30%, transparent); color: var(--danger-fg); }
.notice a { color: inherit; font-weight: 600; }
.plain-list { list-style: disc; padding-left: 1.2rem; }
.plain-list li + li { margin-top: 0.2rem; }
.notice .plain-list { margin-top: 0.25rem; }

.plain-link { overflow-wrap: anywhere; }
a.ext { display: inline-flex; align-items: baseline; gap: 0.25rem; overflow-wrap: anywhere; }
a.ext .icon { width: 0.8em; height: 0.8em; align-self: center; opacity: 0.75; }

.codeline { display: inline-flex; align-items: center; gap: 0.25rem; max-width: 100%; }
.codeline code { padding: 0.2rem 0.5rem; min-width: 0; }

/* ---- disclosures: one quiet pattern, hairline separators and a chevron, never a nested box ---- */

.group, .filters-more, .detail-more, .version-supplement, .registry-notes { border-top: 1px solid var(--line); }
.group > summary, .filters-more > summary, .detail-more > summary, .version-supplement > summary, .registry-notes > summary {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  color: var(--text);
  transition: color 0.12s ease-out;
}
.group > summary::-webkit-details-marker, .filters-more > summary::-webkit-details-marker, .detail-more > summary::-webkit-details-marker,
.version-supplement > summary::-webkit-details-marker, .registry-notes > summary::-webkit-details-marker { display: none; }
.group > summary::before, .filters-more > summary::before, .detail-more > summary::before, .version-supplement > summary::before, .registry-notes > summary::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform 0.15s ease-out;
  flex: none;
}
.group[open] > summary::before, .filters-more[open] > summary::before, .detail-more[open] > summary::before,
.version-supplement[open] > summary::before, .registry-notes[open] > summary::before { transform: rotate(45deg); }
.group > summary:hover, .filters-more > summary:hover, .detail-more > summary:hover, .version-supplement > summary:hover, .registry-notes > summary:hover { color: var(--accent); }
.detail-more, .version-supplement, .registry-notes { margin-bottom: 2rem; border-bottom: 1px solid var(--line); }
.detail-more > summary, .version-supplement > summary, .registry-notes > summary { font-size: 1rem; padding: 0.85rem 0; }
.detail-more[open], .version-supplement[open], .registry-notes[open] { padding-bottom: 1.25rem; }
.detail-more .card, .version-supplement .card, .registry-notes .card { background: none; border: 0; border-radius: 0; padding: 0; }
.version-supplement .block > h2, .detail-more .block > h2 { font-size: 1rem; }
.version-supplement .block:last-child, .detail-more .block:last-child { margin-bottom: 0; }
.registry-notes { margin-top: 2.5rem; }
.registry-notes .status { border: 0; padding: 0 0 0.25rem; margin: 0; }

/* ---- home: search, filters, results -------------------------------------- */

.catalogue-head { margin-bottom: 1.5rem; }
.catalogue-head h1 { font-size: clamp(2rem, 1rem + 3vw, 3.1rem); line-height: 1.08; letter-spacing: -0.02em; margin-bottom: 0.65rem; max-width: 22ch; }
:lang(zh) .catalogue-head h1 { line-height: 1.2; letter-spacing: 0; }
.catalogue-head .lede { max-width: 54ch; }
.lede-action { margin-top: 0.85rem; }
.scope-note { display: flex; gap: 0.5rem; align-items: baseline; margin: -0.25rem 0 1rem; font-size: 0.875rem; color: var(--muted); max-width: 72ch; }
.scope-note .icon { flex: none; transform: translateY(0.15rem); }
.submit-form { margin: 1.25rem 0 2rem; }
.submit-form > label { display: block; font-weight: 600; margin-bottom: 0.4rem; }
.submit-form .search-field input { padding-left: 0.9rem; }
.mod-evidence { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 1rem 1.1rem; margin-bottom: 1.25rem; }
.mod-evidence h2 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.mod-evidence .plain-list { margin: 0.4rem 0 0.6rem; }
.mod-evidence .muted { font-size: 0.8125rem; }

.search { margin-bottom: 1.25rem; }
.search-row { display: flex; gap: 0.5rem; }
.search-field { position: relative; flex: 1; min-width: 0; }
.search-field .icon { position: absolute; left: 0.9rem; top: 50%; transform: translateY(-50%); width: 1.1rem; height: 1.1rem; color: var(--muted); pointer-events: none; }
.search-field input { padding-left: 2.6rem; }
.search-row .btn { min-width: 6rem; }
.catalogue-page .search-row .search-field input, .catalogue-page .search-row .btn { height: 3rem; font-size: 1rem; }
.catalogue-page .search-row .search-field input { border-radius: 10px; }
.catalogue-page .search-row .btn { border-radius: 10px; }
.search-help { margin-top: 0.5rem; }

.filters-primary { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 14rem)); gap: 0.6rem 1rem; margin-top: 0.85rem; align-items: end; }
.filters { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr)); gap: 0.75rem; margin-top: 0.75rem; }
.filters-more { margin-top: 0.85rem; border-top: 0; }
.filters-more > summary { display: inline-flex; padding: 0.3rem 0; font-size: 0.875rem; font-weight: 550; color: var(--muted); }
.filters-more[open] > summary { color: var(--text); }
.filters-more .filters { margin-top: 0.4rem; padding-bottom: 0.25rem; }

.status { border-block: 1px solid var(--line); padding: 0.65rem 0; margin-bottom: 1.25rem; }
.statline { display: flex; flex-wrap: wrap; gap: 0.35rem 1.75rem; }
.statline > div { display: flex; align-items: baseline; gap: 0.45rem; }
.statline dt { color: var(--muted); font-size: 0.8125rem; }
.statline dd { font-weight: 650; }
.statline-run { margin-left: auto; }
.statline-run dd { font-weight: 400; display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: center; }
.statline-run .badge { margin-left: 0; }
.status-note { display: flex; gap: 0.5rem; align-items: baseline; margin-top: 0.5rem; font-size: 0.8125rem; color: var(--muted); }
.status-note.warn-text { color: var(--warn-fg); }

.chips { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; align-items: center; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  max-width: 100%;
  padding: 0.2rem 0.65rem;
  border-radius: 14px;
  background: var(--accent-weak);
  color: var(--accent);
  font-size: 0.8125rem;
  text-decoration: none;
  transition: background-color 0.12s ease-out, color 0.12s ease-out;
}
.chip:hover { background: var(--accent); color: var(--on-accent); }
.chip-name { color: var(--muted); }
.chip:hover .chip-name { color: inherit; }
.chip .icon { width: 0.8rem; height: 0.8rem; }
.chip-clear { font-size: 0.8125rem; margin-left: 0.25rem; }

.results-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 0.25rem 1.5rem; margin-bottom: 0.75rem; color: var(--muted); font-size: 0.8125rem; }
.results-note { max-width: 62ch; }

/* Lists (sources, updates, repository groups) are hairline-separated rows; only the catalogue turns rows into cards. */
.results { border-top: 1px solid var(--line); }
.row { display: flex; flex-direction: column; gap: 0.75rem; min-width: 0; padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.row-main { min-width: 0; }
.row-title { font-size: 1.0625rem; font-weight: 600; line-height: 1.3; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0; }
.row-title a { color: var(--text); font-weight: 600; text-decoration: none; margin-right: 0.1rem; overflow-wrap: anywhere; }
.row-title a:hover { color: var(--accent); text-decoration: underline; }
.row-desc {
  margin-top: 0.3rem;
  max-width: 75ch;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.row-meta { display: flex; flex-wrap: wrap; gap: 0.15rem 0.9rem; margin-top: 0.5rem; font-size: 0.8125rem; line-height: 1.5; color: var(--muted); }
.row-meta a { color: var(--muted); text-decoration-color: var(--line-strong); }
.row-meta a:hover { color: var(--accent); text-decoration-color: currentColor; }
.meta-path code { font-size: 0.78rem; }

.row-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.4rem 0.9rem; margin-top: auto; padding-top: 0.7rem; border-top: 1px solid var(--line); font-size: 0.8125rem; min-width: 0; }
.row-metrics { display: flex; flex-wrap: wrap; gap: 0.2rem 0.9rem; color: var(--muted); min-width: 0; }
.row-metrics .stat { display: inline-flex; align-items: baseline; gap: 0.3rem; text-align: left; }
.row-metrics .stat-value { font-size: 0.8125rem; color: var(--text); }
.row-metrics .stat-label { display: inline; font-size: 0.8125rem; }
.row-footer .ver-link { justify-content: flex-start; }

/* Catalogue: calm 1 / 2 / 3 column grid of quiet cards. */
.catalogue-page .results:not(.repo-groups) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1rem; border-top: 0; }
.catalogue-page .results:not(.repo-groups) > .row {
  padding: 1.1rem 1.15rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color 0.12s ease-out;
}
.catalogue-page .results:not(.repo-groups) > .row:hover { border-color: var(--line-strong); }
.catalogue-page .results:not(.repo-groups) .row-desc { -webkit-line-clamp: 3; line-clamp: 3; }
@media (min-width: 44rem) {
  .catalogue-page .results:not(.repo-groups) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (min-width: 72rem) {
  .catalogue-page .results:not(.repo-groups) { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Matched component evidence: a quiet quoted block, kept visible while searching. */
.evidence { margin-top: 0.65rem; padding: 0.1rem 0 0.1rem 0.75rem; max-width: 75ch; border-left: 2px solid var(--line-strong); font-size: 0.8125rem; }
.evidence-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.2rem 0.75rem; color: var(--muted); }
.evidence-title { font-weight: 600; overflow-wrap: anywhere; }
.evidence-version { display: inline-flex; align-items: center; gap: 0.3rem; color: var(--muted); text-decoration: none; }
.evidence-version:hover { color: var(--accent); }
.evidence-version code { font-size: 0.78rem; white-space: nowrap; }
.evidence-list { display: grid; gap: 0.35rem; margin-top: 0.4rem; }
.evidence-item { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 0.5rem; align-items: start; min-width: 0; }
.evidence-item .badge { margin: 0; }
.evidence-text { display: flex; flex-direction: column; min-width: 0; }
.evidence-text .comp-path { max-width: 100%; }
.evidence-more { margin-top: 0.4rem; color: var(--muted); }

.stat { text-align: right; }
.stat-value { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 600; font-size: 1rem; }
.stat-value .icon { width: 0.95rem; height: 0.95rem; color: var(--muted); }
.stat-label { display: block; color: var(--muted); font-size: 0.78rem; }

.ver-link { display: inline-flex; flex-wrap: wrap; align-items: center; gap: 0.4rem; text-decoration: none; color: var(--text); max-width: 100%; }
.ver-link:hover { color: var(--accent); }
.ver-link .icon { color: var(--muted); }
.ver-name { font-weight: 600; overflow-wrap: anywhere; }
.ver-link code { font-size: 0.78rem; white-space: nowrap; }

/* ---- repository-grouped view ---------------------------------------------- */

.view-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 0.35rem 0.75rem; margin-bottom: 0.9rem; }
.view-label { color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.view-bar .seg a { min-height: 2.25rem; padding: 0 0.9rem; }

.repo-group { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.repo-group-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 0.5rem 1.5rem; align-items: start; }
.repo-group-title { font-size: 1.0625rem; font-weight: 600; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0; min-width: 0; }
.repo-group-name { overflow-wrap: anywhere; }
.repo-group-previews { display: grid; gap: 0.9rem; margin: 0.65rem 0 0 0.15rem; padding-left: 0.9rem; border-left: 2px solid var(--line); }
.repo-preview { min-width: 0; }
.repo-preview-title { margin: 0; font-size: 0.9375rem; font-weight: 600; line-height: 1.4; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.2rem 0; }
.repo-preview-title a { color: var(--text); text-decoration: none; margin-right: 0.1rem; overflow-wrap: anywhere; }
.repo-preview-title a:hover { color: var(--accent); text-decoration: underline; }
.repo-preview-desc {
  margin-top: 0.1rem;
  max-width: 75ch;
  font-size: 0.875rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.repo-preview-meta { margin-top: 0.25rem; }
.repo-preview-meta strong { color: var(--text); font-weight: 600; }
.repo-preview-version { display: inline-flex; align-items: center; gap: 0.3rem; text-decoration: none; }
.repo-preview-version:hover { color: var(--accent); }
.repo-preview-version code { font-size: 0.78rem; white-space: nowrap; }
.repo-preview .evidence { margin-top: 0.4rem; }
.repo-group-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 0.35rem 1.25rem; margin-top: 0.75rem; font-size: 0.8125rem; color: var(--muted); }
.repo-group-count { max-width: 62ch; }
.repo-group-actions { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; font-weight: 600; }
.repo-group-note { display: flex; gap: 0.5rem; align-items: flex-start; margin-top: 0.65rem; max-width: 75ch; padding-left: 0.75rem; border-left: 2px solid var(--line-strong); font-size: 0.8125rem; color: var(--muted); }
.repo-group-note .icon { margin-top: 0.2rem; }

.empty { border-top: 1px solid var(--line); padding: 2rem 0; display: flex; flex-direction: column; gap: 0.75rem; }
.empty p { max-width: 62ch; }
.empty-inline { color: var(--muted); padding: 0.75rem 0; }
.prompt { margin-bottom: 1.75rem; }
.actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.pager { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; margin-top: 1.5rem; }
.pager ol { display: flex; flex-wrap: wrap; gap: 0.25rem; }
.page-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  min-width: 2.5rem;
  min-height: 2.5rem;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: transparent;
  color: var(--text);
  text-decoration: none;
  transition: background-color 0.12s ease-out;
}
a.page-link:hover { background: var(--surface-2); color: var(--text); }
.page-link.is-current { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 650; }
.page-link.is-disabled { opacity: 0.55; }
.gap { padding: 0 0.25rem; color: var(--muted); }

/* ---- detail pages -------------------------------------------------------- */

.detail-head { margin-bottom: 2rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.crumbs { display: flex; flex-wrap: wrap; gap: 0.4rem; color: var(--muted); font-size: 0.8125rem; margin-bottom: 0.6rem; overflow-wrap: anywhere; }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }
.detail-head h1 { font-size: clamp(1.875rem, 1.2rem + 2.2vw, 2.75rem); line-height: 1.1; overflow-wrap: anywhere; }
.ver-title { font-family: var(--font-mono); font-weight: 400; color: var(--muted); font-size: 0.6em; letter-spacing: 0; }
.detail-desc { margin-top: 0.65rem; max-width: 66ch; font-size: 1.0625rem; line-height: 1.55; text-wrap: pretty; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 1.1rem 0 0; align-items: center; }
.page > .detail-actions { margin-bottom: 1rem; }
.detail-head .detail-more { margin: 1rem 0 0; border-bottom: 0; padding-bottom: 0; }
.detail-head .detail-more > summary { font-size: 0.875rem; font-weight: 550; color: var(--muted); padding: 0.4rem 0; }
.detail-head .detail-more[open] > summary { color: var(--text); }
.detail-head .detail-more .detail-actions { margin-top: 0.25rem; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 19.5rem; gap: 3rem; align-items: start; }
.detail-main { min-width: 0; }
.detail-side { display: flex; flex-direction: column; gap: 1.25rem; min-width: 0; }
.detail-side .card { background: none; border: 0; border-top: 1px solid var(--line); border-radius: 0; padding: 1rem 0 0; }
.detail-side .card:first-child { border-top: 0; padding-top: 0; }
.detail-side .detail-more { margin-bottom: 0; }

.block { margin-bottom: 2.25rem; }
.lead-line { margin-bottom: 1rem; color: var(--muted); font-size: 0.9375rem; }
.block > h2 { font-size: 1.25rem; margin-bottom: 0.75rem; display: flex; flex-wrap: wrap; align-items: baseline; gap: 0.1rem 0.5rem; }
.block > h2:not(:first-child), .block > h3 { margin-top: 1.25rem; }
.count { display: inline-block; color: var(--muted); font-size: 0.875rem; font-weight: 500; }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; }
.card > h2 { font-size: 1rem; margin-bottom: 0.6rem; }
.steps { display: flex; flex-direction: column; gap: 0.6rem; margin-top: 0.6rem; counter-reset: step; }
.steps > li { counter-increment: step; min-width: 0; }
.step-label { display: block; font-size: 0.8125rem; color: var(--muted); margin-bottom: 0.2rem; }

/* Acquire: the install commands are the primary product content of a detail page, set in the main column. */
.detail-acquire { margin-bottom: 2.5rem; }
.card.install-card { padding: 1.25rem 1.4rem; border-radius: 12px; }
.card.install-card > h2 { font-size: 1.25rem; margin-bottom: 0.35rem; }
.install-card .steps { gap: 1rem; margin-top: 1rem; }
.install-card .step-label { font-size: 0.875rem; font-weight: 600; color: var(--text); margin-bottom: 0.35rem; }
.install-card .step-label::before { content: counter(step) ". "; color: var(--accent); }
.install-card .codeline { display: flex; width: 100%; gap: 0.35rem; }
.install-card .codeline code { flex: 1; min-width: 0; padding: 0.65rem 0.85rem; font-size: 0.875rem; line-height: 1.5; border-radius: 8px; background: var(--surface-2); }
.install-card .fineprint { margin-top: 0.9rem; }

.facts > div { display: grid; grid-template-columns: 7.5rem minmax(0, 1fr); gap: 0.5rem; padding: 0.45rem 0; border-bottom: 1px solid var(--line); }
.facts > div:last-child { border-bottom: 0; }
.facts dt { color: var(--muted); font-size: 0.8125rem; padding-top: 0.1rem; }
.facts dd { overflow-wrap: anywhere; }
.detail-side .facts > div { grid-template-columns: 6rem minmax(0, 1fr); }
.facts-wide { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 2rem; margin: 0.5rem 0 1rem; }
.inline-details { margin-top: 0.25rem; font-size: 0.8125rem; }
.inline-details summary { cursor: pointer; color: var(--accent); }
.facts .block-note { display: block; margin-top: 0.25rem; font-size: 0.8125rem; }
.run-search-cell { flex: 1; min-width: 0; text-align: left; }

.filterbox { display: flex; align-items: center; flex-wrap: wrap; gap: 0.5rem; margin-bottom: 0.75rem; }
.filterbox label { font-size: 0.8125rem; color: var(--muted); font-weight: 600; }
.filterbox input { max-width: 22rem; height: 2.25rem; }
.filter-count { color: var(--muted); font-size: 0.8125rem; }

.groups { display: flex; flex-direction: column; border-bottom: 1px solid var(--line); }
.group > summary .group-name { min-width: 0; overflow-wrap: anywhere; }
.comp-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(17rem, 100%), 1fr)); gap: 0.25rem 1.5rem; padding: 0 0 1rem 1.1rem; }
.comp-list li { display: flex; flex-direction: column; min-width: 0; padding: 0.4rem 0; border-bottom: 1px solid var(--line); }
.comp-name { font-weight: 550; overflow-wrap: anywhere; }
.comp-kind { color: var(--muted); font-weight: 400; margin-right: 0.25rem; }
.comp-path { align-self: flex-start; margin-top: 0.15rem; font-size: 0.78rem; background: transparent; border: 0; padding: 0; color: var(--muted); }
.comp-path-pair { display: flex; flex-wrap: wrap; gap: 0.25rem 0.5rem; align-items: center; color: var(--muted); font-size: 0.78rem; margin-top: 0.15rem; }
.comp-path-pair code { background: transparent; border: 0; padding: 0; }
.comp-list .badge { align-self: flex-start; margin: 0.25rem 0 0; }
.comp-list li[data-component-selected] { outline: 2px solid var(--accent); outline-offset: 0.3rem; scroll-margin-top: 6rem; }
.comp-actions { display: flex; align-items: center; gap: 0.4rem; margin-top: 0.3rem; font-size: 0.78rem; }

/* ---- tables -------------------------------------------------------------- */

.table { width: 100%; border-collapse: collapse; background: transparent; border-top: 1px solid var(--line); }
.table th, .table td { text-align: left; padding: 0.65rem 0.8rem 0.65rem 0; border-bottom: 1px solid var(--line); vertical-align: top; overflow-wrap: anywhere; }
.table thead th { background: transparent; color: var(--muted); font-size: 0.8125rem; font-weight: 600; border-bottom-color: var(--line-strong); }
.table tbody tr:last-child > * { border-bottom: 0; }
.table tr.is-current { background: var(--accent-weak); }
.table tr.is-current > * { padding-left: 0.6rem; }
.row-actions { display: flex; flex-wrap: wrap; gap: 0.25rem 0.9rem; }
.row-actions a { white-space: nowrap; }
.table .badge { margin-left: 0.3rem; }
.log-row td { background: var(--surface-2); }
.log-row .group { margin: 0; }
.log { padding: 0.25rem 0 0.75rem 1.1rem; list-style: none; }
.log li { padding: 0.25rem 0; border-bottom: 1px solid var(--line); font-size: 0.8125rem; overflow-wrap: anywhere; }
.log .badge { margin: 0 0.4rem 0 0; }

/* ---- comparison ---------------------------------------------------------- */

.compare { table-layout: fixed; }
.compare th[scope="row"] { width: 12rem; background: transparent; color: var(--muted); font-weight: 600; font-size: 0.8125rem; }
.compare thead th { position: sticky; top: 0; z-index: 2; background: var(--bg); color: var(--text); padding: 0.75rem 0.8rem 0.75rem 0; box-shadow: 0 1px 0 var(--line-strong); }
.compare thead th:first-child { width: 12rem; }
.compare tbody td { vertical-align: top; padding-right: 1.25rem; }
.vs-head { display: flex; flex-direction: column; gap: 0.15rem; font-weight: 400; font-size: 0.9375rem; }
.vs-side { color: var(--muted); font-size: 0.78rem; font-weight: 600; }
.vs-name { font-weight: 600; font-size: 1rem; }
.vs-ver { display: inline-flex; align-items: center; gap: 0.4rem; text-decoration: none; color: var(--text); }
.vs-ver:hover { color: var(--accent); }
.vs-ver .icon { color: var(--muted); }
.vs-repo { color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.state { display: inline-block; margin-left: 0.4rem; padding: 0 0.4rem; border-radius: 4px; font-size: 0.72rem; font-weight: 600; }
.state-same { color: var(--muted); border: 1px solid var(--line); }
.state-diff { color: var(--accent); background: var(--accent-weak); }
.toggle { display: inline-flex; align-items: center; gap: 0.4rem; font-size: 0.875rem; margin-left: 0.5rem; cursor: pointer; }
.toggle input { width: 1rem; height: 1rem; }
.compare.only-diff tr[data-same] { display: none !important; }
/* Source-file evidence: only fully "same" groups carry data-source-same; unknown and changed are never hidden. */
.page:has([data-diff-toggle] input:checked) [data-source-same] { display: none; }
.src-totals { display: flex; flex-wrap: wrap; gap: 0.35rem 1.25rem; margin: 0.6rem 0 0.75rem; }
.src-totals li { display: flex; align-items: center; gap: 0.4rem; min-width: 0; }
.src-totals .badge { margin: 0; }
.src-list { display: grid; gap: 0.75rem; padding: 0 0 0.85rem 1.1rem; }
.src-item { min-width: 0; padding-bottom: 0.75rem; border-bottom: 1px solid var(--line); }
.src-head { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.6rem; }
.src-head .badge { margin: 0; }
.src-reason { font-size: 0.8125rem; }
.src-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem 1.5rem; margin-top: 0.4rem; }
.src-pair h4 { margin-bottom: 0.25rem; color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.src-files { display: grid; gap: 0.5rem; }
.src-facts > div { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: 0.5rem; padding: 0.15rem 0; font-size: 0.8125rem; }
.src-facts dt { color: var(--muted); }
.src-facts dd { min-width: 0; overflow-wrap: anywhere; }
.src-facts .badge { margin: 0; }
.src-whole { margin-top: 0.25rem; color: var(--warn-fg); font-size: 0.78rem; }
.src-gap { margin-top: 0.25rem; font-size: 0.8125rem; overflow-wrap: anywhere; }
.src-retry { margin-top: 0.3rem; }
.cov-total { margin-top: 0.6rem; }
.cov-counts { margin-top: 0.4rem; }
.cov-sub { margin-top: 1.25rem; font-size: 1rem; }
.cov-retries { display: grid; gap: 0.6rem; margin-top: 0.5rem; max-width: 75ch; }
.cov-retry { min-width: 0; padding: 0.1rem 0 0.1rem 0.75rem; border-left: 2px solid var(--line-strong); }
.cov-msg { font-family: var(--font-mono); white-space: pre-wrap; overflow-wrap: anywhere; }
.decl-list { display: grid; gap: 0; margin-top: 0.75rem; min-width: 0; border-bottom: 1px solid var(--line); }
.decl-item { min-width: 0; padding: 0.9rem 0; border-top: 1px solid var(--line); }
.decl-item > * + * { margin-top: 0.6rem; }
.decl-item .badge { margin: 0; }
.decl-file { margin: 0; font-size: 0.9375rem; overflow-wrap: anywhere; min-width: 0; }
.decl-sub { margin: 0 0 0.2rem; color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.decl-components { display: grid; gap: 0.25rem; min-width: 0; font-size: 0.8125rem; }
.decl-components li { min-width: 0; overflow-wrap: anywhere; }
.decl-value { display: block; margin-top: 0.25rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.decl-fields > div { grid-template-columns: 12rem minmax(0, 1fr); }
.decl-note { display: block; margin-top: 0.15rem; color: var(--muted); font-size: 0.78rem; overflow-wrap: anywhere; }
.decl-selected { background: var(--accent-weak); outline: 2px solid var(--accent); outline-offset: 0; padding-inline: 0.75rem; }
@media (max-width: 44rem) {
  .src-pair { grid-template-columns: minmax(0, 1fr); }
  .src-list { padding-left: 0.6rem; }
  .src-facts > div { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .decl-fields > div { grid-template-columns: minmax(0, 1fr); }
  .decl-selected { padding-inline: 0.5rem; }
}
.vs-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; }
.vs-pair h3 { margin-bottom: 0.4rem; color: var(--muted); font-size: 0.875rem; }

/* ---- compare selector ---------------------------------------------------- */

.slots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.slot { border: 1px dashed var(--line-strong); border-radius: var(--radius); padding: 0.85rem 1rem; background: transparent; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.slot.is-filled { border-style: solid; border-color: var(--accent); background: var(--accent-weak); }
.slot.is-error { border-style: solid; border-color: var(--warn-fg); background: var(--warn-bg); }
.slot-label { font-size: 0.8125rem; font-weight: 600; color: var(--muted); }
.slot.is-filled .slot-label { color: var(--accent); }
.slot.is-error .slot-label { color: var(--warn-fg); }
.slot-name { font-size: 1rem; font-weight: 600; overflow-wrap: anywhere; }
.slot-meta { color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.slot-change { align-self: flex-start; margin-top: 0.35rem; font-size: 0.8125rem; }
.pick-list { border-top: 1px solid var(--line); margin: 0.5rem 0 1rem; }
.pick { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.5rem 1rem; padding: 0.75rem 0; border-bottom: 1px solid var(--line); }
.pick-main { min-width: 0; flex: 1 1 14rem; }
.pick-name { font-weight: 600; overflow-wrap: anywhere; }
.pick-meta { color: var(--muted); font-size: 0.8125rem; overflow-wrap: anywhere; }
.pick-actions { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.inline-form { display: flex; gap: 0.5rem; margin-bottom: 0.5rem; }
.ids-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)) auto; gap: 0.75rem; align-items: end; }

/* ---- methodology --------------------------------------------------------- */

.toc { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 2rem; }
.toc a { padding: 0.25rem 0.75rem; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; color: var(--text); font-size: 0.875rem; background: transparent; }
.toc a:hover { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }
.prose { max-width: 72ch; }
.prose p { margin-bottom: 0.75rem; line-height: 1.65; }
.prose ul { list-style: disc; padding-left: 1.3rem; margin-bottom: 0.75rem; }
.prose li + li { margin-top: 0.35rem; }
.prose .table { margin: 0.5rem 0 1rem; max-width: none; }
#runs { max-width: none; }
.defs { display: flex; flex-direction: column; gap: 0.9rem; }
.defs dt { font-weight: 600; }
.defs dd { color: var(--muted); }
.api-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: 0.35rem; }

/* ---- observed updates ---------------------------------------------------- */

.toc.kind-nav { margin-bottom: 1rem; }
.toc.kind-nav a[aria-current="page"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); font-weight: 650; }
.updates-filter { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0.75rem; align-items: end; max-width: 44rem; margin-bottom: 1rem; }
.chip-value { overflow-wrap: anywhere; }

.explain { margin-bottom: 1.25rem; }
.explain-body { display: flex; flex-direction: column; gap: 0.6rem; max-width: 75ch; padding: 0 0 1rem 1.1rem; }
.explain-body .defs { margin: 0.25rem 0; }
.explain-body dt .badge { margin-left: 0; }

.event {
  display: grid;
  grid-template-columns: 11rem minmax(0, 1fr);
  gap: 0.5rem 1.5rem;
  align-items: start;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--line);
}
.event-kind .badge { margin-left: 0; }
.event-time { margin-top: 0.35rem; font-size: 0.8125rem; color: var(--muted); }
.event-term, .meta-term { color: var(--muted); font-size: 0.8125rem; font-weight: 600; }
.event-versions { margin-top: 0.5rem; }
.event-versions > div { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: 0.5rem; padding: 0.2rem 0; }
.event-versions dt { color: var(--muted); font-size: 0.8125rem; padding-top: 0.1rem; }
.event-versions dd { overflow-wrap: anywhere; }
.event-note { margin-top: 0.4rem; max-width: 75ch; color: var(--muted); font-size: 0.8125rem; }
.event-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.75rem; }

/* ---- source inventory ---------------------------------------------------- */

.source-filter { margin-top: 0.75rem; max-width: 16rem; }
.row.source-row { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: 0.5rem 2rem; align-items: start; }
.facts-compact > div { grid-template-columns: 6.5rem minmax(0, 1fr); padding: 0.3rem 0; font-size: 0.8125rem; }
.facts-compact dd > .badge:first-child, .source-cards dd > .badge:first-child { margin-left: 0; }
.source-note { margin-top: 0.5rem; max-width: 75ch; font-size: 0.8125rem; color: var(--muted); overflow-wrap: anywhere; }
.source-note.is-failed { color: var(--danger-fg); }
.source-message { padding: 0.6rem 0.8rem; background: var(--surface-2); border-radius: var(--radius-sm); font-family: var(--font-mono); font-size: 0.8125rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.source-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(19rem, 100%), 1fr)); gap: 1rem; align-items: start; margin-bottom: 2rem; }
.source-cards .card { min-width: 0; }
.source-section > p { margin-bottom: 0.6rem; max-width: 75ch; }
.source-notes { max-width: 75ch; overflow-wrap: anywhere; }

/* ---- local following ------------------------------------------------------ */

.follow-privacy { margin: 0 0 0.75rem; }
.follow-summary { margin: 0.5rem 0 0.25rem; font-weight: 650; outline: none; }
.follow-list { display: flex; flex-direction: column; margin-top: 0.75rem; border-top: 1px solid var(--line); }
.follow-list > .follow-card { padding: 1.1rem 0; border-bottom: 1px solid var(--line); }
.follow-name { font-size: 1.0625rem; overflow-wrap: anywhere; }
.follow-name a { color: var(--text); font-weight: 600; text-decoration: none; }
.follow-name a:hover { color: var(--accent); text-decoration: underline; }
.follow-badge { margin: 0.4rem 0 0; }
.follow-problem { margin-top: 0.5rem; padding: 0.5rem 0.75rem; border-radius: var(--radius-sm); background: var(--warn-bg); color: var(--warn-fg); }
.follow-card .row-meta { margin-top: 0.25rem; }

/* ---- responsive ---------------------------------------------------------- */

@media (max-width: 62rem) {
  .detail-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .stat { text-align: left; }
  .event { grid-template-columns: minmax(0, 1fr); }
  .event-kind { display: flex; flex-wrap: wrap; align-items: center; gap: 0.25rem 0.75rem; }
  .event-time { margin-top: 0; }
  .row.source-row { grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 44rem) {
  .page { padding: 1.5rem 1rem 0.5rem; }
  .catalogue-head { margin-bottom: 1.25rem; }
  .topbar-inner { padding: 0.5rem 1rem; }
  .nav { margin-right: 0; }
  .topbar-tools { margin-left: auto; }
  .statline-run { margin-left: 0; }
  .search-row .btn { min-width: 4.5rem; padding: 0 0.75rem; }
  .filters-primary { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: none; }
  .catalogue-page .search-help { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
  .slots, .vs-pair, .facts-wide { grid-template-columns: minmax(0, 1fr); }
  .ids-form { grid-template-columns: minmax(0, 1fr); }
  .ids-form .btn { justify-self: start; }
  .facts > div { grid-template-columns: 6.5rem minmax(0, 1fr); }
  .install-card .step-label { font-size: 0.8125rem; }
  .card.install-card { padding: 1rem 1rem; }
  .repo-group-previews { padding-left: 0.65rem; }
  .explain-body { padding-left: 0.6rem; }

  .stack, .stack tbody { display: block; }
  .stack thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .stack tr { display: block; padding: 0.5rem 0; border-bottom: 1px solid var(--line); }
  .stack tbody tr:last-child { border-bottom: 0; }
  .stack td { display: flex; gap: 0.75rem; justify-content: space-between; border: 0; padding: 0.2rem 0; text-align: right; }
  .stack td::before { content: attr(data-label); color: var(--muted); font-size: 0.8125rem; text-align: left; flex: none; }
  .stack td.row-actions { justify-content: flex-start; }
  .stack td.row-actions::before { content: none; }
  .stack td[colspan] { display: block; padding: 0; text-align: left; }
  .event-versions > div { grid-template-columns: minmax(0, 1fr); gap: 0; }

  .compare, .compare thead, .compare tbody { display: block; }
  .compare thead tr, .compare tbody tr { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .compare thead th:first-child { display: none; }
  .compare thead th { position: static; }
  .compare th[scope="row"] { grid-column: 1 / -1; width: auto; padding-bottom: 0.1rem; border-bottom: 0; }
  .compare tbody tr { border-bottom: 1px solid var(--line); }
  .compare tbody td { border-bottom: 0; padding-right: 0.5rem; }
  .compare tbody td::before { content: attr(data-side); display: block; color: var(--muted); font-size: 0.75rem; font-weight: 600; }
}

@media (max-width: 30rem) {
  .btn-block, .detail-actions .btn { flex: 1 1 auto; }
  .repo-group-head { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .repo-group-title { grid-column: 1 / -1; }
  .updates-filter { grid-template-columns: minmax(0, 1fr); }
}

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

@media print {
  .topbar, .footer, .search, .detail-actions, .pager { display: none; }
  body { background: #fff; color: #000; }
}
