/* PatchBook — design system */

:root {
  --bg:          #ffffff;
  --bg2:         #f6f8fa;
  --bg3:         #eaeef2;
  --border:      #d0d7de;
  --border-soft: #e8ecf0;
  --text:        #1f2328;
  --muted:       #57606a;
  --muted2:      #8c959f;

  --green:        #1a7f37;
  --green-bg:     #dafbe1;
  --green-border: #aceebb;

  --blue:        #0969da;
  --blue-bg:     #ddf4ff;
  --blue-border: #80ccff;

  --orange:        #953800;
  --orange-bg:     #fff1e5;
  --orange-border: #ffa657;

  --red:        #cf222e;
  --red-bg:     #ffebe9;
  --red-border: #ffaba8;

  --yellow:        #7d4e00;
  --yellow-bg:     #fff8c5;
  --yellow-border: #f0c000;

  --font-mono: 'SFMono-Regular', 'Consolas', 'Liberation Mono', monospace;
  --font-ui:   -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', sans-serif;

  --shadow-sm: 0 1px 3px rgba(31,35,40,0.08);
  --shadow:    0 3px 10px rgba(31,35,40,0.10);
  --radius:    8px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  background: var(--bg2);
  color: var(--text);
  font-family: var(--font-ui);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── nav ── */
nav {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  height: 60px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}
.nav-brand {
  font-family: var(--font-mono);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
  text-decoration: none;
  margin-right: 2.5rem;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.brand-icon {
  width: 28px; height: 28px;
  background: var(--blue);
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  color: white;
  font-size: 0.9rem;
  font-weight: 900;
  flex-shrink: 0;
}
.nav-links { display: flex; gap: 0; flex: 1; }
.nav-links a {
  color: var(--muted);
  text-decoration: none;
  padding: 0 1rem;
  height: 60px;
  display: flex;
  align-items: center;
  font-size: 0.9rem;
  font-weight: 500;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); }
.nav-links a.active { color: var(--text); border-bottom-color: var(--blue); }
.nav-github {
  display: flex; align-items: center; justify-content: center;
  margin-left: 1rem; color: var(--muted); transition: color 0.15s ease;
}
.nav-github:hover { color: var(--text); }

/* ── badges ── */
.badge {
  display: inline-flex; align-items: center;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border: 1px solid;
  white-space: nowrap;
}
.badge.green  { background: var(--green-bg);  color: var(--green);  border-color: var(--green-border); }
.badge.blue   { background: var(--blue-bg);   color: var(--blue);   border-color: var(--blue-border); }
.badge.orange { background: var(--orange-bg); color: var(--orange); border-color: var(--orange-border); }
.badge.red    { background: var(--red-bg);    color: var(--red);    border-color: var(--red-border); }
.badge.yellow { background: var(--yellow-bg); color: var(--yellow); border-color: var(--yellow-border); }
.badge.muted  { background: var(--bg3);       color: var(--muted);  border-color: var(--border); }
.badge.mono   { font-family: var(--font-mono); }

/* ── buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.9rem;
  border-radius: 6px;
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid;
  text-decoration: none;
  transition: filter 0.15s;
  white-space: nowrap;
  font-family: var(--font-ui);
}
.btn:hover { filter: brightness(0.93); }
.btn-muted { background: var(--bg3); color: var(--muted); border-color: var(--border); }
.btn-blue  { background: var(--blue); color: #fff; border-color: var(--blue); }

/* ── community votes & suggestions ── */

/* horizontal bar under the title: votes on the left, action buttons on the
   right — kept on one line; wraps only as a fallback on very narrow screens */
.community-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  margin-top: 1.25rem;
  padding: 0.6rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.votes {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.community-tally-label {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-right: 0.15rem;
}

/* a vote button, its live count, and the voter popover anchored to that count */
.vote-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
.vote-btn {
  cursor: pointer;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  opacity: 0.75;
  transition: opacity 0.12s ease, box-shadow 0.12s ease;
}
.vote-btn:hover { opacity: 1; }
/* the reader's own current vote */
.vote-btn.is-mine {
  opacity: 1;
  box-shadow: inset 0 0 0 1px currentColor;
}
.vote-count {
  cursor: default;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  background: none;
  border: none;
  padding: 0.1rem 0.15rem;
  min-width: 1.1rem;
  text-align: left;
}
.vote-count:hover, .vote-count:focus-visible { color: var(--text); }

/* Who voted — reachable by hover, by keyboard focus, and by tapping the count
   (which toggles .is-open). Never rendered into the report body. */
.voter-popover {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  z-index: 20;
  display: none;
  width: 260px;
  max-width: 70vw;
  max-height: 16rem;
  overflow-y: auto;
  padding: 0.5rem 0.85rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
/* Focus is scoped to the count itself, not the group. `:focus-within` on the
   group also matched the vote buttons inside it, so casting a vote left the
   popover stuck open until something else took focus. `:focus-visible` keeps
   the list reachable by keyboard without a mouse click pinning it open;
   .voter-popover is the count's next sibling, hence `~`. */
.vote-group:hover .voter-popover,
.vote-count:focus-visible ~ .voter-popover,
.vote-group.is-open .voter-popover { display: block; }

.voter-list { list-style: none; margin: 0; padding: 0; }
.voter-list li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.9rem;
}
.voter-list li:last-child { border-bottom: none; }
.voter-list a { color: var(--blue); text-decoration: none; font-weight: 600; }
.voter-list a:hover { text-decoration: underline; }

.vote-status { font-size: 0.8rem; color: var(--muted); }
.vote-status.is-error { color: var(--red); }

.community-note {
  flex-basis: 100%;
  color: var(--muted);
  font-size: 0.85rem;
  padding-left: 0.2rem;
}

/* actions: compact buttons on the right side of the community bar */
.community-actions {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  align-items: flex-start;
}
/* shrink the action buttons so they sit on the same line as the tally */
.community-actions > .community-box > summary {
  padding: 0.28rem 0.7rem;
  font-size: 0.8rem;
}
.community-box > summary {
  list-style: none;
  display: inline-flex;
}
.community-box > summary::-webkit-details-marker { display: none; }
.community-form {
  position: relative; /* positioning context for the .community-thanks overlay */
  width: 360px;
  max-width: 100%;
  margin-top: 0.6rem;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  box-shadow: var(--shadow-sm);
}

/* Shown after a submission opens its GitHub issue — covers the form so it
   can't be edited or resubmitted until the page reloads (see lockForm in
   patchbook.js). */
.community-thanks {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.35rem;
  text-align: center;
  padding: 1rem;
  background: var(--green-bg);
  border: 1px solid var(--green-border);
  border-radius: var(--radius);
}
.community-thanks strong { color: var(--green); font-size: 0.95rem; }
.community-thanks span { color: var(--muted); font-size: 0.85rem; }
.community-form textarea {
  width: 100%;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.5rem 0.65rem;
  resize: vertical;
}
.community-form textarea:focus {
  outline: none;
  border-color: var(--blue);
  background: var(--bg);
}
.community-form .btn { align-self: flex-start; }
.community-edit { align-self: flex-start; }

/* editor credits at the bottom of a report — from the `editors:` frontmatter,
   which PR authors maintain by hand */
.report-editors {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
}
.report-editors h2 {
  margin: 0 0 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.report-editors ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
.report-editors li {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid var(--border-soft);
  font-size: 0.9rem;
}
.report-editors li:last-child { border-bottom: none; }
.report-editors a { color: var(--blue); text-decoration: none; font-weight: 600; }
.report-editors a:hover { text-decoration: underline; }

/* ── layout ── */
.page {
  max-width: 860px;
  margin: 0 auto;
  padding: 2.5rem 2rem;
  flex: 1;
  width: 100%;
}
.page-report { max-width: 780px; }
.page-header { margin-bottom: 2rem; }
.page-header h1 {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text);
}
.page-header p { color: var(--muted); margin-top: 0.4rem; font-size: 1rem; }

/* ── report list (homepage) ── */
.report-list { display: flex; flex-direction: column; gap: 1rem; }

.report-card {
  display: block;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.4rem;
  text-decoration: none;
  color: inherit;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.report-card:hover {
  border-color: var(--blue);
  box-shadow: var(--shadow);
}
.report-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.75rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.report-date {
  font-size: 0.82rem;
  color: var(--muted2);
  font-family: var(--font-mono);
}
.report-card-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 0.3rem;
  line-height: 1.4;
}
.report-card-subtitle {
  font-size: 0.95rem;
  color: var(--blue);
  font-weight: 600;
  margin-bottom: 0.5rem;
}
.report-card-excerpt {
  font-size: 0.92rem;
  color: var(--muted);
  line-height: 1.65;
  margin-bottom: 0.75rem;
}
.report-card-link {
  font-size: 0.88rem;
  color: var(--blue);
  font-weight: 600;
}

/* ── report page header ── */
.report-header {
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}
.report-header-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.9rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.back-link { font-size: 0.85rem; }
.report-title {
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text);
}

/* ── prose / markdown ── */
.prose { font-size: 1rem; line-height: 1.8; color: var(--text); }
.prose h1, .prose h2, .prose h3, .prose h4 {
  color: var(--text); margin: 2rem 0 0.75rem; line-height: 1.3;
}
.prose h1 { font-size: 1.9rem; border-bottom: 2px solid var(--border); padding-bottom: 0.5rem; }
.prose h2 { font-size: 1.45rem; border-bottom: 1px solid var(--border); padding-bottom: 0.35rem; }
.prose h3 { font-size: 1.15rem; color: var(--blue); }
.prose h4 { font-size: 1rem; color: var(--muted); }
.prose p  { margin: 0.9rem 0; }
.prose a  { color: var(--blue); text-decoration: none; font-weight: 500; }
.prose a:hover { text-decoration: underline; }
.prose code {
  background: var(--bg3);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.15em 0.45em;
  font-family: var(--font-mono);
  font-size: 0.88em;
  color: var(--orange);
}
.prose pre {
  background: #1b1f23;
  border: 1px solid #30363d;
  border-radius: var(--radius);
  padding: 1.25rem;
  overflow-x: auto;
  margin: 1.25rem 0;
}
.prose pre code {
  background: none; border: none; padding: 0;
  font-size: 0.88rem; color: #c9d1d9;
}
.prose table { margin: 1.25rem 0; font-size: 0.92rem; width: 100%; border-collapse: collapse; }
.prose th {
  text-align: left;
  padding: 0.6rem 0.9rem;
  color: var(--muted);
  font-weight: 600;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border-bottom: 1px solid var(--border);
  background: var(--bg2);
}
.prose td {
  padding: 0.6rem 0.9rem;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}
.prose blockquote {
  border-left: 4px solid var(--blue-border);
  padding: 0.5rem 1rem;
  color: var(--muted);
  margin: 1rem 0;
  background: var(--blue-bg);
  border-radius: 0 6px 6px 0;
}
.prose ul, .prose ol { padding-left: 1.75rem; margin: 0.6rem 0; }
.prose li { margin: 0.3rem 0; }
.prose hr { border: none; border-top: 1px solid var(--border); margin: 2rem 0; }
.prose strong { font-weight: 700; }
.prose em { font-style: italic; }

/* ── Rouge syntax highlighting (github-dark theme) ── */
.highlight { background: #1b1f23; border-radius: var(--radius); }
.highlight .c, .highlight .ch, .highlight .cd, .highlight .cm,
.highlight .cpf, .highlight .c1, .highlight .cs { color: #8b949e; font-style: italic; }
.highlight .cp { color: #79c0ff; }
.highlight .err { color: #f85149; }
.highlight .k, .highlight .kc, .highlight .kd, .highlight .kn,
.highlight .kp, .highlight .kr { color: #ff7b72; font-weight: bold; }
.highlight .kt { color: #79c0ff; }
.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh,
.highlight .mi, .highlight .mo { color: #79c0ff; }
.highlight .s, .highlight .sa, .highlight .sb, .highlight .sc,
.highlight .dl, .highlight .sd, .highlight .s2, .highlight .se,
.highlight .sh, .highlight .si, .highlight .sx, .highlight .sr,
.highlight .s1, .highlight .ss { color: #a5d6ff; }
.highlight .na { color: #79c0ff; }
.highlight .nb { color: #c9d1d9; }
.highlight .nc { color: #7ee787; font-weight: bold; }
.highlight .no { color: #79c0ff; }
.highlight .nd { color: #d2a8ff; font-weight: bold; }
.highlight .ni { color: #c9d1d9; font-weight: bold; }
.highlight .ne { color: #f85149; font-weight: bold; }
.highlight .nf, .highlight .fm { color: #d2a8ff; font-weight: bold; }
.highlight .nl { color: #c9d1d9; font-weight: bold; }
.highlight .nn { color: #ff7b72; }
.highlight .nt { color: #7ee787; }
.highlight .nv, .highlight .vc, .highlight .vg, .highlight .vi,
.highlight .vm { color: #79c0ff; }
.highlight .ow { color: #ff7b72; font-weight: bold; }
.highlight .o  { color: #ff7b72; }
.highlight .p  { color: #c9d1d9; }
.highlight .w  { color: #c9d1d9; }

/* ── misc utilities ── */
.mono  { font-family: var(--font-mono); }
.muted { color: var(--muted); }
.small { font-size: 0.85rem; }
.flex-gap { display: flex; align-items: center; gap: 0.6rem; }

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}
.empty-state .empty-icon { font-size: 2.5rem; margin-bottom: 0.75rem; }

/* scrollbar */
::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-track { background: var(--bg2); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted2); }

/* ── responsive ── */
@media (max-width: 600px) {
  nav { padding: 0 1rem; }
  .page { padding: 1.5rem 1rem; }
  .report-title { font-size: 1.4rem; }
}

/* ── category chooser ── */
.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}
.category-tile {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  color: inherit;
  min-height: 116px;
}
a.category-tile { transition: box-shadow 0.15s, transform 0.15s, border-color 0.15s; }
a.category-tile:hover {
  border-color: var(--blue-border);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}
.category-body { display: flex; flex-direction: column; gap: 0.2rem; }
.category-name { font-size: 1.15rem; font-weight: 700; }
.category-count { font-size: 0.85rem; color: var(--muted); }

/* The Windows motif: four panes on a blue field, drawn rather than fetched.
   The slight skew reads as the logo's perspective without imitating it. */
.category-art {
  flex-shrink: 0;
  width: 68px; height: 68px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: 1fr 1fr;
  gap: 4px;
  padding: 10px;
  border-radius: 10px;
  background: linear-gradient(145deg, var(--blue) 0%, #0b52a8 100%);
  transform: skewX(-6deg);
}
.win-pane { background: #fff; border-radius: 2px; opacity: 0.94; }

/* Not selectable: no link, no focus, and visibly recessive. */
.category-soon {
  background: var(--bg2);
  border-style: dashed;
  box-shadow: none;
  cursor: not-allowed;
}
.category-soon .category-name { color: var(--muted); }
.category-soon .category-count { color: var(--muted2); }

/* ── filter row ── */
.report-filter {
  margin-bottom: 1.25rem;
  padding: 0.9rem 1rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.filter-row {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.75rem;
}
.filter-field { display: flex; flex-direction: column; gap: 0.25rem; }
.filter-field > span {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.filter-field input {
  font: inherit;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.32rem 0.5rem;
}
.filter-field input:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
.filter-summary { margin-left: auto; font-size: 0.85rem; color: var(--muted); }

/* One track, two draggable handles. Native <input type=range> cannot express a
   range, and two overlaid inputs fight for the pointer wherever the thumbs meet
   — the one later in the DOM wins and the other becomes ungrabbable. This is a
   plain pointer/keyboard implementation instead, so both ends stay reachable
   everywhere on the line. */
.range-slider {
  position: relative;
  height: 36px;
  margin-top: 0.9rem;
  touch-action: none;          /* let a drag be a drag, not a page scroll */
  user-select: none;
}
.range-track {
  position: absolute; top: 16px; left: 8px; right: 8px; height: 4px;
  background: var(--bg3); border-radius: 999px; cursor: pointer;
}
.range-fill { position: absolute; top: 0; height: 100%; background: var(--blue); border-radius: 999px; }
.range-handle {
  position: absolute; top: 10px;
  width: 16px; height: 16px; padding: 0;
  margin-left: -8px;                     /* centre on its value */
  border-radius: 50%;
  background: var(--bg);
  border: 2px solid var(--blue);
  box-shadow: var(--shadow-sm);
  cursor: grab;
  touch-action: none;
}
.range-handle:active { cursor: grabbing; }
.range-handle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }
.range-handle.is-dragging { box-shadow: 0 0 0 6px var(--blue-bg); }
.range-ends {
  display: flex; justify-content: space-between;
  margin-top: 0.1rem;
  font-size: 0.72rem; color: var(--muted2);
  font-family: var(--font-mono);
}

/* ── severity chart ── */
.severity-chart {
  margin: 0 0 1.25rem;
  padding: 0.9rem 1rem 0.6rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.chart-title {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.4rem;
}
.chart-frame { position: relative; }
/* aspect-ratio, not `height: auto`. An inline SVG carrying only a viewBox has
   no intrinsic height, so `height: auto` collapses it to zero and the chart
   vanishes while still being "visible" in the DOM — invisible to any test that
   does not do layout. Stating the ratio keeps the height deterministic and the
   scaling uniform, so the dots stay round. */
.severity-chart svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 960 / 220;
}
.chart-note { margin-top: 0.35rem; font-size: 0.8rem; color: var(--muted); }

/* recessive grid: hairline, solid, one step off the surface */
.chart-grid { stroke: var(--border-soft); stroke-width: 1; }
.chart-axis-text { fill: var(--muted); font-size: 11px; font-family: var(--font-ui); }

/* One hue for every dot: y-position already encodes severity, and severity-
   banded fills fail CVD separation (orange/yellow ΔE 0.4 under deuteranopia).
   The 2px surface ring keeps overlapping dots legible. */
.chart-dot { fill: var(--blue); stroke: var(--bg); stroke-width: 2; }
.chart-hit { fill: transparent; cursor: pointer; }
.chart-point:hover .chart-dot,
.chart-point:focus-visible .chart-dot { fill: #0b52a8; }
.chart-point:focus-visible { outline: none; }
.chart-point:focus-visible .chart-hit { stroke: var(--blue); stroke-width: 2; }

.chart-tip {
  position: absolute;
  z-index: 10;
  pointer-events: none;
  transform: translate(-50%, -100%);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: var(--shadow);
  padding: 0.4rem 0.6rem;
  font-size: 0.8rem;
  white-space: nowrap;
}
/* value leads, label follows */
.chart-tip-value { font-weight: 700; font-family: var(--font-mono); }
.chart-tip-label { color: var(--muted); }
.chart-tip-key {
  display: inline-block; width: 12px; height: 2px;
  background: var(--blue); vertical-align: middle; margin-right: 0.35rem;
}

.severity-badge { font-family: var(--font-mono); }

/* `.report-card { display: block }` outranks the user-agent's
   `[hidden] { display: none }`, so filtered-out cards stayed on screen while
   the chart correctly dropped them. Any element we toggle with the `hidden`
   property needs its own rule at matching specificity. */
.report-card[hidden],
.severity-chart[hidden] { display: none; }

.filter-empty { display: none; }
.filter-empty:not([hidden]) { display: block; }

/* ── publish form ── */
.publish-form,
.publish-output {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 1.25rem;
}
.publish-output { margin-top: 1.25rem; }
.publish-output h2 { font-size: 1.05rem; margin-bottom: 0.5rem; }
.publish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 0.9rem;
  margin-bottom: 0.9rem;
}
.publish-wide { margin-bottom: 0.9rem; }
.filter-field select,
.filter-field textarea {
  font: inherit;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.32rem 0.5rem;
  width: 100%;
  resize: vertical;
}
.filter-field textarea { font-family: var(--font-mono); line-height: 1.5; }
.filter-field select:focus-visible,
.filter-field textarea:focus-visible { outline: 2px solid var(--blue); outline-offset: 1px; }
/* A field the browser has already judged invalid — not every empty field on
   load, which :invalid alone would paint red before anyone has typed. */
.publish-form input:user-invalid,
.publish-form textarea:user-invalid { border-color: var(--red); }

.severity-input { display: flex; align-items: center; gap: 0.5rem; }
.severity-input input { flex: 1; min-width: 0; }

.publish-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 0.6rem;
}
.publish-actions [data-publish-filename] { font-family: var(--font-mono); word-break: break-all; }
.publish-error {
  margin-top: 0.6rem;
  padding: 0.5rem 0.7rem;
  background: var(--red-bg);
  border: 1px solid var(--red-border);
  border-radius: 6px;
  color: var(--red);
  font-size: 0.85rem;
}
.publish-error[hidden] { display: none; }
.publish-status { font-size: 0.9rem; margin-bottom: 0.6rem; }
.publish-file {
  width: 100%;
  font-family: var(--font-mono);
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.6rem;
  resize: vertical;
}
.publish-output[hidden] { display: none; }
.publish-hint { font-size: 0.85rem; color: var(--muted); }

/* ── about ── */
/* No page subtitle here: the opening line is the first paragraph of the same
   prose block, so it inherits one type treatment with everything below it. */
.page-about .prose {
  font-size: 1.1rem;
  line-height: 1.75;
  max-width: 42em;
}
.page-about .prose p { margin: 1.1rem 0; }
