/* Coque pit wall : barre haute fixe sur deux rangées (contexte, onglets + météo) et sidebar fixe de 300 px, rétractable.
   Ouverte, la sidebar réduit réellement la largeur du contenu. Sous 900 px elle passe en volet superposé. */
:root { --topbar-h: 80px; --sidebar-w: 300px; }
/* Hors d'une session (HOME, circuit, course, PILOTES, profil) : pas de rangée d'onglets, la barre haute n'a qu'une rangée. */
body.no-tabs { --topbar-h: 45px; }

/* ---------- Barre haute ---------- */
.shell-topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  height: var(--topbar-h);
  display: flex;
  flex-direction: column;
  background: var(--topbar-bg);
  border-bottom: 1px solid var(--line-strong);
}
.tb-row { display: flex; align-items: center; gap: var(--s3); padding: 0 var(--s4); }
.tb-context { height: 44px; }
.tb-tabs { height: 36px; gap: 0; border-top: 1px solid var(--line); min-width: 0; }

.sb-toggle { flex: none; width: 32px; min-height: 32px; padding: 0; background: transparent; border-color: var(--line); color: var(--text-2); }
.sb-toggle:hover { background: var(--hover); color: var(--text); }
.sb-toggle svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }

.tb-logo { flex: none; display: inline-flex; align-items: center; gap: var(--s2); color: var(--text); font-size: 14px; font-weight: 700; letter-spacing: .14em; text-decoration: none; }
.tb-logo:hover { text-decoration: none; color: var(--text); }
.tb-logo img { display: block; height: 28px; width: auto; }
/* Le logo est blanc et rouge : sur le thème clair il garde une plaquette sombre pour rester lisible. */
:root[data-theme="light"] .tb-logo { background: #0c0e10; border-radius: var(--r-md); padding: 4px 10px; }

/* Picto VUE MOBILE (porteur, 17/10/2026) : entre le logo et la navigation, meme gabarit que le bouton du panneau
   lateral (.sb-toggle), mais toujours visible (pas seulement quand un panneau existe). */
.tb-mobile-link { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 32px; min-height: 32px; border: 1px solid var(--line); border-radius: var(--r-md); color: var(--text-2); text-decoration: none; }
.tb-mobile-link:hover { background: var(--hover); color: var(--text); text-decoration: none; }
.tb-mobile-link svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; }

.tb-nav { flex: none; display: flex; align-items: center; gap: var(--s2); }
.tb-nav-link { display: inline-flex; align-items: center; min-height: 28px; padding: 0 var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-md); color: var(--text-2); font-size: 12px; font-weight: 650; letter-spacing: .08em; text-decoration: none; white-space: nowrap; }
.tb-nav-link:hover { color: var(--text); background: var(--hover); text-decoration: none; }
.tb-nav-link[aria-current="page"] { color: var(--brand-text); border-color: color-mix(in srgb, var(--brand) 60%, transparent); background: var(--brand-tint); }
.tb-crumbs { display: flex; align-items: center; min-width: 0; flex: 1; }
.tb-crumbs > * { display: inline-flex; align-items: center; min-width: 0; padding: 0 var(--s3); white-space: nowrap; }
.tb-crumbs > * + * { border-left: 1px solid var(--line-strong); }
.tb-circuit { color: var(--text-2); }
.tb-event { color: var(--text); font-weight: 650; overflow: hidden; text-overflow: ellipsis; display: block !important; line-height: 44px; }
.tb-crumbs .badge { margin: 0 var(--s1); }
.tb-crumbs > .tb-status { padding: 0 var(--s2); border-left: 0; }

.shell-topbar .actions { flex: none; display: flex; margin: 0 0 0 auto; align-items: center; gap: var(--s1); }
.shell-topbar .actions .who, .shell-topbar .actions a { padding: var(--s2) var(--s3); color: var(--text-2); font-size: 12px; font-weight: 600; text-decoration: none; }
.shell-topbar .actions a:hover { color: var(--text); }
/* Aperçu pilote (recette, demande du porteur du 18/10/2026, voir DriverPreview) : couleur distincte, jamais confondu
   avec un lien de navigation ordinaire. */
.shell-topbar .actions a.is-preview { border: 1px solid color-mix(in srgb, var(--warning-text) 55%, transparent); border-radius: var(--r-sm); color: var(--warning-text); }
.shell-topbar .actions a.is-preview:hover { color: var(--warning-text); background: color-mix(in srgb, var(--warning-text) 12%, transparent); }
.shell-topbar .actions form { margin: 0; }
.shell-topbar .actions button { min-height: 28px; padding: 3px 10px; font-size: 11.5px; }
.shell-topbar .actions button.link { padding: 3px var(--s2); }

/* Onglets */
.tb-tabs-list { display: flex; flex: none; height: 100%; }
.tb-tab { position: relative; display: inline-flex; align-items: center; height: 100%; padding: 0 var(--s4); color: var(--text-2); font-size: 12px; font-weight: 650; letter-spacing: .08em; text-decoration: none; white-space: nowrap; }
a.tb-tab:hover { color: var(--text); background: var(--hover); text-decoration: none; }
.tb-tab[aria-current="page"] { color: var(--text); }
.tb-tab[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand-text); }
.tb-tab.is-disabled { opacity: .4; cursor: default; }

/* Bandeau météo défilant : à droite des onglets, défilement lent (vitesse fixée par le script). */
.ticker { flex: 1; min-width: 0; margin-left: var(--s3); overflow: hidden; container-type: inline-size; white-space: nowrap; font-size: 12px; color: var(--text-2);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent);
  mask-image: linear-gradient(90deg, transparent, #000 28px, #000 calc(100% - 28px), transparent); }
.ticker-track { display: inline-flex; animation: ticker-scroll 90s linear infinite; will-change: transform; }
.ticker-copy { display: inline-flex; flex: 0 0 auto; min-width: 100cqw; align-items: center; gap: 22px; padding-right: 48px; }
.ticker-item { flex: none; }
.ticker-item:first-child { color: var(--brand-text); font-weight: 650; }
.ticker:hover .ticker-track, .ticker:focus-within .ticker-track { animation-play-state: paused; }
@keyframes ticker-scroll { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .ticker-track { animation: none; }
  .ticker-copy[aria-hidden="true"] { display: none; }
  .ticker { overflow-x: auto; }
}

/* ---------- Sidebar ---------- */
.sidebar {
  position: fixed;
  top: var(--topbar-h);
  bottom: 0;
  left: 0;
  z-index: 40;
  width: var(--sidebar-w);
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--surface);
  border-right: 1px solid var(--line-strong);
  transform: translateX(-100%);
  visibility: hidden;
  transition: transform var(--t-slow) ease, visibility 0s linear var(--t-slow);
}
html[data-sidebar="open"] .sidebar { transform: none; visibility: visible; transition: transform var(--t-slow) ease; }

.shell-main {
  min-width: 0;
  margin-left: 0;
  padding: calc(var(--topbar-h) + var(--s4)) var(--s4) var(--s5);
  transition: margin-left var(--t-slow) ease;
}
.shell-main > .page { max-width: 1280px; margin: 0 auto; }
html[data-sidebar="open"] body.has-sidebar .shell-main { margin-left: var(--sidebar-w); }
.sb-backdrop { display: none; }

/* Page sans coque (connexion) */
.plain-main { padding: var(--s4); }
.plain-brand { display: block; padding: var(--s4); }

/* Zones de la sidebar */
.sb-section { display: grid; gap: var(--s3); padding: var(--s4); border-bottom: 1px solid var(--line); }
.sb-title { margin: 0; color: var(--text-2); font-size: 10.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.sb-metric small { display: block; margin-bottom: 2px; font-size: 10.5px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; color: var(--text-2); }
.sb-metric strong { display: block; font-size: 15px; font-weight: 700; line-height: 1.2; overflow-wrap: anywhere; }
.sb-title .sb-team-name { margin-left: var(--s1); color: var(--text); letter-spacing: 0; text-transform: none; }
.sb-metric.is-alert strong { color: var(--critical-text); }
.sb-metric.is-primary strong { font-size: 32px; font-family: var(--mono); letter-spacing: -.02em; }
.sb-metric .sb-note { display: block; margin-top: 2px; font-size: 11px; color: var(--text-2); }
.sb-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s3); }
.sb-line { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s2); }
.sb-team { display: grid; gap: var(--s3); padding: var(--s3); border: 1px solid color-mix(in srgb, var(--brand) 45%, transparent); border-radius: var(--r-md); background: var(--brand-tint); }
.sb-team .sb-metric.is-primary strong { color: var(--brand-text); }
.sb-conf-block { padding-top: var(--s2); border-top: 1px solid color-mix(in srgb, var(--brand) 30%, transparent); }
.sb-conf-open { width: 100%; min-height: 76px; display: flex; align-items: center; justify-content: center; gap: var(--s3); padding: var(--s2); border: 1px solid color-mix(in srgb, var(--brand) 42%, transparent); border-radius: var(--r-md); color: var(--text); background: color-mix(in srgb, var(--surface) 82%, transparent); text-align: left; cursor: pointer; }
.sb-conf-open:hover { border-color: var(--brand); background: var(--surface); }
.sb-conf-open:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.sb-conf-ring, .conf-modal-ring { --conf-score: 0; flex: 0 0 auto; position: relative; display: grid; place-content: center; width: 64px; height: 64px; border-radius: 50%; background: radial-gradient(circle at center, var(--surface) 57%, transparent 59%), conic-gradient(var(--success) calc(var(--conf-score) * 1%), var(--line-strong) 0); font-variant-numeric: tabular-nums; }
.sb-conf-ring::after, .conf-modal-ring::after { content: ""; position: absolute; inset: 5px; border-radius: inherit; border: 1px solid color-mix(in srgb, var(--text-2) 20%, transparent); pointer-events: none; }
.sb-conf-ring.is-medium, .conf-modal-ring.is-medium { background: radial-gradient(circle at center, var(--surface) 57%, transparent 59%), conic-gradient(var(--warning) calc(var(--conf-score) * 1%), var(--line-strong) 0); }
.sb-conf-ring.is-low, .conf-modal-ring.is-low { background: radial-gradient(circle at center, var(--surface) 57%, transparent 59%), conic-gradient(var(--critical) calc(var(--conf-score) * 1%), var(--line-strong) 0); }
.sb-conf-ring.is-na, .conf-modal-ring.is-na { background: radial-gradient(circle at center, var(--surface) 57%, transparent 59%), conic-gradient(var(--text-2) 7%, var(--line-strong) 0); }
.sb-conf-ring strong { display: block; font: 700 17px/1 var(--mono); text-align: center; }
.sb-conf-ring small { display: block; margin-top: 2px; color: var(--text-2); font-size: 8px; text-align: center; }
.sb-conf-copy { min-width: 0; display: grid; gap: 2px; }
.sb-conf-copy small { color: var(--brand-text); font-size: 10px; font-weight: 750; letter-spacing: .1em; }
.sb-conf-copy strong { max-width: 145px; overflow: hidden; font-size: 13px; text-overflow: ellipsis; white-space: nowrap; }
.sb-conf-copy span { color: var(--text-2); font-size: 10.5px; }

/* Détail du CONF SCORE : hors de la sidebar pour rester ouvert pendant son polling. */
.conf-modal-bg { position: fixed; inset: 0; z-index: 100; display: grid; place-items: center; padding: var(--s4); overflow: auto; background: var(--overlay); }
.conf-modal { width: min(760px, 100%); max-height: calc(100vh - 32px); overflow: auto; display: grid; gap: var(--s4); padding: var(--s5); border: 1px solid var(--line-strong); border-radius: var(--r-xl); background: var(--surface); box-shadow: var(--shadow); }
.conf-modal-head { display: flex; align-items: start; justify-content: space-between; gap: var(--s3); }
.conf-modal-head h2 { margin: 0; font-size: 19px; }
.conf-modal-head p { margin: 3px 0 0; color: var(--text-2); font-size: 12px; }
.conf-modal-close { flex: 0 0 auto; width: 34px; height: 34px; padding: 0; border-radius: 50%; font-size: 20px; }
.conf-modal-control { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--s3); }
.conf-modal-control label { display: grid; gap: var(--s1); color: var(--text-2); font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; }
.conf-modal-control select { width: 100%; }
.conf-source { align-self: center; }
.conf-hero { display: flex; align-items: center; gap: var(--s4); padding: var(--s4); border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--surface-2); }
.conf-modal-ring { width: 104px; height: 104px; }
.conf-modal-ring strong { display: block; font: 750 30px/1 var(--mono); text-align: center; }
.conf-modal-ring small { display: block; margin-top: 3px; color: var(--text-2); font-size: 10px; text-align: center; }
.conf-hero-copy { display: grid; gap: var(--s1); }
.conf-hero-copy strong { font-size: 17px; }
.conf-hero-copy span { color: var(--text-2); font-size: 12px; }
.conf-unavailable { margin: 0; color: var(--warning-text); font-weight: 650; }
.conf-section { display: grid; gap: var(--s2); }
.conf-section h3 { margin: 0; color: var(--text-2); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; }
.conf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s2) var(--s4); margin: 0; }
.conf-grid > div { min-width: 0; display: flex; justify-content: space-between; gap: var(--s3); padding-bottom: var(--s1); border-bottom: 1px solid var(--line); }
.conf-grid dt { color: var(--text-2); font-size: 12px; }
.conf-grid dd { margin: 0; font-size: 12px; font-weight: 650; text-align: right; overflow-wrap: anywhere; }
.conf-components { display: grid; gap: var(--s2); }
.conf-component { display: grid; grid-template-columns: minmax(120px, 1fr) 1.5fr minmax(145px, auto); align-items: center; gap: var(--s2); font-size: 12px; }
.conf-component-label { font-size: 12px; font-weight: 600; }
.conf-component-track { height: 7px; overflow: hidden; border-radius: 999px; background: var(--line); }
.conf-component-fill { height: 100%; border-radius: inherit; background: var(--brand); }
.conf-component-value { min-width: 145px; display: grid; justify-items: end; gap: 1px; text-align: right; font-variant-numeric: tabular-nums; }
.conf-component-value strong { color: var(--text); font-family: var(--mono); font-size: 12px; }
.conf-component-value small { color: var(--text-2); font-size: 10px; line-height: 1.25; }
.conf-components-total { display: flex; justify-content: space-between; gap: var(--s3); margin-top: var(--s1); padding-top: var(--s2); border-top: 1px solid var(--line-strong); font-size: 11px; }
.conf-components-total strong { color: var(--brand-text); }
.conf-components-total span { color: var(--text-2); text-align: right; }
.conf-tech summary { cursor: pointer; color: var(--text-2); font-size: 12px; font-weight: 650; }
.conf-tech .conf-grid { margin-top: var(--s3); }
.conf-note { margin: 0; color: var(--text-2); font-size: 11px; }
body.conf-modal-open { overflow: hidden; }
@media (max-width: 620px) {
  .conf-modal-bg { padding: var(--s2); }
  .conf-modal { padding: var(--s4); max-height: calc(100vh - 16px); }
  .conf-modal-control, .conf-grid { grid-template-columns: 1fr; }
  .conf-hero { align-items: flex-start; }
  .conf-modal-ring { width: 88px; height: 88px; }
  .conf-component { grid-template-columns: minmax(100px, 1fr) 1.3fr auto; }
}
/* Tout est centré dans ce bloc ; les étiquettes (CURRENT DRIVER, STINT TIME…) restent sur une seule ligne même dans une colonne étroite. */
.sb-team .sb-metric { text-align: center; }
.sb-team .sb-metric small { white-space: nowrap; }
.sb-team .sb-row-cells { justify-content: center; gap: var(--s3); }
.sb-kv { display: grid; grid-template-columns: auto 1fr; gap: var(--s1) var(--s3); margin: 0; font-size: 12px; }
.sb-kv dt { color: var(--text-2); }
.sb-kv dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.sb-links { display: grid; gap: var(--s1); }
.sb-comments { list-style: none; margin: 0; padding: 0 var(--s2) 0 0; display: grid; gap: var(--s2); max-height: 160px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent; }
/* Barre de défilement discrète (porteur, 27/09/2026) : fine, arrondie, couleurs de la charte, plus marquée au survol. */
.sb-comments::-webkit-scrollbar { width: 6px; }
.sb-comments::-webkit-scrollbar-track { background: transparent; }
.sb-comments::-webkit-scrollbar-thumb { background: var(--line-strong); border-radius: 999px; }
.sb-comments:hover::-webkit-scrollbar-thumb { background: var(--text-2); }
.sb-comments:hover { scrollbar-color: var(--text-2) transparent; }
.sb-comments:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; border-radius: var(--r-md); }
.sb-count { margin-left: var(--s1); padding: 0 6px; border-radius: 999px; background: var(--surface-2); color: var(--text-2); font-size: 10px; font-weight: 700; letter-spacing: 0; vertical-align: 1px; }
.sb-comments li { display: flex; flex-wrap: wrap; align-items: baseline; gap: var(--s1) var(--s2); padding-bottom: var(--s2); border-bottom: 1px solid var(--line); font-size: 12px; }
.sb-comment-time { color: var(--text-2); font-weight: 650; }
.sb-comment-text { flex: 1 1 100%; overflow-wrap: anywhere; }

/* ---------- Écrans étroits : volet superposé ---------- */
@media (max-width: 900px) {
  html[data-sidebar="open"] body.has-sidebar .shell-main { margin-left: 0; }
  .sidebar { width: min(var(--sidebar-w), 88vw); }
  html[data-sidebar="open"] .sidebar { box-shadow: var(--shadow); }
  .sb-backdrop { display: block; position: fixed; inset: var(--topbar-h) 0 0 0; z-index: 39; background: var(--overlay); opacity: 0; pointer-events: none; transition: opacity var(--t-slow) ease; }
  html[data-sidebar="open"] .sb-backdrop { opacity: 1; pointer-events: auto; }
  .tb-circuit { display: none !important; }
}
@media (max-width: 700px) {
  .tb-row { padding: 0 var(--s3); }
  .tb-logo img { height: 22px; }
  .tb-crumbs { overflow-x: auto; scrollbar-width: none; }
  .tb-crumbs::-webkit-scrollbar { display: none; }
  .shell-topbar .actions .who, .shell-topbar .actions > a { display: none; }
  .tb-event { min-width: 96px; }
  .tb-tabs { overflow-x: auto; scrollbar-width: none; }
  .tb-tabs::-webkit-scrollbar { display: none; }
  .tb-tab { padding: 0 var(--s3); }
  .ticker { flex: none; width: 260px; }
  .shell-main { padding-left: var(--s3); padding-right: var(--s3); }
}

/* Onglets d'une page (PARAM COURSE : RACE, MÉTÉO, ADMIN) */
.page-tabs { display: flex; gap: 0; margin: 0 0 var(--s4); border-bottom: 1px solid var(--line-strong); overflow-x: auto; scrollbar-width: none; }
.page-tabs::-webkit-scrollbar { display: none; }
.page-tab { position: relative; padding: var(--s2) var(--s4); color: var(--text-2); font-size: 12px; font-weight: 650; letter-spacing: .08em; text-decoration: none; white-space: nowrap; }
.page-tab:hover { color: var(--text); background: var(--hover); text-decoration: none; }
.page-tab[aria-current="page"] { color: var(--text); }
.page-tab[aria-current="page"]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; background: var(--brand-text); }
/* ADMIN (actions sensibles : statut forcé, écoute, journal) : repéré en rouge parmi les sous-onglets de PARAM COURSE. */
.page-tab-danger, .page-tab-danger[aria-current="page"] { color: var(--critical-text); }
.page-tab-danger:hover { color: var(--critical-text); background: color-mix(in srgb, var(--critical) 10%, transparent); }
.page-tab-danger[aria-current="page"]::after { background: var(--critical); }

/* Blocs repliables de la sidebar (Météo, Système) avec voyant : vert = normal, rouge = à regarder, gris = sans donnée.
   Le voyant a toujours un texte à côté : la couleur ne porte jamais seule le sens. */
.sb-fold.sb-section { display: block; }
.sb-fold > * + * { margin-top: var(--s3); }
.sb-fold > summary { list-style: none; cursor: pointer; }
.sb-fold > summary::-webkit-details-marker { display: none; }
.sb-fold-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); }
.sb-fold-head::after { content: "▸"; order: 3; color: var(--text-2); font-size: 11px; transition: transform var(--t-base); }
.sb-fold[open] > .sb-fold-head::after { transform: rotate(90deg); }
.sb-fold-head .sb-title { flex: 1; }
.sb-light { display: inline-flex; align-items: center; gap: var(--s2); font-size: 10.5px; font-weight: 700; letter-spacing: .08em; }
.sb-light-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--text-2); box-shadow: 0 0 0 3px color-mix(in srgb, var(--text-2) 22%, transparent); }
.sb-light.is-green { color: var(--success-text); }
.sb-light.is-green .sb-light-dot { background: var(--success); box-shadow: 0 0 0 3px color-mix(in srgb, var(--success) 25%, transparent); }
.sb-light.is-orange { color: var(--warning-text); }
.sb-light.is-orange .sb-light-dot { background: var(--warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 25%, transparent); }
.sb-light.is-red { color: var(--critical-text); }
.sb-light.is-red .sb-light-dot { background: var(--critical); box-shadow: 0 0 0 3px color-mix(in srgb, var(--critical) 25%, transparent); }
.sb-light.is-grey { color: var(--text-2); }
/* Rosée (06/10/2026) : pastille orange — moins grave que la pluie — mais le mot en rouge, pour qu'il se voie. */
.sb-light.is-dew { color: var(--critical-text); }
.sb-light.is-dew .sb-light-dot { background: var(--warning); box-shadow: 0 0 0 3px color-mix(in srgb, var(--warning) 25%, transparent); }
.sb-fold > .msg { margin: 0 0 var(--s3); }

/* Notre équipe : ligne 1 RAW POS · REAL POS · KART, ligne 2 TEAM · PILOTE COURANT, ligne 3 les quatre temps sur une seule ligne. */
.sb-row { display: grid; gap: var(--s3); align-items: start; }
.sb-row-3 { grid-template-columns: 1fr 1fr 1fr; }
.sb-row .sb-metric { min-width: 0; }
/* CURRENT DRIVER : toujours sur une seule ligne (le nom complet est dans l'infobulle si l'espace manque). */
.sb-metric.sb-nowrap strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.sb-row-2 { grid-template-columns: 1fr 1.3fr; }
.sb-row-cells { grid-template-columns: repeat(4, auto); justify-content: space-between; gap: var(--s1); padding-top: var(--s2); border-top: 1px solid var(--line); }
.sb-row-cells .sb-metric small { font-size: 9.5px; letter-spacing: .05em; white-space: nowrap; }
.sb-row-cells .sb-metric strong { font-size: 10px; font-weight: 650; white-space: nowrap; letter-spacing: -.01em; }
.sb-row-cells .sb-metric strong.sb-laps-time { display: grid; gap: 1px; line-height: 1.05; white-space: normal; }
/* LAST LAP · BEST LAP · LEAD GAP · INTERVAL (porteur, 27/09/2026) : couleurs alternées blanc / orange clair pour les distinguer d'un coup d'œil. */
.sb-row-cells .sb-metric:nth-child(odd) strong { color: var(--text); }
.sb-row-cells .sb-metric:nth-child(even) strong { color: var(--soft-orange-text); }
.sb-row-2 .sb-metric strong { font-size: 13px; }
.sb-metric.is-primary strong .trend { font-size: 14px; margin-left: var(--s1); vertical-align: middle; }
.sb-team .sb-row-3 .sb-metric strong { font-family: var(--mono); font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.sb-team .sb-metric.sb-real-pos strong { color: var(--warning-text); }
.sb-team .sb-metric.sb-kart strong { color: var(--text); }
.sb-metric strong.is-pending { color: var(--text-2); font-family: var(--mono); font-size: 28px; }
/* Mots-clés des commentaires d'Apex : le mot reste écrit, la couleur n'est qu'un renfort */
.word-penalty { color: var(--critical-text); font-weight: 700; }
.word-warning { color: var(--warning-text); font-weight: 700; }

/* Barre de commande du replay : dans la rangée des onglets, à la place de la météo défilante. */
.replay-slot { flex: 1; min-width: 0; display: flex; }
.replay-slot:not(:has(.replay-bar)) { display: none; }
/* Quand la barre de replay apparaît (lancée pendant que la page est ouverte), elle prend la place de la météo défilante. */
.tb-tabs:has(.replay-bar) .ticker { display: none; }
.replay-bar { flex: 1; min-width: 0; display: flex; align-items: center; gap: var(--s2); margin-left: var(--s3); overflow-x: auto; scrollbar-width: none; white-space: nowrap; }
.replay-bar::-webkit-scrollbar { display: none; }
.replay-bar form { margin: 0; display: flex; align-items: center; }
.replay-bar button { min-height: 26px; padding: 2px 9px; font-size: 11.5px; }
.replay-bar select { width: auto; min-height: 26px; padding: 2px 6px; font-size: 11.5px; }
.replay-bar input[type=time] { min-height: 26px; padding: 1px 6px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font: inherit; font-size: 11.5px; }
.replay-tag { color: var(--best); font-size: 11px; font-weight: 700; letter-spacing: .12em; }
.replay-group { display: inline-flex; }
.replay-group button { border-radius: 0; }
.replay-group button:first-child { border-radius: var(--r-md) 0 0 var(--r-md); }
.replay-group button:last-child { border-radius: 0 var(--r-md) var(--r-md) 0; margin-left: -1px; }
.replay-bar button[aria-pressed="true"] { background: var(--brand-tint); border-color: color-mix(in srgb, var(--brand) 60%, transparent); color: var(--brand-text); }
.replay-primary { background: var(--brand); border-color: var(--brand); color: var(--on-brand); }
.replay-primary:hover { background: var(--brand-strong); }
.replay-range { flex: 1 1 180px; min-width: 120px; max-width: 420px; accent-color: var(--best); }
.replay-time { min-width: 62px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--best); }
/* Compteur du replay (27/09/2026) : compte à rebours (défaut) ou temps écoulé ; l'heure de Paris en petit, simple information. */
.replay-time .rc-clock { margin-left: var(--s1); color: var(--text-2); font-size: 10.5px; font-weight: 500; }
.rc-elapsed { display: none; }
html[data-replay-clock="elapsed"] .rc-countdown, .replay-bar.no-countdown .rc-countdown { display: none; }
html[data-replay-clock="elapsed"] .rc-elapsed, .replay-bar.no-countdown .rc-elapsed { display: inline; }
[data-replay-clock-toggle] { min-width: 28px; padding: 0 var(--s1); }
/* Menu OPTIONS du replay (porteur, 27/09/2026, sur le modèle du menu SYSTÈME) : sens de lecture, « Aller à », bornes et départ de
   référence. Panneau placé par rapport à la fenêtre : la barre défile horizontalement et couperait un panneau placé dans la barre. */
.replay-options { flex: none; }
.replay-options-head { display: inline-flex; align-items: center; justify-content: center; width: 28px; min-height: 26px; padding: 2px; border: 1px solid var(--line-strong); border-radius: var(--r-md); color: var(--text); font-size: 17px; font-weight: 700; line-height: 1; cursor: pointer; list-style: none; }
.replay-options-head::-webkit-details-marker { display: none; }
.replay-options[open] > .replay-options-head { background: var(--hover); }
.replay-options-panel { position: fixed; top: var(--topbar-h); right: var(--s3); z-index: 60; display: grid; gap: var(--s3); width: 360px; max-width: calc(100vw - 2 * var(--s3)); padding: var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); white-space: normal; }
.replay-option-row { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s2); }
.replay-option-label { color: var(--text-2); font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.replay-options-panel input[type=text] { min-height: 26px; padding: 1px 6px; border-radius: var(--r-md); border: 1px solid var(--line-strong); background: var(--surface-2); color: var(--text); font: inherit; font-size: 12px; font-variant-numeric: tabular-nums; width: 90px; }
.replay-option-info { display: grid; grid-template-columns: auto 1fr; gap: 2px var(--s3); margin: 0; font-size: 11.5px; }
.replay-option-info dt { color: var(--text-2); }
.replay-option-info dd { margin: 0; font-variant-numeric: tabular-nums; }
/* Lecture / pause (porteur, 28/09/2026) : trois boutons ▶ ⏸ ■ ; celui de l'état en cours clignote : ▶ vert en lecture, ⏸ orange en pause. */
.replay-bar .replay-play.is-active { background: var(--success); border-color: var(--success); color: #fff; animation: replay-blink-green 1.2s ease-in-out infinite; }
.replay-bar .replay-pause.is-active { background: var(--warning); border-color: var(--warning); color: #1b1300; animation: replay-blink-orange 1.2s ease-in-out infinite; }
@keyframes replay-blink-green { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 70%, transparent); opacity: 1; } 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 0%, transparent); opacity: .55; } }
@keyframes replay-blink-orange { 0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--warning) 70%, transparent); opacity: 1; } 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--warning) 0%, transparent); opacity: .55; } }
@media (prefers-reduced-motion: reduce) { .replay-bar .replay-state.is-active { animation: none; } }
/* Boutons du replay en symbole seul (porteur, 27/09/2026 : gagner de la place) ; le nom est en infobulle et pour les lecteurs d'écran. */
.replay-bar .replay-icon { min-width: 30px; padding: 0 var(--s1); justify-content: center; }
.replay-goto { display: inline-flex; align-items: center; gap: var(--s1); margin: 0; color: var(--text-2); font-size: 11.5px; font-weight: 500; }
.replay-range-info, .replay-note { color: var(--text-2); font-size: 11.5px; }
.replay-note.is-stalled { color: var(--critical-text); font-weight: 600; cursor: help; }
.replay-error { color: var(--critical-text); font-size: 11.5px; font-weight: 600; }

/* Bandeau d'alerte de dépassement de relais (Apex vs planning), visible sur toutes les pages de la course. */
.overrun-alert { margin: 0 0 var(--s2); padding: var(--s2) var(--s3); border-radius: var(--r-md); border: 1px solid color-mix(in srgb, var(--warning) 55%, transparent); background: color-mix(in srgb, var(--warning) 12%, transparent); }
.overrun-text { margin: 0 0 var(--s2); color: var(--warning-text); }
.overrun-choices { display: flex; flex-wrap: wrap; gap: var(--s2); }
.overrun-choice { margin: 0; }
.overrun-choice button { font-size: 12.5px; }
.overrun-error { margin: var(--s2) 0 0; color: var(--critical-text); }

/* Voyants de la barre d'onglets d'une course (26/09/2026) : MÉTÉO (pluie) et SYSTÈME (chaîne de collecte, détail déroulant). */
.tb-light-slot { display: inline-flex; margin-left: var(--s2); }
.tb-tab .sb-light { font-size: 10px; letter-spacing: .06em; }
.tb-system { position: relative; height: 100%; }
.tb-system-head { cursor: pointer; list-style: none; gap: var(--s2); }
.tb-system-head::-webkit-details-marker { display: none; }
.tb-system-head::after { content: "▾"; margin-left: var(--s1); color: var(--text-2); font-size: 10px; }
.tb-system[open] > .tb-system-head { color: var(--text); background: var(--hover); }
.tb-system-panel { position: absolute; top: 100%; left: 0; z-index: 60; width: 340px; max-width: calc(100vw - 2 * var(--s4)); padding: var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 12px 32px rgba(0, 0, 0, .35); }
.tb-system-panel .msg { margin: 0 0 var(--s2); font-size: 12px; }
@media (max-width: 700px) {
  /* La barre d'onglets défile horizontalement : le panneau se place sous la barre haute, sur la largeur de l'écran. */
  .tb-system-panel { position: fixed; top: var(--topbar-h); left: var(--s3); right: var(--s3); width: auto; max-width: none; }
}

/* Première ligne de la sidebar (26/09/2026) : TIME LEFT | TEAM, étiquettes alignées en haut, nom de l'équipe sur deux lignes au plus. */
.sb-row.sb-head-row { grid-template-columns: auto minmax(0, 1fr); align-items: start; column-gap: var(--s4); }
.sb-head-row .sb-metric.is-primary strong { font-size: 24px; line-height: 1.15; white-space: nowrap; }
.sb-team-head { min-width: 0; text-align: right; }
.sb-head-row .sb-team-head strong.sb-team-name { margin: 0; color: var(--text); font-size: 13px; line-height: 1.25; white-space: normal; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; line-clamp: 2; overflow: hidden; }

/* CONF SCORE repris du dernier relais terminé (26/09/2026) : anneau gris, valeur lisible mais atténuée. */
.sb-conf-ring.is-carry, .conf-modal-ring.is-carry { background: radial-gradient(circle at center, var(--surface) 57%, transparent 59%), conic-gradient(var(--text-2) calc(var(--conf-score) * 1%), var(--line-strong) 0); }
.sb-conf-ring.is-carry strong, .conf-modal-ring.is-carry strong { color: var(--text-2); }

/* Détail du CONF SCORE enrichi (26/09/2026) : barres des composantes visibles, mesures, courbe du relais, tours pris en compte. */
.conf-component-fill { display: block; } /* un <span> en ligne ignorait largeur et hauteur : les barres restaient vides */
.conf-legend { display: flex; flex-wrap: wrap; gap: var(--s2); }
.conf-legend-item { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 2px 10px; border: 1px solid var(--line-strong); border-radius: 999px; background: transparent; color: var(--text); font-size: 11px; }
.conf-legend-item::before { content: ""; width: 14px; height: 3px; border-radius: 2px; background: currentColor; }
.conf-legend-item[aria-pressed="false"] { opacity: .45; text-decoration: line-through; }
.conf-wave { position: relative; }
.conf-wave-svg { display: block; width: 100%; height: auto; }
.conf-wave .w-grid { stroke: var(--line); stroke-width: 1; }
.conf-wave .w-axis { fill: var(--text-2); font-size: 10px; }
.conf-wave .w-line { fill: none; stroke-width: 1.6; stroke-linejoin: round; stroke-linecap: round; }
.conf-wave .w-line.w-score { stroke-width: 3; }
.conf-wave .w-cursor { stroke: var(--text-2); stroke-dasharray: 3 3; }
.conf-wave .w-hit { fill: transparent; cursor: crosshair; }
.w-score { color: var(--brand-text); stroke: var(--brand-text); }
.w-dur { color: var(--success-text); stroke: var(--success-text); }
.w-lq { color: var(--warning-text); stroke: var(--warning-text); }
.w-reg { color: var(--info-text, var(--text-2)); stroke: var(--info-text, var(--text-2)); }
.w-evo { color: var(--best); stroke: var(--best); }
.w-rain { color: var(--critical-text); stroke: var(--critical-text); }
.conf-wave-tip { position: absolute; top: 8px; z-index: 2; display: grid; gap: 2px; min-width: 170px; padding: var(--s2) var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); font-size: 11px; pointer-events: none; }
.conf-laps { display: grid; gap: 2px; font-size: 12px; }
.conf-lap { display: grid; grid-template-columns: 28px 80px 1fr; gap: var(--s2); padding: 2px 0; border-bottom: 1px solid var(--line); }
.conf-lap-n { color: var(--text-2); text-align: right; }
.conf-lap-time { font-family: var(--mono); font-weight: 650; }
.conf-lap.is-out { color: var(--text-2); }
.conf-lap.is-out .conf-lap-time { text-decoration: line-through; }

/* Page CONF SCORE (conf.php, 26/09/2026) : la fenêtre du détail devient une page. */
.conf-page-titlebar { display: flex; align-items: end; justify-content: space-between; gap: var(--s4); margin: var(--s2) 0 var(--s3); }
.conf-page-title { margin: 0; }
.conf-driver-picker { display: grid; gap: var(--s1); width: min(360px, 48%); color: var(--text-2); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.conf-driver-picker select { width: 100%; }
.conf-page { display: grid; gap: var(--s4); }
.conf-page > [hidden] { display: none !important; }
.conf-page-head { display: flex; flex-wrap: wrap; align-items: end; gap: var(--s3); }
.conf-page-head label { display: grid; gap: var(--s1); min-width: min(360px, 100%); color: var(--text-2); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.conf-page .card.conf-section { gap: var(--s3); }
.conf-hint { margin: 0; color: var(--text-2); font-size: 12px; }
.conf-info-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s5); align-items: start; }
.conf-info-grid > .conf-section:last-child { grid-column: 1 / -1; }
@media (max-width: 1000px) { .conf-info-grid { grid-template-columns: 1fr; } .conf-info-grid > .conf-section:last-child { grid-column: auto; } }
.conf-legend.is-static .conf-legend-item { cursor: default; }
.conf-wave .w-area { fill: currentColor; fill-opacity: .55; stroke: currentColor; stroke-width: .8; }
.conf-wave .w-line.w-total { stroke: var(--text); stroke-width: 2.4; }

/* Page CONF SCORE : « Mesures du relais » (ex-électrocardiogramme) des sous-scores (charte : libellés 11 px majuscules, chiffres à chasse fixe alignés, traits
   de 1 px, teintes par color-mix, état dit par la couleur ET par le sous-score écrit) et relais précédents IN → OUT (26/09/2026). */
.conf-ecg { display: grid; border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface-2); }
.ecg-row { display: grid; grid-template-columns: 188px minmax(0, 1fr) 112px; align-items: center; gap: var(--s3); min-height: 92px; padding: var(--s1) var(--s3); border-bottom: 1px solid var(--line); }
.ecg-desc { grid-column: 1 / -1; margin: var(--s1) 0 0; font-size: 12px; line-height: 1.4; color: var(--text-2); }
.ecg-meta { display: grid; gap: 2px; min-width: 0; }
.ecg-label { font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text); }
.ecg-unit { font-size: 11px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ecg-plot { display: block; width: 100%; height: 80px; overflow: visible; }
.ecg-plot .ecg-good { fill: color-mix(in srgb, var(--success) 13%, transparent); }
.ecg-plot .ecg-bad { fill: color-mix(in srgb, var(--critical) 10%, transparent); }
.ecg-plot .ecg-limit { stroke: color-mix(in srgb, var(--critical) 70%, transparent); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.ecg-plot .ecg-zero { stroke: var(--line-strong); stroke-width: 1; vector-effect: non-scaling-stroke; }
.ecg-plot .ecg-trace { fill: none; stroke: var(--brand-text); stroke-width: 1.25; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ecg-plot .ecg-dot { stroke-width: 6; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ecg-plot .ecg-dot.is-ok { stroke: var(--success); }
.ecg-plot .ecg-dot.is-warn { stroke: var(--warning); }
.ecg-plot .ecg-dot.is-bad { stroke: var(--critical); }
.ecg-plot .ecg-dot.is-na { stroke: var(--text-2); }
.ecg-plotwrap { position: relative; min-width: 0; }
.ecg-plot .ecg-pt { stroke: var(--brand-text); stroke-width: 3.5; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.ecg-plot .chart-cursor { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.ecg-pt-label { position: absolute; transform: translate(-50%, calc(-100% - 5px)); padding: 0 3px; border-radius: 3px; background: color-mix(in srgb, var(--surface-2) 85%, transparent); font-family: var(--mono); font-size: 10px; line-height: 1.3; color: var(--text-2); white-space: nowrap; pointer-events: none; font-variant-numeric: tabular-nums; }
.ecg-pt-label.is-below { transform: translate(-50%, 5px); }
.ecg-pt-label.is-last { font-weight: 700; color: var(--text); }
.ecg-pt-label.is-last.is-ok { color: var(--success-text); }
.ecg-pt-label.is-last.is-warn { color: var(--warning-text); }
.ecg-pt-label.is-last.is-bad { color: var(--critical-text); }
.ecg-value { display: grid; justify-items: end; gap: 2px; font-variant-numeric: tabular-nums; }
.ecg-value strong { font-family: var(--mono); font-size: 13px; font-weight: 700; }
.ecg-value span { font-size: 11px; color: var(--text-2); }
.ecg-value.is-ok strong { color: var(--success-text); }
.ecg-value.is-warn strong { color: var(--warning-text); }
.ecg-value.is-bad strong { color: var(--critical-text); }
.ecg-axis { min-height: 24px; border-bottom: 0; }
.ecg-xaxis { display: grid; gap: 2px; justify-items: center; }
.ecg-xaxis .ecg-ticks { justify-self: stretch; }
.ecg-ticks { display: flex; justify-content: space-between; font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
@media (max-width: 700px) { .ecg-row { grid-template-columns: 1fr 88px; } .ecg-plotwrap { grid-column: 1 / -1; grid-row: 3; } }
.conf-stints-table { width: 100%; font-size: 12px; }
.conf-stints-table th { white-space: nowrap; }
.conf-stints-table td.conf-io { font-family: var(--mono); white-space: nowrap; }
.conf-stints-table td.is-down { color: var(--critical-text); font-weight: 700; }
.conf-stints-table td.is-up { color: var(--success-text); font-weight: 700; }

/* Page CONF SCORE : ligne 1 sur deux colonnes, 30 % pour le score et l'accès aux temps, 70 % pour les composantes. */
.conf-top { display: grid; grid-template-columns: minmax(260px, 3fr) minmax(0, 7fr); gap: var(--s4); align-items: stretch; }
.conf-primary { min-width: 0; display: grid; grid-template-rows: auto auto; gap: var(--s3); }
.conf-primary > .card { margin: 0; }
/* Sous le CONF SCORE : accès aux temps du relais. */
.conf-top .conf-page-link { padding: 0; overflow: hidden; background: var(--surface-2); }
.conf-page-link .conf-detail-button { position: relative; width: 100%; min-height: 100%; justify-content: flex-start; gap: var(--s3); padding: var(--s4); border: 0; border-radius: inherit; background: transparent; color: var(--text); text-align: left; box-shadow: inset 3px 0 0 var(--brand); }
.conf-page-link .conf-detail-button:hover { background: var(--brand-tint); color: var(--text); }
.conf-detail-icon { flex: 0 0 auto; display: grid; place-items: center; width: 46px; height: 46px; border: 1px solid color-mix(in srgb, var(--brand) 48%, var(--line)); border-radius: 50%; background: var(--brand-tint); color: var(--brand-text); }
.conf-detail-icon svg { width: 25px; height: 25px; fill: none; stroke: currentColor; stroke-width: 1.65; stroke-linecap: round; stroke-linejoin: round; }
.conf-detail-icon svg circle { fill: var(--surface-2); stroke: currentColor; stroke-width: 1.65; }
.conf-detail-copy { min-width: 0; display: grid; gap: 3px; }
.conf-detail-copy strong { font-size: 13px; font-weight: 700; line-height: 1.25; }
.conf-detail-copy small { color: var(--text-2); font-size: 10.5px; font-weight: 550; letter-spacing: .035em; line-height: 1.3; }
.conf-detail-arrow { margin-left: auto; color: var(--brand-text); font: 700 20px/1 var(--mono); transition: transform var(--t-fast); }
.conf-detail-button:hover .conf-detail-arrow { transform: translateX(3px); }
.conf-page-link .conf-detail-button[aria-disabled="true"], .conf-page-link .conf-detail-button[aria-disabled="true"]:hover { cursor: not-allowed; background: transparent; color: var(--text-2); box-shadow: inset 3px 0 0 var(--line-strong); }
.conf-detail-button[aria-disabled="true"] .conf-detail-icon { border-color: var(--line-strong); background: color-mix(in srgb, var(--text-2) 8%, transparent); color: var(--text-2); }
.conf-detail-button[aria-disabled="true"] .conf-detail-arrow { color: var(--text-2); transform: none; }
.conf-top > .card { margin: 0; }
.conf-top .conf-hero { display: flex; align-items: center; gap: var(--s4); }
.conf-eyebrow { color: var(--brand-text) !important; font-size: 10px !important; font-weight: 750; letter-spacing: .1em; }
.conf-components-card { align-content: center; }
.conf-components-card h3 span { font-weight: 500; }
@media (max-width: 900px) { .conf-top { grid-template-columns: 1fr; } }

/* Page CONF SCORE : panneau inférieur à trois onglets. */
.conf-tabs { padding: 0; overflow: hidden; }
.conf-tab-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.conf-tab-list button { min-height: 48px; padding: var(--s3) var(--s4); border: 0; border-right: 1px solid var(--line); border-radius: 0; background: transparent; color: var(--text-2); font-size: 11px; font-weight: 700; letter-spacing: .055em; line-height: 1.35; text-transform: uppercase; }
.conf-tab-list button:last-child { border-right: 0; }
.conf-tab-list button:hover { background: var(--brand-tint); color: var(--text); }
.conf-tab-list button[aria-selected="true"] { box-shadow: inset 0 -3px 0 var(--brand); background: var(--surface); color: var(--brand-text); }
.conf-tab-panel { display: grid; gap: var(--s4); padding: var(--s4); }
.conf-tab-panel[hidden] { display: none; }
.conf-tab-panel .conf-tech { padding-top: var(--s3); border-top: 1px solid var(--line); }

/* Les explications des graphiques sont disponibles uniquement dans une infobulle. */
.conf-section-heading, .conf-chart-heading { display: flex; align-items: center; gap: var(--s2); }
.conf-section-heading h3, .conf-chart-heading h4 { margin: 0; }
.conf-info-tip { position: relative; z-index: 2; display: inline-flex; flex: 0 0 auto; }
.conf-info-button { display: grid; place-items: center; width: 22px; height: 22px; padding: 0; border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface-2); color: var(--brand-text); font: 750 12px/1 Georgia, serif; text-transform: none; }
.conf-info-button:hover, .conf-info-button:focus-visible { border-color: var(--brand); background: var(--brand-tint); }
.conf-info-bubble { position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; width: min(360px, 75vw); padding: var(--s3); border: 1px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow); color: var(--text); font-size: 12px; font-weight: 450; letter-spacing: normal; line-height: 1.45; text-align: left; text-transform: none; opacity: 0; visibility: hidden; transform: translateY(-3px); transition: opacity var(--t-fast), transform var(--t-fast), visibility var(--t-fast); pointer-events: none; }
.conf-info-tip:hover .conf-info-bubble, .conf-info-tip:focus-within .conf-info-bubble { opacity: 1; visibility: visible; transform: translateY(0); }
@media (max-width: 620px) {
  .conf-page-titlebar { align-items: stretch; flex-direction: column; }
  .conf-driver-picker { width: 100%; }
  .conf-tab-list { grid-template-columns: 1fr; }
  .conf-tab-list button { min-height: 42px; border-right: 0; border-bottom: 1px solid var(--line); }
  .conf-tab-list button:last-child { border-bottom: 0; }
  .conf-tab-list button[aria-selected="true"] { box-shadow: inset 3px 0 0 var(--brand); }
  .conf-component { grid-template-columns: minmax(105px, 1fr) minmax(135px, auto); }
  .conf-component-track { grid-column: 1 / -1; grid-row: 2; }
  .conf-components-total { align-items: flex-start; flex-direction: column; }
  .conf-components-total span { text-align: left; }
}
.chart { display: grid; grid-template-columns: 18px minmax(0, 1fr); grid-template-rows: auto auto; gap: var(--s1) var(--s2); }
.chart-ytitle { grid-row: 1; writing-mode: vertical-rl; transform: rotate(180deg); align-self: center; justify-self: center; font-size: 11px; color: var(--text-2); white-space: nowrap; }
.chart-body { grid-row: 1; grid-column: 2; display: grid; grid-template-columns: 30px minmax(0, 1fr); }
.chart-yticks { position: relative; height: 220px; }
.chart-yticks span { position: absolute; right: 6px; transform: translateY(-50%); font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.chart-plot { position: relative; }
.chart-plot.is-scrollable { overflow-x: auto; overflow-y: hidden; scrollbar-color: var(--brand) var(--surface-3); scrollbar-width: thin; }
.chart-scroll-content { position: relative; min-width: 100%; }
.chart-svg { display: block; width: 100%; height: 220px; overflow: visible; }
.chart-svg .chart-grid { stroke: var(--line); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-svg .chart-xguide { stroke: color-mix(in srgb, var(--line-strong) 48%, transparent); stroke-width: 1; stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.chart-svg .chart-cursor { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.chart-svg .chart-line { fill: none; stroke-width: 1.25; stroke-linejoin: round; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-svg .chart-line.is-main { stroke-width: 2.25; }
.chart-svg .bar { stroke: none; }
.chart-svg .bar.w-dur { fill: color-mix(in srgb, var(--success) 70%, transparent); }
.chart-svg .bar.w-lq { fill: color-mix(in srgb, var(--warning) 75%, transparent); }
.chart-svg .bar.w-reg { fill: color-mix(in srgb, var(--info) 75%, transparent); }
.chart-svg .bar.w-evo { fill: color-mix(in srgb, var(--best) 70%, transparent); }
.chart-svg .bar.w-rain { fill: color-mix(in srgb, var(--critical) 70%, transparent); }
.chart-svg .bar.w-penalty { fill: color-mix(in srgb, var(--critical) 45%, transparent); }
.chart-svg .bar.w-kept { fill: color-mix(in srgb, var(--text-2) 22%, transparent); }
.conf-legend-item.w-penalty { color: var(--critical-text); }
.conf-legend-item.w-kept { color: var(--text-2); }
.chart-xticks { position: relative; height: 16px; }
.chart-xticks span { position: absolute; top: 2px; transform: translateX(-50%); font-size: 11px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.chart-xtitle { grid-column: 2; justify-self: center; font-size: 11px; color: var(--text-2); }

/* Page CONF SCORE : titre de section avec action à droite (« Course en détail », 26/09/2026). */
.conf-section-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); flex-wrap: wrap; }
.conf-section-head h3 { margin: 0; }
.conf-section-head .button { font-size: 12px; }

/* Sous-score RYTHME (conf-score-v2, 26/09/2026). */
.w-pace { color: var(--text); stroke: var(--text); }
.chart-svg .bar.w-pace { fill: color-mix(in srgb, var(--text) 55%, transparent); }

/* Page CONF SCORE · « Lecture du relais : 4 graphiques » (29/09/2026) : deux colonnes, une seule sur écran étroit. */
.conf-four { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s4) var(--s5); }
@media (max-width: 1000px) { .conf-four { grid-template-columns: minmax(0, 1fr); } }
.conf-four-item h4 { font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; }
.conf-four-item .conf-chart-heading { margin-bottom: var(--s2); }
.conf-four-item .conf-legend { margin-bottom: var(--s2); }
.conf-four-item .chart-body { grid-template-columns: 50px minmax(0, 1fr); } /* graduations « 1:12.9 » plus larges que « 100 » */
.conf-four-item.is-performance { grid-column: 1 / -1; }
.conf-performance-layout { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--s3); align-items: stretch; }
.conf-performance-chart { min-width: 0; }
.conf-performance-metric { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: var(--s2) var(--s4); min-width: 0; padding: var(--s2) var(--s3); border: 1px solid var(--line); border-left: 3px solid var(--line-strong); border-radius: var(--r-md); background: var(--surface-2); text-align: center; }
.conf-performance-metric-label { color: var(--text-2); font-size: 10px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.conf-performance-metric strong { font: 750 clamp(16px, 1.65vw, 24px)/1 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.conf-performance-metric small { color: var(--text-2); font-size: 10px; line-height: 1.35; }
.conf-performance-metric.is-gain { border-left-color: var(--success); }
.conf-performance-metric.is-gain strong { color: var(--success-text); }
.conf-performance-metric.is-loss { border-left-color: var(--critical); }
.conf-performance-metric.is-loss strong { color: var(--critical-text); }
@media (max-width: 620px) { .conf-performance-metric { align-items: center; flex-direction: column; min-height: 90px; } }

/* PERFORMANCE : vue spatiale tour par tour (01/10/2026). */
.performance-race { min-width: 0; }
.performance-race-legend { margin-bottom: var(--s3); }
.performance-tour-scroll { width: 100%; overflow-x: auto; overflow-y: hidden; padding: 0 0 var(--s2); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); scrollbar-color: var(--brand) var(--surface-3); scrollbar-width: thin; scroll-snap-type: x proximity; }
.performance-tour-track { display: grid; align-items: stretch; min-height: 500px; }
.performance-tour { display: grid; grid-template-rows: auto 1fr; min-width: 0; border-right: 1px solid var(--line); scroll-snap-align: start; }
.performance-tour:last-child { border-right: 0; }
.performance-tour-head { display: flex; align-items: center; justify-content: center; gap: var(--s2); min-height: 46px; padding: var(--s2); border-bottom: 1px solid var(--line); background: var(--surface-2); }
.performance-tour-head strong { font: 750 15px/1 var(--mono); font-variant-numeric: tabular-nums; }
.performance-tour-head > span { padding: 3px 7px; color: var(--success-text); border: 1px solid color-mix(in srgb, var(--success) 50%, transparent); border-radius: 999px; background: color-mix(in srgb, var(--success) 12%, transparent); font-size: 8px; font-weight: 800; letter-spacing: .08em; }
.performance-tour-head > .performance-position-change { display: inline-flex; align-items: center; gap: 5px; padding: 3px 7px 3px 4px; border-radius: 8px; overflow: hidden; transform-origin: center; }
.performance-position-change-icon { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 6px; color: #06130d; font: 950 17px/.8 var(--mono); }
.performance-position-change-copy { display: grid; gap: 1px; line-height: 1; text-align: left; }
.performance-position-change-copy small { font-size: 7px; font-weight: 850; letter-spacing: .12em; }
.performance-tour-head .performance-position-change-copy strong { font: 900 9px/1 var(--mono); letter-spacing: 0; white-space: nowrap; }
.performance-tour-head .performance-position-change.is-gain { color: var(--success-text); border-color: color-mix(in srgb, var(--success) 72%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--success) 24%, transparent), color-mix(in srgb, var(--success) 8%, transparent)); box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 30%, transparent); animation: performance-position-gain-pulse 2.2s ease-in-out infinite; }
.performance-position-change.is-gain .performance-position-change-icon { background: var(--success-text); animation: performance-position-arrow-up 1.15s ease-in-out infinite; }
.performance-tour-head .performance-position-change.is-loss { color: var(--critical-text); border-color: color-mix(in srgb, var(--critical) 72%, transparent); background: linear-gradient(135deg, color-mix(in srgb, var(--critical) 24%, transparent), color-mix(in srgb, var(--critical) 8%, transparent)); }
.performance-position-change.is-loss .performance-position-change-icon { color: #fff; background: var(--critical); animation: performance-position-arrow-down 1.15s ease-in-out infinite; }
@keyframes performance-position-gain-pulse {
  0%, 100% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--success) 30%, transparent); transform: scale(1); }
  50% { box-shadow: 0 0 0 5px transparent; transform: scale(1.035); }
}
@keyframes performance-position-arrow-up {
  0%, 100% { transform: translateY(2px); opacity: .72; }
  50% { transform: translateY(-2px); opacity: 1; }
}
@keyframes performance-position-arrow-down {
  0%, 100% { transform: translateY(-2px); opacity: .72; }
  50% { transform: translateY(2px); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .performance-tour-head .performance-position-change, .performance-position-change .performance-position-change-icon { animation: none; }
}
.performance-tour-stage { position: relative; display: grid; grid-template-rows: minmax(160px, 1fr) auto minmax(160px, 1fr); align-items: center; justify-items: stretch; gap: var(--s2); padding: var(--s3) var(--s2); }
.performance-tour.is-live { border: 1px solid color-mix(in srgb, var(--success) 58%, var(--line)); background: color-mix(in srgb, var(--success) 4%, var(--surface)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--success) 14%, transparent); }
.performance-tour.is-live .performance-tour-head { justify-content: space-between; background: color-mix(in srgb, var(--success) 8%, var(--surface-2)); }
.performance-opponent-block { display: flex; align-items: center; flex-direction: column; justify-content: center; align-self: stretch; min-width: 0; padding: var(--s2); border-radius: var(--r-sm); background: #15191e; }
.performance-rival, .performance-us { position: relative; display: flex; align-items: center; flex-direction: column; justify-content: center; gap: 4px; max-width: 100%; text-align: center; }
.performance-kart-meta { position: relative; z-index: 1; display: inline-flex; align-items: stretch; justify-content: center; max-width: 100%; margin: 5px; border: 1px solid #fff; border-radius: 4px; background: #080a0d; overflow: hidden; }
.performance-kart-number { position: relative; z-index: 1; min-width: 34px; margin-bottom: -3px; padding: 3px 7px; color: #fff; border: 1px solid #fff; border-radius: 4px; background: #080a0d; font: 800 10px/1 var(--mono); }
.performance-kart-meta .performance-kart-number { margin: 0; border: 0; border-right: 1px solid #ffffff66; border-radius: 0; }
.performance-kart-interval { min-width: 48px; padding: 3px 6px; color: var(--text-2); font: 750 9px/1 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.performance-kart-image { display: block; width: 46px; height: 46px; margin: 5px; object-fit: contain; filter: drop-shadow(0 4px 5px #0009); }
.performance-kart-image.is-ours { width: 96px; height: 96px; filter: drop-shadow(0 5px 8px #000b); }
.performance-us-name { display: flex; align-items: center; flex-direction: column; max-width: 125px; padding: 4px 8px; color: var(--success-text); border-radius: var(--r-sm); background: #080a0d; }
.performance-us-name strong, .performance-us-name span { max-width: 100%; overflow: hidden; font-size: 9px; line-height: 1.2; text-overflow: ellipsis; white-space: nowrap; }
.performance-movement { position: relative; z-index: 1; display: flex; align-items: center; flex-direction: column; justify-content: center; min-width: 0; text-align: center; }
.performance-arrows { white-space: pre-line; font: 850 23px/.55 var(--mono); }
.performance-delta { margin-top: 8px; font: 800 19px/1 var(--mono); font-variant-numeric: tabular-nums; white-space: nowrap; }
.performance-verdict { margin-top: 7px; padding: 3px 8px; border-radius: 999px; font-size: 8px; font-style: normal; font-weight: 850; letter-spacing: .04em; white-space: nowrap; }
.performance-movement.is-good { color: var(--success-text); }
.performance-movement.is-good .performance-verdict { color: #06130d; background: var(--success-text); }
.performance-movement.is-bad { color: var(--critical-text); }
.performance-movement.is-bad .performance-verdict { color: #fff; background: var(--critical); }
.performance-movement.is-neutral { color: var(--text-2); }
.performance-movement.is-neutral .performance-verdict { color: var(--text-2); background: var(--surface-3); }
@media (max-width: 760px) {
  .performance-tour-track { min-height: 460px; }
  .performance-tour-stage { grid-template-rows: minmax(145px, 1fr) auto minmax(145px, 1fr); }
}
.chart-svg .chart-band { stroke: none; }
.chart-svg .chart-band.band-pilot { fill: color-mix(in srgb, var(--info, var(--brand)) 22%, transparent); }
.chart-svg .chart-band.band-limit { fill: color-mix(in srgb, var(--critical) 12%, transparent); stroke: color-mix(in srgb, var(--critical) 70%, transparent); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.chart-svg .chart-band.band-energy-critical { fill: color-mix(in srgb, var(--critical) 10%, transparent); }
.chart-svg .chart-line.energy-critical { stroke: var(--critical); stroke-width: 2.25; }
.chart-svg .chart-ref { stroke-width: 1.25; stroke-dasharray: 6 4; vector-effect: non-scaling-stroke; }
.chart-svg .chart-ref.ref-avg { stroke: var(--text-2); }
.chart-svg .chart-ref.ref-best { stroke: var(--success-text); }
.conf-legend-item.band-pilot { color: color-mix(in srgb, var(--info, var(--brand)) 70%, var(--text)); }
.conf-legend-item.band-limit { color: var(--critical-text); }
.conf-legend-item.energy-critical { color: var(--critical-text); }
.conf-legend-item.energy-critical::before { height: 10px; background: color-mix(in srgb, var(--critical) 24%, transparent); border-bottom: 3px solid var(--critical); border-radius: 2px; }
.conf-legend-item.ref-avg { color: var(--text-2); }
.conf-legend-item.ref-best { color: var(--success-text); }

.chart-svg .chart-focus { fill: color-mix(in srgb, var(--brand) 10%, transparent); stroke: none; }
.conf-legend-item.focus { color: var(--brand-text); }
.conf-legend-item.focus::before { height: 10px; background: color-mix(in srgb, var(--brand) 25%, transparent); }

/* RÉGULARITÉ v4 (29/09/2026) : moyenne M en pointillé, tours hors fourchette en points rouges. */
.chart-svg .chart-line.ref-mean { stroke: var(--text-2); stroke-dasharray: 4 3; }
.chart-svg .chart-line.limit-low { stroke: var(--success-text); stroke-width: 1.65; }
.chart-svg .chart-line.limit-high { stroke: var(--critical); stroke-width: 1.25; stroke-dasharray: 3 3; }
.conf-legend-item.limit-low, .conf-legend-item.mark-fast { color: var(--success-text); }
.chart-svg .chart-mark.mark-fast { stroke: var(--success-text); }
.conf-legend-item.mark-fast::before { width: 8px; height: 8px; border-radius: 50%; }
/* PERFORMANCE (29/09/2026) : aire du cumul repris ou perdu sur le kart devant, et point vert / rouge par tour. */
.chart-svg .chart-line.guide-hi { stroke: color-mix(in srgb, var(--success-text) 70%, transparent); stroke-dasharray: 5 4; }
.chart-svg .chart-line.guide-lo { stroke: color-mix(in srgb, var(--critical) 70%, transparent); stroke-dasharray: 5 4; }
.conf-legend-item.guide-hi { color: var(--success-text); }
.conf-legend-item.guide-lo { color: var(--critical-text); }
.chart-svg .chart-area { stroke: none; }
.chart-svg .chart-area.w-lq { fill: color-mix(in srgb, var(--warning) 20%, transparent); }
.chart-svg .chart-area.w-score { fill: color-mix(in srgb, var(--brand-text) 16%, transparent); }
/* Barres du graphique PERFORMANCE : gain ou perte de chaque tour. */
.chart-svg .chart-bar { stroke: none; }
.chart-svg .chart-bar.is-gain { fill: color-mix(in srgb, var(--success-text) 85%, transparent); }
.chart-svg .chart-bar.is-loss { fill: color-mix(in srgb, var(--critical) 85%, transparent); }
.chart-svg .chart-bar.is-behind { fill-opacity: 0.55; }
.chart-bar-label { position: absolute; z-index: 1; max-width: 92px; overflow: hidden; color: var(--text); font: 650 9px/1.1 var(--mono); text-overflow: ellipsis; white-space: nowrap; pointer-events: none; text-shadow: 0 1px 2px var(--surface), 0 -1px 2px var(--surface), 1px 0 2px var(--surface), -1px 0 2px var(--surface); }
.chart-bar-label.is-ahead { transform: translate(-100%, -50%); text-align: right; }
.chart-bar-label.is-behind { transform: translate(0, -50%); text-align: left; }
.chart-bar-label.is-up { margin-top: -3px; }
.chart-bar-label.is-down { margin-top: 3px; }
.conf-legend-item.bar-gain { color: var(--success-text); }
.conf-legend-item.bar-loss { color: var(--critical-text); }
.conf-legend-item.bar-gain::before, .conf-legend-item.bar-loss::before { width: 7px; height: 13px; border-radius: 2px; }
.conf-legend-item.bar-ahead, .conf-legend-item.bar-behind { color: var(--text-2); }
.conf-legend-item.bar-ahead::before, .conf-legend-item.bar-behind::before { width: 7px; height: 13px; border-radius: 2px; background: var(--text-2); }
.conf-legend-item.bar-behind::before { opacity: .55; }
.chart-svg .chart-mark { fill: none; stroke-width: 7; stroke-linecap: round; vector-effect: non-scaling-stroke; }
.chart-svg .chart-mark.w-good { stroke: var(--success-text); }
.chart-svg .chart-mark.w-bad { stroke: var(--critical); }
.chart-svg .chart-mark.w-neutral { stroke: var(--text-2); }
.chart-svg .chart-mark.mark-out { stroke: var(--critical); }
.conf-legend-item.mark-out { color: var(--critical-text); }
.conf-legend-item.mark-out::before { width: 8px; height: 8px; border-radius: 50%; }
.conf-wave-tip .is-out { color: var(--critical-text); font-weight: 700; }
.conf-wave-tip .is-fast { color: var(--success-text); font-weight: 700; }

/* Provenance d'une valeur déduite et non constatée (pilote pris au planning quand Apex ne publie pas drteam, 03/10/2026). */
.sb-metric strong .sb-src { display: block; margin-top: 1px; color: var(--warning, #d08a2a); font-family: inherit; font-size: 8.5px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; line-height: 1; }

/* Relais : numéro réel, temps au volant, temps restant ; puis la dérive contre l'horaire du planning (03/10/2026). */
.sb-drift { margin: 2px 0 0; color: var(--warning, #d08a2a); font-size: 9.5px; letter-spacing: .02em; }
.sb-conf-mode { margin: 4px 0 0; padding: 3px 5px; border-left: 2px solid var(--warning, #d08a2a); color: var(--text-2, #9aa3ad); font-size: 9.5px; line-height: 1.35; }

/* PERFORMANCE : lecture spatiale selon la maquette du porteur (04/10/2026) — pastille du kart adverse, casque et nom du pilote au
   centre, légende des trois places une seule fois à droite, bilan cumulé en bandeau sous la piste. */
.performance-kart-badge { display: inline-block; padding: 5px 10px; color: #fff; border-radius: var(--r-sm); background: var(--brand); font: 800 12px/1.1 var(--font); letter-spacing: .02em; white-space: nowrap; }
.performance-rival .performance-kart-interval { color: var(--text-2); font: 600 10px/1.2 var(--mono); font-variant-numeric: tabular-nums; }
.performance-us { gap: 2px; }
.performance-helmet-icon { width: 46px; height: 46px; object-fit: contain; }
.performance-us-name { color: var(--text); font: 800 10px/1.2 var(--font); letter-spacing: .06em; text-transform: uppercase; max-width: 130px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.performance-key { min-width: 86px; border-right: 0; border-left: 1px solid var(--line-strong); }
.performance-key .performance-tour-head { background: var(--surface-2); }
.performance-key .performance-tour-stage { justify-items: center; }
.performance-key-row { display: grid; align-content: center; justify-items: center; gap: 2px; color: var(--text-2); font: 600 10px/1.2 var(--font); }
.performance-key-row.is-ours { color: var(--brand-text); font-weight: 800; }
.performance-key-kart { opacity: .55; }
.performance-key-row.is-ours .performance-key-kart { opacity: 1; }
.conf-performance-metric { margin-top: var(--s3); }
@media (max-width: 760px) { .performance-key { display: none; } }
