/* PLESTY hub registry — plesty.net site header over a light content theme. */

* { margin: 0; padding: 0; box-sizing: border-box; }

:root { --accent: #2563eb; }

body {
  background: #f8fafc;
  color: #0f172a;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}

/* ── Site header ──────────────────────────────────────────────────────────
   The same bar plesty.net uses: night background, the wordmark SVG on the
   left, the subdomain name beside it in the subdomain accent. The logo links
   back to plesty.net; the subdomain name links to this site's own home.
   plesty.net tints its bar translucent because the page behind it is dark
   too; over this light page the bar stays opaque. */
.site-nav {
  position: sticky; top: 0; z-index: 50;
  background: #070915;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}
.site-nav-inner {
  width: min(calc(100% - 2rem), 1180px); margin: 0 auto;
  display: flex; align-items: center; gap: 0.85rem; min-height: 72px;
}
.brand { display: inline-flex; align-items: center; flex: none; }
.brand img { display: block; width: 196px; height: 56px; object-fit: contain; }
.brand-divider { width: 1px; height: 30px; background: rgba(255, 255, 255, 0.18); flex: none; }
/* The sibling sites, named at the same weight so the row reads as one title.
   Only the site you are on takes its accent; the rest stay grey, which is the
   whole cue — colour means "you are here", not "this is a link". The grey is
   deliberately dim: any brighter and it would outweigh the accent, which is
   dark enough on this background to lead on hue rather than on lightness. */
.site-switch { display: flex; align-items: center; gap: 0.9rem; flex: none; }
.site-switch a {
  color: #737d90; text-decoration: none;
  font-size: 1.15rem; font-weight: 800; letter-spacing: -0.02em;
  transition: color 160ms ease; white-space: nowrap;
}
.site-switch a:hover { color: #e5e7eb; }
.site-switch a.is-current, .site-switch a.is-current:hover { color: var(--accent); }
@media (max-width: 60rem) {
  .site-nav-inner { min-height: 64px; gap: 0.6rem; }
  .brand img { width: 168px; height: 48px; }
}

main { margin: 0 auto; padding: 3rem 2rem; }

/* Symmetric gutters keep .primary centered on the page; the recent-activity
   sidebar lives in the right gutter without shifting the content. */
.layout {
  display: grid; grid-template-columns: 1fr minmax(0, 52rem) 1fr;
  align-items: start;
}
.primary { grid-column: 2; min-width: 0; }

@media (max-width: 88rem) {
  .layout { grid-template-columns: minmax(0, 1fr); }
  .primary { grid-column: 1; width: 100%; max-width: 52rem; margin: 0 auto; }
}

h1 {
  font-size: 3rem; margin: 0 0 0.5rem; font-weight: 700;
  color: var(--accent); text-align: center;
}

.tagline { text-align: center; color: #64748b; margin-bottom: 2rem; }

#q {
  display: block; width: 100%; padding: 0.9rem 1.1rem; margin-bottom: 1rem;
  font-size: 1rem; color: #0f172a; background: #ffffff;
  border: 1px solid #e2e8f0; border-radius: 0.6rem; outline: none;
}
#q:focus { border-color: #2563eb; }

.facet-row { margin: 0.35rem 0; }

.chip {
  display: inline-block; margin: 0.15rem 0.3rem 0.15rem 0;
  padding: 0.25rem 0.75rem; font-size: 0.82rem; cursor: pointer;
  background: #ffffff; color: #475569;
  border: 1px solid #e2e8f0; border-radius: 999px;
}
.chip:hover { border-color: #2563eb; color: #2563eb; }
.chip.on { background: #2563eb; color: #ffffff; border-color: #2563eb; }

.toolbar {
  display: flex; align-items: center; gap: 0.6rem;
  margin: 1rem 0 1.5rem; color: #64748b; font-size: 0.9rem;
}
.toolbar select {
  padding: 0.3rem 0.5rem; border: 1px solid #e2e8f0; border-radius: 0.4rem;
  background: #ffffff; color: #0f172a; font-size: 0.9rem;
}
.toolbar button {
  margin-left: auto; padding: 0.3rem 0.8rem; font-size: 0.85rem; cursor: pointer;
  background: #ffffff; color: #475569;
  border: 1px solid #e2e8f0; border-radius: 0.4rem;
}
.toolbar button:hover { border-color: #2563eb; color: #2563eb; }

h2 { margin: 2rem 0 0.75rem; font-size: 1.5rem; }
h3 {
  margin: 1rem 0 0.5rem; font-size: 1.05rem; color: #64748b;
  text-transform: capitalize;
}

.card {
  background: #ffffff; border: 1px solid #e2e8f0; border-radius: 0.6rem;
  padding: 0.9rem 1.1rem; margin: 0.5rem 0; cursor: pointer;
}
.card:hover { border-color: #93c5fd; }
.card.open { border-color: #2563eb; cursor: default; }

.card header {
  display: flex; align-items: baseline; gap: 0.5rem; flex-wrap: wrap;
}
.card header .activity { margin-left: auto; font-size: 0.78rem; color: #94a3b8; }

.badge {
  font-size: 0.72rem; padding: 0.1rem 0.5rem; border-radius: 999px;
  background: #eff6ff; color: #2563eb; border: 1px solid #bfdbfe;
}
.badge.standard { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }

.card p { margin: 0.35rem 0 0; color: #475569; font-size: 0.92rem; }

.detail { margin-top: 0.6rem; display: none; }
.card.open .detail { display: block; }

.detail dl {
  display: grid; grid-template-columns: max-content 1fr; gap: 0.15rem 1rem;
  font-size: 0.85rem; margin-bottom: 0.6rem;
}
.detail dt { color: #94a3b8; }
.detail dd { color: #475569; overflow-wrap: anywhere; }

.links { margin: 0.45rem 0; }
.links a { color: #2563eb; text-decoration: none; margin-right: 1rem; }
.links a:hover { text-decoration: underline; }

.install { display: flex; gap: 0.5rem; align-items: stretch; }
.install code {
  flex: 1; font-size: 0.8rem; color: #475569; background: #f1f5f9;
  border-radius: 0.4rem; padding: 0.4rem 0.6rem; overflow-x: auto;
}
.install button {
  padding: 0 0.8rem; font-size: 0.8rem; cursor: pointer;
  background: #ffffff; color: #475569;
  border: 1px solid #e2e8f0; border-radius: 0.4rem; white-space: nowrap;
}
.install button:hover { border-color: #2563eb; color: #2563eb; }

#recent {
  background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 0.6rem;
  padding: 0.9rem 1.1rem;
  grid-column: 3; justify-self: start;
  width: 17rem; margin-left: 1.5rem;
  position: sticky; top: 1.5rem;
}

@media (max-width: 88rem) {
  #recent {
    grid-column: 1; order: -1; position: static;
    width: 100%; max-width: 52rem; margin: 0 auto 1rem;
  }
}
#recent h2 { margin: 0 0 0.5rem; font-size: 1rem; color: #2563eb; }
#recent ul { list-style: none; }
#recent li {
  padding: 0.4rem 0; font-size: 0.86rem;
  border-top: 1px solid #dbeafe;
}
#recent li:first-child { border-top: none; }
#recent li a {
  display: block; color: #0f172a; font-weight: 600;
  text-decoration: none; cursor: pointer;
}
#recent li a:hover { color: #2563eb; }
#recent li .commit {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden; color: #64748b; font-size: 0.8rem; margin-top: 0.1rem;
}
#recent li .when {
  display: block; color: #94a3b8; font-size: 0.75rem; margin-top: 0.1rem;
}

#empty { text-align: center; color: #64748b; margin: 2rem 0; }

/* Bottom site links. Scoped to .sitelinks so the sticky header's own <nav>
   does not inherit the centred footer styling. */
.sitelinks { margin-top: 2.5rem; text-align: center; }
.sitelinks a {
  color: #0f172a; text-decoration: none; margin: 0 0.9rem;
  border-bottom: 1px solid #cbd5e1; padding-bottom: 2px;
}
.sitelinks a:hover { color: var(--accent); border-color: var(--accent); }

footer { margin-top: 3rem; font-size: 0.8rem; color: #94a3b8; text-align: center; }

[hidden] { display: none !important; }

/* ── Module quality ───────────────────────────────────────────────────────
   Green for a module whose gates pass, red for one with a failing gate or an
   error finding: a module claiming an API it does not have is exactly what a
   quality page is for, so it is not a quiet state. Amber for a declared but
   unverified entry — not a failure, but not a pass either. */
.badge.quality-ok { background: #f0fdf4; color: #16a34a; border-color: #bbf7d0; }
.badge.quality-error { background: #fef2f2; color: #dc2626; border-color: #fecaca; }

/* The expanded card's cue that a second click opens the module's page. */
.more { margin-top: 0.75rem; color: #2563eb; font-size: 0.85rem; }

/* ── Module detail page ───────────────────────────────────────────────────
   Centred on the same 52rem measure as the index's .primary column, so the
   two pages line up when you move between them. */
.detail-page { max-width: 52rem; margin: 0 auto; }

.back {
  display: inline-block; margin-bottom: 1rem;
  color: #64748b; text-decoration: none; font-size: 0.9rem;
}
.back:hover { color: #2563eb; }

.detail-page h1 { text-align: center; }
.lede { max-width: 62ch; margin: 0 auto 1.5rem; color: #475569; text-align: center; }

.summary {
  display: flex; flex-wrap: wrap; justify-content: center;
  gap: 1.25rem 2.5rem; margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: #ffffff; border: 1px solid #e2e8f0; border-radius: 0.6rem;
}
.stat { display: flex; flex-direction: column; gap: 0.2rem; text-align: center; }
.stat-label {
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: #94a3b8;
}
.stat-value { font-size: 1.02rem; color: #0f172a; }
.stat-value.ok { color: #16a34a; }
.stat-value.bad { color: #dc2626; }

.detail-page .links,
.detail-page .install { justify-content: center; text-align: center; }

.quality { margin-top: 2.5rem; }

.tabs {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem;
  border-bottom: 1px solid #e2e8f0;
}
.tab {
  padding: 0.55rem 1rem; border: 0; border-bottom: 2px solid transparent;
  background: transparent; color: #64748b; font: inherit; font-size: 0.92rem;
  cursor: pointer;
}
/* Hover goes to the accent, as every other control on the site does —
   .chip:hover, .toolbar button:hover and .back:hover all do the same. */
.tab:hover { color: #2563eb; }
.tab[aria-selected="true"] {
  color: #2563eb; border-bottom-color: #2563eb; font-weight: 600;
}

.panel { padding-top: 1.25rem; }
.panel-note { max-width: 74ch; margin: 0 auto 1rem; color: #64748b; font-size: 0.88rem; }

.quality table {
  width: 100%; border-collapse: collapse; margin: 1rem 0 1.5rem; font-size: 0.9rem;
  background: #ffffff; border: 1px solid #e2e8f0; border-radius: 0.6rem;
}
.quality th {
  text-align: left; padding: 0.45rem 0.7rem; border-bottom: 1px solid #e2e8f0;
  font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.05em;
  color: #94a3b8; font-weight: 600;
}
.quality td {
  padding: 0.45rem 0.7rem; border-bottom: 1px solid #f1f5f9; vertical-align: top;
}
.quality tr:last-child td { border-bottom: 0; }
.quality td.status { text-transform: uppercase; font-size: 0.74rem; letter-spacing: 0.05em; }
.quality td.reason { color: #64748b; font-size: 0.85rem; }
.quality code { font-size: 0.85rem; color: #0f172a; }

.status-pass td.status, .verified-roundtrip td.status,
.verified-called td.status, .verified-queried td.status { color: #16a34a; }
.status-skip td.status, .verified-declared td.status { color: #d97706; }
.status-fail td.status, .severity-error td.status { color: #dc2626; }
.severity-warning td.status { color: #d97706; }
.severity-info td.status { color: #2563eb; }

.quality h3 { margin: 1.75rem 0 0.25rem; font-size: 1rem; text-align: center; }

/* Section titles inside a panel: a tier, or the comparison between two of
   them. Distinct from the h3 labels below them — one instrument's two tiers
   carry the same table headings, so "Coverage" has to read as a label of the
   tier above it and never as a section of its own. */
.quality h2 {
  margin: 2rem 0 0.35rem; font-size: 1.3rem; font-weight: 700;
  color: #2563eb; text-align: center;
}

/* One instrument's tiers, stacked. The accent rule scopes everything inside
   to the tier named at its top: the gate table, the findings and the coverage
   of a host run and of a client run are the same tables with different
   numbers, and which one you are reading has to survive a scroll. */
.tier {
  border-left: 3px solid #bfdbfe; padding-left: 1.1rem; margin-top: 2.5rem;
}
.tier h2 { margin-top: 0.75rem; }
.tier h3 {
  margin: 1.75rem 0 0.25rem; font-size: 0.78rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.08em; color: #94a3b8;
}

/* Amber, the page's existing "not a failure, but not a pass either" — a green
   report under older tooling is still green, and was held to another
   contract. Never red: nothing here failed. */
.panel-note.tooling code {
  background: #f1f5f9; border-radius: 0.3rem;
  padding: 0.05rem 0.35rem; font-size: 0.82rem;
}
.stat-note, .panel-note.stale, .panel-note.tooling code.stale { color: #d97706; }
.stat-note { font-size: 0.72rem; }
.panel-note.tooling code.stale { border-bottom: 1px dotted #d97706; }

/* Column widths. Left to the browser, the text column takes the slack and
   pushes the numbers to the far edge, so reading a row means crossing the
   page. Text columns absorb the width; status and numbers stay next to what
   they describe. */
.quality table { table-layout: fixed; }

.quality td:first-child, .quality th:first-child { padding-left: 0.9rem; }
.quality td:last-child, .quality th:last-child { padding-right: 0.9rem; }

/* plesty check: gate · tier · status · reason */
#panel-check th:nth-child(1), #panel-check td:nth-child(1) { width: 42%; }
#panel-check th:nth-child(2), #panel-check td:nth-child(2) { width: 10%; }
#panel-check th:nth-child(3), #panel-check td:nth-child(3) { width: 12%; }

/* Field test gates: gate · status · reason */
.quality table.gates th:nth-child(1), .quality table.gates td:nth-child(1) { width: 30%; }
.quality table.gates th:nth-child(2), .quality table.gates td:nth-child(2) { width: 12%; }

/* Tier comparison: entry · kind · call · host · client · × */
.quality table.delta th:nth-child(1), .quality table.delta td:nth-child(1) { width: 30%; }
.quality table.delta th:nth-child(2), .quality table.delta td:nth-child(2) { width: 15%; }
.quality table.delta th:nth-child(3), .quality table.delta td:nth-child(3) { width: 11%; }
.quality table.delta th:nth-child(n+4), .quality table.delta td:nth-child(n+4) {
  width: 14.6%; text-align: right; font-variant-numeric: tabular-nums;
}

/* Coverage: entry · kind · verified · median · p95 */
.quality table.coverage th:nth-child(1), .quality table.coverage td:nth-child(1) { width: 38%; }
.quality table.coverage th:nth-child(2), .quality table.coverage td:nth-child(2) { width: 16%; }
.quality table.coverage th:nth-child(3), .quality table.coverage td:nth-child(3) { width: 18%; }
.quality table.coverage th:nth-child(4), .quality table.coverage td:nth-child(4),
.quality table.coverage th:nth-child(5), .quality table.coverage td:nth-child(5) {
  width: 14%; text-align: right; font-variant-numeric: tabular-nums;
}

/* Findings: severity · subject · what · action */
.quality table.findings th:nth-child(1), .quality table.findings td:nth-child(1) { width: 11%; }
.quality table.findings th:nth-child(2), .quality table.findings td:nth-child(2) { width: 22%; }

/* Long values wrap inside their column instead of widening it. */
.quality td { overflow-wrap: anywhere; }
