/* LMUAnalyzer — interface web. Couleurs par rôle (thème clair / sombre).
   Style « Livrée technique » : rouge et noir de course, titres penchés,
   étiquettes techniques, fond quadrillé. Polices hébergées dans fonts/. */
@font-face {
  font-family: "Archivo"; font-style: normal; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%; src: url("fonts/archivo.woff2") format("woff2");
}
@font-face {
  font-family: "Archivo"; font-style: italic; font-display: swap;
  font-weight: 100 900; font-stretch: 62% 125%; src: url("fonts/archivo-italic.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-display: swap;
  font-weight: 400; src: url("fonts/plex-mono-400.woff2") format("woff2");
}
@font-face {
  font-family: "IBM Plex Mono"; font-style: normal; font-display: swap;
  font-weight: 500; src: url("fonts/plex-mono-500.woff2") format("woff2");
}
:root {
  color-scheme: light;
  --font: "Archivo", system-ui, "Segoe UI", sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Consolas, monospace;
  --page: #f2f3f5; --paper-line: #e3e6ea; --surface: #ffffff; --ink: #111111; --ink-2: #5a5d66; --muted: #6f727b;
  --grid: #eceef2; --axis: #c9ccd3; --border: #d5d9df;
  --accent: #d42a22; --accent-soft: rgba(226, 50, 42, 0.10); --danger: #c41e17;
  --red: #e2322a; --best: #7c3aed; --sec-green: #15803d; --sec-yellow: #a16207;
  --side: #111111; --side-ink: #c9c9c9; --side-muted: #8a8a8a;
  --speed: #111111; --throttle: #1f9d55; --brake: #e2322a; --track-under: #dfe2e7;
  --track-surface: #eceef2; --edge: #5a5d66;
  --lap1: #111111; --lap2: #e2322a; --steer: #7c3aed; --rpm: #b7791f;
  --seq-0: #f4b9b4; --seq-1: #ec8f87; --seq-2: #e2625a; --seq-3: #d42a22;
  --seq-4: #a91d17; --seq-5: #7e130f; --seq-6: #520b08;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0e0f11; --paper-line: #181b1f; --surface: #17191c; --ink: #f2f3f5; --ink-2: #b4b8c0; --muted: #8b9099;
    --grid: #262a2f; --axis: #3a3f46; --border: #2c3036;
    --accent: #e5372c; --accent-soft: rgba(255, 74, 61, 0.16); --danger: #ff6b5f;
    --red: #e5372c; --best: #b794f6; --sec-green: #34d399; --sec-yellow: #facc15;
    --side: #060708; --side-ink: #c9c9c9; --side-muted: #8a8a8a;
    --speed: #f2f3f5; --throttle: #2fbf6a; --brake: #ff5a4f; --track-under: #262a2f;
    --track-surface: #1f2226; --edge: #b4b8c0;
    --lap1: #f2f3f5; --lap2: #ff5a4f; --steer: #a78bfa; --rpm: #e0b04a;
    --seq-0: #5c1410; --seq-1: #86201a; --seq-2: #b52c24; --seq-3: #e5372c;
    --seq-4: #f2766d; --seq-5: #f9a8a1; --seq-6: #ffd8d4;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0e0f11; --paper-line: #181b1f; --surface: #17191c; --ink: #f2f3f5; --ink-2: #b4b8c0; --muted: #8b9099;
  --grid: #262a2f; --axis: #3a3f46; --border: #2c3036;
  --accent: #e5372c; --accent-soft: rgba(255, 74, 61, 0.16); --danger: #ff6b5f;
  --red: #e5372c; --best: #b794f6; --sec-green: #34d399; --sec-yellow: #facc15;
  --side: #060708; --side-ink: #c9c9c9; --side-muted: #8a8a8a;
  --speed: #f2f3f5; --throttle: #2fbf6a; --brake: #ff5a4f; --track-under: #262a2f;
  --track-surface: #1f2226; --edge: #b4b8c0;
  --lap1: #f2f3f5; --lap2: #ff5a4f; --steer: #a78bfa; --rpm: #e0b04a;
  --seq-0: #5c1410; --seq-1: #86201a; --seq-2: #b52c24; --seq-3: #e5372c;
  --seq-4: #f2766d; --seq-5: #f9a8a1; --seq-6: #ffd8d4;
}

* { box-sizing: border-box; }
html { background: var(--page); }
body {
  margin: 0; background: var(--page); color: var(--ink);
  font: 15px/1.45 system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: var(--accent); }
h1 { font-size: 24px; margin: 0 0 4px; }
h2 { font-size: 16px; margin: 0 0 12px; }
.muted { color: var(--ink-2); }
.notice { padding: 16px; }

[hidden] { display: none !important; }

/* Structure : volet à gauche (logo + menu), page à droite */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky; top: 0; height: 100vh; display: flex; flex-direction: column; gap: 20px;
  padding: 16px 12px; background: var(--surface); border-right: 1px solid var(--border);
}
.sidebar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; padding: 0 4px; }
.brand-logo { width: 40px; height: 26px; display: block; }
.brand-name { font-size: 18px; letter-spacing: 0.01em; }
.brand-name strong { font-weight: 700; color: var(--accent); }
.side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-nav a, .side-logout {
  display: flex; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px;
  color: var(--ink-2); text-decoration: none; font: inherit; background: none; border: 0;
  cursor: pointer; text-align: left; width: 100%;
}
.side-nav a:hover, .side-logout:hover { background: var(--accent-soft); color: var(--ink); }
.side-nav a[aria-current="page"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.side-nav svg, .menu-toggle svg {
  width: 20px; height: 20px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round;
}
.side-logout { margin-top: auto; }
.menu-toggle {
  display: none; align-items: center; gap: 6px; font: inherit; color: var(--ink);
  background: transparent; border: 1px solid var(--axis); border-radius: 8px; padding: 6px 10px; cursor: pointer;
}
.side-nav a:focus-visible, .side-logout:focus-visible, .menu-toggle:focus-visible, .brand:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
@media (max-width: 760px) {
  .shell { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .sidebar { height: auto; z-index: 5; gap: 8px; padding: 10px 16px; border-right: 0; border-bottom: 1px solid var(--border); }
  .menu-toggle { display: inline-flex; }
  body:not(.menu-open) .side-nav { display: none; }
  .side-logout { margin-top: 8px; }
}

main { width: 100%; max-width: 1480px; margin: 0 auto; padding: 24px 16px 48px; outline: none; }
.page-title { margin-bottom: 16px; }

/* Tableau de bord */
.card.driver-card { margin-bottom: 12px; }
.driver-name { font-size: 28px; font-weight: 700; line-height: 1.2; margin: 2px 0 4px; overflow-wrap: anywhere; }
.driver-card .muted { margin: 0; }
.last-session { display: flex; flex-direction: column; gap: 2px; color: var(--ink); text-decoration: none; }
.last-session:hover strong { color: var(--accent); text-decoration: underline; }

/* Sessions : chargement des pages suivantes */
.more { display: flex; justify-content: center; margin-top: 16px; }

/* Mes records */
.records { display: grid; gap: 16px; }
.record-track .layout { font-weight: 400; color: var(--ink-2); font-size: 14px; margin-left: 8px; }
.class-tag {
  display: inline-block; font-size: 12px; font-weight: 600; color: var(--accent);
  background: var(--accent-soft); border-radius: 999px; padding: 1px 10px;
}
.record-time a { font-weight: 600; color: var(--ink); text-decoration: none; }
/* Mêmes colonnes d'un circuit à l'autre (défilement horizontal sur petit écran). */
.records-table { table-layout: fixed; min-width: 940px; }
.records-table th:nth-child(1) { width: 11%; }
.records-table th:nth-child(2) { width: 10%; }
.records-table th:nth-child(3) { width: 13%; }
.records-table th:nth-child(4) { width: 172px; }
.records-table th:nth-child(5) { width: 22%; }
.records-table th:nth-child(6) { width: 14%; }
.records-table td { overflow: hidden; text-overflow: ellipsis; }

/* Analyse : choix des deux tours */
.slots { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); gap: 12px; align-items: center; }
@media (max-width: 860px) { .slots { grid-template-columns: minmax(0, 1fr); } .swap { justify-self: center; } }
.slot { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; min-height: 150px; }
.slot-head { display: flex; align-items: center; gap: 10px; }
.slot-head h2 { margin: 0; }
.slot-choice { display: flex; flex-direction: column; gap: 2px; }
.slot .button { margin-top: auto; }
.analyse-action { display: flex; justify-content: center; margin: 16px 0; }
.analyse-action .button { min-width: 200px; font-size: 16px; padding: 11px 24px; }
.analysis-results > * { margin-bottom: 16px; }
.analysis-results .top { margin-bottom: 16px; }
.swatch-line { display: inline-block; width: 26px; height: 0; border-top: 3px solid var(--lap1); flex: none; }
.swatch-line.lap2 { border-top: 3px dashed var(--lap2); }
.lap-action { margin-left: auto; text-decoration: none; }

/* Fenêtre « Parcourir » */
.picker {
  width: min(960px, calc(100vw - 32px)); max-height: calc(100vh - 48px); padding: 0;
  border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--ink);
}
.picker::backdrop { background: rgba(0, 0, 0, 0.45); }
.picker-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface);
}
.picker-head h2 { margin: 0; }
.picker-body { padding: 12px 16px 16px; }
.picker-body > .map-button { margin-bottom: 8px; }

/* Analyse : résultat */
.summary-gap { font-size: 24px; font-weight: 700; font-variant-numeric: tabular-nums; margin: 2px 0; }
.lost { color: var(--danger); }
.gained { color: var(--throttle); }
.compare-legend { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; }
.compare-legend li { display: flex; align-items: center; gap: 10px; }
.s-lap1 { stroke: var(--lap1); }
.s-lap2 { stroke: var(--lap2); }
.series.ref { stroke-dasharray: 6 4; }
.s-delta { stroke: var(--ink-2); }
.area-above { fill: var(--danger); opacity: 0.18; stroke: none; }
.area-below { fill: var(--throttle); opacity: 0.18; stroke: none; }
.zero-line { stroke: var(--ink-2); stroke-width: 1; }
.lap-line { fill: none; stroke-width: 3; stroke-linejoin: round; stroke-linecap: round; }
.lap-line.lap1 { stroke: var(--lap1); }
.lap-line.lap2 { stroke: var(--lap2); stroke-width: 2; stroke-dasharray: 5 4; }
.cursor-dot.dot1 { fill: var(--lap1); }
.cursor-dot.dot2 { fill: var(--lap2); }
#tip .row3 { display: grid; grid-template-columns: 1fr 52px 52px; gap: 8px; align-items: center; }
#tip .row3 strong { text-align: right; }
#tip .row3 .v1 { color: var(--lap1); }
#tip .row3 .v2 { color: var(--lap2); }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.back { display: inline-block; margin-bottom: 12px; color: var(--ink-2); text-decoration: none; }
.back:hover { color: var(--ink); }

/* Cartes, boutons, formulaires */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; margin: 0; }
.button {
  background: var(--accent); color: #fff; border: 0; border-radius: 8px;
  padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer;
}
.button.secondary { background: transparent; color: var(--ink); border: 1px solid var(--axis); font-weight: 500; }
.button:focus-visible, input:focus-visible, select:focus-visible, a:focus-visible, tr:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
input, select {
  font: inherit; color: var(--ink); background: var(--surface);
  border: 1px solid var(--axis); border-radius: 8px; padding: 8px 10px;
}
label { display: block; font-weight: 600; margin-bottom: 6px; }
.login { max-width: 460px; margin: 48px auto; }
.login input { width: 100%; margin-bottom: 12px; }
.login .resend { display: block; margin: 0 0 12px; }
.error { color: var(--danger); margin: 0 0 12px; }
.hint { color: var(--ink-2); font-size: 13px; margin-top: 12px; }
.filters { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

/* Chiffres clés */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi-label { color: var(--ink-2); font-size: 13px; }
.kpi-value { font-size: 18px; font-weight: 600; white-space: nowrap; }

/* Tableaux */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; color: var(--ink-2); font-weight: 500; border-bottom: 1px solid var(--axis); padding: 8px; white-space: nowrap; }
td { padding: 8px; border-bottom: 1px solid var(--grid); white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: var(--accent-soft); }
tr.selected td { background: var(--accent-soft); }
tr.selected td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
tr.best td { font-weight: 600; }
tr.dim td { color: var(--ink-2); }
.tag { display: inline-block; font-size: 12px; color: var(--ink-2); border: 1px solid var(--axis); border-radius: 999px; padding: 0 8px; margin-left: 6px; }
.empty { color: var(--ink-2); padding: 24px 0; text-align: center; }

/* Tour sélectionné */
.lap-head { display: flex; align-items: baseline; gap: 12px; margin: 24px 0 12px; flex-wrap: wrap; }
.lap-head h2 { margin: 0; font-size: 20px; }
.top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; margin-bottom: 16px; }
@media (max-width: 860px) { .top { grid-template-columns: 1fr; } }
.map-card { position: relative; }
.map-svg {
  width: 100%; max-width: 520px; aspect-ratio: 1; height: auto; display: block; margin: 0 auto;
  cursor: grab; touch-action: none; user-select: none;
}
.map-svg.dragging { cursor: grabbing; }
.map-tools { display: flex; justify-content: flex-end; gap: 6px; margin-bottom: 6px; }
.map-button { padding: 2px 10px; min-width: 32px; font-size: 13px; }
/* Traits d'épaisseur constante à l'écran, quel que soit le zoom. */
.map-svg polyline, .map-svg circle { vector-effect: non-scaling-stroke; }
.track-surface { fill: var(--track-surface); stroke: none; }
.edge { fill: none; stroke: var(--edge); stroke-width: 1.5; stroke-linejoin: round; }
.edge.estimated { stroke-dasharray: 4 4; opacity: 0.7; }
.pit-lane { fill: none; stroke: var(--muted); stroke-width: 1.5; stroke-dasharray: 2 4; }
.start-line { fill: none; stroke: var(--ink); stroke-width: 3; }
.track-under { fill: none; stroke: var(--track-under); stroke-width: 10; stroke-linejoin: round; stroke-linecap: round; }
.spd { fill: none; stroke-width: 4; stroke-linejoin: round; stroke-linecap: round; }
.spd.on-map { stroke-width: 3; }
.spd0 { stroke: var(--seq-0); } .spd1 { stroke: var(--seq-1); } .spd2 { stroke: var(--seq-2); }
.spd3 { stroke: var(--seq-3); } .spd4 { stroke: var(--seq-4); } .spd5 { stroke: var(--seq-5); }
.spd6 { stroke: var(--seq-6); }
.start { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.cursor-dot { fill: var(--brake); stroke: var(--surface); stroke-width: 2; pointer-events: none; }
.legend { display: flex; align-items: center; justify-content: center; gap: 8px; color: var(--ink-2); font-size: 13px; margin-top: 8px; }
.ramp { display: inline-flex; gap: 2px; }
.swatch { width: 18px; height: 10px; border-radius: 2px; display: inline-block; }
.bg0 { background: var(--seq-0); } .bg1 { background: var(--seq-1); } .bg2 { background: var(--seq-2); }
.bg3 { background: var(--seq-3); } .bg4 { background: var(--seq-4); } .bg5 { background: var(--seq-5); }
.bg6 { background: var(--seq-6); }
.stat { padding-bottom: 12px; border-bottom: 1px solid var(--grid); }

/* Courbes */
.charts { display: grid; gap: 12px; }
.chart-card figcaption { font-weight: 600; margin-bottom: 4px; }
.unit { color: var(--ink-2); font-weight: 400; }
.chart { width: 100%; height: auto; display: block; touch-action: none; }
.grid-line { stroke: var(--grid); stroke-width: 1; }
.axis { stroke: var(--axis); stroke-width: 1; }
.tick { fill: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.sector { stroke: var(--ink-2); stroke-width: 1; stroke-dasharray: 4 4; }
.sector-label { fill: var(--ink-2); font-size: 12px; font-weight: 600; }
.series { fill: none; stroke-width: 2; stroke-linejoin: round; }
.s-speed { stroke: var(--speed); } .s-throttle { stroke: var(--throttle); } .s-brake { stroke: var(--brake); }
.s-steer { stroke: var(--steer); } .s-gear { stroke: var(--ink-2); } .s-rpm { stroke: var(--rpm); }
.cursor { stroke: var(--ink); stroke-width: 1; pointer-events: none; }
.hit { fill: transparent; cursor: crosshair; }

/* Bulle du curseur */
#tip {
  position: fixed; pointer-events: none; z-index: 10; background: var(--surface); color: var(--ink);
  border: 1px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); min-width: 180px;
}
#tip .row { display: flex; justify-content: space-between; gap: 12px; align-items: center; }
#tip .key { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
#tip .key i { width: 12px; height: 2px; display: inline-block; }
#tip .key i.k-speed { background: var(--speed); }
#tip .key i.k-throttle { background: var(--throttle); }
#tip .key i.k-brake { background: var(--brake); }
#tip .key i.k-steer { background: var(--steer); }
#tip .key i.k-rpm { background: var(--rpm); }
#tip strong { font-variant-numeric: tabular-nums; }

/* Tour (et Analyse) : carte à gauche, courbes à droite, visibles en même temps */
.lap-layout { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 16px; align-items: start; margin-bottom: 16px; }
.lap-side { position: sticky; top: 12px; display: grid; gap: 12px; }
.lap-side .map-svg { max-width: none; }
.lap-curves { display: grid; gap: 10px; min-width: 0; }
.lap-curves .charts { gap: 10px; }
.lap-curves .chart-card { padding: 10px 14px 6px; }
/* Courbes affichées plus petites dans la colonne : graduations agrandies pour rester lisibles. */
.lap-curves .tick, .lap-curves .sector-label { font-size: 16px; }
.curves-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.curves-head h2 { margin: 0; }
.curves-head .hint { margin: 0; flex: 1; }
@media (max-width: 1100px) {
  .lap-layout { grid-template-columns: minmax(0, 1fr); }
  .lap-side { position: static; }
}
.zoom-select { fill: var(--accent); opacity: 0.15; pointer-events: none; }
.zoom-range-line { fill: none; stroke: var(--accent); stroke-width: 9; opacity: 0.3; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; pointer-events: none; }

/* Bandeau « Ce tour en chiffres » et météo */
.lap-numbers { margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips-title { margin-top: 14px; }
.chip { display: flex; flex-direction: column; padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--page); min-width: 110px; }
.chip-label { font-size: 12px; color: var(--ink-2); }
.chip strong { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Widget pneus */
.tyre-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.tyre-head h2 { margin: 0 0 8px; }
.tyre-grid {
  display: grid; grid-template-columns: minmax(0, 1fr) 84px minmax(0, 1fr); gap: 10px 12px; align-items: center;
  grid-template-areas: "fl car fr" "rl car rr";
}
.tyre-fl { grid-area: fl; text-align: right; }
.tyre-fr { grid-area: fr; }
.tyre-rl { grid-area: rl; text-align: right; }
.tyre-rr { grid-area: rr; }
.tyre-car-cell { grid-area: car; }
.tyre-car { width: 84px; height: auto; display: block; }
.tyre-body { fill: var(--track-surface); stroke: var(--axis); stroke-width: 1.5; }
.tyre-cockpit { fill: var(--grid); }
.tyre-shape { fill: var(--grid); stroke: var(--ink); stroke-width: 1; transition: fill 0.15s; }
.tyre-cell { display: flex; flex-direction: column; gap: 1px; font-variant-numeric: tabular-nums; }
.tyre-name { font-size: 12px; font-weight: 600; color: var(--ink-2); }
.tyre-temp { font-size: 20px; line-height: 1.1; }
.tyre-zones, .tyre-wear { font-size: 12px; color: var(--ink-2); }
.tyre-scale { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; font-size: 12px; color: var(--ink-2); }
.tyre-ramp {
  width: 120px; height: 8px; border-radius: 4px;
  background: linear-gradient(90deg, hsl(220 78% 50%), hsl(165 78% 45%), hsl(110 78% 45%), hsl(55 78% 50%), hsl(0 78% 50%));
}
.tyre-zones { white-space: nowrap; }
.tyre-pair { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.tyre-pair .tyre-widget { padding: 12px 10px; }
.tyre-pair .tyre-grid { grid-template-columns: minmax(0, 1fr) 52px minmax(0, 1fr); gap: 8px 6px; }
.tyre-pair .tyre-car { width: 52px; }
.tyre-pair .tyre-temp { font-size: 17px; }
.tyre-pair .tyre-zones, .tyre-pair .tyre-wear { font-size: 11px; }
.tyre-widget.lap1 { box-shadow: inset 0 3px 0 var(--lap1); }
.tyre-widget.lap2 { box-shadow: inset 0 3px 0 var(--lap2); }

/* ===== Style « Livrée technique » (v0.10) : surcouche d'apparence ===== */
body {
  font-family: var(--font);
  background-color: var(--page);
  background-image: linear-gradient(var(--paper-line) 1px, transparent 1px), linear-gradient(90deg, var(--paper-line) 1px, transparent 1px);
  background-size: 24px 24px;
}
h1 {
  font-style: italic; font-weight: 900; font-stretch: 125%; text-transform: uppercase;
  font-size: 30px; line-height: 1.05; letter-spacing: -0.01em;
  padding-bottom: 12px; margin-bottom: 10px;
  background:
    linear-gradient(var(--red), var(--red)) left bottom / 56px 5px no-repeat,
    linear-gradient(var(--ink), var(--ink)) 62px bottom / 14px 5px no-repeat;
}
h2, .chart-card figcaption {
  font-style: italic; font-weight: 800; font-stretch: 125%; text-transform: uppercase;
  font-size: 15px; letter-spacing: 0.01em;
}

/* Volet de gauche : noir, onglet actif rouge en biseau */
.sidebar { background: var(--side); border-right: 0; padding: 20px 0; }
.sidebar-head { padding: 0 16px; }
.brand { color: #ffffff; padding: 0; }
.brand-name { font-style: italic; font-weight: 900; font-stretch: 100%; text-transform: uppercase; font-size: 17px; letter-spacing: 0; white-space: nowrap; }
.brand-name strong { color: var(--red); font-weight: 900; }
.side-nav { gap: 0; }
.side-nav a, .side-logout { border-radius: 0; padding: 11px 20px; color: var(--side-ink); font-weight: 600; }
.side-nav a:hover, .side-logout:hover { background: rgba(255, 255, 255, 0.07); color: #ffffff; }
.side-nav a[aria-current="page"] {
  background: var(--red); color: #ffffff; font-weight: 800; font-style: italic;
  clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%);
}
.menu-toggle { color: #ffffff; border-color: var(--side-muted); border-radius: 0; }
@media (max-width: 760px) { .sidebar { padding: 10px 0; border-bottom: 0; } }

/* Cartes et boutons : angles vifs */
.card, #tip, .picker, .chip, input, select { border-radius: 0; }
.card { border: 1px solid var(--border); }
.button { border-radius: 0; font-weight: 700; }
.button.secondary { border: 1.5px solid var(--ink); font-weight: 600; }
.back { font-family: var(--mono); font-size: 13px; }
.hint { font-family: var(--mono); font-size: 12px; }

/* Étiquettes techniques */
.kpi-label, .chip-label, th, .tyre-name, .tyre-zones, .tyre-wear, .tyre-mode,
.tick, .sector-label, .legend, .tyre-scale, .unit, .tag, .class-tag {
  font-family: var(--mono);
}
.kpi-label, .chip-label { font-size: 11px; text-transform: lowercase; }
th { font-size: 11px; color: var(--ink-2); font-weight: 400; border-bottom: 2px solid var(--ink); }
.class-tag { border-radius: 0; background: var(--ink); color: var(--surface); font-weight: 500; }
.tag { border-radius: 0; }

/* Chiffres clés : grands chiffres penchés, le premier en rouge */
.kpis { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; }
.kpis > .card { padding: 9px 13px; }
.kpi-value { font-style: italic; font-weight: 900; font-stretch: 112%; font-size: 19px; line-height: 1.15; margin-top: 2px; white-space: normal; }
.kpis > .card:first-child { background: var(--red); border-color: var(--red); color: #ffffff; }
.kpis > .card:first-child .kpi-label { color: rgba(255, 255, 255, 0.85); }
.driver-name { font-style: italic; font-weight: 900; font-stretch: 125%; text-transform: uppercase; }

/* Tableaux */
td { border-bottom-color: var(--grid); }
.num { font-variant-numeric: tabular-nums; }
tr.selected td:first-child { box-shadow: inset 4px 0 0 var(--red); }
tr.best td { font-weight: 700; }
.record-time a { font-style: italic; font-weight: 800; }

/* Courbes et carte */
.series { stroke-width: 1.75; }
.s-speed { stroke-width: 2.25; }
.cursor-dot { fill: var(--red); }
.zoom-select { fill: var(--red); }
.zoom-range-line { stroke: var(--red); }
#tip { box-shadow: 4px 4px 0 rgba(0, 0, 0, 0.12); }

/* Bandeau du tour */
.chip { background: var(--surface); border-color: var(--border); }
.chip strong { font-style: italic; font-weight: 800; }

/* Widget pneus */
.tyre-body { fill: var(--surface); stroke: var(--ink); stroke-width: 2; }
.tyre-cockpit { fill: var(--red); }
.tyre-shape { stroke: var(--ink); stroke-width: 1.5; }
.tyre-temp { font-style: italic; font-weight: 900; }
.tyre-ramp { border-radius: 0; }
.tyre-widget.lap1 { box-shadow: inset 0 4px 0 var(--lap1); }
.tyre-widget.lap2 { box-shadow: inset 0 4px 0 var(--lap2); }

/* ===== Animations (désactivées si Windows demande moins d'animations) ===== */
.button, .side-nav a, .side-logout, tr.clickable td, .kpis > .card, .chip, .back, .map-button {
  transition: background-color 0.18s, color 0.18s, transform 0.18s, box-shadow 0.18s, border-color 0.18s;
}
@media (prefers-reduced-motion: no-preference) {
  @keyframes lmu-rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
  @keyframes lmu-fade { from { opacity: 0; } to { opacity: 1; } }
  @keyframes lmu-stripe { from { background-size: 0 5px, 0 5px; } to { background-size: 56px 5px, 14px 5px; } }
  @keyframes lmu-tab { from { clip-path: polygon(0 0, 0 0, 0 100%, 0 100%); } to { clip-path: polygon(0 0, 100% 0, 92% 100%, 0 100%); } }
  @keyframes lmu-reveal { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
  @keyframes lmu-zoom-in { from { opacity: 0; transform: scale(0.96); } to { opacity: 1; transform: none; } }
  @keyframes lmu-flash { from { background-color: rgba(226, 50, 42, 0.35); } }
  @keyframes lmu-loading { to { background-position: 28px 0; } }

  /* Arrivée d'une page : les blocs montent l'un après l'autre */
  main > * { animation: lmu-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
  main > *:nth-child(2) { animation-delay: 0.04s; }
  main > *:nth-child(3) { animation-delay: 0.08s; }
  main > *:nth-child(4) { animation-delay: 0.12s; }
  main > *:nth-child(5) { animation-delay: 0.16s; }
  main > *:nth-child(n+6) { animation-delay: 0.2s; }
  h1 { animation: lmu-stripe 0.6s 0.15s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
  main > h1 { animation: lmu-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) backwards, lmu-stripe 0.6s 0.2s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }

  /* Chiffres clés : en cascade */
  .kpis > * { animation: lmu-rise 0.4s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
  .kpis > *:nth-child(2) { animation-delay: 0.06s; }
  .kpis > *:nth-child(3) { animation-delay: 0.12s; }
  .kpis > *:nth-child(4) { animation-delay: 0.18s; }
  .kpis > *:nth-child(5) { animation-delay: 0.24s; }
  .kpis > *:nth-child(n+6) { animation-delay: 0.3s; }

  /* Onglet actif du menu : le biseau rouge glisse */
  .side-nav a[aria-current="page"] { animation: lmu-tab 0.35s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }

  /* Ouverture d'un tour : carte, pneus, puis les courbes se tracent de gauche à droite */
  .lap-side > * { animation: lmu-rise 0.45s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
  .lap-side > *:nth-child(2) { animation-delay: 0.1s; }
  .map-svg { animation: lmu-zoom-in 0.6s 0.1s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
  .charts > * { animation: lmu-fade 0.3s backwards; }
  .chart { animation: lmu-reveal 0.9s cubic-bezier(0.45, 0, 0.2, 1) backwards; }
  .charts > *:nth-child(2), .charts > *:nth-child(2) .chart { animation-delay: 0.08s; }
  .charts > *:nth-child(3), .charts > *:nth-child(3) .chart { animation-delay: 0.16s; }
  .charts > *:nth-child(4), .charts > *:nth-child(4) .chart { animation-delay: 0.24s; }
  .charts > *:nth-child(5), .charts > *:nth-child(5) .chart { animation-delay: 0.32s; }
  .charts > *:nth-child(n+6), .charts > *:nth-child(n+6) .chart { animation-delay: 0.4s; }
  .lap-numbers .chip { animation: lmu-rise 0.35s 0.3s backwards; }

  /* Changement de tour dans le tableau : la ligne choisie s'allume */
  tr.selected td { animation: lmu-flash 0.8s ease-out; }

  /* Survols */
  .kpis > .card:hover, .chip:hover { transform: translateY(-2px); box-shadow: 4px 4px 0 var(--ink); }
  .button:hover { transform: translateY(-1px); box-shadow: 3px 3px 0 var(--ink); }
  .button:active { transform: translateY(1px); box-shadow: none; }
  .side-nav a:not([aria-current="page"]):hover { transform: translateX(4px); }
  tr.clickable:hover td:first-child { box-shadow: inset 4px 0 0 var(--red); }
  .back:hover { transform: translateX(-3px); }

  /* Chargement : bande de course qui défile */
  main > p.muted:only-child::after {
    content: ""; display: block; width: 180px; height: 6px; margin-top: 12px;
    background: repeating-linear-gradient(115deg, var(--red) 0 10px, transparent 10px 14px);
    background-size: 28px 6px; animation: lmu-loading 0.5s linear infinite;
  }
}

/* ===== Accueil : grandes tuiles avec photo vers les autres pages ===== */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 16px 0; }
.tile {
  position: relative; display: flex; align-items: center; justify-content: center;
  height: 300px; overflow: hidden; border-radius: 14px; isolation: isolate;
  background: var(--side); color: #ffffff; text-decoration: none;
}
.tile-photo {
  position: absolute; inset: 0; z-index: -2; width: 100%; height: 100%;
  object-fit: cover; transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.4s;
}
.tile-sessions .tile-photo { object-position: 50% 76%; }
.tile-records .tile-photo { inset: auto; left: 0; top: -55%; height: 150%; object-position: 50% 50%; filter: brightness(1.25); }
.tile-analyse .tile-photo { object-position: 35% 70%; }
/* Voile sombre teinté de rouge : le texte reste lisible sur toutes les photos. */
.tile::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(180deg, rgba(17, 17, 17, 0.25) 0%, rgba(17, 17, 17, 0.55) 55%, rgba(120, 16, 12, 0.75) 100%);
  transition: opacity 0.4s;
}
.tile-text { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 16px; text-align: center; transition: transform 0.4s cubic-bezier(0.2, 0.7, 0.2, 1); }
.tile-label {
  font-weight: 800; font-stretch: 62%; font-size: 46px; line-height: 1; letter-spacing: 0.005em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.55);
}
/* Bande rouge et noire sous le nom, comme sous les titres de page */
.tile-label::after {
  content: ""; display: block; height: 5px; margin: 10px auto 0; width: 56px;
  background: linear-gradient(90deg, var(--red) 0 44px, transparent 44px 48px, #ffffff 48px);
  transition: width 0.4s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.tile-hint { font-family: var(--mono); font-size: 12px; color: rgba(255, 255, 255, 0.85); opacity: 0; transform: translateY(6px); transition: opacity 0.3s, transform 0.3s; }
.tile:hover .tile-hint, .tile:focus-visible .tile-hint { opacity: 1; transform: none; }
.tile:hover .tile-label::after, .tile:focus-visible .tile-label::after { width: 96px; }
.tile:hover::before, .tile:focus-visible::before { opacity: 0.8; }
.tile:focus-visible { outline: 3px solid var(--red); outline-offset: 3px; }
@media (max-width: 760px) { .tile { height: 180px; } .tile-label { font-size: 38px; } .tile-hint { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: no-preference) {
  .tiles > * { animation: lmu-rise 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) backwards; }
  .tiles > *:nth-child(2) { animation-delay: 0.08s; }
  .tiles > *:nth-child(3) { animation-delay: 0.16s; }
  .tile:hover .tile-photo, .tile:focus-visible .tile-photo { transform: scale(1.07); }
  .tile:hover .tile-text, .tile:focus-visible .tile-text { transform: translateY(-4px); }
}

/* ===== Étiquettes de catégorie, secteurs colorés, filtres, thème ===== */
/* Catégories : couleurs du WEC (Hypercar rouge, LMP2 bleu, LMGT3 orange…). */
.class-tag { vertical-align: 1px; letter-spacing: 0.02em; }
.class-tag.cls-hyper { background: #d42a22; color: #ffffff; }
.class-tag.cls-lmp2 { background: #1d5fd1; color: #ffffff; }
.class-tag.cls-lmp3 { background: #7c3aed; color: #ffffff; }
.class-tag.cls-gt3 { background: #ea7a12; color: #111111; }
.class-tag.cls-gte { background: #15803d; color: #ffffff; }
.class-tag.cls-other { background: var(--ink); color: var(--surface); }
.session-line .class-tag { margin-right: 2px; }

/* Secteurs façon télévision : violet (meilleur sur le tracé), vert (session), jaune (plus lent). */
.sector-track { color: var(--best); font-weight: 700; }
.sector-session { color: var(--sec-green); font-weight: 700; }
.sector-slower { color: var(--sec-yellow); }
.sector-legend span { font-weight: 700; }

/* Liste des sessions : case « masquer les sessions sans tour chronométré » */
label.check {
  display: inline-flex; align-items: center; gap: 8px; margin: 0;
  font-weight: 400; font-size: 14px; color: var(--ink-2); cursor: pointer;
}
label.check input { width: 18px; height: 18px; margin: 0; accent-color: var(--red); cursor: pointer; }

/* Thème et déconnexion : deux icônes côte à côte en bas du volet ; chaque bouton
   ne réagit que sur sa propre taille. Volet réduit : la rangée passe sur deux lignes. */
.side-actions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: auto; padding: 0 0 0 14px; }
.side-actions .side-logout, .sidebar-toggle { width: auto; margin-top: 0; }
.side-nav .side-actions .side-logout { padding: 10px; }
@media (max-width: 760px) { .side-actions { margin-top: 8px; } }

/* ===== Volet de gauche rétractable (logos seuls) ===== */
/* Bouton discret, tout en bas du volet, sous « Se déconnecter ». */
.sidebar-toggle { margin-top: 0; color: var(--side-muted); opacity: 0.8; align-self: flex-start; }
.side-nav .sidebar-toggle { margin-left: 14px; padding: 10px; }
.sidebar-toggle:hover { opacity: 1; }
.sidebar-toggle svg { width: 18px; height: 18px; transition: transform 0.25s; }
.theme-toggle svg { width: 22px; height: 22px; }
@media (max-width: 760px) { .sidebar-toggle { display: none; } }
@media (min-width: 761px) {
  main { padding-left: 32px; }
  /* Mêmes marges dans les deux états : seuls la largeur et l'opacité des textes changent,
     les textes restent sur une ligne et sont simplement coupés pendant l'animation. */
  .sidebar { overflow-x: hidden; }
  .sidebar-head { padding: 0 14px; }
  .side-nav a, .side-logout { padding: 11px 24px; }
  .brand-name, .side-nav a span, .side-logout span { white-space: nowrap; transition: opacity 0.2s; }
  html[data-volet="reduit"] .shell { grid-template-columns: 68px minmax(0, 1fr); }
  html[data-volet="reduit"] .brand-name,
  html[data-volet="reduit"] .side-nav a span,
  html[data-volet="reduit"] .side-logout span { opacity: 0; }
  html[data-volet="reduit"] .side-nav a[aria-current="page"] { clip-path: polygon(0 0, 100% 0, 84% 100%, 0 100%); }
  html[data-volet="reduit"] .sidebar-toggle svg { transform: rotate(180deg); }
}
@media (min-width: 761px) and (prefers-reduced-motion: no-preference) {
  .shell { transition: grid-template-columns 0.25s cubic-bezier(0.2, 0.7, 0.2, 1); }
}

/* ===== Miniatures des tracés, tour idéal, progression (v0.12) ===== */
.track-thumb {
  width: 22px; height: 22px; flex: none; display: inline-block; vertical-align: middle;
  margin-right: 8px; color: var(--ink-2);
}
.track-thumb polygon {
  fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
.track-thumb.medium { width: 30px; height: 30px; margin-right: 10px; color: var(--red); }
.track-thumb.medium polygon { stroke-width: 2; }
.track-thumb.large { width: 46px; height: 46px; margin: 0; color: var(--red); }
.track-thumb.large polygon { stroke-width: 2.2; }
.track-cell { white-space: nowrap; }
tr.clickable:hover .track-thumb { color: var(--red); }
.record-track { display: flex; align-items: center; flex-wrap: wrap; }
.last-session { flex-direction: row; align-items: center; gap: 14px; }
.last-session-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

.ideal-cell { color: var(--ink-2); }
.ideal-margin { display: block; font-size: 12px; color: var(--sec-green); }
.kpi-note { font-family: var(--mono); font-size: 11px; margin-top: 3px; color: var(--muted); }
.kpis > .card:first-child .kpi-note { color: rgba(255, 255, 255, 0.85); }

.progress-cell { padding-top: 4px; padding-bottom: 4px; }
.progress-chart { display: block; overflow: visible; }
.progress-chart .record-line {
  fill: none; stroke: var(--red); stroke-width: 1.6; stroke-linejoin: round; opacity: 0.85;
}
.progress-chart circle { fill: var(--muted); stroke: var(--surface); stroke-width: 1; }
.progress-chart circle.pb { fill: var(--red); }
.progress-chart a:hover circle, .progress-chart a:focus-visible circle { r: 4; fill: var(--ink); }

/* ===== Mon profil et Administration (v0.14) ===== */
.account-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); align-items: start; }
.account-card h2 { margin-top: 0; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 6px 16px; margin: 0; }
.facts dt { font-family: var(--mono); font-size: 12px; text-transform: lowercase; color: var(--ink-2); align-self: center; }
.facts dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.stack input { width: 100%; margin-bottom: 10px; }
.success { color: var(--sec-green); margin: 0 0 12px; }
.danger-zone { border-color: var(--danger); }
.danger-zone h2 { color: var(--danger); }
.button.danger { background: var(--danger); border-color: var(--danger); color: #ffffff; }
.danger-text { color: var(--danger); }
.tag-admin { background: var(--red); color: #ffffff; }
.tag-blocked { background: var(--ink); color: var(--surface); }
td .tag { margin-left: 6px; }
td.actions { display: flex; flex-wrap: wrap; gap: 6px; }
.admin-users td { vertical-align: middle; }
.journal td { font-size: 13px; }
.small-dialog { width: min(520px, calc(100vw - 32px)); }
.dialog-form input { width: 100%; margin-bottom: 10px; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.link-box { width: 100%; font-family: var(--mono); font-size: 12px; }
#profile-link svg { width: 21px; height: 21px; }
/* Icône de profil : pas le style d'onglet du menu (biseau, animation, décalage au survol). */
#profile-link[aria-current="page"] {
  color: #ffffff; background: var(--red); clip-path: none; animation: none; font-style: normal;
}
#profile-link:hover { transform: none; }
.account-card.wide { grid-column: 1 / -1; }
@media (max-width: 760px) { .account-grid { grid-template-columns: minmax(0, 1fr); } }

/* Connecter un PC (v0.15) */
.connect-card { margin-top: 0; }
.connect-pc { font-size: 26px; font-weight: 900; font-style: italic; margin: 4px 0 12px; overflow-wrap: anywhere; }
.connect-actions { justify-content: flex-start; margin-top: 16px; }
.connect-done { max-width: 460px; margin: 16px auto; }

/* ===== Carte « Dernière session » de l'accueil (v0.17) ===== */
.last-card { display: flex; flex-direction: column; gap: 16px; }
.last-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.last-head .last-session { flex: 1 1 320px; min-width: 0; }
.last-track { font-size: 20px; font-style: italic; font-weight: 900; font-stretch: 112%; line-height: 1.15; overflow-wrap: anywhere; }
.last-meta .class-tag { margin-left: 2px; }
.verdict { flex: 0 1 280px; padding: 9px 13px; border: 1px solid var(--border); border-left: 4px solid var(--ink-2); }
.verdict-title { font-style: italic; font-weight: 900; font-stretch: 112%; font-size: 19px; line-height: 1.15; }
.verdict-note { font-family: var(--mono); font-size: 11px; margin-top: 3px; color: var(--ink-2); }
.verdict-record { background: var(--red); border-color: var(--red); color: #ffffff; }
.verdict-record .verdict-note { color: rgba(255, 255, 255, 0.85); }
.verdict-gap { border-left-color: var(--red); }
.last-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 20px; align-items: start; }
.last-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px 16px; }
.last-stat { border-top: 2px solid var(--ink); padding-top: 6px; min-width: 0; }
.last-stat-value { font-style: italic; font-weight: 900; font-stretch: 112%; font-size: 18px; line-height: 1.15; margin-top: 2px; overflow-wrap: anywhere; }
.last-chart { min-width: 0; }
.lap-chart { display: block; width: 100%; height: auto; margin-top: 6px; overflow: visible; }
.lap-chart .tick { font-size: 12px; }
.lap-chart .axis { stroke: var(--axis); stroke-width: 1; }
.lap-chart .grid { stroke: var(--grid); stroke-width: 1; }
.lap-chart .record { stroke: var(--red); stroke-width: 1.2; stroke-dasharray: 4 3; }
.lap-chart .lap-line { fill: none; stroke: var(--ink-2); stroke-width: 1.4; stroke-linejoin: round; opacity: 0.6; }
.lap-chart circle { stroke: var(--surface); stroke-width: 1.2; }
.lap-chart circle.valid { fill: var(--ink); }
.lap-chart circle.invalid { fill: var(--surface); stroke: var(--muted); stroke-width: 1.5; }
.lap-chart circle.best { fill: var(--best); }
.lap-chart circle.off { stroke-dasharray: 2 1.5; }
.lap-chart a:hover circle, .lap-chart a:focus-visible circle { r: 5.5; }
.last-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.last-actions .button { text-decoration: none; display: inline-block; }
@media (max-width: 900px) { .last-body { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) { .verdict { flex-basis: 100%; } .lap-chart .tick { font-size: 18px; } }
.lap-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 6px; font-family: var(--mono); font-size: 11px; color: var(--ink-2); }
.lg::before { content: ""; display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 0; }
.lg-best::before { background: var(--best); }
.lg-valid::before { background: var(--ink); }
.lg-invalid::before { border: 1.5px solid var(--muted); width: 6px; height: 6px; }
.lg-record::before { width: 14px; height: 0; border-radius: 0; border-top: 1.5px dashed var(--red); vertical-align: 3px; }

/* ===== Espace de stockage et quotas (v0.21) ===== */
.quota-figure { font-style: italic; font-weight: 900; font-stretch: 112%; font-size: 20px; margin: 0 0 8px; }
.quota-bar { height: 10px; background: var(--grid); border-radius: 999px; overflow: hidden; }
.quota-bar span { display: block; height: 100%; background: var(--ink-2); border-radius: 999px; }
.quota-bar.warning span { background: var(--sec-yellow); }
.quota-bar.full span { background: var(--danger); }
.quota-bar.small { height: 6px; margin-top: 4px; min-width: 90px; }
.quota-note { border-left: 4px solid var(--sec-yellow); padding: 8px 12px; margin: 12px 0 0; background: var(--accent-soft); }
.quota-note.full { border-left-color: var(--danger); }
.quota-cell { min-width: 120px; }
.quota-cell .muted { font-size: 12px; }
.quota-default { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }
.quota-default input { width: 90px; }
.quota-choice { display: grid; gap: 8px; margin: 8px 0 12px; }
.quota-choice label { display: flex; align-items: center; justify-content: flex-start; gap: 8px; margin: 0; font-weight: 500; }
.quota-choice input[type="radio"] { width: auto; margin: 0; flex: none; accent-color: var(--accent); }
.quota-choice input[type="text"] { width: 100px; margin: 0; }
.raw-purged { font-size: 13px; margin-top: -4px; }
/* Analyses en échec : le message d'erreur passe à la ligne, les boutons restent visibles. */
.failed-jobs td { white-space: normal; overflow-wrap: anywhere; vertical-align: top; }
.failed-jobs td:nth-child(4) { min-width: 220px; font-size: 13px; }
.failed-jobs td.actions { flex-wrap: nowrap; white-space: nowrap; }

/* Base des circuits : case cliquable et fenêtre de complétion (v0.21) */
.kpi-button { font: inherit; color: inherit; text-align: left; cursor: pointer; width: 100%; }
.kpi-button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.circuits-dialog { width: min(1200px, calc(100vw - 32px)); }
.circuits-table td { vertical-align: top; }
.circuits-table td .muted { font-size: 12px; }
.completion-cell { min-width: 130px; font-weight: 600; }
.quota-bar.completion.ok span { background: var(--sec-green); }
.missing-layouts { columns: 2 320px; margin: 8px 0 0; padding-left: 18px; }
.missing-layouts li { margin-bottom: 4px; break-inside: avoid; }

/* Téléchargement de l'agent (v0.25) : petit bouton à côté du titre de l'accueil ; encadré
   mis en évidence tant qu'aucun PC n'est relié au compte. */
.page-head .page-title { margin: 0; }
.button.download-small { padding: 5px 12px; font-size: 13px; text-decoration: none; white-space: nowrap; }
.card.download-card {
  margin-bottom: 12px; border-left: 4px solid var(--accent);
  background: linear-gradient(90deg, var(--accent-soft), transparent 70%), var(--surface);
}
.download-card h2 { margin: 0 0 6px; }
.download-card p { margin: 0 0 14px; color: var(--ink-2); max-width: 64ch; }
.button.download-button { display: inline-block; text-decoration: none; padding: 12px 22px; font-size: 16px; }
.download-soon.small { font-size: 13px; }
.driver-missing { margin: 6px 0 4px; }
.login .field-hint { margin: -6px 0 12px; }
.user-name { display: block; }
.user-email { display: block; font-size: 13px; }
.card.username-missing { border-color: var(--accent); }
