
:root {
  color-scheme: light;
  --font-sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font-size-1: 0.8125rem;
  --font-size-2: 0.875rem;
  --font-size-3: 1rem;
  --font-size-4: 1.25rem;
  --font-size-5: 1.5rem;
  --font-size-6: 2rem;
  --font-size-7: 3rem;
  --line-height: 1.5;
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.5rem;
  --space-6: 2rem;
  --space-7: 3rem;
  --radius-1: 4px;
  --radius-2: 8px;
  --shadow-1: 0 1px 2px rgb(27 31 36 / 0.08);
  --color-ink: #1B1F24;
  --color-muted: #525A66;
  --color-bg: #F6F7F9;
  --color-surface: #FFFFFF;
  --color-subtle: #EEF1F5;
  --color-border: #79818D;
  --color-accent: #1F4E79;
  --color-accent-ink: #FFFFFF;
  --color-focus: #B45309;
  --color-sev-critical: #9B1C1C;
  --color-sev-high: #A63D10;
  --color-sev-medium: #7A5200;
  --color-sev-low: #33622A;
  --color-sev-info: #525A66;
  --color-verdict-failure: #9B1C1C;
  --color-verdict-neutral: #7A5200;
  --color-verdict-success: #1E6B3A;
  --color-diff-add: #E6F4EA;
  --color-diff-del: #FBE9E9;
  --color-banner: #FFF1CC;
}

*, *::before, *::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font-family: var(--font-sans);
  font-size: var(--font-size-3);
  line-height: var(--line-height);
}

.skip-link {
  position: absolute;
  left: -100vw;
  top: var(--space-2);
  z-index: 10;
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface);
  color: var(--color-accent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-1);
}

.skip-link:focus {
  left: var(--space-2);
}

.demo-banner {
  background: var(--color-banner);
  color: var(--color-ink);
  font-weight: 700;
  font-size: var(--font-size-2);
  text-align: center;
  padding: var(--space-2) var(--space-4);
  border-bottom: 1px solid var(--color-border);
}

.site-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  padding: var(--space-3) var(--space-4);
  padding-inline: max(var(--space-4), calc((100% - 80rem) / 2 + var(--space-4)));
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-2);
}

.wordmark {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.site-header .wordmark {
  margin-right: auto;
  color: var(--color-ink);
  font-size: var(--font-size-4);
  font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand-mark {
  flex: none;
  color: var(--color-accent);
}

.brand-mark .brand-check {
  stroke: var(--color-surface);
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.site-nav {
  /* q024 R2-3: below 48rem the six-link inline nav is replaced by the Menu disclosure below, so
   * it is hidden here (shown again at 48rem, where the flex value below is what places it). */
  display: none;
  flex: 1 1 100%;
}

.site-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a {
  display: block;
  padding: var(--space-2) 0;
  color: var(--color-muted);
  text-decoration: none;
}

.site-nav a:hover {
  color: var(--color-ink);
  text-decoration: underline;
}

.site-nav a[aria-current="page"] {
  color: var(--color-ink);
  font-weight: 700;
}

.nav-signin {
  color: var(--color-accent);
  font-weight: 700;
}

.site-menu {
  /* q024 R2-3: the phone Menu disclosure holding How it works, Pricing, Docs, Security and
   * Language support; the standalone Sign in link sits beside it, outside the menu, at every
   * width below 48rem (hidden again at 48rem, where Sign in already sits inside .site-nav). */
  position: relative;
}

.site-menu > summary {
  /* q025 R3-2: a visible control (border, chevron, 44px touch target); the focus ring is the
   * shared summary:focus-visible rule. */
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-width: 44px;
  min-height: 44px;
  padding: 0 var(--space-3);
  background: var(--color-surface);
  color: var(--color-ink);
  font-weight: 600;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
  cursor: pointer;
  list-style: none;
}

.site-menu > summary::after {
  content: "";
  width: 0.45em;
  height: 0.45em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-0.15em) rotate(45deg);
}

.site-menu[open] > summary::after {
  transform: translateY(0.15em) rotate(-135deg);
}

/* q025 R3-2: the 44px Menu control keeps the public phone header at 62px (8.5px + 44px + 8.5px
 * + 1px border); at 48rem the Menu is hidden and the header keeps its usual padding. */
.site-header:has(> .site-menu) {
  padding-block: 0.53125rem;
}

.site-menu > summary::-webkit-details-marker {
  display: none;
}

.site-menu nav {
  position: absolute;
  top: 100%;
  right: 0;
  z-index: 10;
  min-width: 12rem;
  padding: var(--space-2);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-1);
}

.site-menu nav ul {
  display: grid;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-menu nav a {
  display: block;
  padding: var(--space-2) var(--space-3);
  color: var(--color-muted);
  text-decoration: none;
}

.site-menu nav a:hover {
  color: var(--color-ink);
  text-decoration: underline;
}

.site-menu nav a[aria-current="page"] {
  color: var(--color-ink);
  font-weight: 700;
}

.site-header .header-org {
  font-weight: 600;
}

.site-header .user {
  color: var(--color-muted);
}

.site-header form {
  margin: 0;
}

.site-header button {
  background: var(--color-surface);
  color: var(--color-accent);
  border-color: var(--color-border);
  padding: var(--space-1) var(--space-3);
}

nav[aria-label="Primary"] {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  padding: 0 var(--space-4);
  padding-inline: max(var(--space-4), calc((100% - 80rem) / 2 + var(--space-4)));
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  font-size: var(--font-size-2);
}

nav[aria-label="Primary"] ul {
  /* t37u: one row at 375px: the five links spread across the width with a small minimum gap and
   * wrap whole below about 360px (no clipping or hidden scroll); desktop overrides at 48rem. */
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0 var(--space-2);
  flex: 1 1 auto;
  margin: 0;
  padding: 0;
  list-style: none;
}

nav[aria-label="Primary"] a {
  display: inline-block;
  padding: var(--space-3) 0;
  color: var(--color-muted);
  text-decoration: none;
  border-bottom: 3px solid transparent;
}

nav[aria-label="Primary"] a:hover {
  color: var(--color-ink);
  text-decoration: underline;
}

nav[aria-label="Primary"] a[aria-current="page"] {
  color: var(--color-ink);
  font-weight: 700;
  border-bottom-color: var(--color-accent);
}

main {
  max-width: 80rem;
  margin: 0 auto;
  padding: var(--space-5) var(--space-4);
  overflow-wrap: anywhere;
}

main > * + * {
  margin-top: var(--space-5);
}

main > section + section {
  margin-top: var(--space-7);
}

section > * + * {
  margin-top: var(--space-3);
}

.site-footer {
  display: grid;
  gap: var(--space-3);
  max-width: 80rem;
  margin: var(--space-7) auto 0;
  padding: var(--space-5) var(--space-4);
  border-top: 1px solid var(--color-border);
  color: var(--color-muted);
  font-size: var(--font-size-2);
}

.site-footer p {
  margin: 0 0 var(--space-1);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-status {
  color: var(--color-ink);
}

/* quick 022: zero-specificity resets so the flow rules (main > * + *, section > * + *) space
 * paragraphs, lists and headings that follow a table, tile grid, card group or code block. */
:where(h1, h2, h3) {
  margin: 0;
}

h1, h2, h3 {
  color: var(--color-ink);
  line-height: 1.25;
}

h1 {
  font-size: var(--font-size-6);
  font-weight: 700;
  letter-spacing: -0.01em;
}

h2 {
  font-size: var(--font-size-5);
  font-weight: 600;
}

h3 {
  font-size: var(--font-size-4);
  font-weight: 600;
}

:where(p, ul, ol) {
  margin: 0;
}

section > * + h3 {
  margin-top: var(--space-5);
}

.page-header > * + * {
  margin-top: var(--space-2);
}

.lede {
  max-width: 44rem;
  font-size: var(--font-size-4);
  color: var(--color-ink);
}

.meta, .hint {
  color: var(--color-muted);
  font-size: var(--font-size-2);
}

a {
  color: var(--color-accent);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 2px;
}

.table-scroll {
  /* q025: the containing block for absolutely positioned descendants (visually-hidden text in
   * matrix cells), so they are clipped by the region instead of widening the page. */
  position: relative;
  overflow-x: auto;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-1);
}

.table-scroll table {
  overflow-wrap: normal;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: var(--font-size-2);
}

th, td {
  padding: var(--space-2) var(--space-3);
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--color-border);
}

th {
  background: var(--color-subtle);
  color: var(--color-muted);
  font-size: var(--font-size-1);
  font-weight: 600;
  letter-spacing: 0.02em;
}

tbody tr:last-child td {
  border-bottom: 0;
}

th.num, td.num, .num {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

code, pre, .sha, .path {
  font-family: var(--font-mono);
  font-size: var(--font-size-2);
}

.sha, .path, code {
  overflow-wrap: anywhere;
}

code {
  padding: 0 var(--space-1);
  background: var(--color-subtle);
  border-radius: var(--radius-1);
}

:where(pre) {
  margin: 0;
}

pre {
  padding: var(--space-3) var(--space-4);
  overflow-x: auto;
  background: var(--color-subtle);
  color: var(--color-ink);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-1);
  font-weight: 400;
  line-height: var(--line-height);
}

pre code {
  padding: 0;
  background: none;
}

button, a.button {
  display: inline-block;
  font: inherit;
  font-size: var(--font-size-2);
  font-weight: 600;
  line-height: var(--line-height);
  padding: var(--space-2) var(--space-4);
  background: var(--color-accent);
  color: var(--color-accent-ink);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-1);
  text-decoration: none;
  cursor: pointer;
}

button:hover, a.button:hover {
  text-decoration: underline;
}

td button {
  background: var(--color-surface);
  color: var(--color-accent);
  border-color: var(--color-border);
  padding: var(--space-1) var(--space-3);
}

:where(form) {
  margin: 0;
}

td form {
  display: inline-block;
  margin: 0 var(--space-2) var(--space-1) 0;
}

input, textarea, select {
  width: 100%;
  max-width: 40rem;
  font: inherit;
  font-size: var(--font-size-2);
  padding: var(--space-2);
  background: var(--color-surface);
  color: var(--color-ink);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-1);
}

textarea {
  min-height: 4.5rem;
}

section > form label, section > form textarea, section > form button {
  display: block;
}

/* q035 (D-187): the terms checkbox sits inline immediately left of its label text, with the whole
 * label clickable; a class beats the generic input/textarea/select and section > form label rules
 * above regardless of source order (one class outranks any number of element selectors). */
.check-label { display: flex; align-items: flex-start; gap: var(--space-2); }
.check-label input { width: auto; margin: 0.2em 0 0; flex: none; }

section > form > * + * {
  margin-top: var(--space-2);
}

label {
  font-size: var(--font-size-2);
  font-weight: 600;
}

.sev, .verdict, .status {
  font-weight: 600;
  white-space: nowrap;
}

/* q025 R3-1: the plain verdict words ("Findings reported, merge not blocked") can be long, so the
 * verdict badge wraps; severity and status words stay on one line. */
.verdict {
  white-space: normal;
}

.sev-critical { color: var(--color-sev-critical); }
.sev-high { color: var(--color-sev-high); }
.sev-medium { color: var(--color-sev-medium); }
.sev-low { color: var(--color-sev-low); }
.sev-info { color: var(--color-sev-info); }
.verdict-failure { color: var(--color-verdict-failure); }
.verdict-neutral { color: var(--color-verdict-neutral); }
.verdict-success { color: var(--color-verdict-success); }
.status-ok { color: var(--color-verdict-success); }
.status-stale { color: var(--color-sev-medium); }
.status-failed { color: var(--color-sev-critical); }
.status-pending { color: var(--color-muted); }
.status-never-scanned { color: var(--color-muted); }
.status-disabled { color: var(--color-muted); }

.rule {
  font-weight: 600;
  white-space: nowrap;
}

.drivers {
  display: block;
  color: var(--color-muted);
  font-size: var(--font-size-1);
}

.notice, .callout {
  padding: var(--space-4);
  background: var(--color-subtle);
  color: var(--color-ink);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
}

.notice > * + * {
  margin-top: var(--space-1);
}

.notice-pending {
  border-left: 4px solid var(--color-accent);
}

/* F-6, legal pages (docs/legal/*.md through src/web/markdown.ts). */
.draft-banner {
  padding: var(--space-4);
  background: var(--color-banner);
  color: var(--color-ink);
  font-weight: 700;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
}

blockquote {
  margin: 0;
  padding: var(--space-3) var(--space-4);
  border-left: 4px solid var(--color-border);
  background: var(--color-subtle);
  color: var(--color-muted);
}

blockquote p {
  margin: 0;
}

mark.placeholder {
  background: var(--color-banner);
  color: var(--color-ink);
  padding: 0 0.2em;
  border-radius: var(--radius-1);
  font-style: italic;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 0;
}

.state-icon {
  display: inline-flex;
  vertical-align: -0.15em;
}

.state-icon svg {
  width: 1em;
  height: 1em;
}

.error-panel {
  padding: var(--space-6);
  max-width: 40rem;
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
}

.error-panel > * + * {
  margin-top: var(--space-3);
}

dl.facts {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--space-1) var(--space-4);
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
}

dl.facts dt {
  color: var(--color-muted);
  font-size: var(--font-size-2);
  font-weight: 600;
}

dl.facts dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

:where(figure, dl) {
  margin: 0;
}

figcaption {
  margin-top: var(--space-2);
  color: var(--color-muted);
  font-size: var(--font-size-2);
}

.callout .button {
  margin-right: var(--space-3);
}

.empty {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-2);
}

.empty > * + * {
  margin-top: var(--space-2);
}

.empty .empty-title {
  font-weight: 700;
}

ol.attention, ol.steps {
  display: grid;
  gap: var(--space-3);
  padding: 0;
  list-style: none;
}

ol.steps > li {
  padding: var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-1);
}

ol.steps > li > * + * {
  margin-top: var(--space-2);
}

/* The needs-attention list is a compact ranked list (A-13), not a card stack: no shadow, tighter
 * padding, a rank badge then the link on one line, the rest of the item below. */
ol.attention > li {
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
  box-shadow: none;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-1) var(--space-4);
  align-items: center;
}

ol.attention > li > * + * {
  margin-top: 0;
}

ol.attention > li > details {
  grid-column: 1 / -1;
}

.rank {
  display: inline-block;
  padding: 0 var(--space-2);
  color: var(--color-accent);
  font-weight: 700;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-1);
}

.attention-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-2) var(--space-3);
}

.attention-head a {
  font-weight: 700;
}

ol.steps {
  counter-reset: step;
  gap: var(--space-4);
}

ol.steps > li {
  counter-increment: step;
  border-left: 4px solid var(--color-border);
}

ol.steps h2 {
  font-size: var(--font-size-4);
}

ol.steps h2::before {
  content: counter(step) ". ";
  color: var(--color-muted);
}

ol.steps li.step-done {
  border-left: 4px solid var(--color-verdict-success);
}

ol.steps li.step-done h2 {
  color: var(--color-muted);
}

ol.steps li.step-current {
  border-left: 4px solid var(--color-accent);
  font-weight: 700;
}

ol.steps li.step-next {
  border-left: 4px solid var(--color-border);
}

.step-state {
  color: var(--color-muted);
  font-size: var(--font-size-2);
}

.step-current .step-state {
  color: var(--color-accent);
}

.build-note {
  color: var(--color-muted);
  font-size: var(--font-size-2);
  padding-top: var(--space-2);
  border-top: 1px dashed var(--color-border);
}

ul.finding-list {
  display: grid;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

ul.finding-list > li {
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
}

.scan-summary {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-1);
}

.scan-summary > * + * {
  margin-top: var(--space-2);
}

.scan-summary-text {
  max-width: 60rem;
  color: var(--color-ink);
  font-size: var(--font-size-4);
}

ol.finding-cards {
  display: grid;
  gap: var(--space-2);
  padding: 0;
  list-style: none;
}

.finding-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-border);
  border-radius: var(--radius-2);
}

.finding-critical { border-left-color: var(--color-sev-critical); }
.finding-high { border-left-color: var(--color-sev-high); }
.finding-medium { border-left-color: var(--color-sev-medium); }
.finding-low { border-left-color: var(--color-sev-low); }
.finding-info { border-left-color: var(--color-sev-info); }

.finding-card-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: var(--space-1) var(--space-2);
}

.rule-name {
  font-weight: 600;
}

.state {
  display: inline-flex;
  align-items: center;
  gap: 0.25em;
  color: var(--color-muted);
  font-size: var(--font-size-1);
}

.finding-card-loc {
  color: var(--color-muted);
  font-size: var(--font-size-2);
}

.finding-card-open a {
  display: inline-block;
  padding: var(--space-1) var(--space-4);
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-1);
  font-weight: 600;
  text-decoration: none;
}

.finding-card-open a:hover {
  text-decoration: underline;
}

/* The feedback queue's reports (A-16): one column of cards, each like a finding card, so nothing
 * can be wider than its own box at any width. */
.report-cards {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-3);
  padding: 0;
  list-style: none;
}

.report-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-1);
  min-width: 0;
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-border);
  border-radius: var(--radius-2);
}

.report-pending {
  border-left-color: var(--color-accent);
}

.report-head {
  font-weight: 600;
}

.report-meta, .report-effect {
  color: var(--color-muted);
  font-size: var(--font-size-2);
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.report-card code.path {
  overflow-wrap: normal;
  word-break: normal;
}

table.stored-data td[data-label="Table"] code {
  white-space: nowrap;
}

.scan-config summary {
  cursor: pointer;
  color: var(--color-accent);
  font-weight: 600;
}

.scan-config pre {
  margin-top: var(--space-2);
}

.plan-cards {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
}

.plan-card {
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-1);
}

.plan-card > * + * {
  margin-top: var(--space-2);
}

.plan-price {
  font-size: var(--font-size-4);
  font-weight: 700;
}

.plan-label, .plan-status {
  color: var(--color-muted);
  font-size: var(--font-size-2);
}

.plan-current {
  color: var(--color-accent);
  font-weight: 700;
}

.plan-includes {
  padding-left: var(--space-5);
}

.simulate {
  padding: var(--space-5);
  border: 1px dashed var(--color-border);
  border-radius: var(--radius-2);
}

.simulate select {
  max-width: 20rem;
}

/* Test strength chart (t29u): one SVG per width so its text stays near 12px; see TREND_LAYOUTS. */
svg.trend {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

svg.trend-wide {
  max-width: 44rem;
}

svg.trend-narrow {
  display: none;
  max-width: 24rem;
}

@media (max-width: 37.49rem) {
  svg.trend-wide {
    display: none;
  }

  svg.trend-narrow {
    display: block;
  }
}

.trend-line {
  stroke: var(--color-accent);
  fill: none;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.trend-grid {
  stroke: var(--color-border);
  stroke-opacity: 0.3;
  stroke-width: 1;
}

.trend-axis {
  stroke: var(--color-border);
  stroke-width: 1;
}

.trend-tick {
  fill: var(--color-muted);
  font-size: 12px;
}

.trend-axis-title {
  fill: var(--color-muted);
  font-size: 12px;
  font-weight: 600;
}

.trend-point {
  fill: var(--color-accent);
  stroke: var(--color-surface);
  stroke-width: 2;
}

.trend-value {
  fill: var(--color-ink);
  font-size: 13px;
  font-weight: 700;
  paint-order: stroke;
  stroke: var(--color-bg);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.hero {
  display: grid;
  gap: var(--space-6);
  padding-block: var(--space-6) var(--space-7);
}

.hero > * + * {
  margin-top: 0;
}

.hero h1 {
  font-size: var(--font-size-6);
  letter-spacing: -0.02em;
}

.hero-text > * + * {
  margin-top: var(--space-4);
}

.hero-actions, .actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  align-items: center;
}

a.button-secondary {
  display: inline-block;
  font-size: var(--font-size-2);
  font-weight: 600;
  line-height: var(--line-height);
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface);
  color: var(--color-accent);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-1);
  text-decoration: none;
}

a.button-secondary:hover {
  text-decoration: underline;
}

.hero-note {
  color: var(--color-muted);
  font-size: var(--font-size-2);
}

.example-card {
  min-width: 0;
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
  box-shadow: var(--shadow-1);
}

.example-card h2 {
  font-size: var(--font-size-4);
}

.example-card h3 {
  font-size: var(--font-size-3);
  font-weight: 700;
}

.example-label {
  color: var(--color-accent);
  font-size: var(--font-size-1);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

pre.diff-excerpt {
  overflow-x: auto;
  padding: var(--space-2) 0;
  background: var(--color-surface);
}

pre.diff-excerpt code {
  display: block;
  width: max-content;
  min-width: 100%;
}

.diff-excerpt .diff-line {
  display: block;
  padding: 0 var(--space-4);
}

.diff-excerpt .diff-del {
  background: var(--color-diff-del);
}

.diff-excerpt .diff-add {
  background: var(--color-diff-add);
}

figure.evidence pre,
figure.evidence pre code {
  font-size: var(--font-size-3);
}

.diff-line .mark, .diff-line .op {
  display: inline-block;
  min-width: 2ch;
}

.diff-line .ln {
  display: inline-block;
  min-width: 4ch;
  margin-right: 1ch;
  text-align: right;
  color: var(--color-muted);
}

.diff-finding {
  font-weight: 700;
}

details.full-diff summary, details.more summary {
  cursor: pointer;
  color: var(--color-accent);
  font-weight: 600;
}

details.full-diff > * + *, details.more > * + * {
  margin-top: var(--space-2);
}

/* Landing "Built for reviewers and engineering leads" (A-08): two cards, stacked on a phone and
 * side by side from 48rem; the leads card's product visual holds the labelled synthetic overview. */
.value-split {
  display: grid;
  gap: var(--space-5);
  align-items: start;
}

.value-card {
  min-width: 0;
  padding: var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
}

.value-card > * + * {
  margin-top: var(--space-3);
}

.tiles {
  display: grid;
  gap: var(--space-3);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 9rem), 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

/* q031 C-1: each /security "Kept for" cell leads with its short period in bold; the detail sits on
 * its own line, smaller and muted, so the column scans at 375px. */
.kept-period {
  font-weight: 600;
}

.kept-detail {
  display: block;
  margin-top: var(--space-1);
  color: var(--color-muted);
  font-size: var(--font-size-2);
}

/* q028 P-1, q029 P-2: the overview/org summary is a size container so a last tile that would sit
 * alone in its row spans the row. The .tiles grid (9rem columns, 0.75rem gap) has k columns from
 * k*9 + (k-1)*0.75 rem: 2 from 18.75, 3 from 28.5, 4 from 38.25, 5 from 48 (all five tiles in one
 * row). CSS cannot read an auto-fit grid's column count, and spanning to line -1 would un-collapse
 * its empty tracks, so each column range has its own rule. */
.value-summary {
  container-type: inline-size;
}

@container (18.75rem <= width < 28.5rem) {
  .value-summary .tiles > :last-child:nth-child(2n+1) {
    grid-column: 1 / -1;
  }
}

@container (28.5rem <= width < 38.25rem) {
  .value-summary .tiles > :last-child:nth-child(3n+1) {
    grid-column: 1 / -1;
  }
}

@container (38.25rem <= width < 48rem) {
  .value-summary .tiles > :last-child:nth-child(4n+1) {
    grid-column: 1 / -1;
  }
}

.value-card .tiles {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tile {
  display: grid;
  gap: var(--space-1);
  padding: var(--space-3) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
}

.tile-value {
  font-size: var(--font-size-5);
  font-weight: 700;
  color: var(--color-ink);
}

.tile-label {
  color: var(--color-muted);
  font-size: var(--font-size-2);
}

.product-visual {
  min-width: 0;
}

.product-visual > * + * {
  margin-top: var(--space-3);
}

ol.visual-list {
  padding-left: var(--space-5);
  font-size: var(--font-size-2);
}

ol.visual-list > li + li {
  margin-top: var(--space-1);
}

#how-it-works ol {
  display: grid;
  gap: var(--space-4);
  padding: 0;
  list-style: none;
  counter-reset: how;
}

#how-it-works li {
  counter-increment: how;
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
}

#how-it-works li::before {
  content: counter(how) ".";
  display: block;
  color: var(--color-accent);
  font-size: var(--font-size-4);
  font-weight: 700;
}

.how-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--color-accent);
  background: var(--color-subtle);
  border-radius: 50%;
}

#how-it-works li h3 {
  font-size: var(--font-size-4);
}

.end-cta {
  padding: var(--space-6);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
}

.end-cta > * + * {
  margin-top: var(--space-3);
}

/* Landing "What it checks" (t39u): five check-group cards, 3 across on desktop, 1 on a phone.
 * q026 L-1: 20rem (320px) alone exceeded the 288px content box at a 320px viewport (page 336px);
 * minmax(min(100%, 20rem), 1fr) caps the card at 100% there instead. */
ul.check-families {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 20rem), 1fr));
  margin: var(--space-4) 0 0;
  padding: 0;
  list-style: none;
}

.check-family {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
}

.check-family-head {
  display: flex;
  gap: var(--space-3);
  align-items: center;
}

.check-family h3 {
  margin: 0;
  font-size: var(--font-size-3);
}

.check-icon {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  color: var(--color-accent);
  background: var(--color-subtle);
  border-radius: 50%;
}

ul.check-names {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

ul.check-names li {
  padding: 0 var(--space-2);
  font-size: var(--font-size-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-1);
}

pre.check-diff {
  padding: var(--space-2) 0;
  font-size: var(--font-size-1);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

pre.check-diff .diff-line {
  display: block;
  padding: 0 var(--space-3);
}

pre.check-diff .diff-del {
  background: var(--color-diff-del);
}

pre.check-diff .diff-add {
  background: var(--color-diff-add);
}

ul.rule-ids {
  margin: var(--space-2) 0 0;
  padding: 0;
  font-size: var(--font-size-1);
  list-style: none;
}

/* Support matrix (t39u, t42u): pill badges that differ in fill, border and icon as well as color;
 * the word is always there. Full: solid accent; Limited: tinted with an accent border; Not supported:
 * dashed outline in muted ink. All text pairs meet WCAG AA (>= 4.5:1). */
ul.support-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-5);
  margin: var(--space-3) 0 var(--space-4);
  padding: 0;
  color: var(--color-muted);
  font-size: var(--font-size-2);
  list-style: none;
}

ul.support-legend li {
  display: flex;
  gap: var(--space-2);
  align-items: center;
}

.badge {
  display: inline-flex;
  gap: 0.3rem;
  align-items: center;
  min-height: 1.75rem;
  padding: 0 0.625rem;
  font-size: var(--font-size-2);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  border: 1.5px solid;
  border-radius: 999px;
}

a.badge:hover {
  text-decoration: underline;
}

.badge-icon {
  flex: none;
  width: 1em;
  height: 1em;
}

.badge-full {
  color: var(--color-accent-ink);
  background: var(--color-accent);
  border-color: var(--color-accent);
}

.badge-limited {
  color: var(--color-accent);
  background: var(--color-subtle);
  border-color: var(--color-accent);
}

.badge-none {
  color: var(--color-muted);
  background: transparent;
  border-style: dashed;
  border-color: var(--color-border);
}

.badge .note-n {
  padding-left: 0.3rem;
  font-size: var(--font-size-1);
  font-weight: 700;
  border-left: 1px solid currentColor;
}

.badge .word-short {
  display: none;
}

td.support-check {
  font-weight: 600;
}

/* 11-12 (D-139 amended): seven language columns no longer fit the matrix at 1280 with the
 * table's default padding; the Check column wraps within a sensible max-width and desktop cell
 * and badge padding tighten a little so table.stack.support-matrix fits its .table-scroll region
 * with no inner horizontal scroll. The phone rules below use the same specificity so they win
 * there (quick 019). */
table.stack.support-matrix th, table.stack.support-matrix td {
  padding: var(--space-2) 0.4375rem;
}

table.stack.support-matrix td.support-check {
  max-width: 10rem;
  white-space: normal;
}

table.stack.support-matrix .badge {
  padding: 0 0.5rem;
  gap: 0.25rem;
}

details.rule-ids-table, details.syntax {
  margin-top: var(--space-3);
}

details.rule-ids-table table, details.syntax table {
  margin-top: var(--space-2);
  font-size: var(--font-size-2);
}

/* t42u follow-up: a quiet up-arrow return link at the end of each note; 24px target, muted until
 * hovered or focused (the focus ring is the shared a:focus-visible rule). */
a.note-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  margin-left: var(--space-1);
  color: var(--color-muted);
  vertical-align: middle;
  border-radius: var(--radius-1);
}

a.note-back:hover {
  color: var(--color-accent);
  background: var(--color-subtle);
}

.check-family-foot {
  /* t42u follow-up: the example and Rule details sit at the bottom of every card in a row */
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: auto;
}

/* t42u: one row per language under "Limits by language"; closed by default. */
.lang-limits {
  margin-top: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-2);
}

.lang-limits > summary {
  display: flex;
  gap: var(--space-3);
  align-items: baseline;
  min-height: 1.75rem;
  color: var(--color-accent);
  cursor: pointer;
  list-style: none;
}

.lang-limits > summary::-webkit-details-marker {
  display: none;
}

.lang-limits > summary::before {
  content: "▸";
  color: var(--color-accent);
}

details.lang-limits[open] > summary::before {
  content: "▾";
}

.limits .lang-limits h3 {
  display: inline;
  margin: 0;
  font-size: var(--font-size-3);
}

.lang-limits-none {
  display: flex;
  gap: var(--space-3);
  align-items: baseline;
}

.lang-count {
  color: var(--color-muted);
  font-size: var(--font-size-2);
}

details.lang-limits[open] > summary {
  margin-bottom: var(--space-2);
}

table.syntax-table th[scope="row"] {
  white-space: nowrap;
}

h2.matrix-head {
  margin-top: var(--space-6);
}

ul.check-families + .actions {
  margin-top: var(--space-4);
}

td .rule-details summary {
  font-size: var(--font-size-1);
}

ol.limit-notes, ul.limit-notes {
  padding-left: var(--space-5);
}

ol.limit-notes > li + li, ul.limit-notes > li + li {
  margin-top: var(--space-2);
}

ol.limit-notes > li:target {
  background: var(--color-banner);
}

.limits h3 {
  margin-top: var(--space-4);
}

a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible, summary:focus-visible, .table-scroll:focus-visible, pre:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 2px;
}

@media (max-width: 37.49rem) {
  /* q025 R3-1: on phones each fact is a label above its value, full width. */
  dl.facts {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  dl.facts dd + dt {
    margin-top: var(--space-2);
  }

  nav[aria-label="Primary"] {
    /* t37u: 13px on phones so the five links, the current one in bold, fit one 343px row. */
    font-size: var(--font-size-1);
  }

  /* quick 020: on phones each syntax note is one full-width block, the term as a small bold
   * label above its explanation; the column headers stay for screen readers only. */
  table.syntax-table, table.syntax-table tbody, table.syntax-table tr {
    display: block;
  }

  table.syntax-table thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  table.syntax-table tr {
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-border);
  }

  table.syntax-table th[scope="row"], table.syntax-table td {
    display: block;
    padding: 0 var(--space-3);
    border: 0;
    white-space: normal;
    overflow-wrap: anywhere;
    text-align: left;
  }

  table.syntax-table th[scope="row"] {
    font-size: var(--font-size-1);
    font-weight: 700;
  }

  /* t42u: on phones a check is one compact card: its name, then an aligned 2x2 grid of language
   * cells; every cell is the same fixed label column + badge column, so badges line up vertically
   * across all cards; no repeated "Check" label. */
  table.stack.support-matrix tbody tr {
    /* quick 019: 0.25rem side padding and column gap so a 2-digit "Limited | NN" badge fits
     * beside the widest label (Gherkin) in a 375px card */
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: var(--space-1) 0.25rem;
    align-items: center;
    padding: var(--space-2) 0.25rem var(--space-3);
  }

  table.stack.support-matrix td {
    padding: 0;
  }

  table.stack.support-matrix td.support-check {
    grid-column: 1 / -1;
    max-width: none;
  }

  table.stack.support-matrix td.support-check::before {
    display: none;
  }

  table.stack.support-matrix td.support {
    display: grid;
    grid-template-columns: 3.3rem minmax(0, 1fr);
    gap: var(--space-1);
    align-items: center;
    justify-items: start;
  }

  table.stack.support-matrix td.support::before {
    display: block;
    color: var(--color-muted);
    font-size: var(--font-size-1);
    font-weight: 400;
    line-height: 1.2;
    white-space: nowrap;
  }

  table.stack.support-matrix .badge, .support-legend .badge {
    /* quick 019: as specific as the desktop rule above, so the phone padding really applies */
    gap: 0.15rem;
    min-height: 1.5rem;
    padding: 0 0.3rem;
    font-size: var(--font-size-1);
  }

  table.stack.support-matrix .badge .note-n {
    padding-left: 0.15rem;
  }

  .support-matrix .badge .word-long, .support-legend .badge .word-long {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  .support-matrix .badge .word-short, .support-legend .badge .word-short {
    display: inline;
  }

  /* the legend as an aligned list: a fixed badge column, then the meaning */
  ul.support-legend {
    display: grid;
    gap: var(--space-2);
  }

  ul.support-legend li {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: var(--space-2);
    align-items: center;
    justify-items: start;
  }

  ul.check-names li {
    /* t42u: larger check tags on phones */
    padding: 0.125rem var(--space-2);
    font-size: var(--font-size-2);
  }

  table.stack thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }

  table.stack, table.stack tbody {
    display: block;
  }

  table.stack tr {
    display: block;
    padding: var(--space-3);
    border-bottom: 1px solid var(--color-border);
  }

  table.stack td {
    display: block;
    padding: var(--space-1) 0;
    border: 0;
    overflow-wrap: anywhere;
    text-align: left;
  }

  table.stack td:first-child {
    font-weight: 600;
  }

  td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    display: block;
  }

  table.stack td.num {
    display: inline-block;
    margin-right: var(--space-4);
  }

  table.stack td.num[data-label]::before {
    display: inline;
    margin-right: var(--space-1);
  }
}

@media (min-width: 48rem) {
  .site-header, nav[aria-label="Primary"] {
    padding-inline: max(var(--space-6), calc((100% - 80rem) / 2 + var(--space-6)));
  }

  nav[aria-label="Primary"] ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0 var(--space-5);
  }

  .site-nav {
    /* q024 R2-3: the 1280 header is unchanged — the six-link inline nav shows again and the
     * phone Menu disclosure (with its own standalone Sign in link) is hidden, since Sign in
     * already sits inside .site-nav here. */
    display: block;
    flex: 0 1 auto;
  }

  .site-menu, .site-header > a.nav-signin {
    display: none;
  }

  .site-header:has(> .site-menu) {
    padding-block: var(--space-3);
  }

  .site-nav ul {
    display: flex;
    flex-wrap: wrap;
    gap: 0 var(--space-5);
  }

  main {
    padding: var(--space-6);
  }

  .site-footer {
    padding: var(--space-5) var(--space-6);
  }

  #how-it-works ol {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .value-split {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .finding-card {
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: var(--space-5);
  }

  .finding-card-open {
    grid-column: 2;
    grid-row: 1 / span 4;
    align-self: center;
  }

  ol.attention > li {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  ol.attention > li > .actions {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}

@media (min-width: 60rem) {
  .hero {
    grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
    gap: var(--space-7);
    align-items: center;
  }

  .hero h1 {
    font-size: var(--font-size-7);
  }
}
