/* Every electric car ranked by what 100 km cost (src/app/charging/page.ts): the list's own rows and table
   (explorer.css), the charge's figures in its columns, each head the link that sorts by it. Tokens only. */

.rc-h { font-size: 1.5rem; line-height: 1.12; text-wrap: balance; max-width: 22em; }
.rc-head-block .ex-sub { white-space: normal; text-wrap: balance; }
.rc-head-block { grid-template-columns: minmax(0, 1fr); grid-template-areas: "h" "sub"; }

/* The views of "Bornes" (app.css `.bn-mode`): the width of the map page's own column, not the table's. */
.rc > .bn-mode { max-width: 420px; }

/* The price of a kWh at home: its rules are app.css's (.cc-kwh), shared with an electric car's page. */
.rc-kwh { display: grid; gap: 6px; justify-items: start; }
.rc .cc-kwh-h { margin: 0; }

/* A point of comparison (the middle diesel, the middle petrol car): a flat band that says what it is, a pump for its
   sign, its one figure. No car's row: no picture's place left empty, no lift, no heart, nothing that answers the hand. */
.rc-ref-in { display: flex; align-items: center; gap: 12px; min-width: 0; }
.rc-ref-sign { flex: none; display: grid; place-items: center; width: 36px; height: 36px; border-radius: var(--r-pill); background: var(--card); box-shadow: inset 0 0 0 1px var(--line); color: var(--ink); }
.rc-ref-sign .ic { width: 18px; height: 18px; }
.rc-ref-w { display: grid; gap: 2px; min-width: 0; }
.rc-ref-w b { font: 700 0.9375rem/1.2 var(--display); }
.rc-ref-w > small:last-child { font: 500 0.75rem/1.3 var(--body); color: var(--soft); }
.rc-ref-hero { flex: none; margin-inline-start: auto; text-align: end; font: 750 1rem/1 var(--display); font-variant-numeric: tabular-nums; white-space: nowrap; }
.rc-ref-hero b { font: inherit; }
.rc-ref-hero small { display: block; margin-top: 3px; font: 550 0.75rem/1 var(--body); color: var(--soft); }

.rc-rests { display: grid; gap: 4px; max-width: 62em; margin: 0; padding: 0; list-style: none; font: 400 0.8125rem/1.45 var(--body); color: var(--soft); text-wrap: pretty; }

/* A figure not given: a dash that keeps its row; its reason in words for a screen reader (D35). */
.rc .ex-none { position: relative; }

/* Narrower than the table (explorer.css: its columns need 1 280 px): the list's cards, each with a line of four named
   figures under it, the cost of 100 km the card's own (its hero). The heads are a row of chips that stays under the
   bar and slides sideways: the same links, the same sort. */
@media (max-width: 1279px) {
  .rc .ex-table thead { position: sticky; top: var(--bar-h); z-index: 5; display: block; margin: 0 calc(var(--pad) * -1) 6px; background: var(--paper); }
  .rc .ex-heads { display: flex; gap: 6px; padding: 6px var(--pad); overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none; }
  .rc .ex-heads > :is(.ex-car-h, .ex-fill) { display: none; }
  .rc .rc-ch { flex: none; display: block; padding: 0; }
  .rc .rc-sort { display: flex; align-items: center; gap: 5px; min-height: 44px; padding-inline: 9px 14px; border: 1px solid var(--line); border-radius: var(--r-pill); background: var(--card); color: var(--ink); font: 600 0.8125rem/1.15 var(--body); text-decoration: none; white-space: nowrap; }
  .rc .rc-hl small { margin-inline-start: 5px; font-weight: 500; color: var(--soft); }
  .rc .rc-hl small:empty { display: none; }
  .rc .ex-arrows { flex: none; display: grid; place-items: center; width: 16px; height: 16px; }
  .rc .ex-arrows .ic { width: 15px; height: 15px; color: var(--faint); }
  .rc .rc-ch.is-sorted .rc-sort { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: color-mix(in srgb, var(--ink) 6%, var(--card)); }
  .rc .rc-ch.is-sorted .ex-arrows .ic { color: var(--ink); }

  .rc .ex-row { grid-template-columns: repeat(4, minmax(0, 1fr)); grid-template-rows: auto 44px auto; }
  .rc .ex-row > .ex-car > .ex-id { grid-row: 1 / 3; }
  .rc .ex-row > .ex-car > .ex-keep { grid-column: 4; grid-row: 2; justify-self: end; margin-inline-end: 4px; }
  .rc .ex-row > .rc-v { display: flex; flex-direction: column; justify-content: flex-start; gap: 3px; grid-row: 3; min-width: 0; padding-block: 9px 12px; padding-inline: 12px 4px; border-top: 1px solid var(--line); font: 750 0.9375rem/1.15 var(--display); letter-spacing: -0.01em; font-variant-numeric: tabular-nums; }
  .rc .ex-row > .rc-v + .rc-v { padding-inline-start: 8px; }
  .rc .rc-l { font: 550 0.75rem/1.2 var(--body); letter-spacing: 0; color: var(--soft); }
  .rc .rc-v.is-sorted .rc-l { color: var(--ink); }
  .rc .rc-v .ex-none.is-said { font: 550 0.75rem/1.2 var(--body); color: var(--soft); }
  .rc .rc-hero { text-align: end; }
  .rc .rc-hero small { display: block; margin-top: 3px; font: 550 0.75rem/1 var(--body); letter-spacing: 0; color: var(--soft); }

  .rc .rc-refs { margin-bottom: 8px; }
  .rc .rc-ref, .rc .rc-ref-id { display: block; }
  .rc .rc-ref { border-radius: var(--r-m); background: color-mix(in srgb, var(--ink) 6%, var(--paper)); }
  .rc .rc-ref-id { padding: 12px 14px; text-align: start; font-weight: inherit; }
  .rc .rc-ref-rest { display: none; }
}

/* With room: the list's table, whole on the page, its heads under the bar while the page scrolls (explorer.css). */
@media (min-width: 760px) {
  .rc-h { font-size: 2rem; }
}
@media (min-width: 1280px) {
  .rc .rc-l { display: none; }
  /* The figures share the whole width, each right-aligned under its head; the car's cell keeps the list's width. */
  .rc .ex-fill { display: none; }
  .rc .ex-v, .rc .ex-ch { width: calc((100% - var(--car-w)) / 6); }
  .rc .ex-v { padding-inline-end: 20px; }
  /* Every head alike: its words on one line, what they are about on the line under (kept where there is none, "Prix"),
     its arrows before them, so that the words end where the figures under them end. The column sorted is said by the
     ink of its head and a rule under it, never by a box round it. */
  .rc .ex-heads > * { height: 60px; }
  .rc .ex-ch { padding-inline: 4px 14px; }
  .rc .ex-ch.is-sorted { background: var(--card); box-shadow: inset 0 -2px var(--ink); }
  .rc .ex-ch.is-sorted.is-g1 { box-shadow: inset 0 -2px var(--ink), inset calc(1px * var(--line-dir)) 0 var(--line); }
  .rc .rc-sort { align-items: flex-start; min-height: 44px; padding-block: 7px; padding-inline: 6px; }
  /* The head sorted keeps its weight: its words and its arrows stay where they were. */
  .rc .ex-ch.is-sorted .rc-sort { font-weight: 600; }
  .rc .ex-arrows { margin: 0; }
  .rc .rc-hl { display: grid; justify-items: end; max-width: none; text-align: end; line-height: 16px; white-space: nowrap; }
  .rc .rc-hl small { min-height: 14px; margin-top: 2px; font: 500 0.75rem/14px var(--body); color: var(--soft); }
  /* The car's head stands on the line of the others' words. */
  .rc .ex-car-h { vertical-align: top; padding-top: 14px; line-height: 16px; }

  .rc .rc-ref > * { border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--ink) 6%, var(--card)); }
  .rc .rc-ref-id { position: sticky; inset-inline-start: 0; z-index: 1; padding-block: 10px; padding-inline: 16px; text-align: start; font-weight: inherit; }
  .rc .rc-ref-in { gap: 14px; }
  /* The sign stands in the pictures' column, the words under the cars' names. */
  .rc .rc-ref-sign { margin-inline-start: calc(var(--pic) - 36px); }
  .rc .rc-ref-hero { display: none; }
  .rc .rc-ref-100 { font-weight: 780; }
}
/* Under 1440 the car's cell gives up some of its width and the figures draw closer. */
@media (min-width: 1280px) and (max-width: 1439px) {
  .rc .rc-scroll { --car-w: 340px; --pic: 96px; }
  .rc .ex-pic { --mm: 0.0196px; }
  .rc .ex-v { min-width: 0; padding-block: 0; padding-inline: 4px 12px; }
  .rc .ex-v .ex-none.is-said { white-space: normal; }
  .rc .ex-ch { padding-inline-end: 6px; }
}
