/* MotoFlip : système de design (refonte du 20/11/2026).
   Principes : sobriété (palette ardoise et un seul accent indigo), couleurs porteuses de sens (vert favorable,
   ambre à surveiller, rouge défavorable), chiffres alignés et lisibles, hiérarchie nette entre les chiffres de
   décision et le reste, mode sombre automatique, confort tactile (cibles de 40 px et plus). */

:root {
  color-scheme: light;
  --fond: #f4f6f9;
  --carte: #ffffff;
  --carte-2: #f8fafc;
  --texte: #0f172a;
  --texte-2: #334155;
  --sourd: #64748b;
  --bord: #e2e8f0;
  --bord-fort: #cbd5e1;
  --accent: #4f46e5;
  --accent-fort: #4338ca;
  --accent-doux: #eef2ff;
  --accent-texte: #3730a3;
  --sur-accent: #ffffff;
  --vert: #15803d;   --vert-doux: #dcfce7;   --vert-texte: #166534;
  --ambre: #b45309;  --ambre-doux: #fef3c7;  --ambre-texte: #92400e;
  --rouge: #dc2626;  --rouge-doux: #fee2e2;  --rouge-texte: #991b1b;
  --bleu: #0284c7;   --bleu-doux: #e0f2fe;   --bleu-texte: #075985;
  --r-s: 6px; --r: 10px; --r-l: 14px;
  --ombre: 0 1px 2px rgba(15, 23, 42, .05), 0 1px 3px rgba(15, 23, 42, .04);
  --ombre-haute: 0 10px 30px rgba(15, 23, 42, .14);
  --anneau: 0 0 0 3px rgba(79, 70, 229, .25);
  --police: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --barre-bas: 0px;
}

/* Mode sombre : automatique (réglage de l'appareil), sauf choix contraire avec le bouton de l'en-tête
   (attribut data-theme sur <html>, retenu sur l'appareil). */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --fond: #0b1120;
    --carte: #111827;
    --carte-2: #0f172a;
    --texte: #e5e7eb;
    --texte-2: #cbd5e1;
    --sourd: #94a3b8;
    --bord: #1f2937;
    --bord-fort: #334155;
    --accent: #818cf8;
    --accent-fort: #a5b4fc;
    --accent-doux: #1e1b4b;
    --accent-texte: #c7d2fe;
    --sur-accent: #0b1120;
    --vert: #4ade80;   --vert-doux: #052e16;   --vert-texte: #86efac;
    --ambre: #fbbf24;  --ambre-doux: #3b2506;  --ambre-texte: #fcd34d;
    --rouge: #f87171;  --rouge-doux: #3f1212;  --rouge-texte: #fca5a5;
    --bleu: #38bdf8;   --bleu-doux: #0c2a3f;   --bleu-texte: #7dd3fc;
    --ombre: 0 1px 2px rgba(0, 0, 0, .4);
    --ombre-haute: 0 10px 30px rgba(0, 0, 0, .55);
    --anneau: 0 0 0 3px rgba(129, 140, 248, .35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --fond: #0b1120;
  --carte: #111827;
  --carte-2: #0f172a;
  --texte: #e5e7eb;
  --texte-2: #cbd5e1;
  --sourd: #94a3b8;
  --bord: #1f2937;
  --bord-fort: #334155;
  --accent: #818cf8;
  --accent-fort: #a5b4fc;
  --accent-doux: #1e1b4b;
  --accent-texte: #c7d2fe;
  --sur-accent: #0b1120;
  --vert: #4ade80;   --vert-doux: #052e16;   --vert-texte: #86efac;
  --ambre: #fbbf24;  --ambre-doux: #3b2506;  --ambre-texte: #fcd34d;
  --rouge: #f87171;  --rouge-doux: #3f1212;  --rouge-texte: #fca5a5;
  --bleu: #38bdf8;   --bleu-doux: #0c2a3f;   --bleu-texte: #7dd3fc;
  --ombre: 0 1px 2px rgba(0, 0, 0, .4);
  --ombre-haute: 0 10px 30px rgba(0, 0, 0, .55);
  --anneau: 0 0 0 3px rgba(129, 140, 248, .35);
}

/* --- Base ------------------------------------------------------------------------------------------------ */
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; font-family: var(--police); font-size: 15px; line-height: 1.5;
  background: var(--fond); color: var(--texte); -webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 2px; }
:focus-visible { outline: none; box-shadow: var(--anneau); border-radius: var(--r-s); }
h1 { font-size: 1.55rem; line-height: 1.25; letter-spacing: -0.02em; margin: 0 0 0.75rem; font-weight: 700; }
h2 { font-size: 1.12rem; letter-spacing: -0.01em; margin: 2rem 0 0.75rem; font-weight: 650; }
h3 { font-size: 0.98rem; margin: 1.25rem 0 0.5rem; font-weight: 650; color: var(--texte-2); }
.note { color: var(--sourd); font-size: 0.92rem; }
code { background: var(--carte-2); border: 1px solid var(--bord); padding: 0.05rem 0.35rem; border-radius: 4px; font-size: 0.88em; }
.icone { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* --- En-tête et navigation ------------------------------------------------------------------------------- */
header {
  position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 1.5rem;
  padding: 0 1.5rem; height: 60px; border-bottom: 1px solid var(--bord);
  background: color-mix(in srgb, var(--carte) 88%, transparent);
  backdrop-filter: saturate(180%) blur(10px); -webkit-backdrop-filter: saturate(180%) blur(10px);
}
.logo { display: flex; align-items: center; gap: 0.55rem; font-weight: 750; font-size: 1.08rem; color: var(--texte); letter-spacing: -0.02em; flex: none; }
.logo:hover { text-decoration: none; }
.logo svg { width: 28px; height: 28px; }
nav.principale { display: flex; align-items: center; gap: 0.2rem; overflow-x: auto; scrollbar-width: none; }
nav.principale::-webkit-scrollbar { display: none; }
nav.principale a {
  display: flex; align-items: center; gap: 0.45rem; white-space: nowrap; color: var(--sourd);
  font-weight: 550; font-size: 0.9rem; padding: 0.45rem 0.65rem; border-radius: 8px;
}
nav.principale a:hover { color: var(--texte); background: var(--carte-2); text-decoration: none; }
nav.principale a.actif { color: var(--accent-texte); background: var(--accent-doux); }
.barre-onglets { display: none; }
.bouton-theme {
  margin-left: auto; flex: none; width: 38px; height: 38px; min-height: 38px; padding: 0; border-radius: 10px;
  background: var(--carte); color: var(--texte-2); border: 1px solid var(--bord); box-shadow: none;
}
.bouton-theme:hover { background: var(--carte-2); color: var(--texte); }
.bouton-theme .icone { width: 19px; height: 19px; }
.bouton-theme .icone { display: none; }
:root[data-theme="dark"] .bouton-theme .i-lune,
:root[data-theme="light"] .bouton-theme .i-soleil,
:root:not([data-theme]) .bouton-theme .i-auto { display: block; }

main { max-width: 1320px; margin: 0 auto; padding: 1.75rem 1.5rem 2rem; }
footer { text-align: center; color: var(--sourd); font-size: 0.8rem; padding: 1.5rem 1rem calc(1.5rem + var(--barre-bas)); }
.bandeau { background: var(--vert-doux); color: var(--vert-texte); padding: 0.5rem 1.5rem; font-size: 0.88rem; border-bottom: 1px solid var(--bord); }

/* --- Cartes, tuiles et chiffres -------------------------------------------------------------------------- */
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.75rem; margin-bottom: 1.5rem; }
.tuile {
  background: var(--carte); border: 1px solid var(--bord); border-radius: var(--r); box-shadow: var(--ombre);
  padding: 0.9rem 1rem; display: flex; flex-direction: column; gap: 0.2rem; min-width: 0;
}
.tuile .chiffre { font-size: 1.6rem; font-weight: 700; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; white-space: nowrap; line-height: 1.15; }
.tuile .libelle { color: var(--sourd); font-size: 0.84rem; line-height: 1.3; }
.positif { color: var(--vert) !important; }
.negatif { color: var(--rouge) !important; }

.formulaire, .analyse, details.pli { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--r-l); box-shadow: var(--ombre); }
.formulaire { padding: 1.1rem 1.25rem; margin-bottom: 1.25rem; }
.formulaire > h2:first-child { margin-top: 0.25rem; }
.analyse { padding: 1rem 1.25rem 1.25rem; margin-bottom: 1.5rem; }
.analyse > h2:first-child { margin-top: 0.25rem; }
.colonnes { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 0 2rem; }
.colonnes th { width: 42%; }

/* Décision d'un lot : jauge de l'indice et chiffres clés */
.decision { display: grid; grid-template-columns: auto 1fr; gap: 1.25rem; align-items: center; margin-bottom: 1rem; }
.jauge {
  --v: 0; --c: var(--sourd); width: 108px; height: 108px; border-radius: 50%; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--v) * 1%), var(--bord) 0);
}
.jauge::before { content: ""; grid-area: 1 / 1; width: 86px; height: 86px; border-radius: 50%; background: var(--carte); }
.jauge > span { grid-area: 1 / 1; text-align: center; line-height: 1.05; z-index: 1; }
.jauge b { display: block; font-size: 1.8rem; font-weight: 750; letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.jauge small { display: block; font-size: 0.62rem; color: var(--sourd); text-transform: uppercase; letter-spacing: 0.06em; }
.jauge.vert { --c: var(--vert); } .jauge.ambre { --c: var(--ambre); } .jauge.rouge { --c: var(--rouge); }
.decision .tuiles { margin: 0; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); }
.decision .tuile { box-shadow: none; background: var(--carte-2); }
.decision .tuile.cle { background: var(--accent-doux); border-color: transparent; }
.decision .tuile.cle .chiffre { color: var(--accent-texte); }

/* --- Tableaux -------------------------------------------------------------------------------------------- */
table {
  width: 100%; border-collapse: separate; border-spacing: 0; font-size: 0.93rem;
  background: var(--carte); border: 1px solid var(--bord); border-radius: var(--r); overflow: hidden;
}
th, td { padding: 0.55rem 0.8rem; border-bottom: 1px solid var(--bord); text-align: left; vertical-align: middle; }
tbody tr:last-child > * { border-bottom: 0; }
thead th { background: var(--carte-2); color: var(--sourd); font-size: 0.73rem; font-weight: 650; text-transform: uppercase; letter-spacing: 0.04em; white-space: nowrap; }
tbody th { font-weight: 550; color: var(--texte-2); background: var(--carte-2); }
tbody tr:hover > td { background: color-mix(in srgb, var(--accent-doux) 45%, transparent); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
td.vide, span.vide { color: var(--sourd); font-style: italic; }
tr.total > * { border-top: 2px solid var(--texte-2); font-weight: 700; background: var(--carte-2); }
thead th.triable { cursor: pointer; user-select: none; }
thead th.triable:hover { color: var(--texte); }
thead th[aria-sort="ascending"]::after { content: " ▲"; font-size: 0.62rem; }
thead th[aria-sort="descending"]::after { content: " ▼"; font-size: 0.62rem; }

/* --- Formulaires et boutons ------------------------------------------------------------------------------ */
.champs { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 0.85rem 1.25rem; margin-bottom: 1rem; }
.champs label { display: flex; flex-direction: column; font-size: 0.84rem; font-weight: 550; color: var(--texte-2); gap: 0.3rem; }
.champs .large, .champs label.large { grid-column: 1 / -1; }
input[type=text], input[type=number], input[type=password], input[type=email], input[type=file], select, textarea {
  font: inherit; font-size: 0.95rem; color: var(--texte); background: var(--carte);
  border: 1px solid var(--bord-fort); border-radius: 8px; padding: 0.5rem 0.65rem; min-height: 40px;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: var(--anneau); }
input[type=checkbox], input[type=radio] { accent-color: var(--accent); width: 17px; height: 17px; }
input[type=range] { padding: 0; accent-color: var(--accent); }
textarea { width: 100%; max-width: 640px; }
button {
  font: inherit; font-size: 0.93rem; font-weight: 600; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem;
  background: var(--accent); color: var(--sur-accent); border: 1px solid transparent; border-radius: 8px;
  padding: 0.55rem 1.05rem; min-height: 40px; box-shadow: 0 1px 2px rgba(15, 23, 42, .12);
  transition: background .15s, box-shadow .15s, transform .05s;
}
button:hover { background: var(--accent-fort); }
button:active { transform: translateY(1px); }
button[disabled] { opacity: 0.45; cursor: default; }
button.secondaire { background: var(--carte); color: var(--texte-2); border-color: var(--bord-fort); box-shadow: none; }
button.secondaire:hover { background: var(--carte-2); }
.boutons { display: flex; gap: 0.6rem; flex-wrap: wrap; align-items: center; margin-bottom: 0.75rem; }
.boutons form { margin: 0; }

/* --- Pastilles et messages ------------------------------------------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: 0.25rem; white-space: nowrap; font-size: 0.74rem; font-weight: 600;
  line-height: 1.2; padding: 0.18rem 0.55rem; border-radius: 999px; margin: 0 0.2rem 0.2rem 0;
  background: var(--accent-doux); color: var(--accent-texte); font-variant-numeric: tabular-nums;
}
.badge.vert { background: var(--vert-doux); color: var(--vert-texte); }
.badge.ambre { background: var(--ambre-doux); color: var(--ambre-texte); }
.badge.rouge { background: var(--rouge-doux); color: var(--rouge-texte); }
.badge.gris { background: var(--carte-2); color: var(--sourd); box-shadow: inset 0 0 0 1px var(--bord); }

.alerte {
  display: block; border-radius: var(--r); padding: 0.7rem 0.9rem; margin-bottom: 0.75rem; font-size: 0.92rem;
  background: var(--ambre-doux); color: var(--ambre-texte); border-left: 4px solid var(--ambre);
}
.alerte.info { background: var(--bleu-doux); color: var(--bleu-texte); border-left-color: var(--bleu); }
.alerte.succes { background: var(--vert-doux); color: var(--vert-texte); border-left-color: var(--vert); }
.alerte.danger { background: var(--rouge-doux); color: var(--rouge-texte); border-left-color: var(--rouge); }
.alerte a { color: inherit; text-decoration: underline; }

/* --- Sections repliables et sous-navigation -------------------------------------------------------------- */
details.pli { margin: 1rem 0; padding: 0.1rem 1rem; }
details.pli[open] { padding-bottom: 0.9rem; }
details.pli > summary { cursor: pointer; font-weight: 650; font-size: 0.98rem; padding: 0.7rem 0; list-style: none; display: flex; align-items: center; gap: 0.5rem; }
details.pli > summary::-webkit-details-marker { display: none; }
details.pli > summary::before {
  content: ""; flex: none; width: 7px; height: 7px; border-right: 2px solid var(--sourd); border-bottom: 2px solid var(--sourd);
  transform: rotate(-45deg); transition: transform .15s; margin: 0 0.15rem;
}
details.pli[open] > summary::before { transform: rotate(45deg); }
details.pli > summary { flex-wrap: wrap; }
details.pli > summary .note { font-weight: 400; font-size: 0.84rem; flex-basis: 100%; padding-left: 1.15rem; margin-top: -0.15rem; }
details.pli.aide { border: 0; box-shadow: none; background: none; padding: 0; margin: 0.25rem 0 0.5rem; }
details.pli.aide > summary { font-size: 0.88rem; font-weight: 600; color: var(--accent); padding: 0.35rem 0; }
details.pli > .formulaire { box-shadow: none; border: 0; padding: 0; margin: 0; background: none; }
details.criteres > form.formulaire { border: 0; box-shadow: none; padding: 0.25rem 0 0; margin: 0; background: none; }

.sous-nav {
  position: sticky; top: 60px; z-index: 20; display: flex; gap: 0.4rem; overflow-x: auto; scrollbar-width: none;
  padding: 0.55rem 0; margin: 0 0 1rem; background: color-mix(in srgb, var(--fond) 90%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
}
.sous-nav::-webkit-scrollbar { display: none; }
.sous-nav a { flex: none; font-size: 0.82rem; font-weight: 600; color: var(--texte-2); background: var(--carte); border: 1px solid var(--bord); border-radius: 999px; padding: 0.38rem 0.85rem; }
.sous-nav a:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
h2[id], h3[id] { scroll-margin-top: 125px; }

.tri { display: none; }

/* --- Médias ---------------------------------------------------------------------------------------------- */
img.miniature { width: 40px; height: 30px; object-fit: cover; border-radius: 5px; float: left; margin: 1px 8px 0 0; background: var(--bord); }
img.photo-entete { width: 220px; height: 165px; object-fit: cover; border-radius: var(--r); float: right; margin: 0 0 0.75rem 1rem; background: var(--bord); box-shadow: var(--ombre); }
.vignettes { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 0.5rem; }
.vignettes img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; display: block; }
.qr svg { width: 180px; height: auto; display: block; background: #fff; border-radius: 8px; padding: 6px; }
.lien code { word-break: break-all; }

/* --- Listes de choix (marques, types) -------------------------------------------------------------------- */
.marques summary { cursor: pointer; color: var(--texte-2); font-size: 0.86rem; font-weight: 550; padding: 0.35rem 0; }
.marques summary b { color: var(--texte); }
.liste-marques {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 0.2rem 1rem; max-height: 16rem; overflow-y: auto;
  border: 1px solid var(--bord); border-radius: var(--r); padding: 0.5rem 0.75rem; background: var(--carte-2);
}
.liste-marques label { flex-direction: row; align-items: center; gap: 0.5rem; color: var(--texte); font-size: 0.92rem; font-weight: 450; padding: 0.15rem 0; }

body.invite form[method="post"] { display: none; }

/* --- Téléphone ------------------------------------------------------------------------------------------- */
@media (max-width: 760px) {
  :root { --barre-bas: calc(62px + env(safe-area-inset-bottom)); }
  header { height: 52px; padding: 0 1rem; gap: 0.75rem; }
  .logo { font-size: 1rem; }
  .logo svg { width: 26px; height: 26px; }
  nav.principale { display: none; }
  /* Barre d'onglets en bas de l'écran, comme une application */
  .barre-onglets {
    display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: var(--barre-bas); padding-bottom: env(safe-area-inset-bottom); border-top: 1px solid var(--bord);
    background: color-mix(in srgb, var(--carte) 92%, transparent);
    backdrop-filter: saturate(180%) blur(12px); -webkit-backdrop-filter: saturate(180%) blur(12px);
  }
  .barre-onglets > a, .barre-onglets > details > summary {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; height: 62px;
    color: var(--sourd); font-size: 0.68rem; font-weight: 600; list-style: none; cursor: pointer;
  }
  .barre-onglets > details > summary::-webkit-details-marker { display: none; }
  .barre-onglets a:hover { text-decoration: none; }
  .barre-onglets .icone { width: 22px; height: 22px; }
  .barre-onglets a.actif, .barre-onglets details.actif > summary { color: var(--accent); }
  .barre-onglets details { position: relative; }
  .barre-onglets .menu-plus {
    position: absolute; right: 8px; bottom: 70px; min-width: 230px; padding: 0.4rem;
    background: var(--carte); border: 1px solid var(--bord); border-radius: var(--r-l); box-shadow: var(--ombre-haute);
  }
  .barre-onglets .menu-plus a { display: flex; align-items: center; gap: 0.7rem; padding: 0.75rem; border-radius: 8px; color: var(--texte); font-size: 0.95rem; font-weight: 550; }
  .barre-onglets .menu-plus a.actif { background: var(--accent-doux); color: var(--accent-texte); }
  main { padding: 1rem 0.85rem 1.5rem; }
  h1 { font-size: 1.28rem; margin-bottom: 0.6rem; }
  h2 { font-size: 1.04rem; margin: 1.5rem 0 0.55rem; }
  .bandeau { padding: 0.45rem 1rem; }
  .sous-nav { top: 52px; margin-left: -0.85rem; margin-right: -0.85rem; padding-left: 0.85rem; padding-right: 0.85rem; }
  h2[id], h3[id] { scroll-margin-top: 110px; }

  .tuiles { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.45rem; margin-bottom: 1rem; }
  .tuile { padding: 0.55rem 0.6rem; }
  .tuile .chiffre { font-size: 1.12rem; }
  .tuile .libelle { font-size: 0.74rem; line-height: 1.25; }
  .analyse { padding: 0.5rem 0.8rem 0.9rem; border-radius: var(--r); }
  .decision { grid-template-columns: 1fr; gap: 0.75rem; justify-items: center; }
  .decision .tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .decision .tuile .chiffre { font-size: 1.2rem; }
  .colonnes { grid-template-columns: minmax(0, 1fr); }
  .colonnes > * { min-width: 0; }
  .colonnes th { width: auto; }
  .formulaire { padding: 0.85rem 0.9rem; border-radius: var(--r); }
  .champs { grid-template-columns: 1fr; }
  input[type=text], input[type=number], input[type=password], select, textarea { font-size: 16px; min-height: 44px; } /* pas de zoom automatique */
  button { min-height: 44px; }
  .boutons { gap: 0.45rem; }
  .boutons button { font-size: 0.9rem; padding: 0.55rem 0.85rem; }
  code { word-break: break-all; }
  img.photo-entete { width: 42vw !important; height: 31.5vw !important; margin-left: 0.75rem; }
  .vignettes { grid-template-columns: repeat(2, 1fr); }

  /* Tableaux sans cartes (deux colonnes) : défilement horizontal si besoin, jamais la page */
  table:not(.cartes) { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  th, td { padding: 0.5rem 0.6rem; }

  /* Listes en cartes : titre (photo et nom) sur toute la largeur, puis les valeurs en grille de quatre */
  table.cartes, table.cartes tbody { display: block; border: 0; background: none; overflow: visible; border-radius: 0; }
  table.cartes thead { display: none; }
  table.cartes tr {
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.25rem 0.55rem; margin-bottom: 0.5rem;
    background: var(--carte); border: 1px solid var(--bord); border-radius: var(--r); box-shadow: var(--ombre); padding: 0.55rem 0.65rem;
  }
  table.cartes tbody tr:hover > td { background: none; }
  table.cartes td { display: block; border: 0; padding: 0; text-align: left; white-space: normal; font-size: 0.84rem; line-height: 1.25; min-width: 0; overflow-wrap: anywhere; }
  table.cartes td::before {
    content: attr(data-label); display: block; font-size: 0.6rem; font-weight: 650; color: var(--sourd); text-transform: uppercase;
    letter-spacing: 0.04em; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  table.cartes td.titre { grid-column: 1 / -1; order: -1; font-weight: 650; font-size: 0.95rem; overflow-wrap: normal; padding-bottom: 0.15rem; }
  table.cartes td.titre::before { display: none; }
  table.cartes td.vide-carte, table.cartes td.mobile-cache { display: none; }
  table.cartes td .badge { margin: 0; }
  table.cartes img.miniature { width: 52px !important; height: 39px !important; border-radius: 6px; }

  /* Tri des listes au toucher */
  .tri { display: flex; align-items: center; gap: 0.5rem; margin: 0 0 0.6rem; font-size: 0.86rem; color: var(--sourd); }
  .tri select { min-height: 38px; font-size: 15px; padding: 0.3rem 0.5rem; flex: 1; }
  .tri button { min-height: 38px; padding: 0.3rem 0.75rem; background: var(--carte); color: var(--texte-2); border-color: var(--bord-fort); box-shadow: none; }
}

/* Avis de l'expert IA (refonte du 20/11/2026) */
.avis { background: var(--carte-2); border: 1px solid var(--bord); border-radius: var(--r-l); padding: 0.4rem 1.1rem 0.6rem; margin: 0 0 1.25rem; }
.avis h3 { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.avis .resume { font-size: 1.02rem; line-height: 1.5; margin: 0.25rem 0 0.75rem; }
.avis .sous-titre { font-weight: 650; font-size: 0.92rem; margin: 0.75rem 0 0.25rem; }
.avis ul { margin: 0.2rem 0 0.5rem; padding-left: 1.2rem; }
.avis li { margin: 0.2rem 0; }
.avis small.note { display: inline; }

/* Bouton discret réduit à une icône (relire la fiche) */
.bouton-icone {
  display: inline-flex; align-items: center; justify-content: center; vertical-align: middle;
  width: 28px; height: 28px; min-height: 28px; padding: 0; margin-left: 0.25rem; border-radius: 8px;
  background: none; color: var(--sourd); border: 1px solid var(--bord); box-shadow: none;
}
.bouton-icone:hover { background: var(--carte-2); color: var(--texte); }
.bouton-icone .icone { width: 15px; height: 15px; }
.bouton-icone:disabled .icone { animation: tourner 1s linear infinite; }
@keyframes tourner { to { transform: rotate(360deg); } }
.sans-coupure { white-space: nowrap; }

/* Lien présenté comme un bouton, états en pastilles (page Paramètres, 20/11/2026) */
a.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.45rem; min-height: 40px;
  padding: 0.55rem 1.05rem; border-radius: 8px; font-size: 0.93rem; font-weight: 600;
  background: var(--accent); color: var(--sur-accent); border: 1px solid transparent;
}
a.bouton:hover { background: var(--accent-fort); text-decoration: none; }
a.bouton.secondaire { background: var(--carte); color: var(--texte-2); border-color: var(--bord-fort); }
a.bouton.secondaire:hover { background: var(--carte-2); }
.etats { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; align-items: center; font-size: 0.9rem; margin: 0.25rem 0 0.9rem; }
.etats > span { display: inline-flex; align-items: center; gap: 0.4rem; }
section.formulaire { scroll-margin-top: 125px; }
section.formulaire > button[type=submit] { margin-top: 0.25rem; }

/* VoitureFlip (21/11/2026) : même outil, accent orange pour distinguer d'un coup d'œil */
body.voiture { --accent: #ea580c; --accent-fort: #c2410c; --accent-doux: #fff1e8; --accent-texte: #9a3412; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) body.voiture { --accent: #fb923c; --accent-fort: #fdba74; --accent-doux: #3b1d0c; --accent-texte: #fed7aa; }
}
:root[data-theme="dark"] body.voiture { --accent: #fb923c; --accent-fort: #fdba74; --accent-doux: #3b1d0c; --accent-texte: #fed7aa; }
.bascule-univers {
  margin-left: auto; flex: none; font-size: 0.8rem; font-weight: 650; white-space: nowrap;
  padding: 0.4rem 0.7rem; border-radius: 999px; border: 1px solid var(--bord); background: var(--carte); color: var(--texte-2);
}
.bascule-univers:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.bascule-univers + .bouton-theme { margin-left: 0.5rem; }

/* Visionneuse de photos (21/11/2026) */
.visionneuse { position: fixed; inset: 0; z-index: 1000; background: #05080f; display: flex; align-items: center; justify-content: center; touch-action: none; overflow: hidden; }
.visionneuse[hidden] { display: none; }
.visionneuse img { max-width: 100vw; max-height: 88vh; object-fit: contain; user-select: none; -webkit-user-drag: none; }
.visionneuse button { position: absolute; background: rgba(255, 255, 255, .12); color: #fff; border: 0; box-shadow: none; border-radius: 999px; width: 46px; height: 46px; min-height: 46px; padding: 0; font-size: 1.8rem; line-height: 1; }
.visionneuse button:hover { background: rgba(255, 255, 255, .24); }
.vn-fermer { top: max(12px, env(safe-area-inset-top)); right: 12px; }
.vn-prec { left: 10px; top: 50%; transform: translateY(-50%); }
.vn-suiv { right: 10px; top: 50%; transform: translateY(-50%); }
.visionneuse.seule .vn-prec, .visionneuse.seule .vn-suiv { display: none; }
.vn-compteur { position: absolute; bottom: max(16px, env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); color: #e2e8f0; font-size: .9rem; font-variant-numeric: tabular-nums; }
body.sans-defilement { overflow: hidden; }

/* Fiche du lot : l'essentiel en un coup d'œil (21/11/2026) */
.essentiel { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 0.5rem; margin: 0.25rem 0 1rem; clear: both; }
.essentiel > div { background: var(--carte); border: 1px solid var(--bord); border-radius: var(--r-m, 10px); padding: 0.5rem 0.7rem; display: flex; flex-direction: column; gap: 0.15rem; min-width: 0; }
.essentiel b { font-size: 1.02rem; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.essentiel span { font-size: 0.78rem; color: var(--sourd); }
.essentiel b .badge { font-size: 0.78rem; }
.essentiel > div.douteux { border-color: var(--ambre); background: var(--ambre-doux); }
@media (max-width: 760px) { .essentiel { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; } .essentiel b { font-size: 0.92rem; } }

.visionneuse img { transform-origin: center center; will-change: transform; cursor: zoom-in; }
.visionneuse.zoomee img { cursor: grab; }
.visionneuse.zoomee .vn-prec, .visionneuse.zoomee .vn-suiv { display: none; }

/* Barre de progression des collectes Leboncoin (23/11/2026) */
.progression { background: var(--carte); border: 1px solid var(--bord); border-left: 4px solid var(--accent);
  border-radius: var(--r); padding: 0.7rem 0.9rem; margin: 0 0 1rem; box-shadow: var(--ombre); }
.progression.en-pause { border-left-color: var(--ambre); }
.progression.terminee { border-left-color: var(--vert); }
.progression-tete { display: flex; justify-content: space-between; align-items: baseline; gap: 0.5rem; }
.progression-pct { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--accent); }
.progression.en-pause .progression-pct { color: var(--ambre); }
.progression-piste { height: 8px; background: var(--bord); border-radius: 999px; overflow: hidden; margin: 0.45rem 0; }
.progression-rempli { height: 100%; background: var(--accent); border-radius: 999px; transition: width 0.6s ease; }
.progression.en-pause .progression-rempli { background: var(--ambre); }
.progression-detail { font-size: 0.88rem; color: var(--texte-2); overflow-wrap: anywhere; }
.progression .lien-arret { background: none; border: 0; padding: 0; margin-left: 0.3rem; color: var(--rouge);
  font: inherit; text-decoration: underline; cursor: pointer; min-height: 0; box-shadow: none; }

/* Retour immédiat à chaque clic (27/11/2026) : barre animée en haut, bulle « ce qui se passe » au-delà d'une seconde */
#chargement { position: fixed; inset: 0 0 auto 0; z-index: 1000; pointer-events: none; }
.chargement-barre { height: 3px; background: linear-gradient(90deg, transparent, var(--accent), transparent) no-repeat;
  background-size: 40% 100%; animation: chargement 1.1s linear infinite; }
@keyframes chargement { from { background-position: -60% 0; } to { background-position: 160% 0; } }
.chargement-bulle { display: none; position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(env(safe-area-inset-bottom, 0px) + 5.5rem); max-width: calc(100vw - 2rem); background: var(--accent);
  color: #fff; padding: 0.55rem 1rem; border-radius: 999px; box-shadow: var(--ombre); font-size: 0.92rem;
  white-space: nowrap; align-items: baseline; }
/* Titre raccourci (…) si l'écran est étroit ; le chrono reste toujours visible (demande du pilote du 28/11/2026). */
#chargement.avec-bulle .chargement-bulle { display: flex; }
.chargement-texte { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.chargement-chrono { flex: none; font-variant-numeric: tabular-nums; opacity: 0.85; margin-left: 0.3rem; }
button[data-occupe] { opacity: 0.7; cursor: progress; }
/* Suivi des tâches longues (avis IA, récupération d'annonce) */
.suivi-tache.echec { border-left-color: var(--rouge); }
.suivi-tache.echec .progression-rempli { background: var(--rouge); }
.suivi-tache.terminee .progression-rempli { background: var(--vert); }
@media (prefers-reduced-motion: reduce) { .chargement-barre { animation-duration: 3s; } }
