/* The registry keeps Sokel's original warm surfaces, generous headline, floating brand marks and quiet cards.
   A separate directory adds the controls needed to browse a growing collection. */
@import url("./tokens.css?v=directory-20261203-5");

* { box-sizing: border-box; }
/* Views switch with the hidden attribute; a class with its own display (grid, flex) must not override it. */
[hidden] { display: none !important; }
html { scroll-padding-top: 76px; }
body {
  margin: 0; background: var(--bg); color: var(--text-1);
  font-family: var(--font-sans); font-size: 14px; line-height: 1.6; -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: 6px; }
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 20; height: 60px;
  background: color-mix(in srgb, var(--bg) 80%, transparent); backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.nav.scrolled { border-bottom-color: var(--border); }
.navin { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); height: 100%; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; }
.logo { width: 28px; height: 28px; border-radius: 7px; background: var(--brand); display: grid; place-items: center; }
/* The Sokel mark, same geometry and proportions as the platform's (tile radius 0.26, glyph 0.56; favicon.svg is the
   platform's file verbatim): a rising polyline whose peak is the signal node, in the surface colour so it stays
   readable on the dark theme's champagne tile. */
.logo svg { width: 16px; height: 16px; fill: none; stroke: var(--surface); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.logo svg circle { fill: var(--surface); stroke: none; }
.brand b { font-size: 16px; font-weight: 700; letter-spacing: -.2px; }
.brandsub { font-size: 14px; color: var(--text-3); padding-inline-start: 9px; border-inline-start: 1px solid var(--border-strong); }
.navlinks { margin-inline-start: auto; display: flex; align-items: center; gap: 4px; font-size: 14px; }
.navlinks > a { color: var(--text-2); padding: 6px 10px; border-radius: 8px; }
.navlinks > a:hover { background: var(--surface-2); color: var(--text-1); }
.navlinks > a[aria-current="page"] { color: var(--text-1); font-weight: 600; }
.navlinks .gh { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border-strong); border-radius: 999px; padding: 5px 12px; color: var(--text-1); margin-inline-start: 6px; }
.navlinks .gh svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.langbtn {
  font: 600 12px var(--font-mono); color: var(--text-2); background: transparent; border: 1px solid var(--border-strong);
  border-radius: 999px; width: 34px; height: 30px; cursor: pointer; margin-inline-start: 4px;
}
.langbtn:hover { color: var(--text-1); background: var(--surface-2); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; padding: 56px 0 44px; }
/* Dotted canvas fading out, and a soft brand glow behind the marks: the product's canvas, quoted. */
.hero::before {
  content: ""; position: absolute; inset: 0;
  background-image: radial-gradient(var(--border-strong) 1.1px, transparent 1.3px); background-size: 22px 22px;
  -webkit-mask-image: radial-gradient(ellipse 60% 75% at 72% 45%, #000 20%, transparent 75%);
  mask-image: radial-gradient(ellipse 60% 75% at 72% 45%, #000 20%, transparent 75%);
  pointer-events: none;
}
.hero::after {
  content: ""; position: absolute; width: 640px; height: 520px; right: -120px; top: -60px;
  background: radial-gradient(closest-side, rgba(236, 72, 153, .11), transparent 72%); pointer-events: none;
}
.herogrid { position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); gap: 40px; align-items: center; }
.eyebrow { font: 500 12px/1 var(--font-mono); letter-spacing: .12em; color: var(--text-3); text-transform: uppercase; }
.hero h1 {
  font-size: clamp(34px, 4.6vw, 54px); font-weight: 800; line-height: 1.08; letter-spacing: -.025em;
  margin: 16px 0 14px; max-width: 13em; text-wrap: balance;
}
.hero h1 em { font-style: normal; color: var(--brand); }
.lede { color: var(--text-2); font-size: 16px; line-height: 1.65; max-width: 52ch; margin: 0 0 26px; }
.herosearch {
  display: flex; align-items: center; gap: 10px; max-width: 520px; height: 52px; padding: 0 8px 0 18px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; box-shadow: var(--sh-2);
  transition: border-color .2s, box-shadow .2s; cursor: text;
}
.herosearch:focus-within { border-color: var(--brand-border); box-shadow: var(--sh-2), 0 0 0 4px var(--brand-soft); }
.herosearch svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: var(--text-3); stroke-width: 2; stroke-linecap: round; }
.herosearch input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 15px; color: var(--text-1); }
.herosearch input::placeholder { color: var(--text-3); }
.herosearch kbd {
  font: 12px var(--font-mono); color: var(--text-3); border: 1px solid var(--border-strong); border-bottom-width: 2px;
  border-radius: 6px; padding: 1px 7px; background: var(--surface-2);
}
.stats { display: flex; gap: 0; margin: 30px 0 0; flex-wrap: wrap; }
.stats div { padding-inline: 22px; border-inline-start: 1px solid var(--border-strong); }
.stats div:first-child { padding-inline-start: 0; border: 0; }
.stats dt { font-size: 26px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stats dd { margin: 4px 0 0; font-size: 12px; color: var(--text-3); }

/* The cloud: a staggered grid of plugin marks, gently floating (still under reduced motion). */
.cloud { display: grid; grid-template-columns: repeat(5, 64px); gap: 14px; justify-content: center; padding-block: 8px; }
.cloud a { display: block; transform: translateY(calc(var(--off, 0) * 1px)); animation: float 7s var(--ease) infinite; animation-delay: calc(var(--i) * -.37s); }
.cloud a:nth-child(5n+2), .cloud a:nth-child(5n+4) { --off: 26; }
.cloud a:nth-child(5n+3) { --off: 12; }
.cloud a:hover .ico { transform: translateY(-3px) scale(1.04); box-shadow: var(--sh-3); }
@keyframes float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -6px; } }
@media (prefers-reduced-motion: reduce) { .cloud a { animation: none; } }

/* The home page invites exploration; the directory handles the complete collection. */
.home-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; margin-top: 18px; }
.home-actions .install { display: inline-flex; align-items: center; justify-content: center; }
.home-search-submit { display: grid; place-items: center; flex: 0 0 36px; width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--surface-2); color: var(--text-1); font: 20px var(--font-sans); cursor: pointer; transition: background .2s; }
.home-search-submit:hover { background: var(--surface-3); }
.home-secondary { font-size: 14px; color: var(--text-2); border-bottom: 1px solid transparent; }
.home-secondary:hover { color: var(--text-1); border-bottom-color: var(--border-strong); }
.home-intro { display: flex; align-items: baseline; justify-content: space-between; flex-wrap: wrap; gap: 12px 24px; padding: 20px 0 4px; }
.home-intro h2 { margin: 0; font-size: 24px; line-height: 1.3; font-weight: 700; letter-spacing: -.02em; }
.home-intro p { margin: 8px 0 0; font-size: 14px; color: var(--text-2); }
.home-intro > a, .shelf-more { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; font-size: 13px; font-weight: 500; color: var(--text-2); border-bottom: 1px solid transparent; }
.home-intro > a:hover, .shelf-more:hover { color: var(--text-1); border-bottom-color: var(--border-strong); }
.shelf { margin-top: 22px; }
.shelf + .shelf { margin-top: 34px; }
.shelfhead { display: flex; align-items: baseline; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }
.shelfhead > div { min-width: 0; }
.shelfhead h2 { margin: 0; font-size: 20px; font-weight: 700; letter-spacing: -.01em; }
.shelfhead h3 { font-size: 15px; font-weight: 700; margin: 0; }
.shelfdesc { font-size: 12px; color: var(--text-3); }
p.shelfdesc { margin: 6px 0 0; }
.shelf-more { margin-inline-start: auto; }
#home-shelves .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.catalog-heading { padding-block: 36px 30px; }
.catalog-heading h1 { font-size: 34px; font-weight: 800; line-height: 1.15; letter-spacing: -.025em; margin: 12px 0 10px; }
.catalog-heading p { max-width: 70ch; margin: 0; font-size: 14px; line-height: 1.65; color: var(--text-2); }

/* ---------- icons ---------- */
/* Brand marks keep their brand color on a white tile; glyphs and letters take the plugin's hue, softly. */
.ico {
  --s: 38px; width: var(--s); height: var(--s); flex: 0 0 var(--s); border-radius: 10px;
  display: grid; place-items: center; color: var(--c); background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--border), var(--sh-1); transition: transform .25s var(--ease), box-shadow .25s;
}
.ico svg { width: 55%; height: 55%; }
/* Some marks arrive wrapped in a span (icon-font style); size the wrapper, and let its svg fill it. */
.ico > span { display: grid; place-items: center; width: 55%; height: 55%; }
.ico > span svg { width: 100%; height: 100%; }
.ico img { width: 62%; height: 62%; object-fit: contain; }
.ico i { font-style: normal; font-weight: 700; font-size: calc(var(--s) * .44); color: var(--c); }
.ico:has(i) { background: color-mix(in srgb, var(--c) 10%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 16%, transparent); }
.ico.lg { --s: 64px; border-radius: 18px; box-shadow: inset 0 0 0 1px var(--border), var(--sh-2); }
.ico.xl { --s: 64px; border-radius: 18px; box-shadow: inset 0 0 0 1px var(--border), var(--sh-2); }

/* ---------- directory filters and toolbar ---------- */
.page { padding-bottom: 64px; }
.layout { display: grid; grid-template-columns: 210px minmax(0, 1fr); gap: 36px; align-items: start; }
.main { min-width: 0; }
.filter-panel { position: sticky; top: 80px; min-width: 0; padding-top: 6px; }
.filter-panel > summary { display: none; }
.side { display: flex; flex-direction: column; gap: 24px; max-height: calc(100dvh - 106px); overflow-y: auto; padding: 0 10px 12px 0; scrollbar-width: thin; }
.filter-section { display: flex; flex-direction: column; gap: 3px; }
.filter-section h3 { margin: 0 0 8px; padding-inline: 10px; font-size: 12px; font-weight: 500; letter-spacing: .03em; color: var(--text-3); }
.filter-option, .sideitem {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; width: 100%;
  font: inherit; font-size: 13px; font-weight: 400; color: var(--text-2); text-align: start;
  background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 7px 9px; cursor: pointer;
}
.filter-option > span:first-child { min-width: 0; overflow-wrap: anywhere; }
.filter-option:hover, .sideitem:hover { background: var(--surface-2); color: var(--text-1); }
.filter-option[aria-pressed="true"], .sideitem[aria-pressed="true"] { background: var(--surface); border-color: var(--border); color: var(--text-1); font-weight: 600; box-shadow: var(--sh-1); }
.filter-option .n, .sideitem .n { flex-shrink: 0; font-size: 11px; color: var(--text-3); font-weight: 400; }
.filter-option[aria-pressed="true"] .n { color: var(--text-2); }
.filter-select { display: flex; flex-direction: column; gap: 7px; padding-inline: 10px; font-size: 12px; color: var(--text-3); }
.filter-select + .filter-select { margin-top: 12px; }
.filter-select select, #sort, .page-size select {
  min-width: 0; height: 36px; border: 1px solid var(--border-strong); border-radius: 9px;
  padding: 0 26px 0 10px; font: inherit; font-size: 13px; color: var(--text-2); background-color: var(--surface); cursor: pointer;
}
.filter-select select { width: 100%; }
.filter-check { display: flex; align-items: flex-start; gap: 8px; padding: 7px 10px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.filter-check input { flex-shrink: 0; width: 14px; height: 14px; margin: 3px 0 0; accent-color: var(--brand); }
.filter-check .n { margin-inline-start: auto; color: var(--text-3); font-size: 11px; }
.catalog-toolbar {
  position: sticky; top: 60px; z-index: 10; display: flex; align-items: center; gap: 10px;
  padding-block: 10px 16px; margin-top: -10px; background: var(--bg);
}
.searchbox {
  display: flex; flex: 1; min-width: 120px; align-items: center; gap: 10px; height: 46px; padding: 0 12px 0 16px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px; box-shadow: var(--sh-1);
  transition: border-color .2s, box-shadow .2s; cursor: text;
}
.searchbox:focus-within { border-color: var(--brand-border); box-shadow: 0 0 0 3px var(--brand-soft); }
.searchbox svg { width: 18px; height: 18px; flex: 0 0 18px; fill: none; stroke: var(--text-3); stroke-width: 1.8; stroke-linecap: round; }
.searchbox input { flex: 1; min-width: 0; height: 100%; padding: 0; border: 0; outline: 0; background: transparent; font: inherit; font-size: 14px; color: var(--text-1); }
.searchbox input::placeholder { color: var(--text-3); }
.searchbox kbd { font: 11px var(--font-mono); color: var(--text-3); border: 1px solid var(--border); border-radius: 4px; padding: 0 5px; background: var(--bg); }
#sort { height: 42px; max-width: 160px; border-radius: 999px; padding-inline-start: 14px; }
.view-toggle { display: flex; flex-shrink: 0; gap: 2px; height: 40px; padding: 3px; border-radius: 999px; background: var(--surface-2); }
.view-toggle button { display: grid; place-items: center; width: 34px; padding: 0; border: 0; border-radius: 999px; background: transparent; color: var(--text-3); cursor: pointer; }
.view-toggle button:hover { color: var(--text-1); background: var(--bg); }
.view-toggle button[aria-pressed="true"] { color: var(--text-1); background: var(--surface); box-shadow: var(--sh-1); }
.view-toggle svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.resulthead { display: flex; align-items: center; gap: 9px; min-height: 54px; flex-wrap: wrap; padding-block: 12px; }
.resulthead h2 { font-size: 20px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.mini-pagination { display: flex; align-items: center; gap: 8px; color: var(--text-3); font-size: 11px; }
.count { font-size: 12px; color: var(--text-3); background: var(--surface-2); border-radius: 999px; padding: 0 8px; line-height: 20px; }
.result-summary { margin-inline-start: auto; font-size: 12px; color: var(--text-3); }
.clear { margin-inline-start: auto; font: inherit; font-size: 12px; color: var(--text-2); background: transparent; border: 1px solid var(--border-strong); border-radius: 999px; padding: 3px 12px; cursor: pointer; }
.clear:hover { color: var(--text-1); background: var(--surface); }
.active-filters { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; padding-bottom: 12px; }
.active-filters:empty { display: none; }
.filter-chip { display: inline-flex; align-items: center; gap: 6px; min-width: 0; max-width: 100%; padding: 4px 10px 4px 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface); font-size: 12px; color: var(--text-2); overflow-wrap: anywhere; }
.filter-chip { font-family: inherit; cursor: pointer; text-align: start; }
.filter-chip:hover { color: var(--text-1); background: var(--surface-2); }

/* ---------- cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(248px, 1fr)); gap: 12px; }
.card {
  display: flex; flex-direction: column; gap: 10px; min-width: 0; padding: 14px 14px 12px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 14px;
  transition: border-color .2s, transform .25s var(--ease), box-shadow .25s;
}
.card:hover { border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--sh-2); }
.chead { display: flex; align-items: center; gap: 11px; min-width: 0; }
.hmain { flex: 1; min-width: 0; line-height: 1.3; }
.name { font-size: 14px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cref { font-size: 11px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.publisher-line { display: flex; align-items: center; gap: 4px 6px; flex-wrap: wrap; min-width: 0; }
.publisher-line .publisher-source { font-size: 10px; padding-inline: 6px; line-height: 17px; }
.go { width: 16px; height: 16px; flex: 0 0 16px; fill: none; stroke: var(--text-4); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; opacity: 0; transform: translate(-3px, 3px); transition: opacity .2s, transform .25s var(--ease); }
.card:hover .go, .card:focus-visible .go { opacity: 1; transform: none; stroke: var(--text-2); }
.desc { color: var(--text-2); font-size: 12.5px; line-height: 1.55; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.1em; overflow-wrap: anywhere; }
.cfoot { display: flex; align-items: center; gap: 8px; margin-top: auto; }
.cfoot .tags { flex: 1; min-width: 0; flex-wrap: nowrap; overflow: hidden; }
.ops { font-size: 11px; color: var(--text-3); white-space: nowrap; }
.ops.zero { color: var(--text-4); }

/* Type / ownership tags are gray pills; "can trigger" is a fact, not a status, so it stays gray too. */
.tags { display: flex; gap: 4px; flex-wrap: wrap; align-items: center; }
.pill { font-size: 11px; padding: 0 8px; border-radius: 999px; line-height: 20px; background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.pill.mono { font-family: var(--font-mono); }

/* Extra catalogue facts stay subordinate to the plugin's name and description. */
.meta { display: flex; align-items: center; gap: 7px; min-width: 0; font-size: 11px; color: var(--text-3); }
.meta > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meta > span + span::before { content: "·"; padding-inline-end: 7px; color: var(--text-4); }
.meta .version { font-family: var(--font-mono); flex-shrink: 0; }
.meta .category { margin-inline-end: auto; }
.plugin-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); }
.plugin-list .card { display: grid; grid-template-columns: minmax(180px, .9fr) minmax(0, 1.2fr) minmax(110px, .65fr); column-gap: 20px; row-gap: 6px; padding: 15px; border: 0; border-bottom: 1px solid var(--border); border-radius: 0; }
.plugin-list .card:last-child { border-bottom: 0; }
.plugin-list .card:hover { transform: none; background: color-mix(in srgb, var(--bg) 55%, var(--surface)); box-shadow: none; }
.plugin-list .chead { grid-column: 1; grid-row: 1 / 3; align-self: center; }
.plugin-list .go { display: none; }
.plugin-list .desc { grid-column: 2; grid-row: 1; min-height: 0; font-size: 12.5px; }
.plugin-list .meta { grid-column: 2; grid-row: 2; align-self: start; }
.plugin-list .meta .category { margin-inline-start: 0; }
.plugin-list .cfoot { grid-column: 3; grid-row: 1 / 3; align-self: center; flex-direction: column; align-items: flex-end; gap: 7px; margin: 0; padding: 0; border: 0; min-width: 0; }
.plugin-list .cfoot .tags { max-width: 100%; justify-content: flex-end; flex-wrap: wrap; }

/* ---------- pagination ---------- */
.pagination { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 14px; margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--border); }
.pagination:empty { display: none; }
.page-size { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-3); }
.page-size select { height: 30px; padding-inline: 8px 24px; }
.pagination-controls { display: flex; align-items: center; gap: 4px; }
.page-button { display: inline-grid; place-items: center; min-width: 30px; height: 30px; padding: 0 8px; border: 1px solid transparent; border-radius: 999px; background: transparent; color: var(--text-2); font: 12px var(--font-mono); cursor: pointer; }
.page-button:hover:not(:disabled) { background: var(--surface); border-color: var(--border-strong); }
.page-button[aria-current="page"] { background: var(--surface); border-color: var(--border-strong); color: var(--text-1); font-weight: 600; box-shadow: var(--sh-1); }
.page-button:disabled { color: var(--text-4); cursor: default; }
.pagination-controls .page-gap { padding-inline: 3px; color: var(--text-3); font-size: 11px; }

/* ---------- detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; margin: 28px 0 18px; font-size: 13px; color: var(--text-3); }
.back:hover { color: var(--text-1); }
.dhead {
  position: relative; overflow: hidden; display: flex; gap: 20px; align-items: flex-start; margin-bottom: 18px;
  padding: 26px 28px; background: var(--surface); border: 1px solid var(--border); border-radius: 18px; box-shadow: var(--sh-1);
}
.dhead::before {
  content: ""; position: absolute; inset: 0 0 auto auto; width: 50%; height: 100%;
  background-image: radial-gradient(var(--border) 1.1px, transparent 1.3px); background-size: 20px 20px;
  -webkit-mask-image: linear-gradient(to left, #000, transparent); mask-image: linear-gradient(to left, #000, transparent); pointer-events: none;
}
.dhead > * { position: relative; }
.dtitle { font-size: 28px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.idline { display: flex; align-items: center; gap: 6px; margin-top: 4px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.idline .sep { color: var(--text-4); }
.dcaps { margin-top: 12px; }
.ref { font-size: 12px; color: var(--text-3); }
.ddesc { color: var(--text-2); font-size: 14px; line-height: 1.7; margin: 12px 0 0; max-width: 70ch; }
.install {
  flex-shrink: 0; font: 600 14px var(--font-sans); color: #fff; background: var(--brand); border: 1px solid var(--brand);
  border-radius: 999px; padding: 10px 20px; cursor: pointer; transition: transform .2s var(--ease), filter .2s;
}
.install:hover { transform: translateY(-1px); filter: brightness(1.05); }
.install.ghost { background: var(--surface); color: var(--text-1); border-color: var(--border-strong); }

.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin-bottom: 16px; }
.ptitle { font-size: 13px; font-weight: 600; margin-bottom: 10px; }
.prow { display: flex; gap: 12px; font-size: 13px; color: var(--text-2); line-height: 1.7; }
.plabel { color: var(--text-3); flex-shrink: 0; min-width: 4.5em; }
.pnote { margin-top: 8px; font-size: 12px; color: var(--text-3); }
.segs { display: inline-flex; gap: 2px; background: var(--surface-2); padding: 3px; border-radius: 999px; flex-wrap: wrap; }
.seg { border: 0; background: transparent; font: inherit; font-size: 13px; color: var(--text-2); padding: 5px 14px; border-radius: 999px; cursor: pointer; }
.seg[aria-pressed="true"] { background: var(--surface); color: var(--text-1); box-shadow: var(--sh-1); font-weight: 600; }
.dtabs { margin-bottom: 14px; }

/* Wide content scrolls on its own; the page itself never scrolls sideways. */
.tablewrap { padding: 0; overflow-x: auto; }
.t { width: 100%; border-collapse: collapse; font-size: 13px; }
.t th { text-align: start; font-weight: 500; font-size: 12px; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.t td { padding: 10px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.t tr:last-child td { border-bottom: 0; }
.t code, .field code { font-family: var(--font-mono); font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.sub { color: var(--text-2); font-size: 12px; line-height: 1.6; }
.dash { color: var(--text-3); font-size: 12px; }
.field { font-size: 12px; line-height: 1.6; margin-bottom: 3px; }
.ftype { color: var(--text-3); font-size: 11px; margin-inline-start: 6px; }
.req { color: var(--warning); margin-inline-start: 4px; }
.fdesc { color: var(--text-3); font-size: 11px; }
.field-group { margin-top: 4px; }
.field-group > summary { color: var(--text-2); cursor: pointer; }
.field-children { border-inline-start: 1px solid var(--border); padding-inline-start: 8px; overflow-wrap: anywhere; }

/* Search and collapsed operation schemas keep large contracts navigable. */
.detail-search { display: flex; align-items: center; gap: 10px; width: min(520px, 100%); height: 40px; padding: 0 12px; margin-bottom: 14px; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface); }
.detail-search:focus-within { border-color: var(--brand-border); box-shadow: 0 0 0 3px var(--brand-soft); }
.detail-search > svg { width: 18px; height: 18px; flex: 0 0 18px; color: var(--text-3); }
.detail-search input { flex: 1; width: 100%; min-width: 0; height: 100%; padding: 0; border: 0; border-radius: 0; outline: 0; background: transparent; font: 13px var(--font-sans); color: var(--text-1); }
.detail-search input::placeholder { color: var(--text-3); }
.detail-search .count { flex-shrink: 0; }
.operation-list { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface); }
.operation { border-bottom: 1px solid var(--border); }
.operation:last-child { border-bottom: 0; }
.operation > summary { position: relative; display: grid; grid-template-columns: minmax(180px, .8fr) minmax(0, 1.2fr); align-items: center; gap: 16px; padding: 14px 42px 14px 18px; cursor: pointer; list-style: none; }
.operation > summary::-webkit-details-marker { display: none; }
.operation > summary::after { content: ""; position: absolute; top: 21px; inset-inline-end: 19px; width: 6px; height: 6px; border-inline-end: 1.5px solid var(--text-3); border-bottom: 1.5px solid var(--text-3); transform: rotate(-45deg); transition: transform .15s; }
.operation[open] > summary::after { transform: rotate(45deg); }
.operation > summary:hover { background: var(--bg); }
.operation[open] > summary { border-bottom: 1px solid var(--border); }
.operation-title { display: flex; align-items: center; flex-wrap: wrap; gap: 5px 9px; min-width: 0; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.operation-title code { font: 11px var(--font-mono); color: var(--text-2); background: var(--surface-2); padding: 2px 5px; border-radius: 4px; }
.operation-desc { color: var(--text-3); font-size: 12px; line-height: 1.65; overflow-wrap: anywhere; }
.operation-fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; padding: 16px 18px; }
.operation-fields h3 { margin: 0 0 10px; font-size: 11px; font-weight: 600; color: var(--text-3); }
.operation-fields .field { overflow-wrap: anywhere; padding-bottom: 6px; }

.doc { padding: 20px 26px; font-size: 14px; line-height: 1.75; color: var(--text-1); }
.doc h1 { font-size: 18px; margin: 0 0 10px; }
.doc h2 { font-size: 16px; margin: 24px 0 8px; }
.doc h3 { font-size: 14px; margin: 18px 0 6px; }
.doc p, .doc ul, .doc ol { margin: 0 0 10px; }
.doc ul, .doc ol { padding-inline-start: 22px; }
.doc li { margin-bottom: 3px; }
.doc code { font-family: var(--font-mono); font-size: 12px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.doc pre { background: var(--surface-2); padding: 12px 14px; border-radius: 10px; overflow-x: auto; margin: 0 0 12px; }
.doc pre code { background: none; padding: 0; }
.doc table { border-collapse: collapse; margin: 0 0 12px; display: block; overflow-x: auto; }
.doc th, .doc td { border: 1px solid var(--border); padding: 6px 10px; text-align: start; }
.doc th { background: var(--surface-2); font-weight: 500; }
.doc blockquote { margin: 0 0 12px; padding-inline-start: 12px; border-inline-start: 3px solid var(--border-strong); color: var(--text-2); }
.plaindoc { white-space: pre-wrap; font-family: inherit; font-size: 13px; line-height: 1.75; margin: 0; }

/* ---------- advisories ---------- */
.advhero h1 { font-size: 34px; font-weight: 800; letter-spacing: -.02em; margin: 34px 0 8px; }
.advhero .lede { font-size: 14px; margin-bottom: 22px; max-width: 70ch; }
/* amber = warn (look at it), red = block (calls are refused) */
.adv { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; padding: 0 8px; line-height: 20px; border-radius: 999px; white-space: nowrap; }
.adv.warn { background: var(--warning-soft); color: var(--warning-text); }
.adv.block { background: var(--danger-soft); color: var(--danger); }
.advpanel { border-radius: 14px; padding: 12px 16px; margin: 0 0 16px; font-size: 13px; }
.advpanel.warn { background: var(--warning-soft); color: var(--warning-text); }
.advpanel.block { background: var(--danger-soft); color: var(--danger); }
.advpanel a { text-decoration: underline; }
.publisher-risk { margin: 0 0 16px; padding: 12px 16px; border-radius: 12px; background: var(--warning-soft); color: var(--warning-text); font-size: 13px; line-height: 1.65; overflow-wrap: anywhere; }
.publisher-risk strong { display: block; font-weight: 600; margin-bottom: 3px; }
.publisher-risk p { margin: 0; }
.advlist { display: flex; flex-direction: column; gap: 10px; }
.advrow { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px; display: grid; grid-template-columns: 220px 1fr auto; gap: 14px; align-items: start; }
.advrow .who { display: flex; gap: 10px; align-items: flex-start; }
.advrow .vers { font-family: var(--font-mono); font-size: 12px; color: var(--text-2); margin-top: 2px; }
.advrow .when { font-family: var(--font-mono); font-size: 12px; color: var(--text-3); white-space: nowrap; }

/* ---------- misc ---------- */
.foot { margin-top: 48px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12px; color: var(--text-3); }
.err { background: var(--surface); border: 1px solid var(--border); border-inline-start: 3px solid var(--brand); border-radius: 12px; padding: 12px 14px; font-size: 13px; margin: 16px 0; }
.empty { padding: 56px; text-align: center; color: var(--text-3); font-size: 13px; }

@media (max-width: 1100px) {
  .plugin-list .card { grid-template-columns: minmax(170px, .8fr) minmax(0, 1fr); }
  .plugin-list .chead { grid-row: 1 / 4; }
  .plugin-list .cfoot { grid-column: 2; grid-row: 3; flex-direction: row; align-items: center; justify-content: space-between; margin-top: 4px; }
  .plugin-list .cfoot .tags { justify-content: flex-start; }
}
@media (max-width: 980px) {
  .herogrid { grid-template-columns: 1fr; }
  .cloud { display: none; }
  #home-shelves .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 900px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .filter-panel { position: static; padding: 0; border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); }
  .filter-panel > summary { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; font-size: 13px; font-weight: 600; cursor: pointer; list-style: none; }
  .filter-panel > summary::-webkit-details-marker { display: none; }
  .filter-panel > summary::after { content: "+"; color: var(--text-3); font-size: 17px; line-height: 1; font-weight: 400; }
  .filter-panel[open] > summary { border-bottom: 1px solid var(--border); }
  .filter-panel[open] > summary::after { content: "−"; }
  .side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px 24px; max-height: 60dvh; padding: 16px; }
  .filter-section:first-child { grid-row: span 2; }
  .catalog-toolbar { margin-top: 0; padding-top: 10px; }
}
@media (max-width: 640px) {
  .nav { height: 56px; }
  .navin { gap: 8px; }
  .brandsub { display: none; }
  .navlinks > a[data-nav="home"] { display: none; }
  .navlinks { gap: 0; font-size: 12px; }
  .navlinks > a { padding-inline: 6px; white-space: nowrap; }
  .navlinks .gh { width: 28px; height: 28px; padding: 0; margin-inline-start: 3px; justify-content: center; }
  .navlinks .gh span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .navlinks .gh svg { width: 14px; height: 14px; }
  .langbtn { width: 30px; height: 28px; font-size: 11px; }
  .brand b { font-size: 15px; }
  .logo { width: 25px; height: 25px; }
  .hero { padding: 32px 0 28px; }
  .stats { flex-wrap: nowrap; }
  .stats div { flex: 1; min-width: 0; padding-inline: 12px; }
  .stats div:last-child { padding-inline-end: 0; }
  .stats dt { font-size: 22px; }
  .home-intro { padding-top: 16px; }
  .home-intro h2 { font-size: 22px; }
  .shelfhead { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; }
  .shelfhead > div { display: contents; }
  .shelfhead h2 { grid-column: 1; grid-row: 1; font-size: 18px; }
  .shelfdesc { grid-column: 1 / -1; grid-row: 2; }
  p.shelfdesc { margin: 0; }
  .shelf-more { grid-column: 2; grid-row: 1; align-self: center; }
  #home-shelves .grid { grid-template-columns: minmax(0, 1fr); }
  .catalog-heading { padding-block: 28px 24px; }
  .catalog-heading h1 { font-size: 30px; }
  .side { gap: 16px; padding: 12px 8px; }
  .catalog-toolbar { top: 56px; flex-wrap: wrap; gap: 8px; padding-block: 8px 12px; }
  .searchbox { flex-basis: 100%; height: 46px; }
  .searchbox input { font-size: 14px; }
  .searchbox kbd { display: none; }
  #sort { height: 38px; flex: 1; max-width: none; }
  .view-toggle { height: 38px; }
  .view-toggle button { width: 30px; }
  .resulthead { gap: 7px; min-height: 50px; }
  .resulthead h2 { font-size: 18px; }
  .result-summary { font-size: 11px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .card { padding: 14px; gap: 10px; }
  .name { font-size: 14px; }
  .desc { font-size: 12.5px; }
  .plugin-list .card { grid-template-columns: minmax(0, 1fr); gap: 7px; padding: 13px; }
  .plugin-list .chead { grid-column: 1; grid-row: 1; }
  .plugin-list .desc { grid-column: 1; grid-row: 2; }
  .plugin-list .meta { grid-column: 1; grid-row: 3; }
  .plugin-list .cfoot { grid-column: 1; grid-row: 4; }
  .pagination { justify-content: center; gap: 12px; }
  .page-size { width: 100%; justify-content: center; }
  .pagination-controls { gap: 2px; }
  .page-button { min-width: 29px; padding-inline: 6px; }
  .dhead { flex-wrap: wrap; padding: 20px; }
  .dhead .install { flex: 1 1 100%; }
  .detail-search { gap: 8px; }
  .detail-search input { flex: 1; width: auto; font-size: 14px; }
  .operation > summary { grid-template-columns: minmax(0, 1fr); gap: 5px; padding-inline-start: 14px; }
  .operation-fields { grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 14px; }
  .advrow { grid-template-columns: 1fr; }
}

/* ---------- manifest tab ---------- */
.mnote { font-size: 12px; color: var(--text-3); margin: 0 0 10px; }
.code { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.codebar {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px 8px 16px; border-bottom: 1px solid var(--border); background: var(--surface-2);
  font-size: 12px; color: var(--text-2);
}
.codeacts { display: flex; gap: 6px; }
.cbtn {
  font: 600 12px var(--font-sans); color: var(--text-1); background: var(--surface); cursor: pointer;
  border: 1px solid var(--border-strong); border-radius: 999px; padding: 4px 12px; min-width: 58px; text-align: center;
}
.cbtn:hover { background: var(--surface-3); }
/* Line numbers via a CSS counter, so copying the text never picks them up. */
.yaml { margin: 0; padding: 14px 0; overflow: auto; max-height: 70vh; font: 12.5px/1.65 var(--font-mono); color: var(--text-1); counter-reset: ln; }
.yaml code { display: block; min-width: max-content; }
.yaml .ln { display: block; padding-inline-end: 18px; }
.yaml .ln::before {
  counter-increment: ln; content: counter(ln); display: inline-block; width: 3.2em; padding-inline-end: 1.2em;
  text-align: end; color: var(--text-4); user-select: none;
}
.yk { color: #0e7490; }
.yd { color: var(--text-3); }
.yc { color: var(--text-3); font-style: italic; }

/* ---------- loading skeletons ---------- */
.sk {
  display: block; max-width: 100%; border-radius: 6px;
  background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface-3) 45%, var(--surface-2) 65%);
  background-size: 300% 100%; animation: sk 1.3s ease-in-out infinite;
}
.skcard { pointer-events: none; }
.skcard:hover { transform: none; box-shadow: none; border-color: var(--border); }
.side .sideitem .sk { margin-block: 4px; }
@keyframes sk { 0% { background-position: 100% 0; } 100% { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) { .sk { animation: none; } }

/* ---------- empty / retry ---------- */
.emptybox {
  display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  padding: 56px 24px; background: var(--surface); border: 1px dashed var(--border-strong); border-radius: 16px; margin-top: 14px;
}
.emptybox svg { width: 28px; height: 28px; color: var(--text-4); margin-bottom: 4px; }
.emptybox b { font-size: 15px; }
.emptybox span { font-size: 13px; color: var(--text-3); }
.emptybox .cbtn { margin-top: 8px; }
.retry { margin-top: 10px; }

/* ---------- install dialog ---------- */
body.modal { overflow: hidden; }
.dlgwrap {
  position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px;
  background: rgba(21, 21, 26, .38); backdrop-filter: blur(3px); animation: fade .16s ease-out;
}
.dlg {
  position: relative; width: min(480px, 100%); background: var(--surface); border-radius: 20px;
  max-height: calc(100dvh - 32px); overflow-y: auto;
  box-shadow: var(--sh-3), 0 0 0 1px var(--border); padding: 24px 24px 20px; animation: pop .22s var(--ease);
}
.dlgx {
  position: absolute; top: 14px; inset-inline-end: 14px; width: 30px; height: 30px; display: grid; place-items: center;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-3); cursor: pointer;
}
.dlgx:hover { background: var(--surface-2); color: var(--text-1); }
.dlgx svg { width: 16px; height: 16px; }
.dlghead { display: flex; align-items: center; gap: 12px; padding-inline-end: 28px; }
.dlghead h2 { font-size: 18px; font-weight: 700; letter-spacing: -.01em; margin: 0; }
.dlgsub { font-size: 13px; color: var(--text-2); }
.dlgsub .mono { font-size: 11px; color: var(--text-3); margin-inline-start: 4px; }
.dlgtext { font-size: 13px; color: var(--text-2); line-height: 1.65; margin: 14px 0 16px; }
.dlglabel { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.dlginput {
  width: 100%; height: 42px; padding: 0 14px; font: 14px var(--font-mono); color: var(--text-1);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 10px; outline: 0;
  transition: border-color .2s, box-shadow .2s;
}
.dlginput:focus { border-color: var(--brand-border); box-shadow: 0 0 0 4px var(--brand-soft); }
.dlginput[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px var(--danger-soft); }
.dlgerr { min-height: 0; font-size: 12px; color: var(--danger); margin-top: 6px; }
.dlgerr:empty { display: none; }
.dlgpreview { font-size: 11.5px; color: var(--text-3); margin-top: 8px; word-break: break-all; line-height: 1.5; }
.dlgpreview span { color: var(--text-2); }
.dlgpreview:empty { display: none; }
.dlgcheck { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-2); margin-top: 14px; cursor: pointer; }
.dlgcheck input { accent-color: var(--brand); width: 15px; height: 15px; margin: 0; }
.dlgacts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.dlgacts .cbtn { padding: 9px 18px; font-size: 13px; }
.dlgacts .install { padding: 9px 20px; font-size: 13px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }
@media (prefers-reduced-motion: reduce) { .dlgwrap, .dlg { animation: none; } }
@media (max-width: 640px) {
  .dlgwrap { place-items: end center; padding: 0; }
  .dlg { max-height: 100dvh; border-radius: 20px 20px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px)); }
  .dlgacts .cbtn, .dlgacts .install { flex: 1; }
}
