/* The comparison (/comparer, src/app/compare/): two to five cars on one ground at one scale, then one line per
   question and one column per car, the best figure of each line ticked. Every colour, space and typeface is a token
   of app.css: nothing is redefined here.

   Nothing moves when what is shown changes: the columns are one width per count of cars (`--n`), every line is one
   height (`--row-h`), a name stands in a box of one height (set smaller, on two lines at most, when it is long), and
   the scale of the cars follows the screen, never the cars (a car longer than 4.8 m alone makes it smaller). With
   room the cars and the six lines are in view together; a phone shows two cars and the six lines in one screen, three
   hold, four and five slide sideways under their names. */

.cp {
  --gap: 8px;
  /* What a line holds, its question and its figures, for laying it in the middle of its height. */
  --row-in: 50px;
  /* Room kept between two cars that stand nose to nose, and around a car in its column. */
  --nose: 6px;
  /* The lines: one height each. */
  --row-h: 64px;
  /* What the screen must also hold under the cars: their names, the six lines, the space between. */
  --ids-h: 84px;
  --rest: calc(10px + var(--ids-h) + var(--kin-h) + 12px + 6 * var(--row-h) + 14px);
  /* Under the names, what each car shares with the first (`.cp-kin`): its room, beside two cars or more. */
  --kin-h: 0px;
  --name: 1.3125rem;
  --cp-w: 100%;
  max-width: var(--cp-w);
  margin: 0 auto;
  padding: 10px var(--pad) calc(var(--sp-7) + var(--held-h));
}
.cp :is(button, a) { -webkit-tap-highlight-color: transparent; }
.cp[data-n="3"] { --ids-h: 72px; --name: 1.0625rem; }
.cp:is([data-n="4"], [data-n="5"]) { --ids-h: 48px; --name: 1.0625rem; }

/* ── The cars, on one ground, at one scale ────────────────────────────────────────────────────────────── */

.cp-cars {
  /* The scale: the longest car fills its column, the cars and the six lines stand together on the screen, and a car
     is never drawn larger than a car should be. The same for every car: two cars in one place always compare. Its
     `100cqi` is this block's width wherever a car is drawn in it. */
  --col: calc((100cqi - (var(--n) - 1) * var(--gap)) / var(--n));
  --mm: max(0.012px, min(0.14px, calc((var(--col) - 2 * var(--nose)) / var(--long)), var(--tall-room, 1px)));
  position: relative;
  container: cars / inline-size;
}
.cp-cols {
  position: relative;
  display: grid;
  grid-template-columns: repeat(var(--n), minmax(0, 1fr));
  gap: 0 var(--gap);
}
/* The ground, and the light the cars stand in. */
.cp-cols::before { content: ""; position: absolute; z-index: -1; left: 2%; right: 2%; top: 0; height: calc(2000 * var(--mm) * 1.12); border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--card) 88%, transparent), transparent); pointer-events: none; }
.cp-cols::after { content: ""; position: absolute; left: 0; right: 0; top: calc(2000 * var(--mm)); height: 1px; background: linear-gradient(90deg, transparent, var(--line) 8%, var(--line) 92%, transparent); pointer-events: none; }

.cp-col { display: grid; grid-template-rows: auto auto; min-width: 0; }
/* The car: bottom on the ground, at the room every car has. A tap opens what can take its place. */
.cp-stand { display: flex; align-items: flex-end; justify-content: center; height: calc(2000 * var(--mm)); margin: 0; padding: 0 var(--nose); border: 0; border-radius: var(--r-m); background: none; line-height: 0; cursor: pointer; touch-action: pan-y; -webkit-touch-callout: none; user-select: none; }
.cp-stand .carfig { flex: none; }
/* Two cars stand nose to nose. */
.cp[data-n="2"] .cp-col:first-child .cp-stand { justify-content: flex-end; }
.cp[data-n="2"] .cp-col:nth-child(2) .cp-stand { justify-content: flex-start; }
/* A car without measures says so where it would stand. */
.cp-stand .carfig.is-nothing { align-self: center; }

/* An open place: where a car will stand. */
.cp-place span { display: grid; place-items: center; width: min(100%, calc(4300 * var(--mm))); height: min(100%, max(46px, calc(1380 * var(--mm)))); border: 1.5px dashed var(--edge); border-radius: var(--r-m); color: var(--soft); }
.cp-place .ic { width: 26px; height: 26px; }

/* Who it is: the make, the name, its version in a few facts. Each in a box of one height. */
/* A block: its lines are as wide as it, whatever they hold, and none ever shifts sideways. */
.cp-id { container: id / inline-size; display: block; height: var(--ids-h); margin-top: 8px; text-align: center; }
.cp-make { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; height: 16px; overflow: hidden; white-space: nowrap; font-size: 0.71875rem; }
.cp-make > span { overflow: hidden; text-overflow: ellipsis; }
.cp-make .dot { flex: none; }
/* Whose picture it is: beside the make where the column has room, else once under the lines (`.cp-shownline`). */
.cp-shown { display: none; overflow: hidden; text-overflow: ellipsis; letter-spacing: 0; text-transform: none; font-size: 0.65625rem; color: var(--soft); }
.cp-nameline {
  /* The arrows stand at the two ends of a line of one width, whatever the name: a step after a step finds its arrow
     where it was. The name, centred between them. */
  --near-w: 0px; --line-w: 100cqi;
  display: grid; grid-template-columns: 1fr var(--near-w) minmax(0, calc(min(100cqi, var(--line-w)) - 2 * var(--near-w))) var(--near-w) 1fr; align-items: center;
  width: 100%; min-width: 0; height: calc(var(--name) * 1.22);
}
.cp-name { position: relative; grid-column: 3; justify-self: center; display: inline-flex; align-items: center; gap: 2px; min-width: 0; max-width: 100%; height: 100%; padding: 0 2px; border: 0; border-radius: 8px; background: none; color: var(--ink); cursor: pointer; }
/* A short name in small type is still a target a finger finds: its tap area reaches past its letters. */
.cp-name::after { content: ""; position: absolute; left: 50%; top: 50%; width: max(100%, 44px); height: max(100%, 32px); translate: -50% -50%; }
/* The name: as large as its box, set smaller by its count of letters when it is long, and on two lines when it must. */
.cp-name b {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden;
  max-height: calc(var(--name) * 1.22);
  font: 800 clamp(calc(var(--name) * 0.6), calc((min(100cqi, var(--line-w)) - 2 * var(--near-w) - 24px) / (var(--chars) * 0.7)), var(--name)) / 1 var(--display);
  letter-spacing: -0.025em; text-align: center; text-wrap: balance; overflow-wrap: anywhere;
}
.cp-name .ic { flex: none; width: 16px; height: 16px; margin-top: 2px; color: var(--faint); }
.cp-name.is-open { color: var(--soft); }
.cp-trim { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 4px; width: 100%; max-height: 2.6em; margin: 2px 0 0; overflow: hidden; font: 500 0.75rem/1.3 var(--body); color: var(--soft); }
.cp-trim span { white-space: nowrap; }
.cp[data-n="3"] .cp-trim { font-size: 0.6875rem; }
.cp:is([data-n="4"], [data-n="5"]) .cp-trim { display: none; }
.cp:is([data-n="4"], [data-n="5"]) .cp-name .ic { display: none; }
.cp:is([data-n="4"], [data-n="5"]) .cp-make { font-size: 0.59375rem; letter-spacing: 0.06em; }

/* What a car shares with the first car compared ("La même mécanique"), under its version: ink on a shade of ink, never
   a colour (yellow is the car held, blue the other car of a pair). Its room is kept in every column of two cars or more,
   said or not, so that a change of car moves nothing; a narrow column shows its first words alone (a screen reader hears
   the whole). Beside three cars or more, the first column says once what the others' words are said against. */
.cp:is([data-n="2"], [data-n="3"], [data-n="4"], [data-n="5"]) { --kin-h: calc(2 * 1.25 * 0.6875rem + 4px); }
.cp[data-n="2"] { --kin-h: calc(1.25 * 0.6875rem + 8px); }
.cp-id { height: calc(var(--ids-h) + var(--kin-h)); }
/* One line of room beside two cars, two beside more; one line more, when the words need it, takes the air kept over the
   lines (scripts/review: every phrase, every size). */
.cp-kin { display: flex; justify-content: center; align-items: flex-start; height: calc(var(--kin-h) - 4px); margin: 4px 0 0; }
.cp-kin-w { max-width: 100%; padding: 0 6px 1px; border-radius: 6px; background: color-mix(in srgb, var(--ink) 7%, transparent); font: 650 0.6875rem/1.25 var(--body); color: var(--ink); text-wrap: balance; }
.cp-kin-to { font: 500 0.6875rem/1.25 var(--body); color: var(--soft); text-wrap: balance; }
.cp-kin.is-late > * { animation: cp-in var(--calm) var(--ease) both; }
/* A phone: the longest words by their first ones; beside three to five cars, the longer too. */
@container id (max-width: 185px) {
  .cp-kin-w.is-longest .cp-kin-more { display: none; }
}
@container id (max-width: 150px) {
  .cp-kin-w, .cp-kin-to { font-size: 0.65625rem; }
  .cp-kin-w { padding-inline: 4px; }
  .cp-kin-w.is-long .cp-kin-more { display: none; }
}

/* One step along the street, on each side of the name: with room (a finger slides on the car). */
.cp-near { display: none; }

/* One more car: its place beside the cars where the screen has a margin for it, under the sentence otherwise. */
.cp-add { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; padding: 0 18px 0 14px; border: 1.5px dashed var(--edge); border-radius: var(--r-pill); background: none; color: var(--ink); font: 650 0.875rem/1.15 var(--body); cursor: pointer; }
.cp-add .ic { width: 18px; height: 18px; }
.cp-add b { font-weight: inherit; }
.cp-add.is-side { display: none; }
.cp-addline { margin: 16px 0 0; text-align: center; }

/* ── The lines: one per question, one column per car ──────────────────────────────────────────────────── */

.cp-t { container: lines / inline-size; display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); column-gap: var(--gap); width: 100%; margin-top: 12px; border-collapse: collapse; border-top: 1px solid var(--line); }
.cp-t > :is(caption, thead) { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cp-line { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; border-bottom: 1px solid var(--line); }
.cp-line > tr { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; }
/* A line's question stands at one height whatever its figures say: the line is laid from its top. */
.cp-row { height: var(--row-h); align-content: start; row-gap: 3px; padding-top: calc((var(--row-h) - var(--row-in)) / 2); }
.cp-label { grid-column: 1 / -1; display: flex; align-items: center; justify-content: center; gap: 4px; padding: 0; font: 600 0.71875rem/1.2 var(--label); letter-spacing: 0.06em; text-transform: uppercase; color: var(--soft); white-space: nowrap; font-variant-numeric: tabular-nums; }
.cp-label .ic { flex: none; width: 13px; height: 13px; color: var(--faint); transition: rotate var(--quick); }
.cp-line:has(> .cp-more [open]) .cp-label { color: var(--ink); }
.cp-line:has(> .cp-more [open]) .cp-label .ic { rotate: 180deg; color: var(--ink); }

/* A cell: its figure, the best ticked, what separates the others from it. A narrow column says it in two lines,
   a wide one in one; both keep the line's height. */
.cp-v { display: flex; flex-direction: column; align-items: center; justify-content: flex-start; min-width: 0; padding: 0; text-align: center; white-space: nowrap; }
.cp-fig { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; font: 650 0.9375rem/1.25 var(--display); letter-spacing: -0.017em; }
.cp-v.is-best .cp-fig { font-weight: 800; }
.cp-v:is(.is-words, .is-empty) .cp-fig { font: 500 0.75rem/1.65 var(--body); letter-spacing: 0; color: var(--soft); }
.cp-v.is-range .cp-fig { font-size: 0.75rem; line-height: 1.6; color: var(--soft); white-space: normal; text-wrap: balance; }
.cp-tick { display: none; }
.cp-far { font: 600 0.6875rem/1.3 var(--body); letter-spacing: 0; color: var(--soft); }
/* In two lines, the tick sits on the figure's line, beside it. */
.cp-v.is-best { flex-flow: row wrap; justify-content: center; align-content: flex-start; align-items: center; gap: 0 4px; }
.cp-v.is-best .cp-tick { display: inline-grid; }
.cp-tick { place-items: center; flex: none; width: 15px; height: 15px; border-radius: 50%; background: var(--good-soft); color: var(--good); }
.cp-tick .ic { width: 10px; height: 10px; }
/* A promotion: its mark beside the figure; with room, the list price struck. */
.cp-promo { display: none; }
.cp-list { display: none; font: 500 0.6875rem/1.3 var(--body); color: var(--soft); text-decoration-thickness: 1px; }
.cp-v.is-promo:not(.is-far) .cp-list { display: inline; }
.cp-v.is-promo.is-far .cp-promo { display: inline-grid; }
.cp-promo { place-items: center; width: 14px; height: 14px; margin-top: -1px; color: var(--soft); }
.cp-promo .ic { width: 12px; height: 12px; }
.cp-v.is-promo.is-far { flex-flow: row wrap; justify-content: center; align-content: flex-start; align-items: center; gap: 0 3px; }
.cp-v.is-promo.is-far .cp-far { flex-basis: 100%; }
.cp-v.is-promo.is-best .cp-list { flex-basis: 100%; }

/* One line for the figure and its gap where every column has the room (about 240 px); its struck list price beside
   them where it has more (about 380 px). */
@container lines (min-width: 500px) {
  .cp:is([data-n="1"], [data-n="2"]) :is(.cp-v, .cp-v.is-best, .cp-v.is-promo.is-far) { flex-flow: row nowrap; align-items: baseline; justify-content: center; gap: 0 8px; }
  .cp:is([data-n="1"], [data-n="2"]) .cp-v :is(.cp-far, .cp-list) { flex-basis: auto; }
  .cp:is([data-n="1"], [data-n="2"]) .cp-tick { align-self: center; }
}
@container lines (min-width: 780px) {
  .cp:is([data-n="1"], [data-n="2"]) .cp-v.is-promo .cp-list { display: inline; }
  .cp:is([data-n="1"], [data-n="2"]) .cp-v.is-promo .cp-promo { display: none; }
}
@container lines (min-width: 760px) {
  .cp[data-n="3"] :is(.cp-v, .cp-v.is-best, .cp-v.is-promo.is-far) { flex-flow: row nowrap; align-items: baseline; justify-content: center; gap: 0 8px; }
  .cp[data-n="3"] .cp-v :is(.cp-far, .cp-list) { flex-basis: auto; }
  .cp[data-n="3"] .cp-tick { align-self: center; }
}
@container lines (min-width: 1160px) {
  .cp[data-n="3"] .cp-v.is-promo .cp-list { display: inline; }
  .cp[data-n="3"] .cp-v.is-promo .cp-promo { display: none; }
}
@container lines (min-width: 1020px) {
  .cp[data-n="4"] :is(.cp-v, .cp-v.is-best, .cp-v.is-promo.is-far) { flex-flow: row nowrap; align-items: baseline; justify-content: center; gap: 0 8px; }
  .cp[data-n="4"] .cp-v :is(.cp-far, .cp-list) { flex-basis: auto; }
  .cp[data-n="4"] .cp-tick { align-self: center; }
}
@container lines (min-width: 1280px) {
  .cp[data-n="5"] :is(.cp-v, .cp-v.is-best, .cp-v.is-promo.is-far) { flex-flow: row nowrap; align-items: baseline; justify-content: center; gap: 0 8px; }
  .cp[data-n="5"] .cp-v :is(.cp-far, .cp-list) { flex-basis: auto; }
  .cp[data-n="5"] .cp-tick { align-self: center; }
}

/* A line, opened: its whole line is the summary of its detail, laid over it (it opens with no script). */
.cp-more > td { grid-column: 1 / -1; padding: 0; }
.cp-d { position: relative; }
.cp-open { position: absolute; z-index: 1; left: 0; right: 0; top: calc(var(--row-h) * -1); height: var(--row-h); list-style: none; cursor: pointer; border-radius: 6px; }
.cp-open::-webkit-details-marker { display: none; }
.cp-open:focus-visible { outline-offset: -2px; }
.cp-d-body { padding: 4px 0 18px; }

/* The detail's small table: a row per fact, a column per car, its own figure in ink. */
.cp-dt-wrap { overflow-x: auto; overscroll-behavior-x: contain; }
.cp-dt { width: 100%; max-width: 760px; margin: 0 auto; border-collapse: collapse; table-layout: fixed; font: 500 0.8125rem/1.3 var(--body); }
.cp:is([data-n="3"], [data-n="4"], [data-n="5"]) .cp-dt { max-width: none; }
.cp-dt :is(th, td) { padding: 7px 4px; border-top: 1px solid var(--line); text-align: center; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.cp-dt thead :is(th, td) { border-top: 0; font: 650 0.75rem/1.2 var(--body); color: var(--soft); }
.cp-dt thead .dot { margin-right: 5px; vertical-align: baseline; }
.cp-dt th[scope="row"] { width: 32%; padding-left: 0; text-align: left; font-weight: 500; color: var(--soft); }
.cp-dt tr.is-sum > * { border-top: 1.5px solid var(--ink); font-weight: 750; color: var(--ink); }
.cp-dt.is-marks th[scope="row"] { color: var(--ink); }
.cp-yes { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; background: var(--good-soft); color: var(--good); vertical-align: middle; }
.cp-yes .ic { width: 12px; height: 12px; }
.cp-no { color: var(--faint); }
.cp-note { max-width: 760px; margin: 10px auto 0; font: 400 0.75rem/1.45 var(--body); color: var(--soft); text-align: left; }
.cp-none { margin: 8px 0; font: 500 0.8125rem/1.4 var(--body); color: var(--soft); }

/* The settings a line's figures follow: the app's switch, its words beside it. */
.cp-set { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px 22px; margin: 2px 0 12px; }
.cp-seg { display: inline-flex; align-items: center; gap: 8px; }
.cp-seg-l { font: 600 0.75rem/1 var(--body); color: var(--soft); }
.cp-seg .switch span { font-variant-numeric: tabular-nums; }
/* The switch with four and five choices (app.css moves its thumb for two and three). */
.cp-seg .switch:has(label:nth-of-type(4) input:checked) { --i: 3; }
.cp-seg .switch:has(label:nth-of-type(5) input:checked) { --i: 4; }
.cp-seg .switch:has(label:nth-of-type(6) input:checked) { --i: 5; }

/* What the sheets list. */
.cp-eq { display: grid; gap: 14px; max-width: 760px; margin: 0 auto; text-align: left; }
.cp:is([data-n="3"], [data-n="4"], [data-n="5"]) .cp-eq { max-width: none; }
.cp-eq-h { display: flex; align-items: center; gap: 7px; margin: 0 0 7px; font: 650 0.8125rem/1.2 var(--body); }
.cp-eq-h small, .cp-same summary small { font: 600 0.71875rem/1 var(--label); color: var(--soft); font-variant-numeric: tabular-nums; }
.cp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cp-tags li { padding: 5px 10px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--ink) 7%, transparent); font: 550 0.75rem/1.2 var(--body); }
.cp-same summary { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font: 600 0.8125rem/1.2 var(--body); color: var(--soft); cursor: pointer; list-style: none; }
.cp-same summary::-webkit-details-marker { display: none; }
.cp-same summary span { text-decoration: underline dotted; text-underline-offset: 4px; }
.cp-same[open] summary { color: var(--ink); margin-bottom: 4px; }

/* Yellow is the car held: the first column wears it only on a device that holds that very car (`data-cp-held`, set
   before the first paint). Otherwise the first column is plain: no dot, the drawing in the plain car's colours. */
:root:not([data-cp-held]) .cp .dot-a { display: none; }
:root:not([data-cp-held]) .cp .carfig .car-body.car-a { fill: var(--car); }
:root:not([data-cp-held]) .cp .carfig .car-pillar.car-a { stroke: var(--car); }

/* ── In a sentence, who is first, the choice ──────────────────────────────────────────────────────────── */

.cp-shownline { margin: 8px 0 0; text-align: center; color: var(--soft); }
.cp-said { max-width: min(100%, 880px); margin: 20px auto 0; text-align: center; text-wrap: balance; }
/* Its place is two lines tall whatever it says (a longer sentence takes two): what follows the lines never moves
   when a car changes. One line stands at the top of it, the air after. */
.cp-said { min-height: 2lh; }
/* The figures of the sentence stand apart as on every page that weighs two cars (public/app/journey-duel.css): what
   is paid on a shade of ink, what is gained underlined. Neither is the yellow of a car: here it is the first car's. */
.cp-said b { font-weight: 400; background: linear-gradient(transparent 62%, color-mix(in srgb, var(--ink) 14%, transparent) 62%); }
.cp-said mark { padding: 0; margin: 0; border-radius: 0; background: none; color: inherit; text-decoration: underline; text-decoration-thickness: 0.07em; text-underline-offset: 0.16em; text-decoration-skip-ink: none; }
.cp-firsts { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px 28px; margin: 20px 0 0; }
.cp-firsts div { display: grid; gap: 3px; text-align: center; }
.cp-firsts dt { font-size: 0.65625rem; color: var(--soft); }
.cp-firsts dd { font: 800 1.0625rem/1.1 var(--display); letter-spacing: -0.017em; }
.cp-which { margin-top: 24px; text-align: center; }
.cp-which-h { margin: 0; }
.cp-take { display: grid; grid-template-columns: minmax(0, 1fr); gap: 8px; margin-top: 12px; }
.cp-take .btn { width: 100%; padding-inline: 10px; }
.cp-take .btn span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-send { margin-top: 10px; }

/* ── Tout comparer: every line of the sheets, what differs first ──────────────────────────────────────── */

.cp-all { margin-top: 28px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cp-all-s { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 56px; cursor: pointer; list-style: none; }
.cp-all-s::-webkit-details-marker { display: none; }
.cp-all-t { font: 700 1rem/1.2 var(--display); letter-spacing: -0.008em; }
.cp-all-s small { font: 500 0.71875rem/1 var(--label); color: var(--soft); font-variant-numeric: tabular-nums; }
.cp-all-s .ic { width: 16px; height: 16px; color: var(--soft); transition: rotate var(--quick); }
.cp-all[open] > .cp-all-s .ic { rotate: 180deg; }
.cp-all-body { padding: 0 0 20px; }
.cp-s-group + .cp-s-group { margin-top: 18px; }
/* A line of a sheet: its words, then a figure under each car, in the columns of the cars above. */
.cp-st { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); column-gap: var(--gap); width: 100%; border-collapse: collapse; }
.cp-st > caption { display: flex; align-items: baseline; gap: 10px; grid-column: 1 / -1; padding: 6px 0; text-align: left; font: 700 0.875rem/1.2 var(--display); }
.cp-st > caption small { font: 500 0.71875rem/1 var(--label); color: var(--soft); font-variant-numeric: tabular-nums; }
.cp-st > caption.vh, .cp-st > thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.cp-st > tbody, .cp-st tr { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; }
.cp-st tr { padding: 6px 0 7px; border-top: 1px solid var(--line); }
.cp-st th[scope="row"] { grid-column: 1 / -1; padding: 0 0 2px; text-align: left; font: 500 0.6875rem/1.3 var(--body); color: var(--soft); }
.cp-st td { min-width: 0; padding: 0; text-align: center; font: 550 0.8125rem/1.35 var(--body); overflow-wrap: anywhere; }
.cp-st tr:not(.is-differ) td { color: var(--soft); }
.cp-s-same > summary { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; font: 600 0.75rem/1.2 var(--body); color: var(--soft); cursor: pointer; list-style: none; }
.cp-s-same > summary::-webkit-details-marker { display: none; }
.cp-s-same > summary span { text-decoration: underline dotted; text-underline-offset: 4px; }
.cp-s-same > summary .ic { width: 14px; height: 14px; transition: rotate var(--quick); }
.cp-s-same[open] > summary .ic { rotate: 180deg; }

.cp-foot { margin-top: 16px; }
/* Where what the cars share comes from: each car's parts, as the map names them, and the pages that say them. */
.cp-parts { display: grid; gap: 10px; margin-top: 8px; }
.cp-parts dt { font: 700 0.8125rem/1.3 var(--display); letter-spacing: -0.008em; color: var(--ink); }
.cp-parts dd { margin-top: 3px; overflow-wrap: anywhere; }
.cp-gone { margin: 0 0 8px; font: 500 0.8125rem/1.4 var(--body); color: var(--soft); text-align: center; text-wrap: balance; }

/* ── The names kept in view, once the cars have left the screen ───────────────────────────────────────── */

.cp-slim { position: fixed; z-index: 9; left: 0; right: 0; top: calc(var(--bar-h) + env(safe-area-inset-top, 0px)); border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--paper) 90%, transparent); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); overflow: hidden; translate: 0 -130%; visibility: hidden; transition: translate var(--calm) var(--ease), visibility 0s var(--calm); }
.cp-slim.is-on { translate: 0 0; visibility: visible; transition: translate var(--calm) var(--ease); }
.cp-slim-in { display: grid; grid-template-columns: repeat(var(--n), minmax(0, 1fr)); gap: 0 var(--gap); max-width: var(--cp-w); margin: 0 auto; padding: 5px var(--pad) 6px; }
.cp-slim-car { display: grid; justify-items: center; gap: 1px; min-width: 0; }
.cp-slim-car b { display: inline-flex; align-items: center; gap: 5px; max-width: 100%; font: 800 0.875rem/1.15 var(--display); letter-spacing: -0.017em; }
.cp-slim-car b span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-slim-car > span { font: 600 0.6875rem/1.1 var(--body); font-variant-numeric: tabular-nums; color: var(--soft); }
.cp-slim-car.is-open b { color: var(--soft); font-weight: 650; }

/* ── The panels that change a car ────────────────────────────────────────────────────────────────────── */

.cp-pop { display: flex; flex-direction: column; }
.pop:has(> .cp-pop) { padding-bottom: 6px; }
.cp-find { display: flex; align-items: center; gap: 8px; width: 100%; height: 44px; margin: 4px 0 6px; padding: 0 14px; border: 1.5px solid var(--line); border-radius: var(--r-pill); background: var(--paper); color: var(--soft); font: 500 0.9375rem/1 var(--body); text-align: left; cursor: text; }
.cp-find .ic { flex: none; width: 18px; height: 18px; }
.cp-find span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-pop-h { margin: 12px 0 2px; }
.cp-opts { margin: 0 calc(var(--pad) * -1); }
.cp-opts .row { grid-template-columns: 74px minmax(0, 1fr) auto; gap: 10px; min-height: 56px; padding: 7px var(--pad); }
.cp-opts .row-pic { --mm: 0.0158px; min-height: 30px; }
.cp-opt-n { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 0.9375rem/1.2 var(--display); letter-spacing: -0.013em; }
.cp-opts .row-sub { font-size: 0.75rem; color: var(--soft); }
/* What a car the industry map sets beside the first one shares with it ("La même mécanique"): said whole, in ink. */
.cp-opts .row-sub.cp-opt-why { white-space: normal; overflow: visible; color: var(--ink); font-weight: 600; }
.cp-opt-p { display: grid; justify-items: end; text-align: right; font: 750 0.875rem/1.2 var(--display); letter-spacing: -0.013em; }
.cp-opt-p small { font: 600 0.75rem/1.3 var(--body); letter-spacing: 0; color: var(--soft); }
.cp-pop-move { display: flex; justify-content: space-between; gap: 8px; margin-top: 8px; border-top: 1px solid var(--line); padding-top: 4px; }
.cp-pop-move .btn { text-decoration: none; }
.cp-pop-move .btn:only-child:last-child { margin-left: auto; }
.cp-pop-foot { margin-top: 2px; text-align: center; }
/* A car already compared: offered, but it would come twice. */
.cp-opts .row[aria-disabled="true"] { opacity: 0.45; }

/* ── With no car yet: two places, and a few pairs to start from ───────────────────────────────────────── */

.cp-ideas { margin-top: 4px; }
.cp-ideas-h { margin-bottom: 8px; text-align: center; }
.cp-ideas-list { display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px; }
.cp-ideas-list > li { display: grid; }
/* The cars stand at the top and the gap at the foot, so that every pair of a row stands on one ground and says its gap
   on one line, whatever the length of its names. */
.cp-idea { container: idea / inline-size; display: grid; grid-template-rows: auto auto auto 1fr; justify-items: center; gap: 4px; padding: 12px 12px 12px; border: 1px solid var(--line); border-radius: var(--r-m); background: var(--card); color: var(--ink); text-decoration: none; }
/* Every pair at one scale, the longest car of the catalogue's kinds filling half a card. */
.cp-idea-cars { --mm: calc((50cqi - 12px) / 5600); display: flex; align-items: flex-end; justify-content: center; gap: 8px; height: calc(2000 * var(--mm)); }
/* Each car whole on its line: two long names stand on two lines, never cut. */
.cp-idea-names { font: 800 1rem/1.2 var(--display); letter-spacing: -0.017em; text-align: center; text-wrap: balance; }
.cp-idea-names b { white-space: nowrap; }
.cp-idea-make { font-weight: 550; color: var(--soft); letter-spacing: -0.005em; }
.cp-idea-or { font: 500 0.84375rem/1 var(--voice); color: var(--soft); letter-spacing: -0.01em; }
.cp-idea-prices { font: 600 0.75rem/1.2 var(--body); color: var(--soft); }
/* A pair of the industry map: the dearer car's gap, then why, as a relative's line on a car's card says it. */
.cp-idea-why { display: flex; flex-wrap: wrap; align-self: end; align-items: center; justify-content: center; gap: 4px 8px; margin-top: 4px; font: 600 0.8125rem/1.35 var(--body); color: var(--ink); }
.cp-idea-why .gap { min-height: 22px; padding: 1px 8px; font-size: 0.75rem; }

/* ── A change of car is one change: the old goes at once, the new comes in from its side ─────────────── */

@keyframes cp-in { from { opacity: 0; translate: calc(var(--from, 0) * 14px) 0; } }
.cp-col.is-in .carfig, .cp-col.is-in .cp-id > * { animation: cp-in 0.18s var(--ease) both; }
.cp-col.is-in .cp-id > * { animation-duration: 0.14s; }

/* ── A phone with four and five cars: the cars and their lines slide sideways together, as a table does ── */

@media (max-width: 899px) {
  /* The words kept for a screen reader inside it (`.vh`, positioned) take it as their block: its scroller clips them,
     and the page never grows wider than the screen (a phone would lay it out wider, and a page's transition abort). */
  .cp:is([data-n="4"], [data-n="5"]) .cp-wide { position: relative; margin-inline: calc(var(--pad) * -1); padding-inline: var(--pad); overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .cp:is([data-n="4"], [data-n="5"]) .cp-wide::-webkit-scrollbar { display: none; }
  /* Three cars and the nose of the next are in view, whatever the phone: the car that peeks in at the edge says there
     are more, and which way. */
  .cp:is([data-n="4"], [data-n="5"]) { --slid: max(104px, calc((100vw - var(--pad)) / 3.35)); }
  .cp[data-n="4"] :is(.cp-cars, .cp-t) { width: calc(var(--slid) * 4); }
  .cp[data-n="5"] :is(.cp-cars, .cp-t) { width: calc(var(--slid) * 5); }
  .cp:is([data-n="4"], [data-n="5"]) .cp-stand { touch-action: auto; }
  /* The question stays at the left of the screen while its figures slide under it. */
  .cp:is([data-n="4"], [data-n="5"]) .cp-label { position: sticky; left: 0; justify-self: start; justify-content: flex-start; padding-right: 8px; }
  .cp[data-n="4"] .cp-slim-in { width: calc(var(--slid) * 4); max-width: none; margin: 0; box-sizing: content-box; translate: calc(var(--slide, 0) * -1px) 0; }
  .cp[data-n="5"] .cp-slim-in { width: calc(var(--slid) * 5); max-width: none; margin: 0; box-sizing: content-box; translate: calc(var(--slide, 0) * -1px) 0; }
  .cp:is([data-n="4"], [data-n="5"]) .cp-dt { min-width: 520px; }
}

/* ── With room ─────────────────────────────────────────────────────────────────────────────────────────── */

@media (min-width: 900px) {
  /* The columns take the screen: wider as the screen is, never a narrow column in wide margins. */
  .cp { --gap: 20px; --nose: 14px; --row-h: 70px; --row-in: 46px; --ids-h: 88px; --name: 2.375rem; --cp-w: clamp(1280px, 1280px + (100vw - 1440px) * 0.5, 1440px); padding-top: 16px; }
  /* With room the cars and the six lines stand together on the screen: the cars take what the screen's height leaves.
     A phone gives them its width, and a short screen a short scroll. */
  .cp-cars { --tall-room: calc((100svh - var(--bar-h) - var(--rest)) / 2000); }
  .cp[data-n="3"] { --cp-w: clamp(1400px, 1400px + (100vw - 1440px) * 0.5, 1600px); --ids-h: 78px; --name: 1.875rem; }
  .cp[data-n="4"] { --cp-w: clamp(1480px, 1480px + (100vw - 1440px) * 0.5, 1680px); --ids-h: 82px; --name: 1.5rem; }
  .cp[data-n="5"] { --cp-w: clamp(1540px, 1540px + (100vw - 1440px) * 0.5, 1760px); --gap: 16px; --ids-h: 78px; --name: 1.3125rem; }
  .cp-id { margin-top: 10px; }
  .cp-make { font-size: 0.71875rem; }
  .cp:is([data-n="1"], [data-n="2"], [data-n="3"]) .cp-shown { display: inline; }
  .cp:is([data-n="1"], [data-n="2"], [data-n="3"]) .cp-shownline { display: none; }
  .cp-nameline { --near-w: 34px; --line-w: 460px; }
  .cp[data-n="3"] .cp-nameline { --line-w: 400px; }
  .cp:is([data-n="4"], [data-n="5"]) .cp-nameline { --near-w: 26px; --line-w: 100cqi; }
  .cp-name .ic { width: 20px; height: 20px; margin-top: 4px; }
  .cp:is([data-n="4"], [data-n="5"]) .cp-name .ic { display: block; width: 16px; height: 16px; }
  .cp-near { display: grid; place-items: center; justify-self: center; width: 34px; height: 34px; padding: 0; border-radius: 50%; color: var(--faint); }
  .cp-near.is-prev { grid-column: 2; }
  .cp-near.is-next { grid-column: 4; }
  .cp:is([data-n="4"], [data-n="5"]) .cp-near { width: 26px; height: 26px; }
  .cp-near .ic { width: 18px; height: 18px; }
  .cp-near.is-none { visibility: hidden; }
  .cp-trim { font-size: 0.8125rem; max-height: 1.3em; }
  .cp:is([data-n="4"], [data-n="5"]) .cp-trim { display: flex; font-size: 0.75rem; max-height: 2.6em; }
  .cp:is([data-n="4"], [data-n="5"]) .cp-make { font-size: 0.65625rem; letter-spacing: 0.06em; }
  /* With room, what a car shares stands on one line: whole where its column has the room (the widths measured in this
     type, view.ts), its first words otherwise; in the narrowest columns (five cars in a small window), set smaller. */
  .cp:is([data-n="2"], [data-n="3"], [data-n="4"], [data-n="5"]) { --kin-h: calc(1.3 * 0.8125rem + 9px); }
  .cp-kin-w { overflow: hidden; padding: 1px 9px 2px; font-size: 0.8125rem; line-height: 1.3; white-space: nowrap; text-overflow: ellipsis; }
  .cp-kin-to { font-size: 0.8125rem; line-height: 1.3; }
  @container id (max-width: 379px) {
    .cp-kin-w.is-longer .cp-kin-more { display: none; }
  }
  @container id (max-width: 327px) {
    .cp-kin-w.is-long .cp-kin-more { display: none; }
  }
  @container id (max-width: 249px) {
    .cp-kin-more { display: none; }
    .cp-kin-w { padding-inline: 6px; font-size: clamp(0.625rem, calc((100cqi - 12px) / (var(--lead) * 0.56)), 0.8125rem); }
    .cp-kin-to { font-size: 0.6875rem; }
  }
  .cp-t { margin-top: 14px; }
  .cp-row { row-gap: 5px; }
  .cp-label { font-size: 0.75rem; }
  .cp-fig { font-size: 1.4375rem; letter-spacing: -0.021em; }
  .cp:is([data-n="4"], [data-n="5"]) .cp-fig { font-size: 1.25rem; }
  .cp-v:is(.is-words, .is-empty) .cp-fig { font-size: 0.875rem; line-height: 1.9; }
  .cp-v.is-range .cp-fig { font-size: 0.9375rem; line-height: 1.6; white-space: nowrap; }
  .cp-far { font-size: 0.8125rem; }
  .cp-list { font-size: 0.75rem; }
  .cp-tick { width: 19px; height: 19px; }
  .cp-tick .ic { width: 13px; height: 13px; }
  .cp-promo { width: 16px; height: 16px; }
  .cp-promo .ic { width: 14px; height: 14px; }
  .cp-dt { font-size: 0.875rem; }
  .cp-said { margin-top: 24px; font-size: 1.1875rem; }
  .cp-take { grid-template-columns: repeat(var(--n), minmax(0, 1fr)); max-width: 760px; margin-inline: auto; }
  .cp:is([data-n="3"], [data-n="4"], [data-n="5"]) .cp-take { max-width: none; }
  .cp-st th[scope="row"] { font-size: 0.75rem; }
  .cp-st td { font-size: 0.875rem; }
  .cp-ideas-list { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cp-pop-h { margin-top: 10px; }
  .cp-opts { margin: 0 -16px; }
  .cp-opts .row { padding: 7px 16px; }
  .pop:has(> .cp-pop) { width: 360px; }
}
@media (min-width: 900px) and (hover: hover) {
  .cp-open:hover { background: color-mix(in srgb, var(--ink) 3.5%, transparent); }
  .cp-name:hover, .cp-near:hover { background: color-mix(in srgb, var(--ink) 6%, transparent); }
  .cp-near:hover, .cp-name:hover .ic { color: var(--ink); }
  .cp-add:hover, .cp-place:hover span { border-color: var(--ink); border-style: solid; }
  .cp-idea:hover { border-color: var(--edge); }
  .cp-find:hover { border-color: var(--edge); }
}
/* One more car's place beside the two cars, where the screen has a margin for it (190 px beside the columns). */
@media (min-width: 1820px) {
  .cp[data-n="2"] .cp-add.is-side { display: grid; }
  .cp[data-n="2"] .cp-addline { display: none; }
}
.cp-add.is-side { position: absolute; left: calc(100% + 26px); top: calc(2000 * var(--mm) - min(104px, 2000 * var(--mm) * 0.62) - 4px); justify-items: center; align-content: center; gap: 4px; width: 138px; height: min(104px, calc(2000 * var(--mm) * 0.62)); padding: 0 10px; border-radius: var(--r-m); color: var(--soft); text-align: center; }
.cp-add.is-side .ic { width: 22px; height: 22px; }

/* A laptop that is not tall: the whole comparison still stands on its first screen. */
@media (min-width: 900px) and (max-height: 820px) {
  .cp { --row-h: 58px; --row-in: 42px; --ids-h: 80px; padding-top: 10px; }
  .cp[data-n="2"] { --name: 2.125rem; }
  .cp[data-n="3"] { --ids-h: 72px; }
  .cp:is([data-n="4"], [data-n="5"]) { --ids-h: 74px; }
  .cp-t { margin-top: 10px; }
  .cp-row { row-gap: 3px; }
  .cp-fig { font-size: 1.3125rem; }
  .cp:is([data-n="4"], [data-n="5"]) .cp-fig { font-size: 1.1875rem; }
  .cp-said { margin-top: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  .cp-slim { transition: none; }
  .cp-col.is-in .carfig, .cp-col.is-in .cp-id > *, .cp-kin.is-late > * { animation: none; }
  .cp-label .ic, .cp-all-s .ic { transition: none; }
}
/* Without scripts, what needs them is not offered: the search of the panels, moving a car. */
@media (scripting: none) {
  .cp-find, .cp-pop-move { display: none; }
}
