:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --text: #1d1d1b;
  --muted: #66645e;
  --border: #e3e0d8;
  --accent: #b4462a;
  --accent-soft: #f6e4dd;
  --edge: #b9b5ab;
  --node: #3a3935;
  --color-1: #b4462a;
  --color-2: #2f6aa3;
  --color-3: #3f8a4f;
  --chip-det: #e6edf5;
  --chip-det-text: #284a6e;
  --chip-rand: #efe7f4;
  --chip-rand-text: #5b3474;
  --row-hover: #f5f3ee;
  --best-bg: #fbf1ec;
  --best-bg-hover: #f7e8e1;
  --warn-bg: #fcefd2;
  --warn-bg-hover: #f8e2b0;
  --warn-text: #7f5200;
  --warn-border: #dcae52;
  --danger-bg: #fbe3e0;
  --danger-text: #9b1c12;
  --danger-border: #e0928a;
  --add-bg: #e2f1e1;
  --add-bg-hover: #cfe7cd;
  --add-text: #2b6a38;
  --add-border: #78b282;
  --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  /* Island figures on the landing page, matching the map on florian-schager.github.io. */
  --map-land: #ebe5d8;
  --map-coast: #d3c9b5;
  --map-line: #efebe2;
  --map-edge: #a59d8c;
  --map-node: #8d8577;
  --map-c1: #c0603f;
  --map-c2: #4a7fb3;
  --map-c3: #519a5f;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #161614;
    --surface: #1e1e1b;
    --text: #ecebe6;
    --muted: #a19f97;
    --border: #34332f;
    --accent: #e57a5c;
    --accent-soft: #3a2620;
    --edge: #5b5952;
    --node: #d9d7d0;
    --color-1: #e57a5c;
    --color-2: #6aa6e0;
    --color-3: #74c085;
    --chip-det: #1f2c3a;
    --chip-det-text: #a9c6e6;
    --chip-rand: #2c2234;
    --chip-rand-text: #d2b4e6;
    --row-hover: #24241f;
    --best-bg: #2a201c;
    --best-bg-hover: #322620;
    --warn-bg: #362a12;
    --warn-bg-hover: #45361a;
    --warn-text: #f1c66e;
    --warn-border: #8d6c2b;
    --danger-bg: #3d1a17;
    --danger-text: #f4a198;
    --danger-border: #93453d;
    --add-bg: #1b2b1e;
    --add-bg-hover: #243a28;
    --add-text: #8fd09c;
    --add-border: #3f6d49;
    --map-land: #262521;
    --map-coast: #3c3a34;
    --map-line: #252421;
    --map-edge: #5f5b52;
    --map-node: #77736a;
    --map-c1: #c96d50;
    --map-c2: #5b8fc2;
    --map-c3: #62a873;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.6 var(--sans);
}

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

.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }

/* Header */
.site-header { border-bottom: 1px solid var(--border); background: var(--surface); }
.header-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 24px; padding-top: 14px; padding-bottom: 14px; }
.brand { font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: var(--text); text-decoration: none; }
.problem-nav { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 0.92rem; }
.problem-nav a { color: var(--text); text-decoration: none; padding-bottom: 2px; border-bottom: 2px solid transparent; }
.problem-nav a.active { border-bottom-color: var(--accent); font-weight: 600; }
.problem-nav .soon { color: var(--muted); opacity: 0.7; cursor: default; }

/* Problem section */
.problem {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 40px;
  align-items: center;
  padding: 48px 0 40px;
}
.eyebrow { margin: 0 0 4px; font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
h1 { font-family: var(--serif); font-weight: 600; font-size: 2.4rem; line-height: 1.15; margin: 0 0 16px; }
.problem-text p { max-width: 62ch; margin: 0 0 14px; }
.problem-text .params { color: var(--muted); font-size: 0.95rem; }

.illustration { margin: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 16px 16px 12px; }
.illustration svg { display: block; width: 100%; height: auto; }
.illustration .edges line { stroke: var(--edge); stroke-width: 2; }
.illustration .matched-edges line { stroke: var(--accent); stroke-width: 5; stroke-linecap: round; }
.illustration .nodes circle { fill: var(--node); stroke: var(--surface); stroke-width: 2.5; }
.illustration .nodes circle.free { fill: var(--surface); stroke: var(--node); stroke-width: 2.5; }
.illustration .nodes circle.in-set { fill: var(--accent); stroke: var(--surface); stroke-width: 2.5; }
figcaption { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: 0.86rem; color: var(--muted); }
.key { display: inline-flex; align-items: center; gap: 6px; color: var(--text); }
.swatch { display: inline-block; }
.swatch-edge { width: 18px; height: 5px; border-radius: 3px; background: var(--accent); }
.swatch-free { width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--node); background: var(--surface); }
.swatch-set { width: 14px; height: 14px; border-radius: 50%; background: var(--accent); }
.caption-text { flex-basis: 100%; }

/* Bibliography */
/* Separator before the secondary links, drawn outside the link so the active underline stays under the text. */
.problem-nav .nav-secondary { position: relative; margin-left: 18px; }
.problem-nav .nav-secondary::before {
  content: ""; position: absolute; left: -18px; top: 15%; bottom: 15%; border-left: 1px solid var(--border);
}
.bibliography { padding-top: 48px; padding-bottom: 64px; }
.bib-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 8px; }
.bib-head .lede { margin-bottom: 0; }
.toggle-all {
  font: inherit; font-size: 0.9rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; cursor: pointer;
}
.toggle-all:hover { border-color: var(--accent); }
.toggle-all:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bib-list { list-style: none; margin: 24px 0 0; padding: 0; }
.bib-entry {
  display: grid; grid-template-columns: 9.5rem minmax(0, 1fr); gap: 4px 20px;
  padding: 18px 0; border-top: 1px solid var(--border); scroll-margin-top: 16px;
}
.bib-entry:last-child { border-bottom: 1px solid var(--border); }
.bib-entry.is-target .bib-label { color: var(--accent); }
.bib-label { font-weight: 600; font-size: 0.92rem; padding-top: 2px; }
.bib-body p { margin: 0; }
.bib-authors { font-size: 0.92rem; color: var(--muted); }
.bib-title { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; line-height: 1.35; margin: 2px 0 4px !important; }
.bib-title a { color: var(--text); text-decoration: none; }
.bib-title a:hover { color: var(--accent); text-decoration: underline; }
.bib-venues { font-size: 0.86rem; color: var(--muted); }
.bib-alt-title { font-style: italic; }
.bib-public { font-weight: 600; white-space: nowrap; }

.bib-results { margin-top: 10px; }
.bib-results summary {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer; list-style: none;
  font-size: 0.86rem; font-weight: 600; color: var(--accent);
  padding: 4px 10px; border: 1px solid var(--border); border-radius: 999px; background: var(--surface);
}
.bib-results summary::-webkit-details-marker { display: none; }
.bib-results summary:hover { border-color: var(--accent); }
.bib-results summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bib-results summary .chevron { width: 6px; height: 6px; margin-left: 0; border-color: var(--accent); }
.bib-results[open] summary .chevron { transform: rotate(-135deg); }
.bib-results ul { list-style: none; margin: 10px 0 0; padding: 0; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.bib-result {
  display: grid; grid-template-columns: 7.5rem 9rem minmax(0, 1.4fr) auto minmax(0, 1fr); align-items: center; gap: 4px 16px;
  padding: 10px 14px; border-top: 1px solid var(--border); font-size: 0.9rem;
}
.bib-result:first-child { border-top: 0; }
.bib-result-kind { color: var(--muted); font-size: 0.84rem; white-space: nowrap; }
.bib-result-problem { font-weight: 600; }
.bib-result-runtime { position: relative; overflow-x: auto; overflow-y: hidden; padding: 2px 0; }
.bib-result-model { white-space: nowrap; }
.bib-result-meta { color: var(--muted); font-size: 0.84rem; }

@media (max-width: 720px) {
  .bib-entry { grid-template-columns: minmax(0, 1fr); }
  .bib-result { grid-template-columns: minmax(0, 1fr) auto; }
  .bib-result-kind, .bib-result-runtime, .bib-result-meta { grid-column: 1 / -1; }
  .bib-result-model { grid-row: 2; grid-column: 2; }
  .problem-nav .nav-secondary { margin-left: 0; }
  .problem-nav .nav-secondary::before { display: none; }
}

/* Landing page */
.landing { padding-top: 48px; padding-bottom: 48px; }
/* Small pill at the very end of the landing page. */
.home-link {
  margin-top: 40px;
  display: inline-flex; align-items: center; gap: 5px; padding: 2px 10px 2px 8px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px;
  color: var(--muted); font-size: 0.78rem; text-decoration: none; transition: border-color 0.15s ease, color 0.15s ease;
}
.home-arrow { color: var(--accent); transition: transform 0.2s ease; }
.home-link:hover { border-color: var(--accent); color: var(--accent); }
.home-link:hover .home-arrow { transform: translateX(-3px); }
.home-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) { .home-arrow { transition: none; } }
.landing h1 { max-width: 22ch; }
.lede { max-width: 62ch; color: var(--muted); font-size: 1.05rem; margin: 0 0 32px; }
.problem-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.problem-card {
  display: flex; flex-direction: column; gap: 6px; padding: 18px 18px 16px;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  color: var(--text); text-decoration: none; transition: border-color 0.15s ease;
}
a.problem-card:hover { border-color: var(--accent); }
a.problem-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.problem-card.soon { opacity: 0.6; }
.card-title { font-family: var(--serif); font-size: 1.2rem; font-weight: 600; }
.card-desc { color: var(--muted); font-size: 0.92rem; flex: 1; }
.card-count { font-size: 0.82rem; font-weight: 600; color: var(--accent); margin-top: 6px; }
.problem-card.soon .card-count { color: var(--muted); }

/* Island figure at the top of each problem card, on a faint map grid. */
.card-map {
  display: block; width: calc(100% + 36px); height: 124px; margin: -18px -18px 8px;
  border-bottom: 1px solid var(--border); border-radius: 10px 10px 0 0;
  background-color: var(--surface);
  background-image: linear-gradient(to right, var(--map-line) 1px, transparent 1px),
                    linear-gradient(to bottom, var(--map-line) 1px, transparent 1px);
  background-size: 22px 22px; background-position: center;
}
.card-map .map-land { fill: var(--map-land); stroke: var(--map-coast); stroke-width: 1.5; transition: stroke 0.15s ease; }
.card-map .map-shore { fill: none; stroke: var(--map-coast); stroke-width: 1; stroke-dasharray: 3 4; }
a.problem-card:hover .card-map .map-land { stroke: var(--accent); }
.map-graph .edge { fill: none; stroke: var(--map-edge); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.map-graph .edge.matched { stroke: var(--map-c1); stroke-width: 4.5; }
.map-graph .edge.e1 { stroke: var(--map-c1); stroke-width: 3.2; }
.map-graph .edge.e2 { stroke: var(--map-c2); stroke-width: 3.2; }
.map-graph .edge.e3 { stroke: var(--map-c3); stroke-width: 3.2; }
.map-graph .node { fill: var(--map-land); stroke: var(--map-node); stroke-width: 1.8; }
.map-graph .node.in-set, .map-graph .node.c1 { fill: var(--map-c1); stroke: var(--map-c1); }
.map-graph .node.c2 { fill: var(--map-c2); stroke: var(--map-c2); }
.map-graph .node.c3 { fill: var(--map-c3); stroke: var(--map-c3); }
.map-graph .cluster { stroke-width: 1.2; }
.map-graph .cluster.c1 { fill: color-mix(in srgb, var(--map-c1) 22%, transparent); stroke: var(--map-c1); }
.map-graph .cluster.c2 { fill: color-mix(in srgb, var(--map-c2) 22%, transparent); stroke: var(--map-c2); }

.landing-more { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 8px 40px; margin-top: 40px; color: var(--muted); }
.landing-more p { margin: 0; max-width: 62ch; }

/* Results */
.results { padding: 8px 0 48px; }
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; border-top: 1px solid var(--border); padding-top: 28px; }
h2 { font-family: var(--serif); font-weight: 600; font-size: 1.6rem; margin: 0; }
.count { margin: 0; color: var(--muted); font-size: 0.9rem; }
/* Algorithms / Lower bounds: the two tables of a problem page, in place of a heading */
.bound-tabs { display: flex; gap: 28px; }
.bound-tabs button {
  font: 600 1.6rem var(--serif); color: var(--muted); background: none; border: 0; padding: 0 0 6px;
  border-bottom: 2px solid transparent; cursor: pointer;
}
.bound-tabs button:hover { color: var(--text); }
.bound-tabs button[aria-selected="true"] { color: var(--text); border-bottom-color: var(--accent); }
.bound-tabs button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bound-tabs .pill-count { font-family: var(--sans); font-size: 0.85rem; margin-left: 4px; }

.filters { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 16px 0 12px; }
.filter-group { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.filter-group[hidden] { display: none; }
.filter-label { font-size: 0.82rem; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; }
.segmented { display: inline-flex; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); }
.segmented button {
  font: inherit; font-size: 0.9rem; color: var(--text); background: transparent;
  border: 0; border-left: 1px solid var(--border); padding: 6px 12px; cursor: pointer;
}
.segmented button:first-child { border-left: 0; }
.segmented button[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.segmented button:focus-visible, .sort:focus-visible, .checks input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
/* Graph-class toggles: several can be on at once */
.filter-classes { flex-basis: 100%; }
.pills { display: flex; flex-wrap: wrap; gap: 6px; }
.pills button {
  font: inherit; font-size: 0.88rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 999px; padding: 4px 12px; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
}
.pills button:hover { border-color: var(--accent); }
.pills button[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 600; }
.pills button[aria-pressed="true"]::before { content: "✓"; font-size: 0.8em; }
.pills button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.pill-count { font-size: 0.78rem; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.checks { display: inline-flex; gap: 14px; font-size: 0.92rem; }
.checks label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.checks input { accent-color: var(--accent); }

/* Filter bar: one toggle per filter; its options open in a popover below it */
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 16px 0 12px; }
.filter-bar[hidden] { display: none; }
.filter-item { position: relative; }
.filter-item[hidden] { display: none; }
.filter-toggle {
  display: inline-flex; align-items: center; gap: 8px;
  font: inherit; font-size: 0.9rem; color: var(--text); background: var(--surface);
  border: 1px solid var(--border); border-radius: 8px; padding: 6px 12px; cursor: pointer;
}
.filter-toggle:hover { border-color: var(--accent); }
.filter-toggle[aria-expanded="true"] { border-color: var(--accent); background: var(--accent-soft); }
.filter-toggle:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.filter-toggle .filter-label { font-size: 0.75rem; }
.filter-toggle .chevron { width: 6px; height: 6px; margin-left: 2px; }
.filter-toggle[aria-expanded="true"] .chevron { transform: rotate(-135deg); }
.filter-value { font-weight: 600; white-space: nowrap; font-variant-numeric: tabular-nums; }
.filter-popover {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20;
  background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18); padding: 12px;
}
.filter-popover[hidden] { display: none; }
.filter-item.is-wide .filter-popover { width: min(600px, calc(100vw - 32px)); }
.filter-popover .timeline { margin: 4px 8px 0; }
.filter-bar .only-best { margin-left: 8px; }

/* Delta regime slider */
.chevron {
  width: 8px; height: 8px; margin-left: auto;
  border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform 0.15s ease;
}
#regime-slider { width: 100%; margin: 4px 0 4px; accent-color: var(--accent); }
/* Tick labels sit under their slider stops (the thumb is ~16px wide, hence the 8px inset). */
.regime-ticks { position: relative; height: 30px; margin: 0 8px; }
.regime-ticks button {
  position: absolute; top: 0; left: var(--pos); transform: translateX(-50%);
  font: inherit; font-size: 0.85rem; color: var(--muted); background: none; border: 0;
  padding: 4px 2px; border-radius: 6px; cursor: pointer; white-space: nowrap;
}
.regime-ticks button:first-child { transform: translateX(-8px); }
.regime-ticks button:last-child { transform: translateX(calc(-100% + 8px)); }
.regime-ticks button[aria-pressed="true"] { color: var(--accent); font-weight: 600; }
.regime-ticks button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.regime-note { margin: 0 0 14px; font-size: 0.86rem; color: var(--muted); }
.regime-note[hidden] { display: none; }

.table-scroll { position: relative; overflow-x: auto; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.results-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; min-width: 1040px; }
.results-table th {
  text-align: left; font-weight: 600; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap;
}
.results-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: top; }
.results-table tbody tr:last-child td { border-bottom: 0; }
.results-table tbody tr:hover { background: var(--row-hover); }
.sort { font: inherit; color: inherit; text-transform: inherit; letter-spacing: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.sort.active { color: var(--text); }
.sort:disabled { cursor: default; opacity: 0.7; }

.results-table tr.is-best td { background: var(--best-bg); }
.results-table tr.is-best td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.results-table tbody tr.is-best:hover td { background: var(--best-bg-hover); }
.best-badge {
  display: block; width: max-content; margin-top: 6px; font-size: 0.7rem; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--accent);
}
.col-best { white-space: nowrap; font-size: 0.9rem; }
.col-best div + div { margin-top: 4px; }
.col-best .none { color: var(--muted); }
.sub.original { font-size: 0.78rem; }

/* Year: as narrow as its content; the "State of the art" label sits in the runtime column. */
.results-table .col-year { font-variant-numeric: tabular-nums; white-space: nowrap; width: 1%; padding-right: 4px; }
.col-runtime { font-size: 1.02rem; min-width: 13rem; max-width: 18rem; }
/* Long runtimes are set smaller, and may break after a top-level + (KaTeX allows breaks there). */
.runtime { display: inline; }
.runtime-long { font-size: 0.88em; }
.runtime-xlong { font-size: 0.78em; }
.col-model { white-space: nowrap; }
.chip { display: inline-block; font-size: 0.78rem; font-weight: 600; padding: 2px 8px; border-radius: 999px; margin-right: 4px; }
.chip.deterministic { background: var(--chip-det); color: var(--chip-det-text); }
.chip.randomized { background: var(--chip-rand); color: var(--chip-rand-text); }
.chip.model { background: transparent; border: 1px solid var(--border); color: var(--text); font-weight: 500; }
/* The reduction a result is obtained by, e.g. "Line graph" (see .reduction-chips). */
.chip.via {
  font-weight: 500; color: var(--muted); text-decoration: none; background: transparent; border: 1px dashed var(--edge);
}
a.chip.via:hover { color: var(--accent); border-color: var(--accent); }
a.chip.via:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.sub { display: block; color: var(--muted); font-size: 0.82rem; margin-top: 2px; }
.col-source a, .col-source .label { font-weight: 600; }
.col-comments { color: var(--muted); min-width: 24ch; max-width: 34ch; }
.empty { color: var(--muted); margin-top: 16px; }

/* Reductions */
.notation { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; max-width: 62ch; font-size: 0.95rem; }
.notation dt { white-space: nowrap; }
.notation dd { margin: 0; color: var(--muted); }
.reduction-map .map-node rect { fill: var(--surface); stroke: var(--node); stroke-width: 1.5; }
.reduction-map .map-node text { fill: var(--text); font: 600 16px var(--sans); }
.reduction-map a .map-node:hover rect { stroke: var(--accent); }
.reduction-map .map-arrow .shaft { stroke: var(--edge); stroke-width: 2.5; }
.reduction-map .map-arrow .hit { stroke: transparent; stroke-width: 14; }
.reduction-map .map-arrow:hover .shaft, .reduction-map .map-arrow:focus-visible .shaft { stroke: var(--accent); }
.reduction-map .map-arrow:focus-visible { outline: none; }
.reduction-map marker path { fill: var(--edge); }
.reduction-map .map-label { fill: var(--muted); font: italic 17px var(--serif); }
.reductions-table { min-width: 980px; }
.reductions-table tbody tr { scroll-margin-top: 16px; }
.reductions-table tbody tr:target td { background: var(--best-bg); }
.reductions-table tbody tr:target td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
.col-problem { white-space: nowrap; }
.col-instance { white-space: nowrap; }
.col-technique { min-width: 22ch; max-width: 32ch; }
.technique { font-weight: 600; }
.folklore { color: var(--muted); font-style: italic; }

.site-footer { border-top: 1px solid var(--border); color: var(--muted); font-size: 0.86rem; padding: 18px 0 28px; }

@media (max-width: 720px) {
  .regime-ticks { display: flex; flex-wrap: wrap; gap: 2px 12px; height: auto; margin: 0; }
  .regime-ticks button, .regime-ticks button:first-child, .regime-ticks button:last-child { position: static; transform: none; }
}

@media (max-width: 820px) {
  .problem { grid-template-columns: minmax(0, 1fr); gap: 28px; padding-top: 32px; }
  h1 { font-size: 2rem; }
}

/* Reductions: problem filter and the T column */
.col-with { white-space: nowrap; font-size: 1.02rem; }
.reduction-map .map-arrow { transition: opacity 0.15s ease; }
.reduction-map .map-arrow.is-dim { opacity: 0.18; }

/* Narrow columns: long assumptions wrap, models stack, and the T column gets a two-line header. */
.col-class .assumption { max-width: 18ch; }
.reductions-table .col-model .chip,
.decomp-table .col-model .chip { display: table; margin: 0 0 4px; }
.decomp-table .col-comments { min-width: 16ch; max-width: 24ch; }
.results-table th.th-wrap { white-space: normal; width: 1%; line-height: 1.3; padding-left: 6px; padding-right: 6px; text-align: center; }
.reductions-table .col-with { text-align: center; padding-left: 6px; padding-right: 6px; }

/* Vertex coloring illustration */
.illustration .nodes circle.color-1 { fill: var(--color-1); }
.illustration .nodes circle.color-2 { fill: var(--color-2); }
.illustration .nodes circle.color-3 { fill: var(--color-3); }
.swatch-color { width: 14px; height: 14px; border-radius: 50%; }
.swatch-color.color-1 { background: var(--color-1); }
.swatch-color.color-2 { background: var(--color-2); }
.swatch-color.color-3 { background: var(--color-3); }
#colors-filter .katex { font-size: 1em; }
.col-colors { white-space: nowrap; }
/* Filter options without results under the current settings are hidden. */
.pills button[hidden], .segmented button[hidden] { display: none; }


/* "Only show state of the art" checkbox */
.only-best { display: inline-flex; align-items: center; gap: 8px; font-size: 0.92rem; cursor: pointer; }
.only-best input { accent-color: var(--accent); width: 16px; height: 16px; margin: 0; }
.only-best input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Edge coloring illustration */
.illustration .colored-edges line { stroke-width: 5; stroke-linecap: round; }
.illustration .colored-edges line.color-1 { stroke: var(--color-1); }
.illustration .colored-edges line.color-2 { stroke: var(--color-2); }
.illustration .colored-edges line.color-3 { stroke: var(--color-3); }
.swatch-edge-color { width: 18px; height: 5px; border-radius: 3px; }
.swatch-edge-color.color-1 { background: var(--color-1); }
.swatch-edge-color.color-2 { background: var(--color-2); }
.swatch-edge-color.color-3 { background: var(--color-3); }

/* Colors filter: the selected option shows its mode, "≤" (at most) or "=" (exactly); clicking it again switches. */
#colors-filter button[data-mode="atmost"]::before { content: "≤"; font-size: 0.95em; }
#colors-filter button[data-mode="exact"]::before { content: "="; font-size: 0.95em; }

/* Bibliography: editing a paper */
.bib-side { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; }
.bib-edit-btn {
  font: inherit; font-size: 0.78rem; color: var(--muted); background: transparent; cursor: pointer;
  border: 1px solid var(--border); border-radius: 6px; padding: 2px 8px;
}
.bib-edit-btn:hover, .bib-edit-btn[aria-expanded="true"] { color: var(--accent); border-color: var(--accent); }
.bib-edit-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.bib-form {
  margin-top: 12px; padding: 14px 16px; border: 1px solid var(--border); border-radius: 10px;
  background: var(--surface); display: grid; gap: 12px; font-size: 0.9rem;
}
.bib-form input, .bib-form select {
  font: inherit; font-size: 0.88rem; color: var(--text); background: var(--bg);
  border: 1px solid var(--border); border-radius: 6px; padding: 4px 8px; min-width: 0;
}
.bib-form input:focus-visible, .bib-form select:focus-visible, .bib-form button:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.bib-grid { display: grid; grid-template-columns: 9rem 1fr; gap: 8px; }
.bib-grid .bib-field:nth-child(2), .bib-grid .bib-field:nth-child(3) { grid-column: 1 / -1; }
.bib-field { display: grid; gap: 3px; }
.bib-field > span, .bib-form legend { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.bib-form fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.bib-rows { display: grid; gap: 6px; }
.bib-row { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.bib-author-row select { flex: 0 1 18rem; }
.bib-version-row input { flex: 1 1 7rem; }
.bib-version-row .bib-year { flex: 0 0 5.5rem; }
.bib-form button.bib-add, .bib-form button.bib-cancel, .bib-form button.bib-remove {
  font: inherit; font-size: 0.82rem; color: var(--text); background: transparent; cursor: pointer;
  border: 1px solid var(--border); border-radius: 6px; padding: 3px 10px; justify-self: start;
}
.bib-form button.bib-remove { padding: 1px 8px; color: var(--muted); }
.bib-form button.bib-remove:hover { color: var(--accent); border-color: var(--accent); }
.bib-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.bib-form button.bib-save {
  font: inherit; font-size: 0.85rem; font-weight: 600; cursor: pointer; border-radius: 6px; padding: 4px 14px;
  color: var(--accent); background: var(--accent-soft); border: 1px solid var(--accent);
}
.bib-status { margin: 0; color: var(--muted); font-size: 0.85rem; }
.bib-yaml {
  margin: 0; padding: 10px 12px; overflow-x: auto; font-size: 0.82rem; line-height: 1.45;
  background: var(--bg); border: 1px solid var(--border); border-radius: 8px;
}

/* Edit (local, with scripts/serve.py) or Report an issue (public site): only one of the two buttons is shown. */
html:not([data-editable]) .entry-edit, html[data-editable] .entry-report { display: none; }
.bib-edit-btn.entry-report { color: var(--warn-text); background: var(--warn-bg); border-color: var(--warn-border); font-weight: 600; }
.bib-edit-btn.entry-report:hover, .bib-edit-btn.entry-report[aria-expanded="true"] {
  color: var(--warn-text); background: var(--warn-bg-hover); border-color: var(--warn-text);
}
.bib-edit-btn.entry-report:focus-visible { outline-color: var(--warn-text); }
.bib-form.report-form { max-width: 640px; }
.report-form fieldset { gap: 8px; }
.report-form legend { margin-bottom: 4px; }
.report-topic { display: grid; gap: 6px; }
.report-topic label { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; justify-self: start; }
.report-topic input { accent-color: var(--accent); }
.report-topic textarea {
  font: inherit; font-size: 0.88rem; color: var(--text); background: var(--bg); resize: vertical;
  border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; margin-left: 24px; min-height: 4.5em;
}
.report-topic textarea:focus-visible, .report-topic input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.report-note { margin: 0; color: var(--muted); font-size: 0.82rem; }

/* "Report missing algorithm / lower bound": centred below the table, with its form underneath. */
.missing-report { display: flex; flex-direction: column; align-items: center; gap: 12px; margin-top: 18px; }
.missing-btn {
  display: inline-flex; align-items: center; gap: 12px; cursor: pointer;
  font: inherit; font-size: 0.95rem; font-weight: 600; color: var(--add-text);
  background: var(--add-bg); border: 1px dashed var(--add-border); border-radius: 10px; padding: 8px 20px 8px 10px;
}
.missing-btn:hover, .missing-btn[aria-expanded="true"] { background: var(--add-bg-hover); border-color: var(--add-text); }
.missing-btn:focus-visible { outline: 2px solid var(--add-text); outline-offset: 2px; }
/* The plus is drawn with two bars rather than a "+" glyph, whose position in its line box varies by font. */
.missing-plus { position: relative; flex: none; width: 2.1rem; height: 2.1rem; border-radius: 50%; background: var(--add-text); }
.missing-plus::before, .missing-plus::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 1.1rem; height: 0.17rem;
  border-radius: 1px; background: var(--add-bg); transform: translate(-50%, -50%);
}
.missing-plus::after { transform: translate(-50%, -50%) rotate(90deg); }
.missing-slot { width: 100%; max-width: 640px; }
.missing-slot:empty { display: none; }
.bib-form.missing-form { margin-top: 0; }
.missing-heading { margin: 0; font-weight: 600; }
.missing-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.missing-form textarea {
  font: inherit; font-size: 0.88rem; color: var(--text); background: var(--bg); resize: vertical;
  border: 1px solid var(--border); border-radius: 6px; padding: 6px 8px; min-height: 4.5em;
}
.missing-form select { justify-self: start; }
@media (max-width: 560px) { .missing-pair { grid-template-columns: 1fr; } }

/* Network decomposition: diameter type under the diameter */
.col-diameter { white-space: nowrap; }
.col-diameter .diameter-strong { color: var(--accent); }
.illustration .clusters ellipse { stroke-width: 1.5; }
.illustration .clusters ellipse.color-1 { fill: color-mix(in srgb, var(--color-1) 18%, transparent); stroke: var(--color-1); }
.illustration .clusters ellipse.color-2 { fill: color-mix(in srgb, var(--color-2) 18%, transparent); stroke: var(--color-2); }
.swatch-cluster { width: 16px; height: 12px; border-radius: 50%; border: 1.5px solid; }
.swatch-cluster.color-1 { background: color-mix(in srgb, var(--color-1) 18%, transparent); border-color: var(--color-1); }
.swatch-cluster.color-2 { background: color-mix(in srgb, var(--color-2) 18%, transparent); border-color: var(--color-2); }

/* A source's reference ("Theorem 1.3") linking to the theorem in the paper */
.col-source .sub a.theorem-link { color: var(--accent); font-weight: 400; }
/* "Preprint": the source has not been peer-reviewed yet; same colours as "Report an issue". */
.chip.preprint {
  color: var(--warn-text); background: var(--warn-bg); border: 1px solid var(--warn-border);
  font-size: 0.72rem; padding: 1px 7px; margin: 2px 6px 2px 0; cursor: help;
}
/* "AI-generated": the source is an AI-generated document; a stronger warning than "Preprint". */
.chip.ai-generated {
  color: var(--danger-text); background: var(--danger-bg); border: 1px solid var(--danger-border);
  font-size: 0.72rem; font-weight: 600; padding: 1px 7px; margin: 2px 6px 2px 0; cursor: help; white-space: nowrap;
}

/* Results: edit button at the end of each row, and the edit form in a row below */
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.results-table .col-edit { width: 1%; white-space: nowrap; padding-left: 6px; }
.results-table tbody tr.edit-row:hover { background: transparent; }
.results-table tbody tr.edit-row > td { padding-top: 0; }
.results-table tbody tr.is-target td { box-shadow: inset 0 0 0 1px var(--accent); }
.result-form { margin-top: 4px; max-width: 980px; }
.result-form .expr-pair input { flex: 1 1 14rem; }
.result-form .result-selects { align-items: flex-end; gap: 10px; }
.result-form .result-selects .bib-field { flex: 0 1 auto; }
.result-form .source-row select { flex: 1 1 16rem; max-width: 26rem; }
.result-form .source-row input { flex: 1 1 10rem; }
.runtime-preview { font-size: 1.05rem; min-height: 1.6em; color: var(--text); }
.assumption-checks { flex-wrap: wrap; gap: 6px 16px; }

/* Results obtained by a reduction: "Reduction: Line graph applied to MIS (GG, 2024)" in the Comments column. */
.reduction-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 2px; }
.reduction-chips + * { margin-top: 6px; }
.reduction-chips .chip { margin-right: 0; }
.reduction-word { color: var(--muted); padding: 0 4px 0 0; }
.reduction-target + .reduction-target .reduction-word { padding-left: 4px; }
.reduction-target { display: inline-flex; align-items: center; white-space: nowrap; }
.chip.result { font-weight: 500; color: var(--text); text-decoration: none; background: transparent; border: 1px solid var(--border); }
a.chip.result:hover { color: var(--accent); border-color: var(--accent); }
a.chip.result:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Year range: a to-scale timeline with a dot per year that has results, and two handles */
/* The label and the range sit on the height of the track (its centre is 12px from the top). */
.years-group { align-items: flex-start; }
.years-group .filter-label { line-height: 24px; }
.timeline-row { display: flex; align-items: flex-start; gap: 14px; flex: 1 1 320px; min-width: 0; max-width: 900px; }
.timeline { position: relative; flex: 1 1 auto; min-width: 0; height: 38px; margin: 0 8px; cursor: pointer; touch-action: none; }
.timeline-track, .timeline-range { position: absolute; top: 10px; height: 4px; border-radius: 2px; }
.timeline-track { left: 0; right: 0; background: var(--border); }
.timeline-range { background: var(--accent); opacity: 0.55; }
.timeline-dot {
  position: absolute; top: 8px; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%;
  background: var(--surface); border: 1.5px solid var(--muted);
}
.timeline-dot.in-range { border-color: var(--accent); background: var(--accent-soft); }
.timeline-axis {
  position: absolute; top: 20px; transform: translateX(-50%); font-size: 0.72rem; color: var(--muted);
  font-variant-numeric: tabular-nums; pointer-events: none;
}
.timeline-thumb {
  position: absolute; top: 4px; width: 16px; height: 16px; margin-left: -8px; border-radius: 50%;
  background: var(--accent); border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--accent);
  cursor: grab; touch-action: none;
}
.timeline-thumb.dragging { cursor: grabbing; }
.timeline-thumb:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.timeline-value { flex: none; font-size: 0.9rem; line-height: 24px; white-space: nowrap; font-variant-numeric: tabular-nums; min-width: 6.5rem; }
/* The axis ends in an arrow at the current year */
.timeline-track { right: -6px; }
.timeline-track::after {
  content: ""; position: absolute; right: -9px; top: -4px;
  border-left: 10px solid var(--border); border-top: 6px solid transparent; border-bottom: 6px solid transparent;
}
