/* Partie de styles.css : graphique principal : contrôles, barre de choix, axes, courbes, étiquettes, légende, réglages, mosaïque des duels.
   Chargée après les parties précédentes, dans l'ordre de scripts/app_sources.js
   (STYLESHEETS) : l'ordre de la cascade est celui de l'ancien fichier unique. */

.filters-head h2 {
  font-size: 1.08rem;
  color: var(--heading);
}

.filters-head h3 {
  margin: 0;
  color: var(--heading);
  font-size: 1rem;
}

.filters-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.4;
}

.controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(170px, 1fr));
  gap: 18px 16px;
  align-items: end;
}

.scenario-notice {
  margin-top: 20px;
  border: 1px solid rgba(196, 69, 54, 0.46);
  border-radius: 2px;
  background: rgba(237, 221, 212, 0.55);
  color: var(--chestnut);
  padding: 12px 14px;
  font-size: 0.84rem;
  line-height: 1.45;
}

.scenario-notice[hidden] {
  display: none;
}

.control {
  min-width: 0;
}

.control label {
  display: block;
  margin: 0 0 8px;
  color: var(--heading);
  font-size: 0.74rem;
  font-weight: 650;
  line-height: 1.2;
}

.control select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 2px;
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 18px) 50% / 6px 6px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 14px) 50% / 6px 6px no-repeat,
    var(--panel);
  color: var(--ink);
  padding: 0 34px 0 13px;
  outline: none;
  cursor: pointer;
  font-size: 0.92rem;
}

.election-control select {
  min-height: 34px;
  border-color: rgba(var(--ink-rgb), 0.28);
  background-color: rgba(var(--panel-rgb), 0.62);
  color: var(--muted);
  padding-left: 11px;
  font-size: 0.82rem;
  font-weight: 650;
}

.election-control select:hover,
.election-control select:focus {
  color: var(--ink);
}

.control select:hover {
  border-color: var(--accent-ink);
  background-color: var(--surface);
}

.control select:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(var(--accent-rgb), 0.22);
  outline-offset: 1px;
}

.segmented {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: var(--panel);
  padding: 0;
}

.segmented button {
  min-width: 0;
  border: 0;
  border-right: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 0.87rem;
  font-weight: 650;
  padding: 0 6px;
  /* Un libellé qui passe à la ligne fait grandir le contrôle et casse
     l'alignement de la pile d'en-tête. */
  white-space: nowrap;
}

.segmented button:last-child {
  border-right: 0;
}

.segmented button:hover {
  background: rgba(237, 221, 212, 0.32);
  color: var(--ink);
}

.segmented button:focus-visible {
  outline: 2px solid rgba(var(--accent-rgb), 0.22);
  outline-offset: -2px;
}

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

.segmented button[aria-pressed="true"] {
  background: var(--accent);
  color: #ffffff;
}

.chart-actions .time-control .segmented {
  grid-template-columns: repeat(3, minmax(0, 1fr)) 42px;
}

.chart-panel {
  background: var(--panel);
  border: 2px solid var(--frame);
  border-radius: 2px;
  overflow: visible;
  min-width: 0;
}

/* Au second tour, la mosaïque est déplacée juste avant le graphique principal.
   Ils restent deux blocs distincts, avec leur propre respiration. */
.duel-mosaic-panel + .chart-panel {
  margin-top: 64px;
}

.round-modebar {
  display: flex;
  align-items: center;
  min-height: 58px;
  margin-bottom: 32px;
  padding: 10px 16px;
  border: 1px solid rgba(var(--accent-rgb), 0.24);
  border-radius: 3px;
  background: rgba(var(--accent-rgb), 0.045);
}

.round-modebar .round-control {
  display: flex;
  align-items: center;
  gap: 13px;
}

.round-modebar .round-control label {
  margin: 0;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Rappel du nom du site dans la barre : seul le thème collant l'affiche. */
.modebar-brand {
  display: none;
}

/* La barre porte aussi le choix de l'élection et reste visible : son display
   flex l'emporterait sinon sur l'attribut hidden du sélecteur de tour (2007). */
.round-modebar .round-control[hidden] {
  display: none;
}

.round-modebar .round-switch {
  width: 214px;
  min-height: 36px;
  border-color: rgba(var(--accent-rgb), 0.32);
  background: var(--panel);
}

.round-modebar .round-switch button {
  font-size: 0.82rem;
}

.chart-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 28px;
  padding: 30px 28px 0;
}

.chart-export-button {
  display: grid;
  place-items: center;
  position: absolute;
  z-index: 2;
  top: 10px;
  right: 28px;
  width: 27px;
  height: 27px;
  padding: 0;
  border: 1px solid rgba(var(--accent-rgb), 0.36);
  border-radius: 2px;
  background: rgba(255, 254, 250, 0.9);
  color: var(--accent-ink);
  cursor: pointer;
}

.chart-export-button:hover {
  border-color: var(--accent-ink);
  background: rgba(var(--accent-rgb), 0.12);
}

.chart-export-button:focus-visible {
  outline: 3px solid rgba(var(--accent-rgb), 0.24);
  outline-offset: 2px;
}

.chart-export-button:disabled {
  cursor: wait;
  opacity: 0.55;
}

.chart-export-button svg {
  width: 14px;
  height: 14px;
  min-height: 0;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.6;
}

.chart-actions {
  display: grid;
  grid-template-columns: minmax(120px, 0.65fr) minmax(240px, 1.35fr);
  flex: 0 0 390px;
  gap: 10px;
  align-items: end;
  padding-top: 2px;
}

.chart-head p {
  margin-top: 6px;
  color: var(--muted);
  font-size: 0.92rem;
}

.chart-wrap {
  position: relative;
  width: 100%;
  min-height: 500px;
}

.time-range-custom-button {
  display: grid;
  place-items: center;
  width: 42px;
  flex: 0 0 42px;
  padding: 0;
}

.time-range-custom-button svg {
  width: 18px;
  height: 18px;
  min-height: 0;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: var(--panel);
  vector-effect: non-scaling-stroke;
}

.time-range-editor {
  margin: -2px 28px 20px;
  padding: 15px 18px 12px;
  border: 1px solid rgba(var(--accent-rgb), 0.25);
  border-radius: 3px;
  background: rgba(var(--accent-rgb), 0.045);
}

.time-range-editor[hidden] {
  display: none;
}

.time-range-editor-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 11px;
}

.time-range-editor h3 {
  margin: 0;
  font-size: 0.88rem;
}

.time-range-editor p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.time-range-editor output {
  color: var(--accent-ink);
  font-size: 0.82rem;
  font-weight: 700;
  white-space: nowrap;
}

.time-range-overview {
  position: relative;
  height: 48px;
  border: 1px solid rgba(var(--ink-rgb), 0.18);
  border-radius: 2px;
  background: rgba(var(--panel-rgb), 0.84);
  overflow: hidden;
}

.time-range-density {
  position: absolute;
  inset: 6px 0 5px;
  display: flex;
  align-items: flex-end;
  gap: 1px;
  padding: 0 2px;
}

.time-range-density span {
  min-width: 1px;
  flex: 1;
  border-radius: 1px 1px 0 0;
  background: rgba(var(--ink-rgb), 0.16);
}

.time-range-selection {
  position: absolute;
  inset-block: 0;
  background: rgba(var(--accent-rgb), 0.12);
  pointer-events: none;
}

.time-range-selection::before,
.time-range-selection::after {
  position: absolute;
  inset-block: 0;
  width: 2px;
  background: var(--stormy-teal);
  content: "";
}

.time-range-selection::before {
  left: 0;
  transform: translateX(-50%);
}

.time-range-selection::after {
  right: 0;
  transform: translateX(50%);
}

.time-range-overview input[type="range"] {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  appearance: none;
  background: transparent;
  pointer-events: none;
}

.time-range-overview input[type="range"]::-webkit-slider-thumb {
  width: 16px;
  height: 38px;
  border: 2px solid var(--panel);
  border-radius: 3px;
  background: var(--stormy-teal);
  box-shadow: 0 1px 5px rgba(var(--ink-rgb), 0.25);
  appearance: none;
  cursor: ew-resize;
  pointer-events: auto;
}

.time-range-overview input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 38px;
  border: 2px solid var(--panel);
  border-radius: 3px;
  background: var(--stormy-teal);
  box-shadow: 0 1px 5px rgba(var(--ink-rgb), 0.25);
  cursor: ew-resize;
  pointer-events: auto;
}

.time-range-overview input[type="range"]:focus-visible::-webkit-slider-thumb {
  outline: 3px solid rgba(var(--accent-rgb), 0.3);
  outline-offset: 2px;
}

.time-range-bounds {
  display: flex;
  justify-content: space-between;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.72rem;
}

svg {
  display: block;
  width: 100%;
  height: clamp(510px, calc(100vh - 270px), 660px);
  min-height: 500px;
}

.axis text,
.axis-label,
.empty-state {
  fill: var(--muted);
  font-size: 12.5px;
}

.grid line {
  stroke: var(--grid-line);
  stroke-width: 1;
}

/* Second tour uniquement : au-dessus du seuil on l'emporte, en dessous non.
   Aplats volontairement très pâles, ils doivent situer la lecture sans
   concurrencer les couleurs de candidats. */
.majority-zone-win {
  fill: rgba(64, 138, 84, 0.17);
}

.majority-zone-lose {
  fill: rgba(198, 58, 42, 0.1);
}

/* Courbes miroir du camp sélectionné : un duel par courbe, dans la couleur de
   l'adversaire. Trait nettement plus fin que les courbes pleines et pointillé
   serré : elles accompagnent la lecture sans la disputer. */
.trend-mirror {
  stroke-width: 1.4;
  stroke-dasharray: 2.5 3.5;
}

.matchup-toggle {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  align-self: end;
  color: var(--heading);
  font-size: 0.84rem;
  font-weight: 600;
  cursor: pointer;
}

.matchup-toggle[hidden] {
  display: none;
}

.matchup-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent-ink);
  cursor: pointer;
}

.majority-line {
  stroke: var(--line-strong);
  stroke-width: 1.5;
}

.axis line,
.axis path {
  stroke: var(--line-strong);
  stroke-width: 1;
}

.trend {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3.8;
  transition: opacity 140ms ease, stroke-width 140ms ease;
}

.trend-band {
  opacity: 0.1;
  pointer-events: none;
  transition: opacity 140ms ease;
}

.point {
  stroke: var(--halo);
  stroke-width: 1.6;
  transition: opacity 140ms ease, stroke-width 140ms ease;
}

.hit-trend {
  fill: none;
  stroke: rgba(0, 0, 0, 0.001);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 22;
  pointer-events: stroke;
}

.hit-point {
  fill: transparent;
  pointer-events: all;
}

.hit-end-label {
  fill: transparent;
  pointer-events: all;
  cursor: pointer;
}

.hover-dot {
  fill: var(--panel);
  stroke-width: 2.5;
  pointer-events: none;
}

.trend.is-hovered-series {
  opacity: 1;
  stroke-width: 4.8;
}

/* Mode évolution : la tendance avant J-7/J-30/J-90 passe en retrait. */
.trend.is-before-evolution {
  opacity: 0.4;
  stroke-width: 2.2;
}

.trend.is-before-evolution.is-hovered-series {
  opacity: 0.6;
  stroke-width: 2.8;
}

.trend.is-before-evolution.is-muted-series {
  opacity: 0.1;
}

.point.is-hovered-series {
  opacity: 1;
  stroke-width: 2.2;
}

/* Points du graphique principal : petits, sans contour blanc. */
.point.point-soft,
.point.point-soft.is-hovered-series {
  stroke: none;
}

.point.point-soft.is-hovered-series {
  opacity: 0.85;
}

.trend-band.is-hovered-series {
  opacity: 0.14;
}

/* Bande du graphique principal : intervalle à 80 %, discret au repos. */
.trend-band.trend-band-main {
  opacity: 0.08;
}

.trend-band.trend-band-main.is-hovered-series {
  opacity: 0.16;
}

.trend-band.trend-band-main.is-muted-series {
  opacity: 0.02;
}

/* Jour du scrutin d'une élection passée : trait, intitulé et un losange par
   candidat au niveau de son résultat officiel. */
.result-rule {
  stroke: var(--ink, #283d3b);
  stroke-width: 1;
  stroke-dasharray: 3 4;
  opacity: 0.5;
  pointer-events: none;
}

.result-rule-label {
  fill: var(--ink, #283d3b);
  font-size: 12px;
  font-weight: 620;
  paint-order: stroke;
  stroke: var(--halo);
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
}

.result-rule-label.is-compact {
  font-size: 11px;
}

.result-marker {
  stroke: var(--panel);
  stroke-width: 1.6;
  pointer-events: all;
}

.result-marker.is-muted-series {
  opacity: 0.18;
}

.trend.is-muted-series,
.point.is-muted-series,
.end-label.is-muted-series,
.end-face.is-muted-series,
.label-leader.is-muted-series,
.end-point.is-muted-series,
.evolution-point.is-muted-series {
  opacity: 0.18;
}

/* Repère discret de la moyenne J-7, J-30 ou J-90 sur chaque courbe. */
.evolution-point {
  stroke: var(--panel);
  stroke-width: 1.2;
  pointer-events: none;
}

.end-point {
  stroke: var(--panel);
  stroke-width: 2;
  pointer-events: none;
}

.trend-band.is-muted-series {
  opacity: 0.025;
}

.end-label {
  font-size: 12.5px;
  font-weight: 680;
  dominant-baseline: middle;
  paint-order: stroke;
  stroke: var(--halo);
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
}

/* Repères du candidat épinglé : plus haut et plus bas de sa tendance. */
.trend-extreme-point {
  stroke: var(--panel);
  stroke-width: 2;
  pointer-events: none;
}

.trend-extreme-label {
  font-weight: 650;
  paint-order: stroke;
  stroke: var(--halo);
  stroke-width: 4px;
  stroke-linejoin: round;
  pointer-events: none;
}

.end-label.is-compact {
  font-size: 11px;
}

.end-label--main {
  font-size: 14px;
}

.end-label--score {
  font-size: 10.5px;
  font-weight: 500;
}

/* Graphique principal : score (et évolution) en graisse normale, nom en gras. */
.end-label--value {
  font-weight: 500;
}

.end-label--name {
  font-weight: 800;
}

.end-face {
  pointer-events: none;
}

@media (max-width: 759px) {
  .end-label--main {
    font-size: 12.5px;
  }
}

.label-leader {
  fill: none;
  stroke-width: 1;
  /* Trait plein : un pointillé de 2 px se lit mal sur les courtes amorces, et
     le trait continu suit mieux l'oeil quand l'étiquette a dû être décalée. */
  opacity: 0.45;
  pointer-events: none;
}

.tooltip {
  position: absolute;
  z-index: 5;
  max-width: 260px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(var(--panel-rgb), 0.97);
  padding: 10px 11px;
  pointer-events: none;
  font-size: 0.82rem;
}

.tooltip strong {
  display: block;
  margin-bottom: 2px;
}

.tooltip span {
  display: block;
  color: var(--muted);
  line-height: 1.45;
}

.legend-panel {
  padding: 16px 28px 18px;
  border-top: 1px solid rgba(var(--accent-rgb), 0.18);
  background: rgba(var(--accent-rgb), 0.055);
}

.legend-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 8px;
}

.legend-title {
  flex: none;
  margin: 0;
  color: var(--heading);
  font-size: 0.9rem;
  line-height: 31px;
}

.legend {
  display: flex;
  flex: 1 1 280px;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.legend-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  flex: none;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: var(--panel);
  color: var(--heading);
  cursor: pointer;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 650;
}

.legend-toggle:hover {
  border-color: var(--accent-ink);
}

.legend-toggle[hidden] {
  display: none;
}

.legend-toggle[aria-expanded="true"] .filters-toggle-chevron {
  transform: translateY(2px) rotate(-135deg);
}

.legend-item {
  display: inline-flex;
  align-items: center;
  position: relative;
  gap: 7px;
  min-height: 31px;
  border: 1px solid rgba(var(--ink-rgb), 0.22);
  border-radius: 2px;
  background: rgba(var(--panel-rgb), 0.52);
  color: rgba(var(--ink-rgb), 0.82);
  padding: 5px 10px;
  cursor: pointer;
}

.legend-item:hover {
  background: rgba(237, 221, 212, 0.42);
  border-color: var(--accent-ink);
}

/* Le clic inverse l'état du candidat : au survol, l'action est annoncée
   directement dans l'étiquette plutôt que laissée à deviner. */
.legend-item[aria-pressed="true"]:hover,
.legend-item[aria-pressed="true"]:focus-visible {
  border-color: rgba(196, 69, 54, 0.52);
}

.legend-item[aria-pressed="true"]:hover::after,
.legend-item[aria-pressed="true"]:focus-visible::after {
  content: "Retirer";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border-radius: inherit;
  background: rgba(var(--panel-rgb), 0.96);
  color: var(--tomato-jam);
  font-size: 0.8rem;
  font-weight: 750;
  pointer-events: none;
}

.legend-item[aria-pressed="false"] {
  color: rgba(var(--ink-rgb), 0.58);
  border-color: rgba(var(--ink-rgb), 0.14);
  background: rgba(237, 221, 212, 0.18);
  opacity: 1;
}

.swatch {
  width: 11px;
  height: 11px;
  flex: 0 0 11px;
  border-radius: 50%;
}

.legend-name {
  overflow-wrap: anywhere;
  font-size: 0.84rem;
  line-height: 1.1;
}

.duel-mosaic-panel {
  margin-top: 64px;
  border: 2px solid var(--chestnut);
  border-radius: 2px;
  background: var(--panel);
  padding: 30px 28px 32px;
}

.duel-mosaic-panel[hidden] {
  display: none;
}

.duel-mosaic-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
}

.comparison-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
}

.duel-mosaic-export,
.duel-mosaic-settings > summary,
.nowcast-export,
.comparison-export,
.projection-export {
  position: static;
  top: auto;
  right: auto;
  flex: 0 0 auto;
}

.nowcast-export {
  align-self: flex-start;
}

.duel-mosaic-head h2 {
  margin: 0;
}

/* Options du graphique principal : roue crantée à gauche du bouton d'export. */
.chart-settings {
  position: absolute;
  z-index: 3;
  top: 10px;
  right: 61px;
}

.chart-settings > summary {
  position: static;
  list-style: none;
}

.chart-settings > summary::-webkit-details-marker {
  display: none;
}

.chart-settings[open] > summary {
  border-color: var(--accent-ink);
  background: rgba(var(--accent-rgb), 0.12);
}

.chart-settings svg {
  stroke-width: 2;
}

.chart-settings-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  width: 220px;
  margin: 0;
  padding: 10px 12px 6px;
  border: 1px solid var(--muted);
  background: var(--panel);
}

.chart-settings-menu legend {
  float: left;
  width: 100%;
  margin: 0 0 4px;
  font-weight: 700;
}

/* Évolution de la moyenne : choix exclusif en pastilles sous la case à cocher. */
.chart-settings-evolution {
  clear: both;
  padding: 6px 0 8px;
  font-size: 0.85rem;
}

.chart-settings-evolution-label {
  display: block;
  margin-bottom: 6px;
}

.chart-settings-choices {
  display: flex;
  border: 1px solid var(--muted);
}

.chart-settings-choices label {
  flex: 1;
  position: relative;
  cursor: pointer;
}

.chart-settings-choices label + label {
  border-left: 1px solid var(--muted);
}

.chart-settings-choices input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.chart-settings-choices span {
  display: block;
  padding: 6px 0;
  text-align: center;
  white-space: nowrap;
}

.chart-settings-choices label:hover span {
  background: var(--hover);
}

.chart-settings-choices input:checked + span {
  background: var(--stormy-teal);
  color: #fff;
  font-weight: 700;
}

.chart-settings-choices input:focus-visible + span {
  outline: 2px solid var(--stormy-teal);
  outline-offset: 1px;
}

/* Réglage de la mosaïque : un menu déroulant sous l'icône, comme les choix de
   candidats du nowcast, pour basculer entre duels récents et tous les duels. */
.duel-mosaic-settings {
  position: relative;
}

.duel-mosaic-settings > summary {
  list-style: none;
}

.duel-mosaic-settings > summary::-webkit-details-marker {
  display: none;
}

.duel-mosaic-settings[open] > summary {
  border-color: var(--accent-ink);
  background: rgba(var(--accent-rgb), 0.12);
}

.duel-mosaic-settings svg circle {
  fill: #fffefa;
}

.duel-mosaic-settings-menu {
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  z-index: 10;
  width: min(270px, calc(100vw - 48px));
  margin: 0;
  padding: 10px 12px 6px;
  border: 1px solid var(--muted);
  background: var(--panel);
}

.duel-mosaic-settings-menu legend {
  float: left;
  width: 100%;
  margin: 0 0 4px;
  padding: 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.duel-mosaic-head p {
  margin: 6px 0 0;
  max-width: 78ch;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.45;
}

.duel-mosaic {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 16px;
  margin-top: 22px;
}

.duel-tile {
  display: block;
  position: relative;
  width: 100%;
  border: 1px solid var(--line);
  border-bottom: 2px solid var(--line-strong);
  border-radius: 2px;
  background: var(--surface);
  padding: 12px 12px 10px;
  text-align: left;
  cursor: pointer;
}

.duel-tile:hover {
  border-color: var(--accent-ink);
  background: rgba(237, 221, 212, 0.42);
}

.duel-tile.is-selected {
  border: 2px solid var(--frame);
  background: var(--surface);
  box-shadow: 0 0 0 2px rgba(var(--ink-rgb), 0.08);
}

.duel-tile.is-selected .duel-tile-chart {
  border-radius: 3px;
  background: rgba(var(--accent-rgb), 0.028);
  box-shadow: inset 0 0 0 1px rgba(var(--accent-rgb), 0.1);
}

.duel-tile:focus-visible {
  outline: 2px solid var(--stormy-teal);
  outline-offset: 3px;
}

.duel-tile-head {
  display: grid;
  gap: 3px;
}

.duel-tile-side {
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(var(--ink-rgb), 0.72);
  font-size: 0.86rem;
}

.duel-tile-side.is-leading {
  color: var(--ink);
  font-weight: 640;
}

.duel-tile-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 50%;
}

.duel-tile-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.duel-tile-value {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.duel-tile-chart {
  display: block;
  width: 100%;
  /* La règle globale `svg` impose la hauteur du grand graphique : une vignette
     se dimensionne au contraire sur son propre rapport d'aspect. */
  height: auto;
  min-height: 0;
  aspect-ratio: 300 / 148;
  margin-top: 6px;
}

.duel-tile-foot {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.74rem;
}

.duel-tile-axis {
  stroke: var(--line);
  stroke-width: 1;
}

.duel-tile-threshold {
  stroke: var(--chestnut);
  stroke-width: 1.2;
  stroke-dasharray: 4 3;
  opacity: 0.7;
}

.duel-tile-threshold-label {
  fill: var(--muted);
  font-size: 8.5px;
  dominant-baseline: middle;
}

.duel-tile-date {
  fill: var(--muted);
  font-size: 8.5px;
}

.duel-tile-trend {
  fill: none;
  stroke-width: 2.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.duel-tile-point {
  opacity: 0.7;
}
