/* CROSS 1 paper page (v1/), Swiss style: the layout of sgs-rl.github.io (itself a paper page) and of the CROSS hub.
   ../assets/css/chrome.css is loaded first: the tokens, the black top bar (.sh-*) and the footer (.sf-*). site.css is not
   loaded here (its generic class names collide with this page's), so the Swiss pieces this page uses are reimplemented
   below with the hub's values. The rules: one family (Inter Tight); huge regular-weight titles between black rules that
   run across the window; light statements with the key phrase in 600; a 12-column grid with --m margins; hairlines
   between rows, black rules above groups; square corners; no shadows, gradients or cards; one accent (red, yellow in the
   dark theme) for small markers; in charts CROSS in --c-cross and the other methods in grey. */

/* ------------------------------------------------------------------ page tokens (the shared ones are in chrome.css) */
:root {
  --subnav-h: 34px;                 /* the section bar under the top bar, borders included */
  --anchor-top: calc(var(--header-h) + var(--subnav-h) - 1px);  /* where a linked or focused element lands */
  --on-accent: #ffffff;             /* text or icons on an accent fill */
  --blue: #2a78d6;                  /* demo: pose branches */
  --green: #1baf7a;                 /* demo: retrievals lifted to poses */
  --canvas-bg: #f2f2ef;             /* demo: the map panels */
  --corridor: #dfdfd9;
  --fig-bg: #ffffff;                /* paper figures are drawn on white */
  --clip-bg: #fefefe;               /* the robustness clips' own white, in both themes (they are figures) */
  --data-other: color-mix(in srgb, var(--ink) 30%, transparent);    /* the other methods in charts */
  --data-other-2: color-mix(in srgb, var(--ink) 58%, transparent);  /* a second baseline, when two are compared */
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    --on-accent: #111110;
    --blue: #3987e5;
    --green: #199e70;
    --canvas-bg: #1a1a19;
    --corridor: #2c2c2a;
    --fig-bg: #f4f3ef;
  }
}
:root[data-theme="dark"] {
  --on-accent: #111110;
  --blue: #3987e5;
  --green: #199e70;
  --canvas-bg: #1a1a19;
  --corridor: #2c2c2a;
  --fig-bg: #f4f3ef;
}

/* ------------------------------------------------------------------ base */
*, *::before, *::after { box-sizing: border-box; }
/* anchors land just below the top bar and the section bar; a section's (or numbered subsection's) top rule hides under
   the bar's bottom rule. The offset is a scroll margin on the targets and on everything that takes focus, not a scroll
   padding on the page: with a padding, Chrome counts the sticky bars as covered and scrolls the page up whenever focus
   moves into them (the theme toggle, Shift+Tab into the section bar). The bars' own links take no margin, except the
   section bar's in short windows, where it scrolls with the page (see max-height: 500px below).
   Smooth scrolling is switched on by main.js once the fonts are in (html.smooth-scroll): a smooth jump to the link's
   #id on load would keep its first target while the fonts and the maths change the page above it. */
html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}
html.smooth-scroll { scroll-behavior: smooth; }
:is([id], a[href], button, input, select, textarea, summary, [tabindex]):not(.sh, .sh *, .topnav, .topnav *) { scroll-margin-top: var(--anchor-top); }
/* targets inside a section get some air under the bar */
#teaser, #demo, #steps, #relocCard, #topoCard, #rob { scroll-margin-top: calc(var(--anchor-top) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, video, canvas, svg { display: block; max-width: 100%; }
img, video { height: auto; }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .18em; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
a:hover { text-decoration-color: currentColor; }
h1, h2, h3, h4 { margin: 0; font-weight: 400; line-height: 1.05; letter-spacing: -0.035em; color: var(--ink); }
strong, b { font-weight: 600; }
p, ul, ol { margin: 0; }
figure { margin: 0; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
code, kbd, pre, samp { font-family: var(--mono); letter-spacing: 0; }
::selection { background: var(--accent); color: var(--bg); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.nowrap { white-space: nowrap; }

/* ------------------------------------------------------------------ Swiss pieces (as on the hub) */
/* a section: <section class="sec"><header class="sx-head">...</header><div class="sec-body">...</div></section> */
.sec-body { padding: clamp(20px, 2.6vw, 36px) var(--m) clamp(56px, 7vw, 104px); }
/* the section title: a huge regular-weight word between two black rules that run across the window */
.sx-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px 24px; flex-wrap: wrap;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  padding: .02em var(--m) .06em;
}
.sx-h { font-size: clamp(44px, 9.6vw, 104px); font-weight: 400; letter-spacing: -0.05em; line-height: 1; padding-top: .04em; }
.sx-aside { padding-bottom: .55em; font-size: clamp(15px, 1.4vw, 21px); letter-spacing: -0.015em; color: var(--ink); }
/* a subsection title between rules that run across the window: <h3 class="sx-sub">From relocalization to ...</h3> */
.sx-sub {
  display: flex; align-items: baseline;
  margin: clamp(56px, 7vw, 104px) calc(-1 * var(--m)) clamp(18px, 2.2vw, 30px);
  padding: .1em var(--m) .06em;
  border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule);
  font-size: clamp(30px, 4vw, 52px); letter-spacing: -0.04em; line-height: 1.05;
}
/* statements: light sentences, the key phrase in 600 */
.sx-statement { max-width: 30em; font-size: clamp(22px, 2.75vw, 40px); font-weight: 200; line-height: 1.14; letter-spacing: -0.03em; }
.sx-statement strong { font-weight: 600; }
/* the mid-size statement of longer sections: a copy of site.css's .sx-statement--md (replays, docs), as site.css is not
   loaded here; smaller, the same light weight and 600 key phrase, its own line height and tracking */
.sx-statement-md { max-width: 36em; font-size: clamp(20px, 2.1vw, 30px); line-height: 1.16; letter-spacing: -0.028em; }
.sec-body > .sx-statement { margin-bottom: clamp(30px, 4vw, 56px); }
.sx-label { font-size: 13px; line-height: 1.4; letter-spacing: 0; color: var(--ink-3); }
.sx-list-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1em; padding-bottom: .3em; border-bottom: 1px solid var(--rule); font-size: 15px; letter-spacing: -0.01em; }
/* text links with an arrow: the underline shrinks on hover */
.sx-link {
  display: inline-flex; align-items: baseline; gap: .3em; color: var(--ink); text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor); background-position: 0 100%; background-repeat: no-repeat;
  background-size: 100% 1px; transition: background-size .25s;
}
.sx-link:hover { background-size: 0% 1px; }

/* ------------------------------------------------------------------ masthead: the wordmark, the title, authors, links */
/* as on the reference paper page: the wordmark on 7 of 12 columns (so its letters are as tall as the hub's) with the
   authors and affiliation under it; the title on the other 5, starting level with the wordmark, and the venue and links
   under it, ending level with the affiliation */
.mast {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto auto; column-gap: var(--g); row-gap: 16px;
  padding: 10px var(--m) clamp(24px, 2.8vw, 40px);
}
.mast-mark { grid-column: 1 / 8; grid-row: 1; container-type: inline-size; min-width: 0; }
.mast h1 { grid-column: 8 / 13; grid-row: 1; align-self: start; padding-top: 4px; min-width: 0; }
.mast-people { grid-column: 1 / 8; grid-row: 2; align-self: end; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.mast-side { grid-column: 8 / 13; grid-row: 2; align-self: end; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
/* the wordmark fills its column: CROSS is 2.845 em wide in Inter Tight at -0.065 em tracking */
.wm { --wm: calc(100cqw / 2.86); position: relative; display: block; width: 2.845em; height: .73em; font-size: var(--wm); }
.wm-mark {
  display: block; margin: 0 0 0 -.0332em; font-weight: 400; font-size: 1em; line-height: .73;
  letter-spacing: -.065em; white-space: nowrap; color: var(--ink);
}
/* the words of the acronym sit inside the letters, in the accent's text shade (4.5:1 at this size) */
.wm-word {
  position: absolute; left: calc(var(--x) * var(--wm)); top: calc(var(--y) * var(--wm));
  font-size: max(8.5px, min(13px, calc(var(--wm) * .046))); line-height: 1; letter-spacing: -0.02em; white-space: nowrap; color: var(--accent-ink);
}
.mast h1 { font-size: clamp(26px, 2.9vw, 56px); line-height: 1.04; letter-spacing: -0.035em; font-weight: 400; text-wrap: balance; }
/* the authors as plain names; a name is underlined only where it links to a page */
.mast-authors { display: flex; flex-wrap: wrap; gap: 2px .85em; font-size: clamp(15px, 1.25vw, 24px); line-height: 1.3; letter-spacing: -0.012em; }
.mast-authors > * { white-space: nowrap; }
.mast-authors a { text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); }
.mast-affil { font-size: clamp(13px, .95vw, 18px); color: var(--ink-3); }
.mast-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; font-size: 16px; letter-spacing: -0.01em; }
.mast-venue { color: var(--ink); }
.mast-more { font-size: 13px; color: var(--ink-3); }

/* ------------------------------------------------------------------ section bar: sticks below the top bar */
.topnav {
  position: sticky; top: var(--header-h); z-index: 50; height: var(--subnav-h);
  background: var(--bg); border-top: 1px solid var(--rule); border-bottom: 1px solid transparent;
}
.topnav.is-stuck { border-bottom-color: var(--rule); }
.topnav-inner { position: relative; height: 100%; padding-inline: var(--m); display: flex; align-items: center; gap: 20px; font-size: 13px; line-height: 1; }
.topnav .brand { flex: none; color: var(--ink); text-decoration: none; }
/* the page's name would run into the centred links: below 1000 px only the links show */
@media (max-width: 1000px) { .topnav .brand { display: none; } }
/* centred under the top bar's links */
.topnav-links { position: absolute; left: 50%; top: 0; bottom: 0; transform: translateX(-50%); display: flex; align-items: center; gap: 18px; }
.topnav-links a { position: relative; color: var(--ink-3); text-decoration: none; white-space: nowrap; transition: color .15s; }
.topnav-links a:hover, .topnav-links a.active { color: var(--ink); }
.topnav-links a.active::before { content: ""; position: absolute; left: -10px; top: 50%; width: 6px; height: 6px; margin-top: -3px; background: var(--accent); }

/* ------------------------------------------------------------------ video: the player, the paragraph, the chapters */
/* 1200 px and up: the player on 8 columns; on the other 4, the section's paragraph at the top and the chapter list at the
   foot. Their type is in container units (cqw, the grid's width), so the column grows with the player and fills its
   height at every width. Narrower: the player, then the paragraph beside the chapters; phones: one column. */
.vid-grid {
  container-type: inline-size;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto 1fr; column-gap: var(--g); row-gap: 1.6cqw;
}
.vid-player { grid-column: 1 / 9; grid-row: 1 / 3; min-width: 0; }
.vid-intro { grid-column: 9 / 13; grid-row: 1; min-width: 0; }
.vid-grid > .chapters { grid-column: 9 / 13; grid-row: 2; align-self: end; min-width: 0; }
.vid-frame { position: relative; aspect-ratio: 16 / 9; background: #000; }
.vid-frame video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
/* the paragraph: a light statement under a black rule */
.vid-intro {
  padding-top: .3em; border-top: 1px solid var(--rule);
  font-size: 1.68cqw; font-weight: 300; line-height: 1.2; letter-spacing: -0.022em; text-wrap: pretty;
}
/* the chapters: time, then the chapter; the playing one in ink with the accent square before its time (the square's
   room is kept, so nothing moves) */
.chapters { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.chapters button {
  width: 100%; display: grid; grid-template-columns: 3.3em minmax(0, 1fr); column-gap: .5em; align-items: baseline;
  padding: .4em 0; border: 0; border-bottom: 1px solid var(--line); background: none; text-align: left;
  font-size: 1.2cqw; letter-spacing: -0.015em; line-height: 1.2; color: var(--ink-3); transition: color .15s;
}
.chapters button:hover, .chapters button[aria-current] { color: var(--ink); }
.ch-t { font-size: .84em; letter-spacing: 0; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ch-t::before { content: ""; display: inline-block; width: .55em; height: .55em; margin-right: .5em; background: transparent; }
.chapters button[aria-current] .ch-t::before { background: var(--accent); }
@media (max-width: 1199px) {
  .vid-grid { grid-template-rows: none; row-gap: 20px; }
  .vid-player { grid-column: 1 / -1; grid-row: auto; }
  .vid-intro { grid-column: 1 / 7; grid-row: auto; font-size: clamp(18px, 2.3vw, 24px); }
  .vid-grid > .chapters { grid-column: 7 / 13; grid-row: auto; align-self: start; }
  .chapters button { font-size: 15px; }
}
@media (max-width: 760px) {
  .vid-intro, .vid-grid > .chapters { grid-column: 1 / -1; }
}

/* ------------------------------------------------------------------ overview: figures and the teaser */
.figures {
  list-style: none; margin: 0; padding: 0;
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--g); row-gap: 28px;
}
.figures li { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding-top: 8px; border-top: 1px solid var(--rule); }
.fig-v { font-size: clamp(48px, 6.6vw, 104px); font-weight: 200; letter-spacing: -0.06em; line-height: .9; white-space: nowrap; }
.fig-u { letter-spacing: -0.04em; }
.fig-k { max-width: 22em; font-size: clamp(15px, 1.15vw, 18px); line-height: 1.25; letter-spacing: -0.012em; }
.fig-c { font-size: 13px; color: var(--ink-3); }
.figures-note { margin-top: 22px; max-width: 70em; }

.teaser { margin-top: clamp(56px, 7vw, 104px); }
.spot-stage { position: relative; overflow: hidden; background: var(--fig-bg); }
.spot-stage img { width: 100%; height: auto; }
.spot-figure-method .spot-stage { padding: 12px; }
/* a figure that opens in the lightbox without a frame of its own (the stage is the frame) */
.zoomable.zoom-flush { padding: 0; background: none; }
/* the spotlight: a square accent frame; the rest of the figure fades toward the page colour */
.spot {
  position: absolute; pointer-events: none;
  border: 2px solid var(--accent); box-shadow: 0 0 0 9999px color-mix(in srgb, var(--bg) 65%, transparent);
  opacity: 0; transition: opacity .25s, left .35s cubic-bezier(.2, .8, .2, 1), top .35s cubic-bezier(.2, .8, .2, 1), width .35s cubic-bezier(.2, .8, .2, 1), height .35s cubic-bezier(.2, .8, .2, 1);
}
.spot.on { opacity: 1; }
.teaser-cap { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); row-gap: 18px; margin-top: 14px; }
.teaser-cap > p { grid-column: 1 / 6; font-size: clamp(15px, 1.25vw, 20px); font-weight: 300; line-height: 1.42; }
.teaser-cap > .spot-keys { grid-column: 7 / 13; }
.spot-keys { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--g); border-top: 1px solid var(--rule); }
.spot-keys li { display: flex; gap: 10px; align-items: baseline; padding: 6px 0; border-bottom: 1px solid var(--line); font-size: 14px; line-height: 1.3; color: var(--ink-2); cursor: default; }
.spot-keys button {
  flex: none; min-width: 30px; height: 22px; padding: 0 6px; border: 1px solid var(--line-2); background: none; color: var(--ink);
  font-family: var(--mono); font-size: 12px; transition: background .15s, color .15s, border-color .15s;
}
.spot-keys li:hover { color: var(--ink); }
.spot-keys li:hover button, .spot-keys button.on, .spot-keys button:focus-visible { background: var(--ink); border-color: var(--ink); color: var(--bg); }

/* ------------------------------------------------------------------ abstract */
.abstract { max-width: 44em; font-size: clamp(18px, 1.45vw, 21px); font-weight: 300; line-height: 1.5; letter-spacing: -0.012em; }

/* ------------------------------------------------------------------ idea: where methods judge a match (2 x 2, ruled) */
.quad { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); }
.quad > :nth-child(3n + 1) { grid-column: 1 / 3; }
.quad > :nth-child(3n + 2) { grid-column: 3 / 8; }
.quad > :nth-child(3n) { grid-column: 8 / 13; }
.quad-corner, .quad-colhead { border-bottom: 1px solid var(--rule); }
.quad-colhead { align-self: end; padding-bottom: 6px; font-size: 13px; line-height: 1.35; color: var(--ink-2); }
.quad-rowhead { padding: 12px 0; border-bottom: 1px solid var(--line); font-size: 13px; line-height: 1.35; color: var(--ink-3); }
.quad-rowhead strong { display: inline-block; margin-top: 3px; font-size: clamp(15px, 1.2vw, 18px); font-weight: 400; letter-spacing: -0.015em; line-height: 1.2; color: var(--ink); }
.quad-cell { padding: 12px 0 16px; border-bottom: 1px solid var(--line); }
.quad-cell h3 { margin-bottom: 6px; font-size: clamp(19px, 1.6vw, 24px); letter-spacing: -0.03em; line-height: 1.1; }
.quad-cell p { max-width: 34em; font-size: 15px; font-weight: 300; line-height: 1.4; }
/* each cell names its column (and, for screen readers, its row); shown only when the grid is one column (phones) */
.quad-cell .quad-tag { margin: 0 0 6px; font-size: 12px; font-weight: 400; line-height: 1.35; color: var(--ink-3); }
@media (min-width: 761px) {
  .quad-cell .quad-tag { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
}
/* the CROSS cell is the marked one: an accent bar and a tint, as a marked line of a listing */
.quad-cross { padding-inline: 14px; background: color-mix(in srgb, var(--accent) 8%, transparent); box-shadow: inset 3px 0 var(--accent); }

/* ------------------------------------------------------------------ demo: an interactive figure with a title that states its point */
.demo { margin-top: clamp(56px, 7vw, 104px); }
.demo-title { padding-top: 8px; border-top: 1px solid var(--rule); font-size: clamp(24px, 2.6vw, 38px); letter-spacing: -0.035em; line-height: 1.08; text-wrap: balance; }
.demo-intro { max-width: 46em; margin-top: 12px; font-size: 16.5px; font-weight: 300; line-height: 1.45; }
.demo-controls {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px 14px;
  margin: 20px 0 18px; padding: 8px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--line);
}
.demo-controls input[type="range"] { flex: 1; min-width: 160px; }
/* square buttons: ink outline, the primary one filled */
.btn {
  flex: none; width: 36px; height: 36px; padding: 0; display: inline-grid; place-items: center;
  border: 1px solid var(--ink); border-radius: 0; background: transparent; color: var(--ink);
  transition: background .15s, color .15s, border-color .15s;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: square; }
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary svg { fill: currentColor; stroke: none; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn .i-pause { display: none; }
.btn.playing .i-play { display: none; }
.btn.playing .i-pause { display: block; }
.btn-text {
  width: auto; height: auto; padding: 4px 0; border: 0; background: none; font-size: 14px;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em;
}
.btn-text:hover { background: none; color: var(--ink); text-decoration-thickness: 2px; }

/* the time slider: a 2 px track, the played part in ink, a square accent thumb */
input[type="range"] { -webkit-appearance: none; appearance: none; height: 28px; margin: 0; background: transparent; cursor: pointer; --pct: 0%; }
input[type="range"]::-webkit-slider-runnable-track {
  height: 2px; background: linear-gradient(90deg, var(--ink) var(--pct), color-mix(in srgb, var(--ink) 18%, transparent) var(--pct));
}
input[type="range"]::-moz-range-track { height: 2px; background: color-mix(in srgb, var(--ink) 18%, transparent); }
input[type="range"]::-moz-range-progress { height: 2px; background: var(--ink); }
input[type="range"]::-webkit-slider-thumb { -webkit-appearance: none; width: 12px; height: 12px; margin-top: -5px; border: 0; border-radius: 0; background: var(--accent); }
input[type="range"]::-moz-range-thumb { width: 12px; height: 12px; border: 0; border-radius: 0; background: var(--accent); }
input[type="range"]:focus-visible { outline-offset: 4px; }

/* text toggles: the chosen one in ink with the accent square (the square's room is kept, so nothing moves) */
.seg { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 14px; }
.seg button {
  display: inline-flex; align-items: baseline; gap: .4em; padding: 2px 0; border: 0; background: none;
  font-size: 14px; color: var(--ink-3); white-space: nowrap; transition: color .15s;
}
.seg button::before { content: ""; align-self: center; flex: none; width: .45em; height: .45em; background: transparent; }
.seg button:hover, .seg button.on { color: var(--ink); }
.seg button.on::before { background: var(--accent); }

/* minmax(0, 1fr): the branch rows that appear during playback must not widen the panels */
.demo-panels { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--g); row-gap: 32px; }
.demo-panel { display: flex; flex-direction: column; min-width: 0; }
.demo-panel-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; min-height: 54px; margin-bottom: 10px; padding-top: 8px; border-top: 1px solid var(--rule); }
.demo-panel-head h4 { font-size: clamp(19px, 1.6vw, 24px); letter-spacing: -0.03em; line-height: 1.1; }
.demo-panel-head p { margin-top: 3px; font-size: 13px; color: var(--ink-3); }
.demo-panel-cross .demo-panel-head h4::before { content: ""; display: inline-block; width: .38em; height: .38em; margin-right: .35em; vertical-align: .14em; background: var(--c-cross); }
.demo-panel canvas { width: 100%; aspect-ratio: 24 / 14.5; background: var(--canvas-bg); }
.badge {
  flex: none; display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 8px;
  border: 1px solid var(--line-2); font-size: 12.5px; color: var(--ink-2); white-space: nowrap;
}
.badge::before { content: ""; width: 6px; height: 6px; background: currentColor; }
/* red means CROSS on this page: a wrong estimate is marked in ink, with a cross */
.badge.bad { color: var(--ink); border-color: currentColor; }
.badge.bad::before { content: "×"; width: auto; height: auto; background: none; font-size: 15px; line-height: 1; }
.badge.good { color: var(--good); border-color: currentColor; }
.badge.wait { color: color-mix(in srgb, var(--blue) 75%, var(--ink)); border-color: currentColor; }
.demo-counter { margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.demo-counter #greedyWrong { font-size: 20px; font-weight: 600; color: var(--bad); }
.hyp-list { display: flex; flex-direction: column; min-height: 66px; margin-top: 8px; }
.hyp {
  display: grid; grid-template-columns: 84px minmax(0, 1fr) 44px auto; gap: 10px; align-items: center;
  padding: 4px 0; border-bottom: 1px solid var(--line); font-size: 13px; color: var(--ink-2);
}
.hyp-name { display: flex; align-items: center; gap: 7px; color: var(--ink); white-space: nowrap; }
/* the ellipse mirrors the branch drawn on the map */
.hyp-name i { flex: none; width: 14px; height: 9px; border-radius: 50%; border: 1.5px solid var(--blue); background: color-mix(in srgb, var(--blue) 25%, transparent); }
.hyp.committed .hyp-name i { border-color: var(--c-cross); background: color-mix(in srgb, var(--c-cross) 35%, transparent); }
.hyp-bar { height: 6px; background: color-mix(in srgb, var(--ink) 10%, transparent); }
.hyp-bar b { display: block; height: 100%; background: var(--blue); transition: width .15s linear; }
.hyp.committed .hyp-bar b { background: var(--c-cross); }
.hyp-w { font-variant-numeric: tabular-nums; text-align: right; }
.hyp-win { display: flex; gap: 2px; align-items: center; }
.hyp-win i { width: 7px; height: 12px; background: color-mix(in srgb, var(--ink) 12%, transparent); }
.hyp-win i.on { background: var(--blue); }
.hyp.committed .hyp-win i.on { background: var(--c-cross); }
.hyp-win em { margin-left: 6px; font-style: normal; font-size: 12px; color: var(--ink-3); white-space: nowrap; }
.hyp-empty { padding: 5px 0; font-size: 13px; color: var(--ink-3); }

.demo-legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin-top: 18px; font-size: 13px; color: var(--ink-2); }
.demo-legend span { display: inline-flex; align-items: center; gap: 7px; }
.demo-legend i { display: inline-block; flex: none; }
/* the legend marks mirror the shapes drawn on the maps */
.lg-node { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }
.lg-robot { width: 0; height: 0; border-left: 11px solid var(--ink); border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.lg-meas { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--green); background: color-mix(in srgb, var(--green) 22%, transparent); }
.lg-hyp { width: 18px; height: 11px; border-radius: 50%; border: 1.5px solid var(--blue); background: color-mix(in srgb, var(--blue) 25%, transparent); }
/* the committed estimate: grey in the commit-on-retrieval panel, red in the CROSS panel (two marks, one label) */
.lg-est { width: 14px; height: 3px; background: var(--ink-2); }
.lg-track { width: 14px; height: 3px; background: var(--c-cross); }
.lg-est + .lg-track { margin-left: -4px; }
.lg-bad { width: 20px; height: 0; border-top: 2px dashed var(--ink-2); }
.demo-error { margin-top: 30px; }
.chart-title { margin-bottom: 8px; }
.chart-title span:last-child { font-size: 13px; color: var(--ink-3); }
.demo-note { margin-top: 10px; max-width: 70em; font-size: 13px; color: var(--ink-3); }

/* ------------------------------------------------------------------ method */
.eq-block { overflow-x: auto; padding: 12px 0; border-top: 1px solid var(--rule); border-bottom: 1px solid var(--line); font-size: 18px; }
.eq-block .katex-display { margin: 10px 0; }
/* text left, equations right, on the 12 columns */
.rep, .step-panel { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); row-gap: 20px; align-items: start; }
.rep { margin-top: clamp(36px, 4.5vw, 64px); }
.rep .step-text, .step-panel .step-text { grid-column: 1 / 7; min-width: 0; }
.rep .step-eq, .step-panel .step-eq { grid-column: 7 / 13; }
.step-text h3 { margin-bottom: 10px; font-size: clamp(21px, 1.9vw, 28px); letter-spacing: -0.03em; line-height: 1.1; }
.step-text p { max-width: 38em; font-size: 16.5px; font-weight: 300; line-height: 1.5; }
.step-text p + p { margin-top: 10px; }
.step-eq { min-width: 0; overflow-x: auto; padding: 2px 0 10px; border-top: 1px solid var(--rule); font-size: 16px; }
.step-eq .katex-display { margin: 14px 0; }
.eq-note { display: block; margin-top: 2px; font-family: var(--mono); font-size: 12px; line-height: 1.5; color: var(--ink-3); }

/* the four steps: tabs on a rule, a big light number, the current one with an accent bar */
.steps { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--g); margin: clamp(56px, 7vw, 104px) 0 18px; }
.step {
  position: relative; display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0;
  padding: 8px 0 10px; border: 0; border-top: 1px solid var(--rule); background: none; text-align: left;
  color: var(--ink-3); transition: color .15s;
}
.step:hover, .step.on { color: var(--ink); }
.step.on::before { content: ""; position: absolute; left: 0; right: 0; top: -1px; height: 3px; background: var(--accent); }
.step-n { font-size: clamp(34px, 4vw, 60px); font-weight: 200; letter-spacing: -0.05em; line-height: .9; font-variant-numeric: tabular-nums; }
.step-name { font-size: clamp(18px, 1.8vw, 26px); letter-spacing: -0.03em; line-height: 1.1; }
.step-panels { margin-top: 26px; }
.js .step-panel:not(.on) { display: none; }
.step-panel + .step-panel { margin-top: 40px; }
.js .step-panel + .step-panel { margin-top: 0; }

/* ------------------------------------------------------------------ results */
.viewers { display: grid; grid-template-columns: minmax(0, 43fr) minmax(0, 57fr); column-gap: var(--g); row-gap: 40px; margin-bottom: clamp(48px, 6vw, 88px); }
/* both viewers stretch to the taller one, and their stages fill the difference, so the two timelines line up */
.viewer { display: flex; flex-direction: column; min-width: 0; }
.viewer-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 2px 12px; margin-bottom: 10px; padding-bottom: 5px; border-bottom: 1px solid var(--rule); }
.viewer-head h3 { font-size: clamp(18px, 1.5vw, 22px); letter-spacing: -0.025em; }
.viewer-head p { font-size: 13px; color: var(--ink-3); }
.viewer-stage { position: relative; flex: 1; overflow: hidden; background: #000; }
.viewer-stage img { width: 100%; height: 100%; object-fit: cover; transition: opacity .45s ease; }
.viewer-stage img.fade-top { position: absolute; inset: 0; }
/* the captures as a segmented track: the current segment in the accent */
.timeline { display: flex; gap: 3px; margin-top: 8px; }
.timeline button {
  flex: 1 1 0; min-width: 0; min-height: 46px; padding: 7px 0 0; border: 0; border-top: 2px solid color-mix(in srgb, var(--ink) 16%, transparent);
  background: none; text-align: left; font-size: 13px; line-height: 1.2; color: var(--ink-3); transition: color .15s, border-color .15s;
}
.timeline button small { display: block; margin-top: 1px; font-size: 12px; }
.timeline button:hover { color: var(--ink); border-top-color: color-mix(in srgb, var(--ink) 45%, transparent); }
.timeline button.on { color: var(--ink); border-top-color: var(--accent); }

/* a chart block: a black rule, the title (and its filters), the chart, a note, the table view */
.chart-card { min-width: 0; margin-bottom: clamp(48px, 6vw, 88px); }
.chart-card-head { display: flex; justify-content: space-between; align-items: flex-start; flex-wrap: wrap; gap: 10px 28px; margin-bottom: 16px; padding-top: 8px; border-top: 1px solid var(--rule); }
.chart-card-head h3, .chart-card-head h4 { font-size: clamp(20px, 1.8vw, 26px); letter-spacing: -0.03em; line-height: 1.1; }
.chart-card-head p { max-width: 46em; margin-top: 6px; font-size: 13px; line-height: 1.4; color: var(--ink-3); }
.filters { display: flex; flex-wrap: wrap; gap: 6px 28px; padding-top: 4px; }
.chart { position: relative; width: 100%; }
.chart svg { width: 100%; height: auto; overflow: visible; }
.chart-foot { max-width: 64em; margin-top: 12px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }
.table-view { margin-top: 12px; font-size: 14px; }
.table-view summary { width: max-content; padding-block: 3px; cursor: pointer; font-size: 13px; color: var(--ink-3); }
.table-view summary:hover { color: var(--ink); }
.table-view > div { overflow-x: auto; }  /* wide tables scroll inside their block on phones */
.table-view table { width: 100%; margin-top: 10px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.table-view th, .table-view td { padding: 7px 12px 7px 0; text-align: left; border-bottom: 1px solid var(--line); }
.table-view thead th { font-size: 13px; font-weight: 400; color: var(--ink-3); border-bottom-color: var(--rule); white-space: nowrap; }
.table-view td:not(:first-child), .table-view th:not(:first-child) { text-align: right; }
.table-view td:last-child, .table-view th:last-child { padding-right: 0; }
.table-view tr.hl td { font-weight: 600; background: color-mix(in srgb, var(--accent) 7%, transparent); }
.table-view tr.hl td:first-child { padding-left: 10px; box-shadow: inset 3px 0 var(--accent); }
.linklike {
  padding: 0; border: 0; background: none; color: var(--ink); font-size: inherit; text-align: left;
  text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; text-decoration-color: color-mix(in srgb, currentColor 45%, transparent);
}
.linklike:hover { text-decoration-color: currentColor; }

/* the per-location figure: three versions on white, enlarged in the lightbox */
.figure-card { margin-bottom: 0; }
.figure-card .chart-card-head { align-items: baseline; }
.zoomable { display: block; width: 100%; padding: 10px; border: 0; background: var(--fig-bg); cursor: zoom-in; }
.zoomable img { width: 100%; height: auto; transition: opacity .3s; }
.figure-card figcaption { max-width: 70em; margin-top: 12px; font-size: 14px; line-height: 1.45; color: var(--ink-2); }

.sub-intro { max-width: 46em; margin-bottom: 26px; font-size: 17px; font-weight: 300; line-height: 1.45; }
/* the robot trials: the three settings and what was asked of the robot on the left, the chart on the right */
.robot-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); row-gap: 36px; align-items: start; margin-bottom: clamp(48px, 6vw, 88px); }
.robot-grid .settings-col { grid-column: 1 / 7; min-width: 0; }
.settings-col .sub-intro { margin: 18px 0 0; }
.robot-grid .chart-card { grid-column: 7 / 13; margin-bottom: 0; }
.settings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); column-gap: 10px; }
.setting { display: flex; flex-direction: column; min-width: 0; }
.setting img { width: 100%; height: auto; }
.setting figcaption { padding-top: 6px; font-size: 13px; line-height: 1.3; color: var(--ink-2); }
.setting figcaption b { display: block; font-family: var(--mono); font-size: 12px; font-weight: 500; color: var(--ink); }
.setting figcaption small { display: block; margin-top: 1px; font-size: 12px; color: var(--ink-3); }

.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--g); row-gap: 48px; align-items: start; }
.two-col .chart-card { margin-bottom: 0; }
.two-col.runtime { margin-top: clamp(56px, 7vw, 104px); }
.callout { margin-top: 18px; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); font-size: 14.5px; line-height: 1.45; color: var(--ink-2); }
.callout strong, .callout b { color: var(--ink); }
.callout a { padding-block: 4px; }  /* a bigger target, same line */

/* ------------------------------------------------------------------ chart marks (SVG from charts.js): thin, square, text in ink */
.c-grid { stroke: var(--grid); stroke-width: 1; }
.c-axis { stroke: var(--ink-3); stroke-width: 1; }
.c-tick { fill: var(--ink-3); font-size: 11.5px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.c-label { fill: var(--ink-2); font-size: 13px; font-family: var(--font); }
.c-label-hl { fill: var(--ink); font-weight: 600; }
/* group labels are wider than the label column: the halo keeps the zero axis from striking through them */
.c-group { fill: var(--ink-3); font-size: 12px; font-family: var(--font); paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }
.c-value { fill: var(--ink-2); font-size: 12.5px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.c-value-hl { fill: var(--ink); font-weight: 600; }
.c-bar { fill: var(--data-other); }
.c-bar-2 { fill: var(--data-other-2); }
.c-bar-hl { fill: var(--c-cross); }
.c-ci { stroke: var(--ink-2); stroke-width: 1.25; }
.c-hit { fill: transparent; cursor: default; }
.c-row:hover .c-bar, .c-row:hover .c-bar-2, .c-row:hover .c-bar-hl { opacity: .8; }
.c-legend { fill: var(--ink-2); font-size: 12.5px; font-family: var(--font); }
.c-halo { paint-order: stroke; stroke: var(--bg); stroke-width: 4px; stroke-linejoin: round; }

/* ------------------------------------------------------------------ robustness: one player for three cases */
/* The clips are 1.2:1 and 1.9:1 figures on white. The frame keeps one shape between the two, in the clips' own white,
   so a switch moves nothing on the page. Beside it, as in the video section: the section's paragraph at the top, then
   the playing case's name, caption and legend, the cases at the foot; type in container units so the column fills the
   frame's height. */
.rob {
  container-type: inline-size;
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-template-rows: auto auto 1fr; column-gap: var(--g); row-gap: 1.5cqw;
}
.rob-stage { grid-column: 1 / 8; grid-row: 1 / 4; position: relative; aspect-ratio: 16 / 10; min-width: 0; background: var(--clip-bg); }
.rob-stage video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: var(--clip-bg); }
.rob-intro {
  grid-column: 8 / 13; grid-row: 1; min-width: 0; padding-top: .3em; border-top: 1px solid var(--rule);
  font-size: 1.72cqw; font-weight: 300; line-height: 1.2; letter-spacing: -0.022em; text-wrap: pretty;
}
.rob-intro strong { font-weight: 600; }
.rob-now { grid-column: 8 / 13; grid-row: 2; min-width: 0; display: flex; flex-direction: column; gap: .5em; font-size: 1.12cqw; }
/* the playing case: its name after the accent square, the link into the full video at the right */
.rob-now-k { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 2px 1em; }
.rob-now-k > :first-child { display: inline-flex; align-items: center; gap: .3em; }
.rob-now-k > :first-child::before { content: ""; width: .6em; height: .6em; margin-right: .25em; background: var(--accent); }
.rob-now-k .linklike { font-size: inherit; }
.rob-caption { font-size: 1.28cqw; font-weight: 300; line-height: 1.38; letter-spacing: -0.01em; }
.rob-legend { font-size: max(12px, .95cqw); line-height: 1.45; color: var(--ink-3); }
.rob-list { grid-column: 8 / 13; grid-row: 3; align-self: end; min-width: 0; list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.rob-list button {
  position: relative; width: 100%; display: block; padding: .32em 1.4em .36em 0; border: 0; border-bottom: 1px solid var(--line);
  background: none; text-align: left; font-size: 1.76cqw; letter-spacing: -0.025em; line-height: 1.15; color: var(--ink-3); transition: color .15s;
}
.rob-list button:hover, .rob-list button[aria-current] { color: var(--ink); }
/* the playing case: the accent square at the row's end (its room is kept, so nothing moves) */
.rob-list button[aria-current]::after { content: ""; position: absolute; right: .2em; top: .78em; width: .4em; height: .4em; background: var(--accent); }
/* between 1000 and 1200 px the side column is a little taller for its width (the legend's 12 px floor, the px gutters):
   a 3:2 frame keeps the two level (measured: the column fills 82-89% of it, never more than 100%; 16:10 overflows) */
@media (min-width: 1001px) and (max-width: 1199px) { .rob-stage { aspect-ratio: 3 / 2; } }
@media (max-width: 1000px) {
  .rob { grid-template-rows: none; row-gap: 20px; }
  .rob-stage { grid-column: 1 / -1; grid-row: auto; }
  .rob-intro { grid-column: 1 / -1; grid-row: auto; font-size: clamp(18px, 2.3vw, 24px); }
  .rob-now { grid-column: 1 / 7; grid-row: auto; font-size: 15px; }
  .rob-list { grid-column: 7 / 13; grid-row: auto; align-self: start; }
  .rob-caption { font-size: 16px; }
  .rob-legend { font-size: 13px; }
  .rob-list button { font-size: 19px; }
}
@media (max-width: 760px) {
  .rob-stage { aspect-ratio: 4 / 3; }
  /* one column: the paragraph, then the cases right under it, then what the playing case shows */
  .rob-intro, .rob-now, .rob-list { grid-column: 1 / -1; }
  .rob-intro { order: 1; }
  .rob-list { order: 2; }
  .rob-now { order: 3; }
}

/* ------------------------------------------------------------------ limitations: the original's unnumbered list, in rows */
/* the bullet is the site's accent square in the first column, centered on the first line */
.limits { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.limits li { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--g); padding: 12px 0 16px; border-bottom: 1px solid var(--line); }
.limits li::before { content: ""; grid-column: 1 / 2; width: .45em; height: .45em; margin-top: .465em; background: var(--accent); }
.limits li::before, .limits li p { font-size: clamp(17px, 1.45vw, 21px); line-height: 1.38; letter-spacing: -0.012em; }
.limits li p { grid-column: 2 / 11; font-weight: 300; }

/* ------------------------------------------------------------------ BibTeX (as on the reference: accent rule, black Copy) */
.sx-bib { position: relative; background: var(--surface-2); border-left: 3px solid var(--accent); }
.sx-bib pre { margin: 0; padding: 1.25rem 6rem 1.25rem 1.5rem; overflow-x: auto; font-size: clamp(12px, 1.05vw, 15px); line-height: 1.6; color: var(--ink); }
.sx-bib .copy { position: absolute; top: .75rem; right: .75rem; }
.copy {
  display: inline-flex; align-items: center; gap: 6px; height: 28px; padding: 0 10px; border: 0; border-radius: 0;
  background: #111110; color: #fff; font-family: var(--font); font-size: 12.5px; font-weight: 400; transition: background .15s, color .15s;
}
html:not(.js) .copy { display: none; }  /* site.js fills in its icon and label: blank without it */
.copy:hover, .copy:focus-visible { background: var(--accent); color: var(--on-accent); }
.copy.is-done { background: var(--good); color: #fff; }
.copy svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; }
:root[data-theme="dark"] .copy { background: #f0efea; color: #000; }
:root[data-theme="dark"] .copy:hover, :root[data-theme="dark"] .copy:focus-visible { background: var(--accent); color: #000; }
:root[data-theme="dark"] .copy.is-done { background: var(--good); color: #000; }
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) .copy { background: #f0efea; color: #000; }
  :root:where(:not([data-theme="light"])) .copy:hover, :root:where(:not([data-theme="light"])) .copy:focus-visible { background: var(--accent); color: #000; }
  :root:where(:not([data-theme="light"])) .copy.is-done { background: var(--good); color: #000; }
}
.credits { margin-top: 16px; font-size: 13px; color: var(--ink-3); }
.credits + .credits { margin-top: 4px; }  /* the original page's footer lines, kept together */

/* ------------------------------------------------------------------ overlays */
/* the lightbox is a modal <dialog> filling the viewport; ::backdrop dims the page */
.lightbox {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none;
  margin: 0; padding: 24px; border: 0; background: transparent; overflow: hidden; cursor: zoom-out;
}
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(0, 0, 0, .92); }
.lightbox img { max-width: 100%; max-height: 100%; background: #fff; }
.lightbox-close {
  position: absolute; top: 12px; right: 12px; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 0;
  background: #000; color: #f0efea; font-size: 26px; line-height: 1;
}
.lightbox-close:hover { background: var(--accent); color: var(--on-accent); }
/* chart tooltips: ink on the page colour inverted, square, the value first */
.tooltip {
  position: fixed; z-index: 90; pointer-events: none; max-width: 260px; padding: 7px 9px;
  background: var(--ink); color: var(--bg); font-size: 13px; line-height: 1.4;
}
.tooltip[hidden] { display: none; }
.tooltip .tt-v { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.tooltip .tt-n { color: color-mix(in srgb, var(--bg) 82%, transparent); }
.tooltip .tt-s { font-size: 12px; color: color-mix(in srgb, var(--bg) 68%, transparent); }

/* ------------------------------------------------------------------ responsive */
@media (max-width: 1000px) {
  /* one column: the wordmark, the title, the authors, the links */
  .mast { grid-template-rows: none; row-gap: 14px; }
  .mast-mark, .mast h1, .mast-people, .mast-side { grid-column: 1 / -1; grid-row: auto; }
  .mast h1 { padding-top: 0; }
  .teaser-cap > p, .teaser-cap > .spot-keys { grid-column: 1 / -1; }
  .rep .step-text, .rep .step-eq, .step-panel .step-text, .step-panel .step-eq { grid-column: 1 / -1; }
  .robot-grid .settings-col, .robot-grid .chart-card { grid-column: 1 / -1; }
  .limits li { grid-template-columns: 1.5em minmax(0, 1fr); }
  .limits li::before { grid-column: 1; }
  .limits li p { grid-column: 2; }
}
@media (max-width: 900px) {
  .figures { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 820px) {
  .viewers, .demo-panels, .two-col { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 760px) {
  .quad { grid-template-columns: minmax(0, 1fr); }
  .quad > :nth-child(n) { grid-column: 1 / -1; }
  .quad-corner, .quad-colhead { display: none; }
  .quad-rowhead { margin-top: 18px; padding: 0 0 6px; border-bottom-color: var(--rule); }
  .quad > .quad-rowhead:nth-child(4) { margin-top: 0; }
}
/* the section bar: the links scroll sideways once they no longer fit under the top bar's */
@media (max-width: 720px) {
  .topnav .brand { display: none; }
  .topnav-links {
    position: static; transform: none; width: calc(100% + 10px); height: 100%; margin-left: -10px; padding-left: 10px;
    overflow-x: auto; scrollbar-width: none;
    -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent);
  }
  .topnav-links::-webkit-scrollbar { display: none; }
}
@media (max-width: 560px) {
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 4px; }
  .spot-keys { grid-template-columns: minmax(0, 1fr); }
  .demo-controls .seg { order: 3; }
  /* branch rows: the support window drops below the name and weight */
  .hyp { grid-template-columns: auto minmax(0, 1fr) 36px; row-gap: 4px; }
  .hyp-win { grid-column: 1 / -1; }
  .settings { column-gap: 6px; }
  .sx-bib pre { padding: 3.25rem 1rem 1rem 1.1rem; }
  /* display maths scrolls sideways when it must; a smaller size keeps most of it in view */
  .eq-block { font-size: 14px; }
  .step-eq { font-size: 13.5px; }
}
/* landscape phones: only the top bar sticks, so the content keeps most of the short screen */
@media (max-height: 500px) {
  :root { --anchor-top: calc(var(--header-h) + 8px); }
  .topnav { position: relative; top: auto; }
  /* the section bar scrolls with the page here: a link focused while the bar is under the top bar is scrolled clear */
  .topnav a { scroll-margin-top: var(--anchor-top); }
}
/* touch: room for a finger on the small controls */
@media (pointer: coarse) {
  .table-view summary, .linklike, .btn-text { padding-block: 9px; }
  .spot-keys button { min-width: 38px; height: 32px; }
  .seg button { min-height: 36px; align-items: center; }
  .timeline button { min-height: 52px; }
  .copy { height: 36px; }
  input[type="range"] { height: 40px; }
  input[type="range"]::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -10px; }
  input[type="range"]::-moz-range-thumb { width: 22px; height: 22px; }
}
@media (prefers-reduced-motion: reduce) {
  html, html.smooth-scroll { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
