:root {
  --bg: #ffffff;
  --panel: #ffffff;
  --border: #dbe0ea;
  --fg: #1c2333;
  --muted: #6b7280;
  --primary: #7290e5;
  --link: #3a5bd0;
  --secondary: #eed45b;
  --secondary-soft: #fbf4d4;
  --secondary-ink: #7a6713;
  --pass: #2ea043;
  --fail: #d1242f;
  --unknown: #9aa1ab;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  border-top: 4px solid var(--secondary);
  font:
    15px/1.5 -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    Roboto,
    Helvetica,
    Arial,
    sans-serif;
}
header.site {
  padding: 32px 0 16px;
  border-bottom: 1px solid var(--border);
}
header.site h1 {
  margin: 0;
  font-size: 26px;
}
header.site h1 span {
  color: var(--primary);
}
header.site p {
  /* One sentence per paragraph; no measure cap so each stays a single
     line on desktop (the .container width still bounds them). */
  margin: 6px 0 0;
  color: var(--muted);
}
header.site a {
  color: var(--link);
  text-decoration: none;
}
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
header.site a.register-cta {
  color: var(--fg);
  background: var(--secondary-soft);
  border: 1px solid var(--secondary);
  border-radius: 8px;
  padding: 7px 14px;
  font-size: 13.5px;
  font-weight: 600;
  transition: box-shadow 0.15s ease;
}
header.site a.register-cta:hover {
  box-shadow: 0 2px 9px rgba(238, 212, 91, 0.6);
}
.stats {
  display: flex;
  gap: 24px;
  margin-top: 14px;
  color: var(--muted);
  font-size: 13px;
}
.stats b {
  color: var(--fg);
  border-bottom: 2px solid var(--secondary);
}
/* Match .wrap's max-width + padding so the header left edge aligns with the
   packages column below it. */
.container {
  max-width: 1320px;
  margin: 0 auto;
  padding: 0 24px;
}
.wrap {
  max-width: 1320px;
  margin: 0 auto;
  padding: 20px 24px 64px;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}
/* The tag rail ships hidden until app.js renders it (no-JS, failed fetch,
   empty registry): without its column the cards must not fall into the
   210px rail track. */
.wrap:has(> #tagbar[hidden]) {
  grid-template-columns: minmax(0, 1fr) 340px;
}
/* The noscript fallback reuses .wrap for width/padding only (both pages);
   as a grid its lone paragraph would be crushed into the first track. */
noscript .wrap {
  display: block;
}
.browse {
  min-width: 0;
}

/* Tag rail (left facet panel; counts are per active distro) */
#tagbar {
  position: sticky;
  top: 20px;
  align-self: start;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 12px;
  box-shadow: 0 1px 3px rgba(27, 35, 51, 0.08);
}
#tagbar h2 {
  margin: 0 4px 8px;
  font-size: 16px;
}
.tagbar-group {
  margin: 12px 4px 3px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}
.tagbar-tag {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  background: none;
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 4px 8px;
  font: inherit;
  font-size: 13.5px;
  color: var(--fg);
  text-align: left;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease;
}
.tagbar-tag:hover {
  background: var(--secondary-soft);
  border-color: var(--secondary);
}
.tagbar-tag:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 0;
}
.tagbar-tag[aria-pressed="true"] {
  background: var(--secondary);
  border-color: var(--secondary);
  font-weight: 600;
}
.tagbar-name {
  overflow-wrap: anywhere;
}
.tagbar-count {
  flex: 0 0 auto;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--fg);
  color: #fff;
  border-radius: 20px;
  padding: 1px 8px;
  min-width: 26px;
  text-align: center;
}
.controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  /* The 12px paddings become the white mask above/below the row while it is
     stuck; the negative top margin cancels the top one at rest, so the row
     sits exactly level with the tag rail and repos builder panels. */
  margin: -12px 0 22px;
  position: sticky;
  top: 0;
  background: var(--bg);
  padding: 12px 0;
  z-index: 5;
}
.controls input,
.controls select {
  background: #fff;
  color: var(--fg);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 8px 10px;
  font-size: 14px;
}
.controls input:focus,
.controls select:focus {
  outline: 2px solid var(--primary);
  outline-offset: 0;
  border-color: var(--primary);
}
.controls input[type="search"] {
  flex: 1;
  min-width: 200px;
}
.card {
  position: relative; /* anchors the absolutely-pinned cart toggle */
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 18px 20px;
  margin-bottom: 14px;
  box-shadow: 0 1px 3px rgba(27, 35, 51, 0.08);
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
/* Two glow families, two meanings. Exploring is golden: hovering a card
   (and, softer, its repository siblings via .repo-hover below). Selection is
   primary blue: a card whose toggle is pressed holds the blue glow (its
   :has() specificity outranks :hover, so it stays blue under the pointer
   too), and repository groups select all-or-nothing, so a whole monorepo
   turns blue together. */
.card:hover {
  border-color: var(--secondary);
  box-shadow: 0 2px 10px rgba(238, 212, 91, 0.35);
}
.card:has(.cart-toggle[aria-pressed="true"]) {
  border-color: var(--primary);
  box-shadow: 0 2px 10px rgba(114, 144, 229, 0.45);
}
/* Hover echo: a softer golden glow on the OTHER cards of the same repository
   while one is hovered: one clone brings them all. :where() keeps specificity
   at plain-class level, so the direct hover/selected glow above always wins
   on the card itself. */
.card:where(.repo-hover) {
  border-color: var(--secondary);
  box-shadow: 0 1px 6px rgba(238, 212, 91, 0.22);
}
.card h2 {
  margin: 0;
  font-size: 18px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  /* Padding keeps the name clear of the pinned toggle; and package names
     are single unbreakable words, so without a break opportunity the
     min-content width would overflow narrow cards (and run under it). */
  padding-right: 42px;
  min-width: 0;
  overflow-wrap: anywhere;
}
.badges {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 20px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: #fff;
}
.badge-distro {
  border-color: var(--secondary);
  background: var(--secondary);
  color: #3a3208;
}
/* Monorepo badge: same quiet outline family as the other badges, but a
   button; clicking filters the list to the repository's packages, clicking
   again clears. font: inherit first (buttons default to a UA font), then
   the badge size back on top. */
button.badge-repo {
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}
button.badge-repo:hover {
  background: var(--secondary-soft);
  border-color: var(--secondary);
  color: var(--secondary-ink);
}
/* Pressed while the repo filter is active (app.js syncs aria-pressed with
   the search box): the same filled-gold treatment as the distro badge and
   the pressed tag-rail rows. After :hover so the fill holds under the
   pointer. */
button.badge-repo[aria-pressed="true"] {
  background: var(--secondary);
  border-color: var(--secondary);
  color: #3a3208;
}
button.badge-repo:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.pill {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 20px;
  color: #fff;
}
.pill-pass {
  background: var(--pass);
}
.pill-fail {
  background: var(--fail);
}
.pill-unknown {
  background: var(--unknown);
}
.description {
  margin: 10px 0 0;
  color: var(--fg);
  font-size: 14px;
  max-width: 78ch;
}
.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
/* The domain tag chips close the card as its footer row (app.js only
   renders the row when the package has tags). */
.card .tags {
  margin-top: 12px;
}
.tag {
  font-size: 12px;
  background: var(--secondary-soft);
  border: 1px solid var(--secondary);
  border-radius: 6px;
  padding: 1px 8px;
  color: var(--secondary-ink);
}
.meta {
  font-size: 13px;
  margin-top: 8px;
}
.repo {
  color: var(--link);
  text-decoration: none;
  word-break: break-all;
}
.maintainers {
  font-size: 13px;
  color: var(--muted);
  margin-top: 6px;
}
.maintainers a,
.versions a {
  color: var(--link);
  text-decoration: none;
}
.muted {
  color: var(--muted);
}
code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
}
details {
  margin-top: 12px;
}
summary {
  cursor: pointer;
  color: var(--link);
  font-size: 13px;
}
table.versions {
  width: 100%;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
}
table.versions th,
table.versions td {
  text-align: left;
  padding: 6px 8px;
  border-bottom: 1px solid var(--border);
}
table.versions th {
  color: var(--muted);
  font-weight: 500;
}
.empty {
  color: var(--muted);
  padding: 40px 0;
  text-align: center;
}
footer {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 28px 24px;
  border-top: 1px solid var(--border);
}
footer .foundation {
  font-weight: 600;
  margin-bottom: 6px;
}
footer .foundation a {
  color: var(--fg);
}
footer .links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 6px 14px;
}
footer a {
  color: var(--link);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 5px;
}
footer a:hover {
  text-decoration: underline;
}
footer svg {
  fill: currentColor;
}
footer .sep {
  color: var(--border);
}

/* Repos builder (cart sidebar) */
/* The classification band: always the card's second line, holding the
   registry pills (status, last green, distro, governance, monorepo) flowing
   from the left. The domain tag chips live at the card's bottom (.card .tags). */
.card-head-actions {
  display: flex;
  align-items: flex-start;
  gap: 8px 10px;
  flex-wrap: wrap;
  margin-top: 8px;
}
/* Fixed-size circular icon button (no size change on hover). Inactive = very
   light gold fill with a normal-gold edge and an ink plus; active (in cart) =
   primary-blue fill with a white check, matching the selected card's blue
   glow. Words live in the title tooltip + aria-label so nothing reflows.
   Pinned to the card's top-right corner, out of the header's wrapping flow,
   so a long package name can never push it to a second line. */
.cart-toggle {
  position: absolute;
  top: 16px;
  right: 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  border: 1px solid var(--secondary);
  background: var(--secondary-soft);
  color: var(--fg);
  box-shadow: 0 1px 2px rgba(27, 35, 51, 0.15);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease,
    box-shadow 0.15s ease;
}
.cart-toggle svg {
  display: block;
}
/* Hover reads as a defined ring plus the glow, not just a faint haze. */
.cart-toggle:hover {
  box-shadow:
    0 0 0 3px rgba(238, 212, 91, 0.5),
    0 2px 10px rgba(238, 212, 91, 0.85);
}
.cart-toggle:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}
.cart-toggle[aria-pressed="true"] {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.cart-toggle[aria-pressed="true"]:hover {
  box-shadow:
    0 0 0 3px rgba(114, 144, 229, 0.45),
    0 2px 10px rgba(114, 144, 229, 0.8);
}

#cart {
  position: sticky;
  top: 20px;
  align-self: start;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 1px 3px rgba(27, 35, 51, 0.08);
}
.cart-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.cart-head h2 {
  margin: 0;
  font-size: 16px;
}
#cart-clear {
  font-size: 12px;
  color: var(--link);
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 9px;
  cursor: pointer;
}
#cart-clear:hover {
  border-color: var(--primary);
}
.cart-scope {
  margin: 4px 0 12px;
  font-size: 13px;
  color: var(--muted);
}
.cart-scope span {
  color: var(--fg);
  font-weight: 600;
}
.cart-empty {
  color: var(--muted);
  font-size: 13px;
  padding: 12px 0;
}

.cart-repo {
  position: relative; /* anchors the pinned remove button */
  border: 1px solid var(--border);
  border-radius: 9px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
/* Repo name and its ref stack as their own lines; the group Remove (trash)
   is pinned to the block's top-right corner, mirroring the cards' pinned
   toggle. Selection is all-or-nothing per repository, so the one Remove
   releases the whole block, not single package rows. */
.cart-repo-head {
  margin-bottom: 4px;
}
.cart-repo-name {
  display: block;
  font-size: 13px;
  color: var(--fg);
  /* Keep clear of the pinned trash button; repo keys are single unbreakable
     words (or URLs), so give them a break opportunity too. */
  padding-right: 30px;
  overflow-wrap: anywhere;
}
.cart-repo-ref {
  font-size: 12px;
}
.cart-pkg {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  padding: 2px 0;
}
.cart-remove {
  position: absolute;
  top: 8px;
  right: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--fail);
  background: #fff;
  border: 1px solid var(--border);
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    box-shadow 0.15s ease;
}
.cart-remove svg {
  display: block;
}
.cart-remove:hover {
  border-color: var(--fail);
  background: rgba(209, 36, 47, 0.08);
  box-shadow: 0 1px 6px rgba(209, 36, 47, 0.35);
}
.cart-remove:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 1px;
}
.cart-note {
  margin: 6px 0 0;
  font-size: 12px;
  background: var(--secondary-soft);
  color: var(--secondary-ink);
  border: 1px solid var(--secondary);
  border-radius: 6px;
  padding: 5px 8px;
}

/* Export panel */
.export {
  margin-top: 14px;
  border-top: 1px solid var(--border);
  padding-top: 12px;
}
.export-block {
  margin-bottom: 12px;
}
.export-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}
.export-head h3 {
  margin: 0;
  font-size: 13px;
}
.export-head h3 a {
  color: var(--link);
  text-decoration: none;
}
.export-head h3 a:hover {
  text-decoration: underline;
}
.export-actions {
  display: flex;
  gap: 6px;
}
.export-actions button {
  font-size: 12px;
  color: var(--link);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 3px 10px;
  cursor: pointer;
}
.export-actions button:hover {
  border-color: var(--primary);
}
.export-out {
  margin: 0;
  background: #f6f8fa;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 10px;
  overflow: auto;
  max-height: 280px;
  font-size: 12px;
}
.export-out code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  white-space: pre;
  color: var(--fg);
}
.copy-status {
  min-height: 16px;
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
}

/* Mid width: fold the tag rail into a wrapped chip row spanning above the
   cards; the group eyebrows would read oddly interleaved between chips, so
   they hide and the chips speak for themselves. */
@media (max-width: 1150px) {
  .wrap {
    grid-template-columns: minmax(0, 1fr) 340px;
  }
  #tagbar {
    grid-column: 1 / -1;
    position: static;
    max-height: none;
  }
  #tagbar-groups {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
  }
  .tagbar-group {
    display: none;
  }
  .tagbar-tag {
    width: auto;
    gap: 6px;
    padding: 3px 9px;
    border-color: var(--border);
  }
}
@media (max-width: 920px) {
  .wrap {
    grid-template-columns: 1fr;
  }
  #cart {
    position: static;
  }
}
