/* Stylesheet of the ml-rust catalogue. One file, no build step. */

:root {
  color-scheme: light dark;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SFMono-Regular", "Cascadia Mono", "Roboto Mono", Menlo, Consolas, monospace;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 24px;
  --space-6: 32px;
  --space-7: 48px;
  --radius-s: 6px;
  --radius-m: 8px;
  --radius-l: 12px;
  --target: 44px;
  --page: 1200px;
  --measure: 72ch;
  --gutter: var(--space-5);
  --sticky-head: 41px;

  /* Light pairs. Every text colour reaches 4.5:1 on every background it meets. */
  --canvas: #f3f4f7;
  --surface: #fcfcfe;
  --ink: #24283a;
  --secondary: #4e5566;
  --quiet: #646b7c;
  --accent: #5e50b0;
  --on-accent: #ffffff;
  --border: #d9dce5;
  --border-strong: #b6bbc9;
  --coral: #ce8166;
  --wash: #eceef3;

  /* Tier badges. Each badge also prints its tier name. */
  --tier-featured-bg: #e9e6f8;
  --tier-featured-text: #44398f;
  --tier-listed-bg: #e7e9ef;
  --tier-listed-text: #3a4052;
  --tier-new-bg: #dfedf8;
  --tier-new-text: #1d4e78;
  --tier-archived-bg: #f8e8e1;
  --tier-archived-text: #7a3a22;
}

@media (prefers-color-scheme: dark) {
  :root {
    --canvas: #1b1e28;
    --surface: #222633;
    --ink: #e8eaf1;
    --secondary: #adb5c7;
    --quiet: #9098ab;
    --accent: #b7a7f2;
    --on-accent: #1b1e28;
    --border: #3b4355;
    --border-strong: #566077;
    --coral: #e6a18c;
    --wash: #2a2f3e;

    --tier-featured-bg: #39345e;
    --tier-featured-text: #d9d0fa;
    --tier-listed-bg: #333949;
    --tier-listed-text: #d6dae6;
    --tier-new-bg: #223b50;
    --tier-new-text: #bcd9f2;
    --tier-archived-bg: #4a2f28;
    --tier-archived-text: #f2c3b3;
  }
}

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

[hidden] {
  display: none !important;
}

html {
  font-family: var(--font-body);
  font-size: 100%;
  line-height: 1.5;
  background: var(--canvas);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: var(--space-4);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-size: 1rem;
  line-height: 1.5rem;
}

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--space-6) var(--gutter) var(--space-7);
}

h1,
h2,
h3 {
  color: var(--ink);
  margin: 0;
}

h1 {
  font-size: 2.25rem;
  line-height: 2.75rem;
  font-weight: 600;
}

h2 {
  font-size: 1.3125rem;
  line-height: 1.75rem;
  font-weight: 500;
}

h3 {
  font-size: 1rem;
  line-height: 1.5rem;
  font-weight: 600;
}

p,
ul,
ol,
dl {
  margin: 0 0 var(--space-4);
}

code {
  font-family: var(--font-mono);
  font-size: 0.875em;
  overflow-wrap: anywhere;
}

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

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

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

main:focus {
  outline: none;
}

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

.icon {
  display: inline-flex;
  flex: none;
  width: 1.25em;
  height: 1.25em;
}

.icon svg,
.tile-icon svg,
.page-icon svg,
.logo svg {
  display: block;
  width: 100%;
  height: 100%;
}

/* Skip link: hidden until it takes focus. */
.skip-link {
  position: absolute;
  left: var(--space-4);
  top: -100%;
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  color: var(--accent);
  border: 2px solid var(--accent);
  border-radius: var(--radius-s);
  z-index: 20;
}

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

/* Header. */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.site-header-inner {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  max-width: calc(var(--page) + 2 * var(--gutter));
  min-height: 64px;
  margin: 0 auto;
  padding: var(--space-2) var(--gutter);
}

.site-name {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--target);
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.logo {
  display: block;
  width: 26px;
  height: 26px;
}

.logo .logo-accent,
.page-icon-logo .logo-accent {
  fill: var(--coral);
}

.page-icon-logo {
  color: var(--ink);
}

.site-name-main {
  font-size: 1.125rem;
  font-weight: 600;
}

.site-name-sub {
  color: var(--secondary);
  font-size: 1.125rem;
}

.site-search,
.hero-search,
.search-box {
  display: flex;
  gap: var(--space-2);
  margin: 0;
}

.site-search {
  flex: 1 1 auto;
  max-width: 480px;
}

.search-field {
  position: relative;
  display: flex;
  align-items: center;
  flex: 1 1 auto;
  min-width: 0;
}

.search-field .icon {
  position: absolute;
  left: var(--space-3);
  color: var(--secondary);
  pointer-events: none;
}

input[type="search"] {
  width: 100%;
  min-height: var(--target);
  padding: 0 var(--space-3) 0 40px;
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
}

input[type="search"]::placeholder {
  color: var(--quiet);
  opacity: 1;
}

input[type="search"]:focus-visible {
  outline-offset: 0;
  border-color: var(--accent);
}

button[type="submit"] {
  flex: none;
  min-height: var(--target);
  padding: 0 var(--space-4);
  font: inherit;
  font-weight: 500;
  color: var(--on-accent);
  background: var(--accent);
  border: 1px solid var(--accent);
  border-radius: var(--radius-s);
  cursor: pointer;
}

.site-search-link {
  display: none;
}

.site-nav {
  margin-left: auto;
}

.site-nav ul {
  display: flex;
  align-items: center;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav a,
.site-menu a {
  display: flex;
  align-items: center;
  min-height: var(--target);
  padding: 0 var(--space-3);
  color: var(--secondary);
  text-decoration: none;
  white-space: nowrap;
  border-radius: var(--radius-s);
}

.site-nav a:hover,
.site-menu a:hover {
  color: var(--ink);
  background: var(--wash);
}

.site-nav a[aria-current="page"],
.site-menu a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 0 -2px 0 var(--accent);
  border-radius: var(--radius-s) var(--radius-s) 0 0;
}

.site-nav li:last-child {
  margin-left: var(--space-2);
}

.site-nav li:last-child a {
  color: var(--accent);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  box-shadow: none;
}

.site-menu {
  display: none;
  margin-left: auto;
  position: relative;
}

.site-menu summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--target);
  padding: 0 var(--space-3);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  cursor: pointer;
  list-style: none;
}

.site-menu summary::-webkit-details-marker,
.tier-help summary::-webkit-details-marker,
.filter summary::-webkit-details-marker {
  display: none;
}

.site-menu nav {
  position: absolute;
  right: 0;
  top: calc(100% + var(--space-2));
  z-index: 10;
  min-width: 200px;
  padding: var(--space-2);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-m);
}

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

/* Footer. */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.site-footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-5);
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--space-5) var(--gutter);
}

.site-footer p,
.site-footer ul {
  margin: 0;
}

.site-footer-name {
  color: var(--ink);
  font-weight: 600;
}

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

.site-footer a {
  color: var(--secondary);
}

.site-footer-links a {
  display: inline-block;
  padding-block: var(--space-1);
  text-decoration: none;
}

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

.site-footer-licenses {
  margin-left: auto !important;
}

/* Home. */
.hero {
  margin-bottom: var(--space-7);
}

.hero h1 {
  margin-bottom: var(--space-2);
}

.hero-statement {
  margin-bottom: var(--space-5);
  color: var(--secondary);
}

.hero-search {
  max-width: 760px;
  margin-bottom: var(--space-3);
}

.hero-search input[type="search"],
.hero-search button[type="submit"],
.search-box input[type="search"],
.search-box button[type="submit"] {
  min-height: 52px;
}

.hero-search button[type="submit"],
.search-box button[type="submit"] {
  padding: 0 var(--space-5);
}

.examples {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
  margin-bottom: var(--space-3);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.examples-label {
  color: var(--secondary);
}

.examples a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  text-decoration: none;
}

.examples a:hover {
  border-color: var(--accent);
}

.hero-meta,
.change-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-4);
  margin: 0;
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.change-line {
  gap: var(--space-1);
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}

.hero-meta a,
.more-link a,
.change-line a:last-child {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.change-line a:last-child {
  margin-left: var(--space-2);
}

section {
  margin-bottom: var(--space-7);
}

section > h2 {
  margin-bottom: var(--space-4);
}

.section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
  margin-bottom: var(--space-3);
}

.section-head h2 {
  margin: 0;
}

.order-note {
  margin: 0;
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.stat-link {
  color: var(--secondary);
}

.compare-note {
  margin: var(--space-3) 0 0;
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.sources-list {
  margin: var(--space-2) 0 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

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

.more-link {
  margin: var(--space-3) 0 0;
}

/* Tiles: a whole-tile link for a job or a category. */
.tiles {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tiles-jobs {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.tiles-categories {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.tile-item {
  display: flex;
  flex-direction: column;
}

.tile {
  flex: 1 0 auto;
  display: flex;
  gap: var(--space-3);
  padding: var(--space-4);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  text-decoration: none;
}

.tile:hover {
  border-color: var(--accent);
}

.tile-small {
  align-items: center;
  min-height: var(--target);
  padding: var(--space-2) var(--space-3);
}

.tile-icon {
  flex: none;
  width: 28px;
  height: 28px;
  color: var(--coral);
}

.tile-small .tile-icon {
  width: 22px;
  height: 22px;
}

.tile-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

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

.tile:hover .tile-name {
  color: var(--accent);
}

.tile-small .tile-name {
  font-weight: 500;
  font-size: 0.9375rem;
  line-height: 1.25rem;
}

.tile-meta,
.tile-top {
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.subtopics,
.sources {
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
  overflow-wrap: anywhere;
}

.tile-summary {
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.tile-item .subtopics,
.tile-item .sources,
.tile-item .tile-summary {
  margin: var(--space-1) 0 0;
}

/* The ML Rust projects: the name is the link, and its hit area covers the tile. */
.tiles-showcase {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.tile-showcase {
  position: relative;
  padding: var(--space-3);
}

.tile-showcase .tile-name {
  color: var(--accent);
  text-decoration: none;
}

.tile-showcase .tile-name::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: var(--radius-m);
}

.tile-showcase:hover .tile-name {
  text-decoration: underline;
}

.showcase-text {
  display: -webkit-box;
  margin: var(--space-1) 0 0;
  overflow: hidden;
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
}

/* The top of a list page. */
.back-link {
  margin: 0 0 var(--space-3);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.back-link a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 24px;
  text-decoration: none;
}

.back-link a:hover {
  text-decoration: underline;
}

.page-title {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-2);
}

.page-icon {
  flex: none;
  width: 36px;
  height: 36px;
  color: var(--coral);
}

.lede {
  max-width: var(--measure);
  margin-bottom: var(--space-4);
  color: var(--secondary);
}

h1 + .lede {
  margin-top: var(--space-2);
}

.list-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-5);
  margin-bottom: var(--space-5);
}

.list-count {
  margin: 0;
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.list-count strong {
  color: var(--ink);
  font-weight: 600;
}

.tier-jumps {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.tier-jumps a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: 32px;
  padding: 0 var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  text-decoration: none;
}

.tier-jumps a:hover {
  border-color: var(--accent);
}

.tier-jump-count {
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}

/* Start here: the first Featured rows, one step above the list. */
.start-here {
  margin-bottom: var(--space-6);
}

.start-here h2 {
  display: inline;
  margin: 0 var(--space-2) 0 0;
  font-size: 1.3125rem;
}

.start-note {
  display: inline;
  color: var(--secondary);
  font-size: 0.875rem;
}

.start-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-3);
  margin: var(--space-3) 0 0;
  padding: 0;
  list-style: none;
}

.start-card {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: var(--radius-m);
}

.start-card p {
  margin: 0;
}

.start-name {
  font-size: 1.125rem;
  line-height: 1.625rem;
  font-weight: 600;
}

.start-name:not(:hover) {
  text-decoration: none;
}

.start-description {
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
  overflow-wrap: anywhere;
}

.start-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-3);
  margin-top: auto !important;
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

/* The comparison table of every list. Below the wide layout it stacks into open rows. */
.rows {
  width: 100%;
  margin: 0;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.rows thead th {
  position: sticky;
  top: 0;
  z-index: 3;
  padding: 10px var(--space-3);
  background: var(--wash);
  border-bottom: 1px solid var(--border);
  color: var(--secondary);
  font-weight: 500;
  text-align: left;
  vertical-align: bottom;
}

.rows thead th:first-child {
  padding-left: var(--space-4);
  border-top-left-radius: var(--radius-l);
}

.rows thead th:last-child {
  border-top-right-radius: var(--radius-l);
}

.col-downloads {
  width: 112px;
}

.col-dependents {
  width: 108px;
}

.col-stars {
  width: 92px;
}

.col-release {
  width: 136px;
}

.col-gpu {
  width: 136px;
}

.col-native {
  width: 112px;
}

.col-license {
  width: 128px;
}

/* The latest release: the version, with its date beneath it. */
.release-version,
.release-date {
  display: block;
  overflow-wrap: anywhere;
}

.release-version + .release-date {
  color: var(--secondary);
  font-size: 0.8125rem;
  line-height: 1.125rem;
}

.rows .rows-group th {
  position: sticky;
  top: var(--sticky-head);
  z-index: 2;
  padding: var(--space-2) var(--space-4);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  color: var(--ink);
  font-weight: 600;
  text-align: left;
  scroll-margin-top: 48px;
}

.rows tbody + tbody .rows-group th {
  border-top: 1px solid var(--border);
}

.rows-group {
  scroll-margin-top: 48px;
}

.rows-group-title {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: 1rem;
  line-height: 1.5rem;
  vertical-align: middle;
}

.rows-group-title .icon {
  color: var(--coral);
}

.rows-group-count {
  margin-left: var(--space-2);
  vertical-align: middle;
  color: var(--secondary);
  font-weight: 400;
}

.entry-row th,
.entry-row td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border);
  font-weight: 400;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.entry-row th {
  padding-left: var(--space-4);
}

.rows tbody:last-of-type .entry-row:last-child th,
.rows tbody:last-of-type .entry-row:last-child td {
  border-bottom: 0;
}

.entry-row:hover th,
.entry-row:hover td {
  background: color-mix(in srgb, var(--wash) 50%, transparent);
}

.entry-row td {
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  padding-top: 15px;
}

.row-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-1) var(--space-2);
}

.row-name {
  font-size: 1.125rem;
  line-height: 1.625rem;
  font-weight: 600;
}

.row-name:not(:hover) {
  text-decoration: none;
}

.row-description {
  margin: 0;
  max-width: 64ch;
  color: var(--secondary);
}

.row-features,
.row-related {
  margin: var(--space-1) 0 0;
}

.fact-quiet {
  color: var(--quiet);
}

.row-tag {
  display: inline-block;
  padding: 0 var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  color: var(--secondary);
  font-size: 0.8125rem;
  line-height: 1.25rem;
  white-space: nowrap;
}

.row-tag-notice {
  border-color: var(--coral);
  color: var(--ink);
}

/* A grouped list prints the tier once, above its rows. A mixed list prints it on each row. */
.rows:not(.rows-mixed) .entry-row .tier-badge {
  display: none;
}

/* Tier badges carry their tier name as text. Colour only repeats it. */
.tier-badge {
  display: inline-block;
  padding: 0 var(--space-2);
  border-radius: var(--radius-s);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25rem;
  white-space: nowrap;
}

.tier-badge.tier-featured {
  background: var(--tier-featured-bg);
  color: var(--tier-featured-text);
}

.tier-badge.tier-listed {
  background: var(--tier-listed-bg);
  color: var(--tier-listed-text);
}

.tier-badge.tier-new {
  background: var(--tier-new-bg);
  color: var(--tier-new-text);
}

.tier-badge.tier-archived {
  background: var(--tier-archived-bg);
  color: var(--tier-archived-text);
}

/* The tier disclosure. */
.tier-help {
  margin-bottom: var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
}

.tier-help summary {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--target);
  padding: var(--space-2) var(--space-4);
  font-weight: 500;
  cursor: pointer;
  list-style: none;
}

.tier-help summary .icon {
  color: var(--secondary);
}

.tier-help[open] summary .icon {
  transform: rotate(90deg);
}

.tier-help > :not(summary) {
  margin-inline: var(--space-4);
  max-width: var(--measure);
}

.tier-help > :last-child {
  margin-bottom: var(--space-4);
}

.tier-help p {
  color: var(--secondary);
}

.tier-list {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: var(--space-1) var(--space-4);
}

.tier-list dt {
  font-weight: 600;
}

.tier-list dd {
  margin: 0;
  color: var(--secondary);
}

/* Search page. */
.page-wide > h1 {
  margin-bottom: var(--space-4);
}

.search-form {
  margin-bottom: var(--space-4);
}

.search-box {
  max-width: 760px;
  margin-bottom: var(--space-3);
}

.search-filters {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.filters-toggle {
  display: none;
}

.filters-all summary::-webkit-details-marker {
  display: none;
}

.filters-label {
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.filter summary {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  min-height: var(--target);
  padding: 0 var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.25rem;
  cursor: pointer;
  list-style: none;
}

.filter[open] summary {
  border-color: var(--accent);
  color: var(--accent);
}

.filter summary .icon {
  width: 16px;
  height: 16px;
  color: var(--secondary);
}

.filter[open] summary .icon {
  transform: rotate(180deg);
}

.filter-selected {
  font-weight: 600;
  color: var(--accent);
}

.filter-selected:not(:empty)::before {
  content: "\00b7\00a0";
}

.search-filter {
  position: absolute;
  z-index: 5;
  top: calc(100% + var(--space-1));
  left: 0;
  width: min(420px, 100%);
  max-height: 340px;
  margin: 0;
  padding: var(--space-2);
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-m);
  box-shadow: 0 8px 24px rgb(20 22 34 / 0.16);
}

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

.search-filter ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.search-filter li {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--target);
  padding: 0 var(--space-2);
  border-radius: var(--radius-s);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.search-filter li:hover {
  background: var(--wash);
}

.search-filter li.facet-none label,
.search-filter li.facet-none .facet-count {
  color: var(--quiet);
}

.search-filter input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.search-filter label {
  flex: 1 1 auto;
  padding-block: var(--space-2);
  cursor: pointer;
}

.facet-count {
  color: var(--secondary);
  font-variant-numeric: tabular-nums;
}

.filter-clear,
.link-button {
  padding: 0;
  font: inherit;
  color: var(--accent);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

.filter-clear {
  min-height: var(--target);
  padding: 0 var(--space-2);
  font-size: 0.875rem;
}

.results-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
  margin-bottom: var(--space-3);
}

.search-status {
  margin: 0;
  color: var(--secondary);
}

.search-status:empty {
  display: none;
}

.search-panel {
  margin-top: var(--space-3);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
}

.search-panel h2 {
  margin-bottom: var(--space-3);
}

.search-panel h3 {
  margin: var(--space-5) 0 var(--space-3);
}

.search-panel .tile {
  background: var(--canvas);
}

.recovery {
  margin-bottom: var(--space-4);
  padding-left: var(--space-5);
  color: var(--secondary);
}

#search-none-query {
  overflow-wrap: anywhere;
}

/* The project page. */
.panel {
  margin: 0 0 var(--space-4);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
}

.panel > :last-child {
  margin-bottom: 0;
}

.panel h2 {
  margin-bottom: var(--space-3);
}

.panel h3 {
  margin: var(--space-4) 0 var(--space-2);
}

.panel .section-head h2 {
  margin: 0;
}

.panel-note {
  max-width: 880px;
  padding: var(--space-4);
  color: var(--secondary);
}

.project-head {
  margin-bottom: var(--space-4);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
}

.project-head > :last-child {
  margin-bottom: 0;
}

.project-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
  margin-bottom: var(--space-2);
}

.project-title h1 {
  overflow-wrap: anywhere;
}

.entry-facts {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
  margin: 0;
}

.entry-kind,
.entry-label,
.stable-label,
.entry-movement {
  display: inline-block;
  padding: 0 var(--space-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  color: var(--secondary);
  font-size: 0.8125rem;
  line-height: 1.25rem;
  white-space: nowrap;
}

.stable-label {
  border-color: var(--border-strong);
  color: var(--ink);
  font-weight: 600;
}

.project-description {
  max-width: var(--measure);
  margin-bottom: var(--space-1);
  font-size: 1.125rem;
  line-height: 1.625rem;
  overflow-wrap: anywhere;
}

.project-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0 var(--space-5);
}

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

.project-checked {
  margin: 0 0 0 auto;
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.stat-strip {
  display: flex;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  margin: var(--space-3) 0 0;
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.stat {
  min-width: 0;
}

.stat dt {
  color: var(--secondary);
  font-size: 0.8125rem;
  line-height: 1.125rem;
  white-space: nowrap;
}

.stat dd {
  margin: 0;
  white-space: nowrap;
}

.stat-value {
  font-size: 1rem;
  line-height: 1.375rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.stat-value.fact-quiet {
  font-weight: 400;
}

.banner {
  margin: var(--space-3) 0 0;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  color: var(--ink);
  border: 1px solid var(--border);
  border-left: 3px solid var(--border-strong);
  border-radius: var(--radius-m);
}

.banner-superseded {
  border-left-color: var(--coral);
  font-weight: 600;
}

.project-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  grid-template-areas: "main action";
  gap: var(--space-4);
  align-items: start;
}

.project-main {
  grid-area: main;
  min-width: 0;
}

.project-main > :last-child {
  margin-bottom: 0;
}

.project-action {
  grid-area: action;
  position: sticky;
  top: var(--space-4);
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
}

.project-action h2 {
  margin-bottom: var(--space-3);
  overflow-wrap: anywhere;
}

.project-action > :last-child {
  margin-bottom: 0;
}

.install-line {
  margin-bottom: var(--space-3);
  padding: var(--space-3);
  background: var(--wash);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  overflow-wrap: anywhere;
}

.install-line code {
  font-size: 0.9375rem;
}

.install-label {
  margin: var(--space-3) 0 var(--space-1);
  color: var(--secondary);
  font-size: 0.8125rem;
  line-height: 1.125rem;
}

.link-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.link-list li + li {
  border-top: 1px solid var(--border);
}

.link-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  padding-block: var(--space-2);
  text-decoration: none;
}

.link-row:hover .link-label {
  text-decoration: underline;
}

.link-label {
  flex: none;
  font-weight: 500;
}

.link-target {
  min-width: 0;
  overflow: hidden;
  color: var(--secondary);
  font-size: 0.8125rem;
  line-height: 1.25rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.readme {
  max-width: var(--measure);
  overflow-wrap: anywhere;
}

.readme > :first-child {
  margin-top: 0;
}

.readme > :last-child {
  margin-bottom: 0;
}

.readme h3,
.readme h4,
.readme h5 {
  margin: var(--space-4) 0 var(--space-2);
}

.readme h4,
.readme h5 {
  font-size: 1rem;
  line-height: 1.5rem;
}

.readme h5 {
  color: var(--secondary);
}

.readme p,
.readme ul,
.readme ol,
.readme blockquote,
.readme pre,
.readme .table-scroll {
  margin: 0 0 var(--space-3);
}

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

.readme li > p:last-child,
.readme li > ul:last-child,
.readme li > ol:last-child {
  margin-bottom: 0;
}

.readme blockquote {
  padding-left: var(--space-3);
  color: var(--secondary);
  border-left: 3px solid var(--border-strong);
}

.readme pre {
  max-width: 100%;
  padding: var(--space-3);
  overflow-x: auto;
  background: var(--wash);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  overflow-wrap: normal;
}

.readme pre code {
  padding: 0;
  background: none;
  font-size: 0.875rem;
  white-space: pre;
}

.readme img {
  max-width: 100%;
  height: auto;
}

.readme-panel > .readme > :first-child img {
  max-height: 6rem;
  width: auto;
}

.readme hr {
  margin: var(--space-4) 0;
  border: 0;
  border-top: 1px solid var(--border);
}

.readme table {
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.25rem;
  overflow-wrap: normal;
}

.readme th,
.readme td {
  padding: var(--space-1) var(--space-3);
  text-align: left;
  border: 1px solid var(--border);
}

.readme-panel > .disclosure {
  margin-top: var(--space-3);
  border-top: 1px solid var(--border);
}

.readme-note {
  margin: var(--space-3) 0 0;
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

#tier h3 {
  margin: var(--space-4) 0 var(--space-2);
}

.button {
  display: inline-flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: center;
  min-height: var(--target);
  padding: 0 var(--space-4);
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  font-weight: 500;
  text-decoration: none;
}

.button:hover {
  border-color: var(--accent);
}

.button-primary {
  color: var(--on-accent);
  background: var(--accent);
  border-color: var(--accent);
}

.project-action-quiet .install-line {
  background: none;
  color: var(--secondary);
}

.why-lead {
  max-width: var(--measure);
  margin-bottom: var(--space-2);
}

.why-list {
  max-width: var(--measure);
  margin-bottom: var(--space-3);
  padding-left: var(--space-5);
  overflow-wrap: anywhere;
}

.why-list li {
  margin-bottom: var(--space-2);
}

.why-list li::marker {
  color: var(--secondary);
}

.why-lacks li::marker {
  color: var(--coral);
}

.why-rule {
  white-space: nowrap;
  font-size: 0.875rem;
}

.why-note {
  max-width: var(--measure);
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.why-rules {
  margin: var(--space-4) 0 var(--space-2);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.why-archived {
  border-left: 3px solid var(--coral);
}

.why-archived h2 {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.why-archived h2 .icon {
  color: var(--coral);
}

.why-archived .why-lead {
  font-size: 1.125rem;
  line-height: 1.625rem;
}

.why-archived .banner {
  margin-bottom: var(--space-3);
}

/* Disclosures share one chevron and one summary line. */
.disclosure > summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0 var(--space-2);
  min-height: var(--target);
  padding: var(--space-2) 0;
  cursor: pointer;
  list-style: none;
}

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

.disclosure > summary .icon {
  color: var(--secondary);
}

.disclosure[open] > summary .icon {
  transform: rotate(90deg);
}

.disclosure-title {
  font-weight: 500;
}

.disclosure-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0 var(--space-3);
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.disclosure-missing {
  color: var(--quiet);
}

.disclosure-group {
  border-top: 1px solid var(--border);
}

.disclosure-group[open] {
  padding-bottom: var(--space-3);
}

.disclosure-card {
  margin-bottom: var(--space-4);
  padding: var(--space-2) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
}

.disclosure-card[open] {
  padding-bottom: var(--space-4);
}

/* A sentence, not a count: it takes the free width and starts after the title. */
@media (min-width: 761px) {
  #tier > summary {
    grid-template-columns: auto auto minmax(0, 1fr);
  }

  #tier > summary .disclosure-summary {
    justify-content: flex-start;
    margin-left: var(--space-2);
  }
}

.reason-list {
  margin-bottom: 0;
  padding-left: var(--space-5);
  font-size: 0.875rem;
  line-height: 1.25rem;
  overflow-wrap: anywhere;
}

.reason-list li {
  margin-bottom: var(--space-1);
}

.compat {
  margin: 0;
}

.compat-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: var(--space-1) var(--space-4);
  padding: var(--space-3) 0;
  border-top: 1px solid var(--border);
}

.compat-row:last-child {
  padding-bottom: 0;
}

.compat-row dt {
  color: var(--secondary);
}

.compat-row dd {
  margin: 0;
  min-width: 0;
  overflow-wrap: anywhere;
}

.compat-word {
  font-weight: 500;
}

.compat-word.fact-quiet {
  font-weight: 400;
}

.compat-lines {
  margin: var(--space-1) 0 0;
  padding: 0;
  list-style: none;
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.compat-lines li + li {
  margin-top: var(--space-1);
}

.compat-more {
  margin-top: var(--space-1);
}

.compat-more summary {
  width: fit-content;
  color: var(--secondary);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  cursor: pointer;
}

.project-compare {
  margin-bottom: var(--space-4);
}

.project-compare .section-head {
  margin-bottom: var(--space-2);
}

.rows-compact .col-project {
  width: auto;
}

.rows-compact .col-downloads {
  width: 100px;
}

.rows-compact .col-dependents {
  width: 104px;
}

.rows-compact .col-release {
  width: 100px;
}

/* The compact table sits beside the action panel, where a Stars column leaves the project name
   no room. The stat strip shows the stars of this project, and the stacked rows show them all. */
@media (min-width: 901px) {
  .rows-compact .col-stars,
  .rows-compact .cell-stars {
    display: none;
  }
}

.rows-compact .col-gpu {
  width: 92px;
}

.rows-compact .col-native {
  width: 88px;
}

.rows-compact .col-license {
  width: 92px;
}

.rows-compact thead th:not(:first-child),
.rows-compact .entry-row td {
  padding-inline: var(--space-2);
}

.rows-compact .entry-row td {
  overflow-wrap: break-word;
}

.rows-compact .row-name {
  font-size: 1rem;
  line-height: 1.5rem;
}

.rows-compact .row-description {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
}

.row-also-in {
  margin: var(--space-1) 0 0;
  color: var(--secondary);
  font-size: 0.8125rem;
  line-height: 1.25rem;
}

.entry-row-current th,
.entry-row-current td,
.entry-row-current:hover th,
.entry-row-current:hover td {
  background: transparent;
}

.entry-row-current th:first-child {
  box-shadow: inset 3px 0 0 var(--accent);
}

.compare-more {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-5);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.crate-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-1) var(--space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
  line-height: 1.25rem;
  overflow-wrap: anywhere;
}

.related-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  padding: 0;
  list-style: none;
}

.table-scroll {
  overflow-x: auto;
}

.data-table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.data-table th,
.data-table td {
  padding: var(--space-2) var(--space-3);
  border-bottom: 1px solid var(--border);
  font-weight: 400;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

.signal-table th:first-child {
  width: 11rem;
}

.signal-table :is(th, td):nth-child(3) {
  min-width: 7rem;
}

.signal-table :is(th, td):nth-child(4),
.signal-table :is(th, td):nth-child(5) {
  white-space: nowrap;
}

.data-table thead th {
  background: var(--wash);
  color: var(--secondary);
  font-weight: 500;
}

.data-table tbody tr:last-child th,
.data-table tbody tr:last-child td {
  border-bottom: 0;
}

td.number {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

td.not-measured {
  color: var(--quiet);
}

.correction-list {
  padding-left: var(--space-5);
}

.correction-list li {
  margin-bottom: var(--space-3);
}

.correction-list p {
  margin: 0 0 var(--space-1);
}

/* The rules page. */
.tier-word {
  display: inline-block;
  padding: 0 var(--space-2);
  border-radius: var(--radius-s);
  font-size: 0.8125rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-decoration: none;
  white-space: nowrap;
  vertical-align: middle;
}

.tier-word.tier-featured {
  background: var(--tier-featured-bg);
  color: var(--tier-featured-text);
}

.tier-word.tier-listed {
  background: var(--tier-listed-bg);
  color: var(--tier-listed-text);
}

.tier-word.tier-new {
  background: var(--tier-new-bg);
  color: var(--tier-new-text);
}

.tier-word.tier-archived {
  background: var(--tier-archived-bg);
  color: var(--tier-archived-text);
}

.threshold-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--space-4);
  max-width: var(--measure);
  margin-bottom: var(--space-3);
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.threshold-status p {
  margin: 0;
}

.principles {
  max-width: var(--measure);
  margin-bottom: var(--space-2);
  padding: 0;
  list-style: none;
}

.principles li {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
}

.principles .icon {
  margin-top: 2px;
  color: var(--coral);
}

.rules-file {
  margin-bottom: var(--space-6);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.rules-file a {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
}

.rules-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: var(--space-6);
  align-items: start;
}

.rules-contents {
  position: sticky;
  top: var(--space-4);
  max-height: calc(100vh - var(--space-6));
  overflow-y: auto;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.rules-contents-title {
  margin-bottom: var(--space-2);
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.rules-contents ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.rules-contents li > a {
  display: block;
  padding-block: var(--space-1);
  font-weight: 500;
  text-decoration: none;
}

.rules-contents li > a:hover {
  text-decoration: underline;
}

.rules-contents ul ul {
  margin: 0 0 var(--space-2);
  padding-left: var(--space-3);
  border-left: 1px solid var(--border);
}

.rules-contents ul ul a {
  font-weight: 400;
  color: var(--secondary);
}

.tier-overview {
  margin-bottom: var(--space-3);
}

.tier-overview > div {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: var(--space-3);
  padding: var(--space-2) 0;
  border-top: 1px solid var(--border);
}

.tier-overview dd {
  margin: 0;
}

.rule-group {
  margin-bottom: var(--space-6);
}

.rule-group > h2 {
  margin-bottom: var(--space-3);
}

.rule {
  margin-bottom: var(--space-3);
  padding: var(--space-4) var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
}

.rule-with-rows {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
  gap: var(--space-5);
}

.rule h3 {
  margin-bottom: var(--space-2);
  font-size: 1.125rem;
  line-height: 1.625rem;
}

.rule-text > :last-child {
  margin-bottom: 0;
}

.rule-text ul {
  padding-left: var(--space-5);
}

.rule-text li {
  margin-bottom: var(--space-1);
}

/* Each threshold stacks: raw name and value on one line, the meaning below. */
.threshold-table,
.threshold-table tbody {
  display: block;
}

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

.threshold-table tr {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0 var(--space-3);
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--border);
}

.threshold-table tbody tr:first-child {
  padding-top: 0;
}

.threshold-table tbody tr:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.threshold-table th,
.threshold-table td,
.threshold-table tbody tr:last-child th,
.threshold-table tbody tr:last-child td {
  display: block;
  padding: 0;
  border: 0;
}

.threshold-table td:last-child {
  grid-column: 1 / -1;
  color: var(--secondary);
}

.threshold-table td.number {
  font-weight: 600;
}

.threshold-table code {
  font-size: 0.8125rem;
}

/* The changes page. */
.feed-link {
  margin-bottom: var(--space-6);
}

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

.timeline {
  max-width: 880px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.timeline-stop {
  position: relative;
  padding: 0 0 var(--space-5) var(--space-5);
  border-left: 2px solid var(--border);
}

.timeline-stop:last-child {
  padding-bottom: 0;
}

.timeline-stop::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 6px;
  width: 12px;
  height: 12px;
  background: var(--surface);
  border: 2px solid var(--accent);
  border-radius: 50%;
}

.timeline-date {
  margin-bottom: var(--space-2);
  font-weight: 600;
}

.timeline-rows {
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
}

.timeline-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-1) var(--space-4);
  padding: var(--space-3) var(--space-4);
}

.timeline-row + .timeline-row {
  border-top: 1px solid var(--border);
}

.timeline-name {
  font-weight: 600;
  overflow-wrap: anywhere;
}

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

.timeline-move .icon {
  width: 16px;
  height: 16px;
  color: var(--secondary);
}

.timeline-card {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
}

.timeline-card > :last-child {
  margin-bottom: 0;
}

.timeline-first-title {
  margin-bottom: var(--space-1);
  font-weight: 600;
}

.tier-counts {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-4);
  padding: 0;
  list-style: none;
}

.tier-count {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.movement-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  margin-top: var(--space-3);
}

.movement-block {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  min-width: 0;
}

.movement-block h3 {
  margin-bottom: var(--space-2);
}

.movement-block > :last-child {
  margin-bottom: 0;
}

/* The submit page. */
.submit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: var(--space-6);
  align-items: start;
}

.submit-main section {
  margin-bottom: var(--space-6);
}

.submit-main section:last-child {
  margin-bottom: 0;
}

.submit-main section > h2 {
  margin-bottom: var(--space-3);
}

.submit-next {
  position: sticky;
  top: var(--space-4);
}

.form-cards {
  display: grid;
  gap: var(--space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.form-cards-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.form-cards-lead .form-card {
  border-left: 3px solid var(--accent);
}

.form-cards li {
  display: flex;
}

.form-card {
  position: relative;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  min-height: var(--target);
  padding: var(--space-4) calc(var(--space-6) + var(--space-3)) var(--space-4) var(--space-4);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
  text-decoration: none;
}

.form-card:hover {
  border-color: var(--accent);
}

.form-card .icon {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  color: var(--secondary);
}

.form-card-name {
  color: var(--accent);
  font-weight: 600;
}

.form-card:hover .form-card-name {
  text-decoration: underline;
}

.form-card-description {
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

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

.steps li {
  margin-bottom: var(--space-3);
  overflow-wrap: anywhere;
}

.steps strong {
  display: block;
  font-weight: 600;
}

/* The not-found page. */
.not-found-code {
  margin-bottom: var(--space-1);
  color: var(--secondary);
  font-size: 1.125rem;
  line-height: 1.625rem;
}

/* The list controls: sort buttons, the filter bar, the copy button. */
.sort-button {
  display: inline-flex;
  align-items: baseline;
  gap: var(--space-1);
  padding: 0;
  font: inherit;
  color: inherit;
  text-align: left;
  background: none;
  border: 0;
  cursor: pointer;
}

.sort-button:hover {
  color: var(--accent);
}

.sort-mark {
  color: var(--quiet);
}

[aria-sort] > .sort-button {
  color: var(--ink);
  font-weight: 600;
}

[aria-sort] .sort-mark {
  color: var(--accent);
}

.order-back {
  white-space: nowrap;
}

.list-filters {
  margin-bottom: var(--space-3);
}

.list-filters .search-filters {
  margin-bottom: var(--space-2);
}

.filter-check {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: var(--target);
  padding: 0 var(--space-3);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.25rem;
  cursor: pointer;
}

.filter-check input,
.row-compare input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.list-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0 var(--space-3);
  min-height: var(--target);
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.list-status:focus {
  outline: none;
}

.install-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2);
}

.install-line code {
  flex: 1 1 auto;
  min-width: 0;
}

.copy-button {
  flex: none;
  min-width: 60px;
  padding: 0 var(--space-2);
  min-height: 28px;
  font: inherit;
  font-size: 0.8125rem;
  line-height: 1.25rem;
  color: var(--accent);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-s);
  cursor: pointer;
}

.copy-button:hover {
  border-color: var(--accent);
}

.copy-note {
  color: var(--secondary);
  font-size: 0.8125rem;
  line-height: 1.25rem;
}

/* The compare box of a row and the bar of selected projects. */
.row-compare {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-left: auto;
  color: var(--secondary);
  font-size: 0.8125rem;
  line-height: 1.25rem;
  white-space: nowrap;
  cursor: pointer;
}

.row-compare:has(input:disabled) {
  color: var(--quiet);
  cursor: not-allowed;
}

.has-compare-tray {
  scroll-padding-bottom: 168px;
}

.compare-tray {
  position: sticky;
  bottom: 0;
  z-index: 6;
  background: var(--surface);
  border-top: 1px solid var(--border-strong);
  box-shadow: 0 -4px 16px rgb(20 22 34 / 0.12);
}

.compare-tray-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2) var(--space-4);
  width: 100%;
  max-width: calc(var(--page) + 2 * var(--gutter));
  margin: 0 auto;
  padding: var(--space-2) var(--gutter);
}

.compare-tray-names {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  min-width: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.compare-tray-name {
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  max-width: 100%;
  padding-left: var(--space-2);
  background: var(--wash);
  border: 1px solid var(--border);
  border-radius: var(--radius-s);
  font-size: 0.875rem;
  line-height: 1.25rem;
  white-space: nowrap;
}

.compare-tray-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  font: inherit;
  font-size: 1.125rem;
  color: var(--secondary);
  background: none;
  border: 0;
  border-radius: var(--radius-s);
  cursor: pointer;
}

.compare-tray-remove:hover {
  color: var(--accent);
}

.compare-tray-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.compare-tray-count {
  color: var(--secondary);
}

.compare-tray-actions .button {
  flex: none;
}

/* The compare page. */
#compare-status {
  margin-bottom: var(--space-2);
}

.compare-notes {
  margin-bottom: var(--space-3);
  padding-left: var(--space-5);
  color: var(--secondary);
  overflow-wrap: anywhere;
}

.compare-bar {
  margin-bottom: var(--space-3);
}

.compare-scroll {
  position: relative;
  overflow-x: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-l);
}

.compare-table {
  --fact-column: 168px;
  --project-column: 240px;
  width: 100%;
  min-width: calc(var(--fact-column) + var(--compare-count, 1) * var(--project-column));
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.compare-table th,
.compare-table td {
  padding: var(--space-3);
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
  white-space: normal;
}

.compare-table tbody tr:last-child th,
.compare-table tbody tr:last-child td {
  border-bottom: 0;
}

.compare-table thead th {
  background: var(--wash);
  color: var(--ink);
  font-weight: 600;
}

.compare-table th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  width: var(--fact-column);
  background: var(--surface);
  color: var(--secondary);
  font-weight: 500;
  border-right: 1px solid var(--border);
}

.compare-table thead th:first-child {
  background: var(--wash);
}

.compare-table .row-tag {
  display: table;
  margin-top: var(--space-1);
  font-weight: 400;
}

.compare-name {
  display: block;
  font-size: 1.125rem;
  line-height: 1.625rem;
}

.compare-remove {
  display: inline-block;
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.25rem;
}

.compare-why p {
  margin: 0;
}

.compare-details {
  margin-top: var(--space-1);
}

.compare-details summary {
  color: var(--secondary);
  font-size: 0.8125rem;
  line-height: 1.25rem;
  cursor: pointer;
}

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

.compare-details p,
.compare-details ul {
  margin: 0 0 var(--space-2);
}

.compare-word {
  margin: 0;
  font-weight: 600;
}

.compare-word.fact-quiet {
  font-weight: 400;
}

.compare-exact {
  margin: var(--space-1) 0 0;
  color: var(--secondary);
}

.compare-why ul {
  padding-left: var(--space-4);
}

.compare-why h3 {
  margin: var(--space-2) 0 var(--space-1);
  font-size: 0.8125rem;
  line-height: 1.25rem;
}

.compare-links {
  margin: 0;
  padding: 0;
  list-style: none;
}

.compare-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-3);
  margin-top: var(--space-4);
}

.compare-picker .search-field {
  flex: 0 1 320px;
}

.compare-picker input[type="search"] {
  padding-left: var(--space-3);
}

.compare-picker-error {
  flex: 1 0 100%;
  margin: 0;
  color: var(--ink);
  font-size: 0.875rem;
  line-height: 1.25rem;
  overflow-wrap: anywhere;
}

.compare-picker-error:empty {
  display: none;
}

/* A wide bar opens each filter under its own button. */
@media (min-width: 1101px) {
  .filter {
    position: relative;
  }

  .search-filter {
    width: 320px;
  }
}

/* Touch: every link and control reaches the minimum target. */
@media (pointer: coarse), (max-width: 900px) {
  .examples a,
  .tier-jumps a {
    min-height: var(--target);
  }

  .hero-meta a,
  .more-link a,
  .change-line a,
  .back-link a,
  .start-name,
  .site-footer-links a,
  .site-footer-licenses a,
  .link-row,
  .rules-contents a,
  .compare-more a,
  .compare-links a,
  .compare-remove,
  .sort-button,
  .order-back,
  .row-compare {
    display: inline-flex;
    align-items: center;
    min-height: var(--target);
  }

  /* A summary stays a list item, or it loses its open and closed marker. */
  .compare-details summary {
    line-height: var(--target);
  }

  .copy-button {
    min-height: var(--target);
    padding: 0 var(--space-3);
  }

  .compare-tray-remove {
    width: var(--target);
    height: var(--target);
  }

  .list-status .filter-clear {
    min-height: var(--target);
  }
}

/* Narrow header: the search moves to its own page, the links into the menu. */
@media (max-width: 1020px) {
  .site-search {
    display: none;
  }

  .site-search-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--target);
    height: var(--target);
    margin-left: auto;
    color: var(--accent);
    border-radius: var(--radius-s);
  }

  .site-search-link + .site-nav,
  .site-search-link + .site-nav + .site-menu {
    margin-left: 0;
  }
}

/* The project page and the submit page drop to one column. The action comes first. */
@media (max-width: 1100px) {
  .stat-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    justify-content: normal;
  }

  /* One column: the README first, then the links card, then the rest of the main column. */
  .project-layout {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
  }

  .project-main {
    display: contents;
  }

  .project-main > * {
    order: 2;
  }

  .project-main > .readme-panel {
    order: 0;
  }

  .project-main > :last-child {
    margin-bottom: var(--space-4);
  }

  .project-action {
    position: static;
    order: 1;
    margin-bottom: var(--space-4);
  }

  .submit-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .submit-next {
    position: static;
  }

  .rules-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-4);
  }

  .rules-contents {
    position: static;
    max-height: none;
    padding: var(--space-4);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
  }

  .rule-with-rows {
    grid-template-columns: minmax(0, 1fr);
  }

  .movement-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* Just above the stacked layout, the fixed columns narrow so the project name keeps its room. */
@media (min-width: 901px) and (max-width: 1100px) {
  .rows:not(.rows-compact) .col-downloads {
    width: 96px;
  }

  .rows:not(.rows-compact) .col-dependents {
    width: 96px;
  }

  .rows:not(.rows-compact) .col-stars {
    width: 72px;
  }

  .rows:not(.rows-compact) .col-release {
    width: 104px;
  }

  .rows:not(.rows-compact) .col-gpu {
    width: 92px;
  }

  .rows:not(.rows-compact) .col-native {
    width: 88px;
  }

  .rows:not(.rows-compact) .col-license {
    width: 92px;
  }
}

/* The table stacks into open rows, on the same markup. */
@media (max-width: 900px) {
  :root {
    --gutter: var(--space-4);
  }

  main {
    padding-top: var(--space-5);
  }

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

  .tiles-categories {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rows,
  .rows tbody {
    display: block;
    width: 100%;
  }

  .rows {
    background: none;
    border: 0;
    border-radius: 0;
  }

  .rows thead {
    display: none;
  }

  /* The sort buttons stay reachable: the head becomes one row of buttons above the stack. */
  .rows:has(.sort-button) thead {
    display: block;
    margin-bottom: var(--space-2);
  }

  .rows:has(.sort-button) thead tr {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
  }

  .rows:has(.sort-button) thead th {
    display: none;
    position: static;
    padding: 0;
    background: none;
    border: 0;
  }

  .rows:has(.sort-button) thead th.col-sortable {
    display: block;
    width: auto;
  }

  .sort-button {
    padding: 0 var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-s);
  }

  .rows .rows-group {
    display: block;
    position: sticky;
    top: 0;
    z-index: 2;
  }

  .rows .rows-group th {
    display: block;
    position: static;
    padding: var(--space-2) 0;
    background: var(--canvas);
    border-top: 0;
    border-bottom: 1px solid var(--border-strong);
  }

  .rows tbody + tbody {
    margin-top: var(--space-5);
  }

  .rows tbody + tbody .rows-group th {
    border-top: 0;
  }

  .entry-row {
    position: relative;
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: var(--space-2) var(--space-3);
    padding: var(--space-3) 0;
    border-bottom: 1px solid var(--border);
  }

  .entry-row th,
  .entry-row td,
  .entry-row:hover th,
  .entry-row:hover td {
    display: block;
    padding: 0;
    background: none;
    border: 0;
  }

  .entry-row th {
    grid-column: 1 / -1;
  }

  .entry-row td::before {
    content: attr(data-label);
    display: block;
    color: var(--secondary);
    font-size: 0.75rem;
    line-height: 1rem;
  }

  .cell-downloads,
  .cell-dependents,
  .cell-stars {
    grid-column: span 2;
  }

  .cell-release {
    grid-column: span 3;
  }

  .cell-gpu,
  .cell-native {
    grid-column: span 3;
    order: 1;
  }

  .cell-license {
    grid-column: span 3;
    order: 2;
  }

  /* The whole row opens the project. Links inside it stay on top. */
  .row-name::after {
    content: "";
    position: absolute;
    inset: 0;
  }

  .row-related a,
  .row-also-in a,
  .row-compare {
    position: relative;
    z-index: 1;
  }

  .row-name {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
  }

  .row-related a,
  .row-also-in a {
    display: inline-block;
    padding-block: var(--space-2);
  }

  .search-filter {
    width: 100%;
  }

  .filters-label {
    display: none;
  }

  .compare-table {
    --fact-column: 112px;
    --project-column: 200px;
  }

  .compare-table th,
  .compare-table td {
    padding: var(--space-2);
  }

  .compare-tray-inner {
    flex-flow: column nowrap;
    align-items: stretch;
    padding-block: var(--space-2);
  }

  .compare-tray-names {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: var(--space-1);
  }

  .compare-tray-name {
    flex: none;
  }

  .compare-tray-actions {
    flex-wrap: nowrap;
  }

  .compare-tray-count {
    flex: 1 1 0;
    min-width: 0;
  }

  .site-footer-licenses {
    margin-left: 0 !important;
  }
}

/* Phone: the job list opens up, the menu replaces the links. */
@media (max-width: 760px) {
  .site-nav {
    display: none;
  }

  .site-menu {
    display: block;
  }

  .site-search-link + .site-nav + .site-menu {
    margin-left: 0;
  }

  .site-header-inner {
    gap: var(--space-2);
    min-height: 56px;
    padding-block: var(--space-1);
  }

  h1 {
    font-size: 1.75rem;
    line-height: 2.25rem;
  }

  .hero {
    margin-bottom: var(--space-6);
  }

  section {
    margin-bottom: var(--space-6);
  }

  .hero-search button[type="submit"],
  .search-box button[type="submit"] {
    padding: 0 var(--space-4);
  }

  .tiles-jobs {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-m);
  }

  .tiles-jobs .tile-item + .tile-item {
    border-top: 1px solid var(--border);
  }

  .tiles-jobs .tile {
    padding: var(--space-3);
    background: none;
    border: 0;
    border-radius: var(--radius-m);
  }

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

  .tiles-showcase {
    grid-template-columns: minmax(0, 1fr);
  }

  .start-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .tier-list {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .tier-list dd {
    margin-bottom: var(--space-2);
  }

  .search-panel {
    padding: var(--space-4);
  }

  .panel,
  .project-head,
  .project-action {
    padding: var(--space-4);
  }

  .disclosure-card {
    padding: var(--space-1) var(--space-4);
  }

  .disclosure-card[open] {
    padding-bottom: var(--space-4);
  }

  .disclosure > summary {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .disclosure-summary {
    grid-column: 2;
    justify-content: flex-start;
  }

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

  .compat-row {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-cards-two {
    grid-template-columns: minmax(0, 1fr);
  }

  .tier-overview > div {
    grid-template-columns: minmax(0, 1fr);
    gap: var(--space-1);
  }

  .rules-contents ul ul {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0 var(--space-3);
  }


  .start-here h2,
  .start-note {
    display: block;
  }

  .filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    min-height: var(--target);
    padding: 0 var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-s);
    font-size: 0.875rem;
    line-height: 1.25rem;
    cursor: pointer;
    list-style: none;
  }

  .filters-toggle .icon {
    width: 16px;
    height: 16px;
    color: var(--secondary);
  }

  .filters-all[open] .filters-toggle {
    margin-bottom: var(--space-2);
    border-color: var(--accent);
    color: var(--accent);
  }

  .filters-all[open] .filters-toggle .icon {
    transform: rotate(180deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}

@media (forced-colors: active) {
  .tier-badge,
  .tier-word,
  .panel,
  .project-head,
  .project-action,
  .rule,
  .form-card,
  .entry-kind,
  .entry-label,
  .stable-label,
  .row-tag,
  .tile,
  .search-filter,
  .rows,
  .compare-scroll,
  .compare-tray,
  .compare-tray-name,
  .filter-check {
    border: 1px solid CanvasText;
  }

  .banner {
    border-left-color: CanvasText;
  }
}

/* The state page. Status colours always sit beside their word. */
:root {
  --status-ready: #0ca30c;
  --status-partial: #fab219;
  --status-gap: #d03b3b;
  --step-1: #86b6ef;
  --step-2: #3987e5;
  --step-3: #256abf;
  --step-4: #104281;
}

@media (prefers-color-scheme: dark) {
  :root {
    --step-1: #184f95;
    --step-2: #256abf;
    --step-3: #3987e5;
    --step-4: #86b6ef;
  }
}

.state {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--space-7);
}

.state-head {
  max-width: var(--measure);
}

.state-quote {
  max-width: var(--measure);
  margin: var(--space-3) 0;
  padding-left: var(--space-3);
  border-left: 3px solid var(--accent);
  font-size: 1.25rem;
  font-weight: 600;
  line-height: 1.35;
}

.state-tools + .state-tools,
.state-org {
  margin-top: var(--space-2);
}

.state-wrapper {
  color: var(--secondary);
  font-size: 0.875em;
}

.state-org-mark {
  display: inline-block;
  width: 1.1em;
  height: 1.1em;
  vertical-align: -0.2em;
}

.state-org-mark svg {
  display: block;
  width: 100%;
  height: 100%;
}

.state-source,
.state-stale,
.state-org {
  color: var(--secondary);
  font-size: 0.875rem;
  line-height: 1.25rem;
}

.state-stale {
  padding: var(--space-2) var(--space-3);
  background: var(--wash);
  border-radius: var(--radius-s);
}

.state-chart {
  margin: 0 0 var(--space-6);
}

.state-chart figcaption strong {
  display: block;
  font-size: 1.125rem;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
  margin: var(--space-2) 0;
  padding: 0;
  list-style: none;
  color: var(--secondary);
  font-size: 0.875rem;
}

.chart-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: var(--space-1);
  border-radius: 3px;
  vertical-align: -1px;
}

.chart-table {
  width: 100%;
  border-collapse: collapse;
}

.chart-table th,
.chart-table td {
  padding: var(--space-1) var(--space-2) var(--space-1) 0;
  border: 0;
  font-size: 0.875rem;
  font-weight: 400;
  text-align: left;
  vertical-align: middle;
}

.chart-table th {
  width: 30%;
}

.chart-bar {
  width: 45%;
}

.chart-bar svg {
  display: block;
  width: 100%;
  height: 14px;
  background: var(--wash);
  border-radius: 4px;
}

.chart-bar rect {
  stroke: var(--surface);
  stroke-width: 2px;
  vector-effect: non-scaling-stroke;
}

.chart-text {
  color: var(--secondary);
}

.status-ready { fill: var(--status-ready); background: var(--status-ready); }
.status-partial { fill: var(--status-partial); background: var(--status-partial); }
.status-gap { fill: var(--status-gap); background: var(--status-gap); }
.step-1 { fill: var(--step-1); background: var(--step-1); }
.step-2 { fill: var(--step-2); background: var(--step-2); }
.step-3 { fill: var(--step-3); background: var(--step-3); }
.step-4 { fill: var(--step-4); background: var(--step-4); }

.status-word {
  display: inline-block;
  background: none;
  color: var(--ink);
  font-size: 0.8125rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-word::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: var(--space-1);
  border-radius: 50%;
  background: var(--status-partial);
}

.status-word.status-ready::before { background: var(--status-ready); }
.status-word.status-gap::before { background: var(--status-gap); }

.state-cards,
.state-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.state-cards {
  display: grid;
  gap: var(--space-4);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
}

.state-card {
  padding: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-m);
}

.state h3 {
  margin: 0 0 var(--space-1);
  font-size: 1rem;
}

.state-card p,
.state-list p {
  margin: var(--space-1) 0 0;
}

.state-watch,
.state-seen {
  color: var(--secondary);
  font-size: 0.875rem;
}

.state-list {
  display: grid;
  gap: var(--space-4);
}

.state-columns {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
}

.state-charts {
  display: grid;
  gap: var(--space-6);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr));
}

.chart-takeaway {
  display: block;
}

.chart-note {
  display: block;
  color: var(--secondary);
  font-size: 0.8125rem;
}

.state-jobs {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

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

.state-jobs tbody th {
  font-weight: 600;
  min-width: 150px;
}

.state-jobs td:nth-child(4) {
  min-width: 300px;
}

@media (max-width: 760px) {
  .chart-table th { width: 40%; }
  .chart-table .chart-text { display: block; }
  .chart-bar { width: 60%; }
  .chart-table tr { display: block; padding: var(--space-2) 0; }
  .chart-table th,
  .chart-table td { display: block; width: 100%; padding: 2px 0; }
  .state-jobs thead { display: none; }
  .state-jobs tr { display: block; padding: var(--space-3) 0; border-bottom: 1px solid var(--border); }
  .state-jobs tbody th,
  .state-jobs td,
  .state-jobs td:nth-child(4) { display: block; min-width: 0; padding: 2px 0; border: 0; }
  .state-jobs td:nth-child(3)::before { content: "Python: "; color: var(--secondary); }
  .state-jobs td:nth-child(5)::before { content: "Key tools: "; color: var(--secondary); }
}
