:root {
  /* structural (poster neutrals) */
  --primary: #3F98BD;
  --primary-dark: #2D6C85;
  --bg-soft: #eef6f9;
  --bg-alt: #f6fafb;
  --panel: #D7EBF1;
  --border: #d5e4ea;
  --text: #3C3C3B;
  --muted: #6E6E6D;
  --light-pill-text: #6E6E6D;
  --light-pill: #ebedf0;

  /* views */
  --view1: #1F60C9;
  --view2: #E8740C;

  /* methods */
  --tsed: #6E6E6D;
  --met3r: #C00000;
  --defect3r: #037F70;
  --defect3r-light: #eaf5f3;

  /* pair types */
  --positive: #266CDE;
  --positive-bg: #e9f0fc;
  --negative: #D6A300;
  --negative-fill: #EEB500;
  --negative-bg: #fdf6df;
  --hard-negative: #C00000;
  --hard-negative-bg: #fbe8e8;

  --accent: #3F98BD;
  --dataset: #3F98BD;
}

html {
  scroll-behavior: smooth;
  /* anchor jumps land below the (possibly multi-line) fixed navbar */
  scroll-padding-top: var(--nav-h, 3.25rem);
}

body {
  font-family: 'Noto Sans', sans-serif;
  color: var(--text);
  background: #fff;
}

body,
button,
input,
select,
textarea {
  font-family: 'Noto Sans', sans-serif;
}

h1,
h2,
h3,
.navbar-item,
.button,
.title {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
}

.title {
  color: var(--text);
}

.title-smaller {
  font-size: 2.5rem;
}

.top-nav {
  box-shadow: 0 6px 20px rgba(20, 60, 80, 0.08);
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(8px);
}

/* one flexible row: brand left, links right; when space runs out the whole link group
   moves to its own line first (flex-basis: max-content), and only then wraps further */
.top-nav > .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
}

.top-nav .navbar-brand {
  flex: none;
}

.top-nav .navbar-menu {
  display: flex;
  flex: 0 1 max-content;
  min-width: 0;
  padding: 0;
  background: transparent;
  box-shadow: none;
}

.top-nav .navbar-end {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  margin-left: auto;
}

.top-nav .navbar-item {
  display: flex;
  align-items: center;
  color: var(--text);
  font-weight: 500;
}

/* set by JS when the links no longer fit next to the brand */
.top-nav.is-wrapped > .container,
.top-nav.is-wrapped .navbar-end {
  justify-content: center;
}

.top-nav.is-wrapped .navbar-menu {
  flex-basis: 100%;
  justify-content: center;
}

.top-nav.is-wrapped .navbar-brand .navbar-item {
  padding-bottom: 0;
}

.top-nav.is-wrapped .navbar-end {
  margin-left: 0;
}

/* hamburger: set by JS (is-collapsible) when the links would need their own row(s);
   the links then only show while the menu is open (is-open) */
.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-right: 0.25rem;
  padding: 0;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: var(--text);
  font-size: 1.15rem;
  cursor: pointer;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  color: var(--primary);
  background: var(--bg-soft);
  outline: none;
}

.nav-toggle .fa-xmark,
.top-nav.is-open .nav-toggle .fa-bars {
  display: none;
}

.top-nav.is-open .nav-toggle .fa-xmark {
  display: inline-block;
}

.top-nav.is-collapsible > .container {
  justify-content: space-between;
}

.top-nav.is-collapsible .nav-toggle {
  display: flex;
}

.top-nav.is-collapsible .navbar-brand .navbar-item {
  padding-bottom: 0.5rem;
}

.top-nav.is-collapsible:not(.is-open) .navbar-menu {
  display: none;
}

.top-nav.is-collapsible.is-open .navbar-menu {
  padding-bottom: 0.4rem;
  animation: nav-drop 0.18s ease-out;
}

@keyframes nav-drop {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

.top-nav .navbar-item:hover,
.top-nav .navbar-item:focus {
  color: var(--primary);
  background: transparent;
}

.nav-brand {
  font-weight: 700;
}

/* Results dropdown: only on wide screens with a real mouse; elsewhere "Results" is a plain link */
.nav-dropdown {
  position: relative;
  display: flex;
}

.nav-caret,
.nav-dropdown-menu {
  display: none;
}

@media (hover: hover) and (pointer: fine) and (min-width: 1024px) {
  .nav-caret {
    display: inline-block;
    margin-left: 0.35rem;
    font-size: 0.65rem;
    transition: transform 0.15s;
  }

  .nav-dropdown-menu {
    display: block;
    position: absolute;
    top: 100%;
    left: 50%;
    min-width: 13rem;
    padding: 0.4rem;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(20, 60, 80, 0.14);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -6px);
    transition: opacity 0.15s, transform 0.15s, visibility 0.15s;
  }

  .nav-dropdown-menu a {
    display: block;
    padding: 0.45rem 0.8rem;
    border-radius: 8px;
    color: var(--text);
    font-family: 'Google Sans', 'Noto Sans', sans-serif;
    font-weight: 500;
    white-space: nowrap;
  }

  .nav-dropdown-menu a:hover,
  .nav-dropdown-menu a:focus-visible {
    color: var(--primary);
    background: var(--bg-soft);
    outline: none;
  }

  .nav-dropdown:not(.is-closed):hover .nav-dropdown-menu,
  .nav-dropdown:not(.is-closed):focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translate(-50%, 0);
  }

  .nav-dropdown:not(.is-closed):hover .nav-caret,
  .nav-dropdown:not(.is-closed):focus-within .nav-caret {
    transform: rotate(180deg);
  }
}

.paper-hero {
  padding-top: calc(var(--nav-h, 3.25rem) + 1.25rem);
  background: linear-gradient(180deg, #f5fafc 0%, #fff 100%);
}

.publication-venue {
  color: var(--muted);
  margin-bottom: 1rem;
  font-weight: 500;
}

.publication-title {
  color: var(--text);
  line-height: 1.15;
  margin-bottom: 1.4rem !important;
}

.publication-authors {
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.publication-authors a {
  color: var(--text);
}

.publication-authors a:hover {
  color: var(--primary);
}

.publication-links {
  margin-top: 1.75rem;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.button.is-primary {
  background-color: var(--primary);
}

.button.is-primary:hover,
.button.is-primary:focus {
  background-color: var(--primary-dark);
}

.button.is-dark {
  background-color: var(--text);
}

/* ---------- Concept colors ---------- */
.accent { color: var(--accent); }
.dataset { color: var(--dataset); }
.view1 { color: var(--view1); }
.view2 { color: var(--view2); }
.tsed { color: var(--tsed); }
.met3r { color: var(--met3r); }
.defect3r { color: var(--defect3r); }
.positive { color: var(--positive); }
.negative { color: var(--negative); }
.hard-negative { color: var(--hard-negative); }

.ours {
  font-weight: 400;
}

/* ---------- Hero figure ---------- */
.hero-figure-section {
  padding-top: 0.5rem;
}

.hero-figure-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  max-width: 820px;
  margin: 0 auto;
}

.hero-panel,
.comparison-card,
.method-card,
.bibtex-block,
.poster-panel {
  border-radius: 18px;
}

.hero-panel {
  margin: 0;
  padding: 0.8rem;
  background: #fff;
  box-shadow: 0 12px 32px rgba(20, 60, 80, 0.08);
  border: 1px solid var(--border);
}

.hero-panel img,
.comparison-card img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 12px;
}

.panel-label {
  text-align: center;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 1.1rem;
  font-weight: 500;
  margin-bottom: 0.55rem;
}

.panel-label.gt {
  color: var(--text);
}

.panel-label.defect3r {
  font-weight: 700;
}

/* colored image frames, as on the poster */
img.framed {
  border: 3px solid var(--text);
  border-radius: 10px !important;
}

img.framed.view1 { border-color: var(--view1); }
img.framed.view2 { border-color: var(--view2); }
img.framed.met3r { border-color: var(--met3r); }
img.framed.defect3r { border-color: var(--defect3r); }

.hero-arrow {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.8rem;
  text-align: center;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 1.25rem;
  font-weight: 500;
  color: var(--text);
}

.arrow-line {
  position: relative;
  width: 80%;
  height: 4px;
  background: var(--primary-dark);
  border-radius: 2px;
}

.arrow-line::before,
.arrow-line::after {
  content: '';
  position: absolute;
  top: 50%;
  border: 9px solid transparent;
  transform: translateY(-50%);
}

.arrow-line::before {
  left: -14px;
  border-right: 14px solid var(--primary-dark);
  border-left: none;
}

.arrow-line::after {
  right: -14px;
  border-left: 14px solid var(--primary-dark);
  border-right: none;
}

.figure-caption,
.table-footnote,
.section-note {
  color: var(--muted);
}

.figure-caption {
  margin: 1rem auto 0;
  max-width: 880px;
  text-align: center;
}

/* ---------- Sections ---------- */
.section-title {
  margin-bottom: 1rem !important;
}

.section-heading {
  margin-bottom: 2rem;
}

/* break a heading at a chosen point on wide screens only */
.keep-together {
  white-space: nowrap;
}

.section-lead {
  max-width: 880px;
  margin: 0 auto;
  color: var(--muted);
}

.abstract-box {
  padding: 1.75rem;
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: 20px;
}

/* short summary shown instead of the full abstract */
.tldr-box {
  padding: 1.4rem 1.75rem;
  background: var(--panel);
  border-radius: 20px;
  font-size: 1.08rem;
  line-height: 1.65;
  text-align: center;
}

/* full abstract, folded away by default */
.abstract-fold {
  margin-top: 1rem;
}

.abstract-fold > summary {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.4rem 1rem;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  cursor: pointer;
  list-style: none;
  user-select: none;
  transition: color 0.15s, border-color 0.15s;
}

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

.abstract-fold > summary:hover,
.abstract-fold > summary:focus-visible {
  color: var(--primary-dark);
  border-color: var(--primary);
  outline: none;
}

.abstract-fold > summary i {
  font-size: 0.75rem;
  transition: transform 0.2s;
}

.abstract-fold[open] > summary i {
  transform: rotate(180deg);
}

.abstract-fold[open] > .abstract-box {
  margin-top: 1rem;
}

.alt-section {
  background: var(--bg-alt);
}

.comparison-group,
.content-block {
  margin-top: 2.25rem;
}

/* ---------- Problem ---------- */
.method-card {
  height: 100%;
  padding: 1.4rem;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 12px 30px rgba(20, 60, 80, 0.07);
}

.method-card p {
  color: var(--muted);
}

.problem-card h3 {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--accent);
}

.problem-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border-radius: 999px;
  background: var(--panel);
  color: var(--primary-dark);
  font-size: 0.9rem;
}

.check-list {
  margin: 0.6rem 0 0.9rem;
  padding: 0;
  list-style: none;
}

.check-list li {
  position: relative;
  padding-left: 1.2rem;
  margin-bottom: 0.35rem;
}

.check-list li::before {
  content: '';
  position: absolute;
  left: 0.15rem;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: var(--accent);
}

.card-note {
  font-size: 0.92rem;
  padding-top: 0.8rem;
  border-top: 1px dashed var(--border);
}

/* ---------- Poster figures ---------- */
.poster-panel {
  margin: 0 auto;
  padding: 1rem;
  background: var(--panel);
  max-width: 900px;
}

.poster-panel img {
  display: block;
  width: 100%;
  height: auto;
}

/* ---------- Dataset ---------- */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 2rem;
}

.stat-card {
  padding: 1.2rem 1rem;
  text-align: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(20, 60, 80, 0.06);
}

.stat-number {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 2.2rem;
  font-weight: 700;
  line-height: 1.1;
  color: var(--accent);
}

.stat-label {
  margin-top: 0.4rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.pair-type-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
  margin-top: 1.25rem;
}

.pair-type-card {
  padding: 1.2rem;
  background: #fff;
  border: 1px solid var(--border);
  border-top: 4px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(20, 60, 80, 0.06);
  text-align: center;
}

.pair-type-card.positive { border-top-color: var(--positive); }
.pair-type-card.negative { border-top-color: var(--negative-fill); }
.pair-type-card.hard-negative { border-top-color: var(--hard-negative); }

.pair-type-card,
.pair-type-card p {
  color: var(--muted);
}

.pair-type-card p {
  font-size: 0.92rem;
  text-align: left;
}

/* two cameras linked by a line: which meshes the two views come from */
.pair-cams {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0.9rem 0 0.8rem;
  color: var(--text);
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-weight: 500;
}

.cam {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.cam i {
  font-size: 0.95rem;
}

.cam-link {
  flex: 0 0 1.6rem;
  height: 2px;
  margin: 0 0.5rem;
  border-radius: 1px;
}

.pair-type-card.positive .cam i { color: var(--positive); }
.pair-type-card.negative .cam i { color: var(--negative-fill); }
.pair-type-card.hard-negative .cam i { color: var(--hard-negative); }
.pair-type-card.positive .cam-link { background: var(--positive); }
.pair-type-card.negative .cam-link { background: var(--negative-fill); }
.pair-type-card.hard-negative .cam-link { background: var(--hard-negative); }

.pair-tag {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
}

.pair-tag.positive { color: var(--positive); background: var(--positive-bg); }
.pair-tag.negative { color: var(--negative); background: var(--negative-bg); }
.pair-tag.hard-negative { color: var(--hard-negative); background: var(--hard-negative-bg); }

/* ---------- Method ---------- */
.method-columns {
  margin-top: 1.5rem;
}

/* ---------- Results: highlights ---------- */
.highlight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.highlight-card {
  padding: 1.2rem;
  text-align: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(20, 60, 80, 0.06);
}

.highlight-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--primary-dark);
  background: var(--panel);
}

.highlight-text {
  margin: 0.7rem 0 0.4rem;
  font-weight: 500;
  color: var(--text);
}

.highlight-number {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 1.6rem;
  color: var(--text);
}

.highlight-number .arrow {
  color: var(--muted);
  margin: 0 0.15rem;
}

.highlight-sub {
  font-size: 0.88rem;
  color: var(--muted);
}

/* ---------- Results: qualitative grid ---------- */
.model-divider {
  display: inline-block;
  padding: 0.45rem 0.9rem;
  margin: 0.25rem 0 1rem;
  border-radius: 999px;
  font-weight: 700;
}

.model-divider.positive { color: var(--positive); background: var(--positive-bg); }
.model-divider.negative { color: var(--negative); background: var(--negative-bg); }
.model-divider.hard-negative { color: var(--hard-negative); background: var(--hard-negative-bg); }

.five-col-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.8rem;
}

.grid-header {
  margin-bottom: 0.75rem;
}

.grid-header > div {
  padding: 0.6rem 0.8rem;
  text-align: center;
  font-weight: 700;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
}

.grid-header > div:not(.view1):not(.view2):not(.met3r):not(.defect3r) {
  color: var(--text);
}

.figure-table-header {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.feature-note {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
}

/* sticky grid header: pose switch + column labels stay below the navbar */
.qualitative {
  /* white margin the sticky bars extend past the grid, so card edges and shadows stay hidden */
  --bar-bleed: 1.5rem;
}

.sticky-head {
  position: sticky;
  top: var(--nav-h, 3.25rem);
  z-index: 6;
  margin: 0 calc(-1 * var(--bar-bleed));
  padding: 0.6rem var(--bar-bleed) 0.1rem;
  background: #fff;
}

.sticky-head .pose-toggle {
  margin: 0 0 1.2rem;
}

.sticky-head .grid-header {
  margin-bottom: 1.2rem;
}

/* the pair-type label sticks below the header, but only while its own group is in view */
.pair-group-head {
  position: sticky;
  top: calc(var(--nav-h, 3.25rem) + var(--head-h, 7rem));
  z-index: 5;
  margin: 0 calc(-1 * var(--bar-bleed));
  padding: 0.1rem var(--bar-bleed) 0.9rem;
  background: #fff;
}

.pair-group-head .model-divider {
  margin: 0;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.pair-group-head .model-divider:hover,
.pair-group-head .model-divider:focus-visible {
  box-shadow: 0 0 0 2px currentColor;
  outline: none;
}

/* clicking a pair-type label scrolls its group to just below the sticky header */
.pair-group {
  scroll-margin-top: var(--head-h, 7rem);
}

/* "Citation" in the navbar lands on the takeaways, so both are in view */
.takeaways {
  scroll-margin-top: 1.5rem;
}

/* targets of the Results dropdown in the navbar */
#visual-comparison,
#pixel-level,
#pair-level {
  scroll-margin-top: 1.25rem;
}

.pair-group + .pair-group {
  margin-top: 1.2rem;
}

.example-row {
  margin-bottom: 0.8rem;
}

.comparison-card {
  position: relative;
  padding: 0.5rem;
  background: #fff;
  border: 1px solid var(--border);
  box-shadow: 0 8px 24px rgba(20, 60, 80, 0.06);
  /* lets the peek pill adapt to the card's own width (see @container below) */
  container-type: inline-size;
}

.comparison-card img {
  border-radius: 8px;
}

.comparison-card.view1 { border: 2px solid var(--view1); }
.comparison-card.view2 { border: 2px solid var(--view2); }
.comparison-card.met3r { border: 2px solid var(--met3r); }
.comparison-card.defect3r { border: 2px solid var(--defect3r); }
.comparison-card.gt { border: 2px solid var(--text); }

.card-pills {
  position: absolute;
  right: 0.9rem;
  bottom: 0.9rem;
  display: flex;
  gap: 0.4rem;
}

/* "Peek DINO only": a hover action, styled as a button rather than a label */
.peek-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.3rem;
  padding: 0.25rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  color: var(--text);
  background: rgba(255, 255, 255, 0.95);
  border: 1px dashed var(--muted);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
  user-select: none;
}

.peek-pill:hover,
.peeking .peek-pill {
  color: #fff;
  background: var(--defect3r);
  border: 1px solid var(--defect3r);
}

.peek-pill.inline {
  cursor: default;
  font-size: 0.8rem;
  padding: 0.1rem 0.5rem;
  box-shadow: none;
}

/* narrow cards: the pill collapses to just the eye icon, the badge still names the variant */
@container (max-width: 175px) {
  .comparison-card .card-pills {
    right: 0.45rem;
    bottom: 0.45rem;
  }

  .peek-pill:not(.inline) {
    padding: 0.3rem;
  }

  .peek-pill:not(.inline) .peek-text {
    display: none;
  }

  .comparison-card .variant-badge {
    top: 0.45rem;
    left: 0.45rem;
    padding: 0.1rem 0.35rem;
    font-size: 0.62rem;
  }
}

@container (max-width: 90px) {
  .comparison-card .card-pills {
    right: 0.25rem;
    bottom: 0.25rem;
  }

  .peek-pill:not(.inline) {
    padding: 0.2rem;
    font-size: 0.6rem;
  }

  .comparison-card .variant-badge {
    top: 0.25rem;
    left: 0.25rem;
    padding: 0.05rem 0.25rem;
    font-size: 0.5rem;
    border-radius: 4px;
  }
}

/* label that appears on the image while peeking, so it is clear what is shown */
.variant-badge {
  position: absolute;
  top: 0.9rem;
  left: 0.9rem;
  padding: 0.2rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: var(--defect3r);
  border-radius: 6px;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}

.peeking .variant-badge {
  opacity: 1;
}

.qualitative[data-pose="gt"] .card-pills {
  display: none;
}

.pose-toggle {
  display: flex;
  justify-content: center;
  margin-top: 1.25rem;
}

.pose-btn {
  padding: 0.45rem 1.1rem;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.pose-btn:first-child { border-radius: 999px 0 0 999px; }
.pose-btn:last-child { border-radius: 0 999px 999px 0; border-left: none; }

.pose-btn.is-active {
  color: #fff;
  background: var(--primary);
  border-color: var(--primary);
}

.figure-breakout {
  width: min(1100px, calc(100vw - 4rem));
  position: relative;
  left: 50%;
  transform: translateX(-50%);
}

/* ---------- Results: tables ---------- */
.table-wrap {
  overflow-x: auto;
  margin-top: 1rem;
}

.results-table {
  margin: 0 auto;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  font-size: 0.9rem;
  font-variant-numeric: tabular-nums;
}

.results-table th,
.results-table td {
  padding: 0.38rem 0.75rem;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
  border-bottom: 1px solid #edf2f5;
}

.results-table col.ours-col {
  background: var(--defect3r-light);
}

.results-table thead th {
  background: var(--bg-soft);
}

.results-table .method-row th {
  padding-top: 0.6rem;
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  border-bottom: 2px solid currentColor;
}

.results-table .method-row th:first-child {
  border-bottom-color: transparent;
}

.results-table .config-row th {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted);
}

.results-table .row-label {
  text-align: left;
  font-weight: 700 !important;
  color: var(--text) !important;
}

.results-table tbody + tbody tr:first-child > * {
  border-top: 1px solid var(--border);
}

.results-table tbody tr:last-child > * {
  border-bottom: none;
}

.results-table tbody:not(:last-child) tr:last-child > * {
  border-bottom: 1px solid #edf2f5;
}

.results-table .subset {
  text-align: left;
  font-weight: 700;
  background: #fff;
}

.results-table .metric {
  text-align: left;
  font-weight: 500;
  color: var(--text);
  background: #fff;
}

.results-table .metric .sub {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--muted);
}

.results-table strong {
  color: var(--text);
}

.results-table .muted-row td {
  color: var(--muted);
}

.table-footnote,
.section-note {
  margin-top: 0.9rem;
  font-size: 0.95rem;
}

.table-footnote {
  text-align: center;
  max-width: 820px;
  margin-left: auto;
  margin-right: auto;
}

/* ---------- Results: AUC chart ---------- */
.auc-chart {
  position: relative;
  max-width: 560px;
  margin: 1.5rem auto 1.75rem;
  padding: 1.2rem 1.4rem 1.9rem;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: 0 8px 24px rgba(20, 60, 80, 0.06);
  --name-w: 6rem;
}

.auc-title {
  font-family: 'Google Sans', 'Noto Sans', sans-serif;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 0.8rem;
}

.auc-title .muted {
  font-weight: 400;
  color: var(--muted);
}

.auc-row {
  display: flex;
  align-items: center;
  margin-bottom: 0.5rem;
}

.auc-name {
  width: var(--name-w);
  flex: none;
  font-weight: 500;
}

.auc-track {
  flex: 1;
  height: 1.7rem;
}

.auc-bar {
  height: 100%;
  display: flex;
  align-items: center;
  padding-left: 0.5rem;
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
  border-radius: 0 6px 6px 0;
}

.auc-bar.tsed { background: var(--tsed); }
.auc-bar.met3r { background: var(--met3r); }
.auc-bar.defect3r { background: var(--defect3r); }

.auc-chance {
  position: absolute;
  top: 2.6rem;
  bottom: 0.9rem;
  /* 50% of the track: chart padding + name column + half of the remaining width */
  left: calc(1.4rem + var(--name-w) + (100% - 2.8rem - var(--name-w)) / 2);
  border-left: 2px dashed var(--muted);
}

.auc-chance span {
  position: absolute;
  bottom: -1.3rem;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.75rem;
  font-style: italic;
  color: var(--muted);
}

/* ---------- Takeaways ---------- */
.takeaways {
  max-width: 760px;
  margin: 0 auto;
  padding: 1.4rem 1.8rem;
  background: var(--panel);
  border-radius: 20px;
}

.takeaways h3 {
  margin-bottom: 0.8rem !important;
}

.takeaways ul {
  list-style: disc;
  margin-left: 1.2rem;
}

.takeaways li {
  margin-bottom: 0.3rem;
}

/* ---------- Citation / footer ---------- */
.bibtex-block {
  padding: 1.4rem;
  background: #2b2b2a;
  color: #f3f6f7;
  overflow-x: auto;
}

.bibtex-wrap {
  position: relative;
}

.copy-btn {
  position: absolute;
  top: 0.7rem;
  right: 0.7rem;
  z-index: 1;
  width: 2.2rem;
  height: 2.2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #f3f6f7;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.copy-btn:hover {
  background: rgba(255, 255, 255, 0.18);
}

.copy-btn.copied {
  color: #7fd6c8;
  border-color: #7fd6c8;
}

.acknowledgments {
  color: var(--muted);
}

.footer-small {
  padding: 2rem 1.5rem 2.5rem;
  background: #fff;
}

/* ---------- Term tooltip / popover ---------- */
.term-trigger {
  position: relative;
  cursor: help;
  border-bottom: 1px dashed currentColor;
  white-space: nowrap;
}

.term-popup {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  z-index: 9999;
  bottom: calc(100% + 10px);
  left: 50%;
  transform: translateX(-50%);
  width: 300px;
  padding: 0.9rem 1rem;
  background: #2b2b2a;
  color: #f3f6f7;
  border-radius: 12px;
  font-size: 0.88rem;
  font-family: 'Noto Sans', sans-serif;
  font-weight: 400;
  line-height: 1.55;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
  text-align: left;
  white-space: normal;
  transition: opacity 0.15s ease, visibility 0.15s ease;
}

.term-popup strong {
  color: #ffffff;
}

.term-popup em {
  color: #b9d9e6;
}

.term-popup::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 7px solid transparent;
  border-top-color: #2b2b2a;
}

.term-trigger:hover .term-popup {
  visibility: visible;
  opacity: 1;
  animation: popover-delay 0.6s;
}

@keyframes popover-delay {
  0%   { opacity: 0; visibility: hidden; }
  66%  { opacity: 0; visibility: hidden; }
  100% { opacity: 1; visibility: visible; }
}

@media screen and (max-width: 1023px) {
  .top-nav > .container {
    padding: 0 0.5rem;
  }
}

@media screen and (max-width: 768px) {
  .publication-title {
    font-size: 2rem !important;
  }

  .tldr-box {
    padding: 1.1rem 1.2rem;
    font-size: 1rem;
    text-align: left;
  }

  /* justified text leaves big gaps on narrow screens */
  .abstract-box {
    padding: 1.2rem;
    text-align: left !important;
  }

  .title-smaller {
    font-size: 1.6rem;
  }

  .wide-only {
    display: none;
  }

  .keep-together {
    white-space: normal;
  }

  .feature-note {
    font-size: 0.6rem;
  }

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

  .pair-type-grid,
  .highlight-grid {
    grid-template-columns: 1fr;
  }

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

  .hero-arrow {
    display: none;
  }

  .five-col-grid {
    gap: 0.35rem;
  }

  .comparison-card {
    padding: 0.2rem;
  }

  .grid-header > div {
    padding: 0.4rem 0.2rem;
    font-size: 0.7rem;
  }

  .figure-breakout {
    width: calc(100vw - 1.5rem);
  }

  .qualitative {
    --bar-bleed: 0.75rem;
  }

  .figure-table-header .ours {
    display: block;
  }
}
