/* Portail flotte Grappie — clair et sombre, mêmes structures.
   Un seul accent (vigne). Vert / ambre / rouge réservés aux états, toujours avec un libellé.
   Plateformes : Uber = encre, Bolt = bleu, Heetch = magenta (palette validée CVD). */

:root {
  color-scheme: light;
  --bg: #f6f3f9;
  --surface: #ffffff;
  --surface-2: #f3eff7;
  --surface-3: #ebe5f1;
  --border: #e4dcec;
  --border-strong: #d3c7de;
  --text: #1c1225;
  --text-2: #4b3f57;
  --muted: #6b5f77;
  --accent: #92e32a;
  --accent-hover: #86d61f;
  --on-accent: #172a00;
  --accent-ink: #3d7400;
  --accent-soft: #eef9dc;
  --accent-line: #5a9a12;
  --raisin: #7a22c9;
  --ok: #157a46;
  --ok-dot: #1f9d58;
  --ok-soft: #e3f5ea;
  --warn: #8f5300;
  --warn-dot: #e09414;
  --warn-soft: #fdf1dc;
  --bad: #b8262f;
  --bad-dot: #e0444b;
  --bad-soft: #fce6e7;
  --idle-dot: #9a8fa5;
  --uber: #2b2233;
  --bolt: #2a78d6;
  --heetch: #d23f8c;
  --grid: #ece6f1;
  --shadow: 0 1px 2px rgba(40, 18, 60, 0.05), 0 1px 1px rgba(40, 18, 60, 0.03);
  --shadow-pop: 0 18px 50px -12px rgba(40, 18, 60, 0.28), 0 2px 6px rgba(40, 18, 60, 0.08);
  --scrim: rgba(28, 18, 37, 0.42);
  --skel-a: #eee8f3;
  --skel-b: #f8f5fa;

  --display: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --body: "Manrope", system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-s: 8px;
  --r: 12px;
  --r-l: 18px;
  --r-xl: 26px;
  --rail: 248px;
  --nav-bas: 64px;
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #120a19;
  --surface: #1b1324;
  --surface-2: #221a2d;
  --surface-3: #2b2238;
  --border: #30263c;
  --border-strong: #42354f;
  --text: #f4eef9;
  --text-2: #cdc1d9;
  --muted: #a594b4;
  --accent: #92e32a;
  --accent-hover: #a3ec44;
  --on-accent: #172a00;
  --accent-ink: #a8ec55;
  --accent-soft: #233114;
  --accent-line: #92e32a;
  --raisin: #b44bff;
  --ok: #4fd98f;
  --ok-dot: #3ccf82;
  --ok-soft: #13301f;
  --warn: #fdbb57;
  --warn-dot: #f5a524;
  --warn-soft: #36270d;
  --bad: #ff7a80;
  --bad-dot: #ff5d64;
  --bad-soft: #3a161b;
  --idle-dot: #7c6d8a;
  --uber: #ece4f3;
  --bolt: #3987e5;
  --heetch: #dc5a9e;
  --grid: #2a2135;
  --shadow: 0 1px 0 rgba(255, 255, 255, 0.02) inset;
  --shadow-pop: 0 24px 60px -12px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.04);
  --scrim: rgba(6, 2, 10, 0.62);
  --skel-a: #241b2f;
  --skel-b: #2e2439;
}

/* Sans JavaScript : suivre le système. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) {
    color-scheme: dark;
    --bg: #120a19; --surface: #1b1324; --surface-2: #221a2d; --border: #30263c;
    --text: #f4eef9; --text-2: #cdc1d9; --muted: #a594b4;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { background: var(--bg); -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body);
  font-size: 0.875rem;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11";
}
h1, h2, h3 { margin: 0; font-family: var(--display); letter-spacing: -0.02em; color: var(--text); }
h1 { font-size: 1.75rem; font-weight: 700; line-height: 1.15; }
h2 { font-size: 1rem; font-weight: 700; letter-spacing: -0.01em; }
h3 { font-size: 0.875rem; font-weight: 700; font-family: var(--body); letter-spacing: 0; }
p { margin: 0; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
.num { font-variant-numeric: tabular-nums; }
.seul-mobile, .qui .seul-mobile, td .seul-mobile { display: none; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; border: 0; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
/* Un tableau garde sa largeur naturelle : en bloc, le 1 px s'applique. */
table.sr { display: block; }
svg.i { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }

:focus-visible { outline: 2px solid var(--raisin); outline-offset: 2px; border-radius: 6px; }

/* ---------------------------------------------------------------- Ossature */
.app {
  display: grid; grid-template-columns: var(--rail) minmax(0, 1fr); min-height: 100vh;
  background: linear-gradient(90deg, var(--surface) calc(var(--rail) - 1px), var(--border) calc(var(--rail) - 1px) var(--rail), transparent var(--rail));
}
.rail {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 4px;
  padding: 20px 14px 16px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.marque { display: flex; align-items: center; gap: 10px; padding: 4px 10px 22px; text-decoration: none; }
.marque svg { width: 32px; height: 32px; flex: none; border-radius: 9px; box-shadow: 0 0 0 1px var(--border-strong); }
.marque b { font-family: var(--display); font-weight: 800; font-size: 1.125rem; letter-spacing: -0.03em; line-height: 1; }
.marque small { display: block; font-size: 0.75rem; font-weight: 600; color: var(--muted); letter-spacing: 0; margin-top: 3px; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 12px;
  min-height: 40px; padding: 0 12px; border-radius: 10px;
  color: var(--text-2); text-decoration: none; font-weight: 600;
  position: relative;
}
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a[aria-current="page"] { background: var(--surface-3); color: var(--text); font-weight: 750; }
.nav a[aria-current="page"]::before {
  content: ""; position: absolute; left: -14px; top: 9px; bottom: 9px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav a[aria-current="page"] svg { color: var(--accent-ink); }
.nav .compte { margin-left: auto; font-size: 0.75rem; font-weight: 700; color: var(--muted); }
.nav .compte.alerte { color: var(--bad); }
.rail-pied { margin-top: auto; display: flex; flex-direction: column; gap: 12px; }
.flotte-carte { padding: 12px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2); }
.flotte-carte b { display: block; font-weight: 750; }
.flotte-carte span { font-size: 0.75rem; color: var(--muted); }

.theme-seg { display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; }
.theme-seg button { display: grid; place-items: center; height: 32px; border: 0; border-radius: 7px; background: transparent; color: var(--muted); cursor: pointer; }
.theme-seg button:hover { color: var(--text); }
.theme-seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); box-shadow: var(--shadow), 0 0 0 1px var(--border); }

.principal { min-width: 0; display: flex; flex-direction: column; }
.entete-mobile { display: none; }
.vue { width: 100%; max-width: 1280px; margin: 0 auto; padding: 28px 36px 64px; }

.tete { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.tete .sous { margin-top: 6px; color: var(--muted); font-size: 0.8125rem; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.tete-actions { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.retour { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); text-decoration: none; font-weight: 600; font-size: 0.8125rem; margin-bottom: 10px; min-height: 28px; }
.retour:hover { color: var(--text); }

/* ---------------------------------------------------------------- Contrôles */
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 11px; }
.seg button {
  min-height: 34px; padding: 0 14px; border: 0; border-radius: 8px; background: transparent;
  color: var(--text-2); font-weight: 650; cursor: pointer; white-space: nowrap;
}
.seg button:hover { color: var(--text); }
.seg button[aria-pressed="true"] { background: var(--surface); color: var(--text); font-weight: 750; box-shadow: var(--shadow), 0 0 0 1px var(--border); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 40px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  font-weight: 700; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:hover { background: var(--surface-2); }
.btn:active { transform: translateY(1px); }
.btn.plein { background: var(--accent); border-color: transparent; color: var(--on-accent); }
.btn.plein:hover { background: var(--accent-hover); }
.btn.danger { color: var(--bad); }
.btn.danger.plein { background: var(--bad); color: #fff; }
:root[data-theme="dark"] .btn.danger.plein { background: var(--bad-dot); color: #2a0306; }
.btn.discret { border-color: transparent; background: transparent; color: var(--text-2); }
.btn.discret:hover { background: var(--surface-2); color: var(--text); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn.large { width: 100%; min-height: 48px; font-size: 0.9375rem; }
.btn .spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: tour 0.7s linear infinite; }
@keyframes tour { to { transform: rotate(360deg); } }

.champ { display: flex; flex-direction: column; gap: 6px; }
.champ label { font-weight: 700; font-size: 0.8125rem; color: var(--text-2); }
.champ input, .recherche input {
  min-height: 44px; padding: 0 14px; border-radius: 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--text);
  outline: none; transition: border-color 0.15s, box-shadow 0.15s; width: 100%;
}
.champ input::placeholder, .recherche input::placeholder { color: var(--muted); opacity: 1; }
.champ input:focus, .recherche input:focus { border-color: var(--raisin); box-shadow: 0 0 0 3px color-mix(in srgb, var(--raisin) 22%, transparent); }
.champ input[aria-invalid="true"] { border-color: var(--bad-dot); }
.champ .aide { font-size: 0.75rem; color: var(--muted); }
.champ .erreur { font-size: 0.8125rem; color: var(--bad); font-weight: 650; }
.grille-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }

.recherche { position: relative; flex: 1 1 260px; max-width: 360px; }
.recherche svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.recherche input { padding-left: 38px; min-height: 40px; }

.puces { display: flex; gap: 8px; flex-wrap: wrap; }
.puce {
  display: inline-flex; align-items: center; gap: 7px; min-height: 36px; padding: 0 13px;
  border-radius: 999px; border: 1px solid var(--border-strong); background: var(--surface);
  color: var(--text-2); font-weight: 650; cursor: pointer;
}
.puce:hover { color: var(--text); background: var(--surface-2); }
.puce[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: var(--bg); }
.puce .n { font-size: 0.75rem; opacity: 0.8; font-variant-numeric: tabular-nums; }

/* ---------------------------------------------------------------- Cartes */
.carte {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-l);
  box-shadow: var(--shadow); min-width: 0;
}
.carte-tete { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 0; flex-wrap: wrap; }
.carte-tete p { color: var(--muted); font-size: 0.8125rem; margin-top: 2px; }
.carte-corps { padding: 16px 20px 20px; }
.pile { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); }
.colonnes { display: grid; gap: 20px; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.colonnes.egal { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* KPI */
.kpis { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; padding: 0; overflow: hidden; }
.kpi { padding: 20px 22px 18px; border-left: 1px solid var(--border); min-width: 0; }
.kpi:first-child { border-left: 0; }
.kpi .lib { font-size: 0.8125rem; font-weight: 650; color: var(--text-2); display: flex; align-items: center; gap: 6px; }
.kpi .val { font-family: var(--display); font-weight: 700; font-size: 2rem; letter-spacing: -0.035em; line-height: 1.1; margin: 8px 0 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.kpi .val small { font-size: 1rem; font-weight: 600; color: var(--muted); letter-spacing: -0.01em; margin-left: 2px; }
.kpi .pied { font-size: 0.75rem; color: var(--muted); display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.kpi.hero .val { color: var(--text); }

.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 750; font-size: 0.75rem; padding: 1px 6px 1px 3px; border-radius: 6px; font-variant-numeric: tabular-nums; }
.delta svg { width: 14px; height: 14px; stroke-width: 2.4; }
.delta.hausse { color: var(--ok); background: var(--ok-soft); }
.delta.baisse { color: var(--bad); background: var(--bad-soft); }
.delta.stable { color: var(--text-2); background: var(--surface-2); }

.etiquette { display: inline-flex; align-items: center; gap: 4px; font-size: 0.6875rem; font-weight: 750; letter-spacing: 0.02em; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); padding: 0 6px; border-radius: 6px; line-height: 18px; }
.etiquette.estime { color: var(--warn); background: var(--warn-soft); border-color: transparent; }

/* Plateforme : pastille avec libellé */
.plat { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.75rem; color: var(--text); white-space: nowrap; }
.plat::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--c); flex: none; }
.plat.uber { --c: var(--uber); }
.plat.bolt { --c: var(--bolt); }
.plat.heetch { --c: var(--heetch); }
.plat.badge { padding: 2px 8px 2px 6px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); }

/* Statut : pastille + libellé, jamais la couleur seule */
.statut { display: inline-flex; align-items: center; gap: 8px; font-weight: 650; white-space: nowrap; }
.statut .pt { width: 8px; height: 8px; border-radius: 50%; background: var(--idle-dot); flex: none; }
.statut.en-ligne .pt { background: var(--ok-dot); box-shadow: 0 0 0 3px var(--ok-soft); }
.statut.en-ligne { color: var(--ok); }
.statut.coupee .pt { background: var(--bad-dot); }
.statut.coupee { color: var(--bad); }
.statut.inactif .pt { background: var(--warn-dot); }
.statut.inactif { color: var(--warn); }
.statut.jamais .pt { background: transparent; border: 1.5px dashed var(--muted); }
.statut.jamais, .statut.recent { color: var(--text-2); }
.statut small { font-weight: 500; color: var(--muted); }

/* Avatar */
.av { width: 34px; height: 34px; border-radius: 50%; flex: none; display: grid; place-items: center; font-weight: 800; font-size: 0.75rem; color: var(--text-2); background: var(--surface-3); border: 1px solid var(--border); letter-spacing: 0.02em; }
.av.grand { width: 64px; height: 64px; font-size: 1.25rem; font-family: var(--display); }
.qui { display: flex; align-items: center; gap: 12px; min-width: 0; }
.qui b { font-weight: 750; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qui .s { font-size: 0.75rem; color: var(--muted); display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qui > span:not(.av) { min-width: 0; }

/* ---------------------------------------------------------------- Graphes */
.graphe { position: relative; }
.graphe svg { display: block; width: 100%; height: auto; overflow: visible; }
.graphe .axe { fill: var(--muted); font-size: 11px; font-family: var(--body); font-variant-numeric: tabular-nums; }
.graphe .grille { stroke: var(--grid); stroke-width: 1; }
.graphe .base { stroke: var(--border-strong); stroke-width: 1; }
.graphe .col { fill: var(--accent-line); }
.graphe .col.vide { fill: var(--surface-3); }
.graphe .ligne { fill: none; stroke: var(--accent-line); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.graphe .aire { fill: var(--accent); opacity: 0.16; }
.graphe .cible { fill: transparent; cursor: crosshair; }
.graphe .curseur { stroke: var(--border-strong); stroke-width: 1; stroke-dasharray: 3 3; }
.graphe .point { fill: var(--surface); stroke: var(--accent-line); stroke-width: 2; }
.bulle {
  position: absolute; pointer-events: none; z-index: 5;
  background: var(--text); color: var(--bg); border-radius: 10px; padding: 8px 10px;
  font-size: 0.75rem; line-height: 1.4; white-space: nowrap; box-shadow: var(--shadow-pop);
  transform: translate(-50%, calc(-100% - 10px));
}
.bulle b { font-size: 0.875rem; font-variant-numeric: tabular-nums; }
.bulle span { opacity: 0.75; }

.barres { display: grid; gap: 14px; }
.barre-ligne { display: grid; grid-template-columns: 84px minmax(0, 1fr) auto; align-items: center; gap: 12px; }
.barre-piste { height: 10px; border-radius: 5px; background: var(--surface-2); overflow: hidden; }
.barre-piste i { display: block; height: 100%; border-radius: 0 5px 5px 0; background: var(--c, var(--accent-line)); min-width: 2px; }
.barre-val { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.barre-val small { display: block; font-weight: 500; color: var(--muted); font-size: 0.75rem; }

.empile { display: flex; height: 10px; gap: 2px; border-radius: 5px; overflow: hidden; background: var(--surface-2); min-width: 80px; }
.empile i { display: block; height: 100%; background: var(--c); }
.legende { display: flex; gap: 14px; flex-wrap: wrap; font-size: 0.75rem; color: var(--text-2); }

.mini-barres { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 6px; align-items: end; height: 132px; }
.mini-barres .mb { display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; min-width: 0; }
.mini-barres .mb i { width: 100%; max-width: 28px; border-radius: 4px 4px 2px 2px; background: var(--accent-line); min-height: 2px; }
.mini-barres .mb i.zero { background: var(--surface-3); }
.mini-barres .mb span { font-size: 0.6875rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.mini-barres .mb b { font-size: 0.6875rem; font-weight: 700; color: var(--text-2); font-variant-numeric: tabular-nums; white-space: nowrap; }

/* ---------------------------------------------------------------- Tables */
.table-boite { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
th { font-size: 0.75rem; font-weight: 700; color: var(--muted); background: var(--surface); position: sticky; top: 0; z-index: 1; }
th.d, td.d { text-align: right; font-variant-numeric: tabular-nums; }
th button { border: 0; background: none; padding: 0; color: inherit; font: inherit; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; min-height: 24px; }
th button:hover { color: var(--text); }
th[aria-sort] button { color: var(--text); }
th button svg { width: 13px; height: 13px; opacity: 0; }
th[aria-sort] button svg { opacity: 1; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr.lien { cursor: pointer; }
tbody tr.lien:hover td { background: var(--surface-2); }
td a, .lignes a { display: inline-block; padding: 3px 0; }
td .sec { display: block; font-size: 0.75rem; color: var(--muted); font-weight: 500; }
td.vide-val { color: var(--muted); }
.dense td { padding-top: 10px; padding-bottom: 10px; }

.classement { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0; margin-top: 6px; }
.classement > div { min-width: 0; overflow-x: auto; }
.plat-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0; }
.plat-col { padding: 4px 24px; border-left: 1px solid var(--border); display: grid; gap: 10px; min-width: 0; }
.plat-col:first-child { border-left: 0; padding-left: 0; }
.plat-col:last-child { padding-right: 0; }
.plat-col-tete { display: flex; gap: 8px; align-items: center; }
.plat-col-tete .plat { font-size: 0.875rem; }
.plat-col-val { font-family: var(--display); font-weight: 700; font-size: 1.625rem; letter-spacing: -0.03em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.plat-col-val small { font-size: 0.875rem; color: var(--muted); margin-left: 2px; }
.plat-col-pied { font-size: 0.75rem; color: var(--text-2); }
.plat-col-pied b { color: var(--text); }
.classement > div + div { border-left: 1px solid var(--border); }
.classement h3 { padding: 16px 20px 6px; display: flex; align-items: center; gap: 8px; }
.classement h3 span { font-weight: 500; color: var(--muted); font-size: 0.75rem; }
.classement td:first-child { padding-left: 20px; }
.classement td:last-child { padding-right: 20px; }
.rang { width: 22px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }

/* Alertes */
.alertes { display: grid; gap: 0; }
.alerte { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 14px 20px; border-top: 1px solid var(--border); text-decoration: none; }
.alerte:hover { background: var(--surface-2); }
.alerte .ic { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; }
.alerte.rouge .ic { background: var(--bad-soft); color: var(--bad); }
.alerte.ambre .ic { background: var(--warn-soft); color: var(--warn); }
.alerte b { font-weight: 750; }
.alerte p { color: var(--text-2); font-size: 0.8125rem; }
.alerte .quand { font-size: 0.75rem; color: var(--muted); white-space: nowrap; }
.groupe-alerte { padding: 12px 20px 8px; font-size: 0.75rem; font-weight: 750; color: var(--muted); letter-spacing: 0.04em; text-transform: uppercase; border-top: 1px solid var(--border); }
.groupe-alerte:first-child { border-top: 0; }

/* Vide, chargement, erreur */
.vide { text-align: center; padding: 40px 24px; display: grid; justify-items: center; gap: 10px; }
.vide .ic { width: 48px; height: 48px; border-radius: 14px; background: var(--surface-2); display: grid; place-items: center; color: var(--text-2); }
.vide .ic svg { width: 22px; height: 22px; }
.vide p { color: var(--text-2); max-width: 46ch; }
.vide.petit { padding: 26px 20px; }
.erreur-boite { border: 1px solid var(--border); background: var(--bad-soft); color: var(--text); border-radius: var(--r); padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; }
.erreur-boite svg { color: var(--bad); margin-top: 1px; }
.squelette { border-radius: 8px; background: linear-gradient(90deg, var(--skel-a) 0%, var(--skel-b) 50%, var(--skel-a) 100%); background-size: 200% 100%; animation: shimmer 1.3s ease-in-out infinite; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }
@media (prefers-reduced-motion: reduce) { .squelette { animation: none; } * { transition: none !important; } }

.maj { display: inline-flex; align-items: center; gap: 6px; }
.maj::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--ok-dot); }
.note-bas { font-size: 0.75rem; color: var(--muted); margin-top: 14px; display: flex; gap: 6px; align-items: flex-start; }
.note-bas svg { width: 14px; height: 14px; margin-top: 2px; }

/* Note /10 */
.note { display: inline-grid; place-items: center; min-width: 34px; height: 24px; padding: 0 6px; border-radius: 7px; font-weight: 800; font-size: 0.75rem; font-variant-numeric: tabular-nums; }
.note.n-haut { background: var(--ok-soft); color: var(--ok); }
.note.n-moy { background: var(--warn-soft); color: var(--warn); }
.note.n-bas { background: var(--bad-soft); color: var(--bad); }

/* ---------------------------------------------------------------- Fiche */
.fiche-tete { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; padding: 22px; }
.fiche-tete .id { flex: 1 1 280px; min-width: 0; }
.fiche-tete h1 { font-size: 1.625rem; }
.fiche-tete .lignes { display: flex; gap: 6px 18px; flex-wrap: wrap; margin-top: 8px; color: var(--text-2); font-size: 0.8125rem; }
.fiche-tete .lignes span { display: inline-flex; gap: 6px; align-items: center; }
.fiche-tete .lignes svg { width: 15px; height: 15px; color: var(--muted); }
.tuiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 0; overflow: hidden; }
.offres-grille { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.offres-grille > div { background: var(--surface-2); border-radius: var(--r); padding: 12px 14px; }
.offres-grille b { font-family: var(--display); font-size: 1.375rem; display: block; font-variant-numeric: tabular-nums; }
.offres-grille span { font-size: 0.75rem; color: var(--text-2); font-weight: 600; }
.comparaison-notes { display: grid; gap: 10px; margin-top: 16px; }
.trajet { display: inline-flex; align-items: center; gap: 6px; max-width: 340px; overflow: hidden; text-overflow: ellipsis; }
.trajet svg { width: 14px; height: 14px; color: var(--muted); flex: none; }
.minicarte { height: 260px; border-radius: 0 0 var(--r-l) var(--r-l); overflow: hidden; border-top: 1px solid var(--border); background: var(--surface-2); }

/* ---------------------------------------------------------------- Carte plein écran */
.vue.vue-carte { max-width: none; padding: 0; height: 100vh; display: grid; grid-template-columns: 340px minmax(0, 1fr); }
.carte-liste { border-right: 1px solid var(--border); background: var(--surface); display: flex; flex-direction: column; min-height: 0; }
.carte-liste .tete { padding: 24px 20px 12px; margin: 0; }
.carte-liste .avert { margin: 0 20px 12px; font-size: 0.75rem; color: var(--text-2); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; display: flex; gap: 8px; }
.carte-liste .avert svg { width: 15px; height: 15px; margin-top: 1px; color: var(--muted); }
.carte-liste ul { list-style: none; margin: 0; padding: 0 10px 20px; overflow-y: auto; }
.carte-liste li button { width: 100%; text-align: left; border: 0; background: transparent; border-radius: 12px; padding: 10px; display: flex; gap: 12px; align-items: center; cursor: pointer; }
.carte-liste li button:hover, .carte-liste li button[aria-current="true"] { background: var(--surface-2); }
.carte-liste li .qui { flex: 1; }
.carte-liste .pos { font-size: 0.75rem; color: var(--muted); text-align: right; white-space: nowrap; }
.carte-liste .pos b { display: block; color: var(--text-2); font-weight: 700; }
/* Repli OpenStreetMap (sans clé CARTO) : fond clair assombri par filtre en thème sombre. */
.tuiles-osm .leaflet-tile-pane { filter: grayscale(1) contrast(0.8) brightness(1.1); }
:root[data-theme="dark"] .tuiles-osm .leaflet-tile-pane { filter: grayscale(1) invert(1) brightness(0.78) contrast(0.85); }
path.tr-trait { fill: none; stroke: var(--raisin); stroke-linecap: round; stroke-linejoin: round; stroke-opacity: 0.85; }
:root[data-theme="dark"] path.tr-trait { stroke: #c27bff; }
.trajets-zone { position: relative; }
.btn-carte { position: absolute; top: 12px; right: 12px; z-index: 800; display: inline-flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--text); font: inherit; font-weight: 750; font-size: 0.8125rem; cursor: pointer; box-shadow: var(--shadow-pop); }
.btn-carte:hover { background: var(--surface-2); }
.btn-carte .i { width: 16px; height: 16px; }
#bloc-trajets.plein-ecran .trajets-zone { flex: 1; min-height: 0; display: flex; }
.avert:empty { display: none; }
#carte-leaflet { height: 100%; min-height: 400px; background: var(--surface-2); }
.leaflet-container { font-family: var(--body); background: var(--surface-2); }
.leaflet-popup-content-wrapper, .leaflet-popup-tip { background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop); }
.leaflet-popup-content { margin: 12px 14px; font-size: 0.8125rem; line-height: 1.45; }
.leaflet-popup-content b { font-weight: 750; }
.leaflet-container a.leaflet-popup-close-button { color: var(--muted); }
.leaflet-control-attribution { background: color-mix(in srgb, var(--surface) 85%, transparent) !important; color: var(--text-2) !important; }
.leaflet-control-attribution a { color: var(--text-2) !important; }
.leaflet-bar a { background: var(--surface) !important; color: var(--text) !important; border-color: var(--border) !important; }
.marqueur { display: grid; place-items: center; }
.marqueur i { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; font-style: normal; font-weight: 800; font-size: 11px; color: #fff; background: #6d6178; border: 2.5px solid var(--surface); box-shadow: 0 4px 12px rgba(0,0,0,0.25); }
.marqueur.en-ligne i { background: #157a46; }

/* Position actuelle : gros marqueur et halo qui pulse (en ligne seulement). */
.marqueur.actuel { position: relative; }
.marqueur.actuel i { width: 38px; height: 38px; font-size: 13px; border-width: 3px; background: #5b5066; box-shadow: 0 0 0 3px rgba(91,80,102,0.35), 0 6px 16px rgba(0,0,0,0.35); position: relative; z-index: 1; }
.marqueur.actuel.en-ligne i { background: #157a46; box-shadow: 0 0 0 3px rgba(31,157,88,0.35), 0 6px 16px rgba(0,0,0,0.35); }
.marqueur.actuel .halo { position: absolute; inset: 0; border-radius: 50%; background: rgba(91,80,102,0.25); }
.marqueur.actuel.en-ligne .halo { background: rgba(31,157,88,0.35); animation: halo 1.8s ease-out infinite; }
@keyframes halo { from { transform: scale(0.7); opacity: 0.9; } to { transform: scale(1.9); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .marqueur.actuel .halo { animation: none; } }

/* Tracés : vert = prise, rouge = non prise (libellés dans la légende et les bulles). */
.leaflet-interactive.tr-pt { stroke: var(--surface); fill-opacity: 1; }
.leaflet-interactive.tr-pt.prise { fill: var(--ok-dot); }
.leaflet-interactive.tr-pt.non { fill: var(--bad-dot); }
path.col.en-cours { opacity: 0.55; }

.carte-zone { position: relative; min-height: 0; height: 100%; }
.carte-reglages { padding: 0 20px 12px; display: grid; gap: 10px; }
.carte-reglages > .seg { width: 100%; }
.carte-reglages > .seg button { flex: 1; }
.trajets-choix { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.jour-nav { display: inline-flex; align-items: center; gap: 4px; }
.jour-nav .num { min-width: 132px; text-align: center; font-weight: 750; font-size: 0.8125rem; }
.btn.icone { min-height: 36px; width: 36px; padding: 0; }
.btn.icone .i { width: 18px; height: 18px; }
.legende-trajets { display: flex; gap: 6px 14px; flex-wrap: wrap; align-items: center; font-size: 0.75rem; font-weight: 650; color: var(--text-2); }
.legende-trajets label, .legende-trajets span { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; min-height: 28px; }
.legende-trajets span { cursor: default; }
.legende-trajets input { width: 16px; height: 16px; margin: 0; accent-color: var(--raisin); }
.pt-l { width: 11px; height: 11px; border-radius: 50%; display: inline-block; border: 2px solid var(--surface); box-shadow: 0 0 0 1px var(--border-strong); }
.pt-l.prise { background: var(--ok-dot); }
.pt-l.non { background: var(--bad-dot); }
.pt-l.trait { width: 16px; height: 0; border: 0; border-top: 2.5px solid var(--raisin); border-radius: 0; box-shadow: none; margin-left: -2px; }
.pt-l.trait.pointille { border-top: 2.5px dotted var(--raisin); }
#bloc-trajets.plein-ecran { position: fixed; inset: 0; z-index: 1200; margin: 0; border-radius: 0; display: flex; flex-direction: column; max-width: none; }
#bloc-trajets.plein-ecran .trajets-carte { flex: 1; height: auto; min-height: 0; }
#bloc-trajets.plein-ecran .btn-carte { top: 16px; right: 16px; }
.sans-defilement, .sans-defilement body { overflow: hidden; }
.pt-l.actuel { width: 14px; height: 14px; background: #157a46; box-shadow: 0 0 0 3px rgba(31,157,88,0.3); }
#carte-legende .legende-trajets { position: absolute; left: 12px; bottom: 22px; z-index: 500; background: color-mix(in srgb, var(--surface) 94%, transparent); border: 1px solid var(--border); border-radius: 12px; padding: 6px 12px; box-shadow: var(--shadow-pop); max-width: calc(100% - 24px); }
.trajets-carte { height: 400px; border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); background: var(--surface-2); }
.trajets-pied { display: flex; gap: 10px 20px; justify-content: space-between; align-items: center; flex-wrap: wrap; padding: 12px 20px 16px; }
.ok-txt { color: var(--ok); }
.bad-txt { color: var(--bad); }
.carte-liste .pos .ok-txt { display: block; font-weight: 700; }
.pop-offre { margin: 8px 0; padding-top: 8px; border-top: 1px solid var(--border); display: grid; gap: 4px; }
.pop-statut { font-weight: 700; }
.pop-montant { display: flex; gap: 6px; align-items: center; }
.pop-statut.prise { color: var(--ok); }
.pop-statut.non { color: var(--bad); }
.pop-trajet { color: var(--text-2); }

/* Applications autorisées : puces de la liste, interrupteurs de la fiche. */
.autors { display: inline-flex; gap: 4px; }
#liste td .statut { flex-wrap: wrap; row-gap: 0; }
#liste td .statut small { flex-basis: 100%; padding-left: 14px; }
/* Écran moyen : les puces d'applications restent visibles, heures et acceptation sont sur la fiche. */
@media (min-width: 901px) and (max-width: 1400px) { #liste th:nth-child(4), #liste td:nth-child(4), #liste th:nth-child(7), #liste td:nth-child(7) { display: none; } }
.autor { font: inherit; font-size: 0.6875rem; font-weight: 750; min-height: 32px; padding: 0 8px 0 7px; border-radius: 7px; gap: 5px; cursor: pointer; display: inline-flex; align-items: center; border: 1px dashed var(--border-strong); background: transparent; color: var(--muted); text-decoration: line-through; }
.autor::before { content: ""; width: 8px; height: 8px; border-radius: 2px; background: var(--idle-dot); }
.autor[aria-pressed="true"] { border-style: solid; border-color: var(--border); background: var(--surface-2); color: var(--text); text-decoration: none; }
.autor.uber[aria-pressed="true"]::before { background: var(--uber); }
:root[data-theme="dark"] .autor.uber[aria-pressed="true"]::before { background: var(--text); }
.autor.bolt[aria-pressed="true"]::before { background: var(--bolt); }
.autor.heetch[aria-pressed="true"]::before { background: var(--heetch); }
.autor:hover { border-color: var(--text-2); }
.autorisations { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.interrupteur { font: inherit; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 14px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; text-align: left; color: var(--text); min-height: 56px; }
.interrupteur .plat { font-size: 0.9375rem; flex: 1; }
.interrupteur .etat { font-size: 0.75rem; font-weight: 750; color: var(--muted); min-width: 64px; text-align: right; }
.interrupteur[aria-checked="true"] { background: var(--surface); border-color: var(--border-strong); }
.interrupteur[aria-checked="true"] .etat { color: var(--ok); }
.interrupteur[aria-checked="false"] .plat { color: var(--muted); }
.glissiere { width: 44px; height: 26px; border-radius: 999px; background: var(--border-strong); position: relative; flex: none; transition: background 0.15s; }
.glissiere i { position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.3); transition: transform 0.15s; }
.interrupteur[aria-checked="true"] .glissiere { background: var(--ok-dot); }
.interrupteur[aria-checked="true"] .glissiere i { transform: translateX(18px); }
.interrupteur:focus-visible, .autor:focus-visible { outline: 3px solid var(--raisin); outline-offset: 2px; }

/* ---------------------------------------------------------------- Connexion */
.connexion { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; background:
  radial-gradient(1200px 600px at 10% -10%, color-mix(in srgb, var(--raisin) 12%, transparent), transparent 60%),
  radial-gradient(900px 500px at 110% 110%, color-mix(in srgb, var(--accent) 12%, transparent), transparent 60%),
  var(--bg); }
.connexion .boite { width: 100%; max-width: 420px; padding: 32px; border-radius: var(--r-xl); }
.connexion .marque { padding: 0 0 26px; }
.connexion h1 { font-size: 1.5rem; margin-bottom: 8px; }
.connexion .chapo { color: var(--text-2); margin-bottom: 22px; }
.connexion form { display: grid; gap: 16px; }
.connexion .pied-co { margin-top: 20px; font-size: 0.75rem; color: var(--muted); text-align: center; }
.code { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 8px; }
.code input {
  height: 56px; width: 100%; text-align: center; font-family: var(--display); font-size: 1.5rem; font-weight: 700;
  border: 1px solid var(--border-strong); border-radius: 12px; background: var(--surface); color: var(--text); outline: none;
  font-variant-numeric: tabular-nums; caret-color: var(--raisin);
}
.code input:focus { border-color: var(--raisin); box-shadow: 0 0 0 3px color-mix(in srgb, var(--raisin) 22%, transparent); }
.code.faux input { border-color: var(--bad-dot); }
.email-envoye { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 12px; background: var(--surface-2); border-radius: 10px; font-weight: 700; }
.email-envoye span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lien-btn { border: 0; background: none; padding: 4px 2px; color: var(--text); font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; min-height: 32px; }
.lien-btn[disabled] { color: var(--muted); text-decoration: none; cursor: default; }

/* ---------------------------------------------------------------- Fenêtres */
dialog {
  border: 1px solid var(--border); border-radius: var(--r-xl); padding: 0; width: min(520px, calc(100vw - 32px));
  background: var(--surface); color: var(--text); box-shadow: var(--shadow-pop);
}
dialog::backdrop { background: var(--scrim); backdrop-filter: blur(2px); }
dialog[open] { animation: monte 0.18s ease-out; }
@keyframes monte { from { opacity: 0; transform: translateY(8px) scale(0.99); } to { opacity: 1; transform: none; } }
.dlg-tete { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 22px 24px 4px; }
.dlg-tete p { color: var(--text-2); margin-top: 4px; }
.dlg-corps { padding: 16px 24px; display: grid; gap: 14px; }
.dlg-pied { padding: 8px 24px 22px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }
.fermer { width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; flex: none; }
.fermer:hover { background: var(--surface-2); color: var(--text); }
.relire { border: 1px solid var(--border); border-radius: var(--r); padding: 16px; background: var(--surface-2); display: grid; gap: 4px; }
.relire .mail { font-family: var(--display); font-weight: 700; font-size: 1.25rem; word-break: break-all; letter-spacing: -0.01em; }
.succes-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--ok-soft); color: var(--ok); }
.succes-ic svg { width: 26px; height: 26px; stroke-width: 2.4; }
.etapes { margin: 0; padding-left: 20px; display: grid; gap: 6px; color: var(--text-2); }
.etapes b { color: var(--text); }

/* Toast */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 50; display: grid; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 12px; font-weight: 650; box-shadow: var(--shadow-pop); display: flex; gap: 10px; align-items: center; animation: monte 0.2s ease-out; max-width: calc(100vw - 32px); }

/* Paramètres */
.reglages { display: grid; gap: 20px; grid-template-columns: minmax(0, 1fr); max-width: 860px; }
.ligne-info { display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 12px; padding: 13px 20px; border-top: 1px solid var(--border); align-items: center; }
.ligne-info:first-of-type { border-top: 0; }
.ligne-info dt { color: var(--text-2); font-weight: 650; }
.ligne-info dd { margin: 0; font-weight: 650; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
code.code-flotte { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-size: 0.8125rem; background: var(--surface-2); border: 1px solid var(--border); padding: 2px 8px; border-radius: 6px; }
.theme-choix { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.theme-choix button { border: 1px solid var(--border-strong); background: var(--surface); border-radius: var(--r); padding: 12px; cursor: pointer; display: grid; gap: 10px; text-align: left; font-weight: 700; }
.theme-choix button[aria-pressed="true"] { border-color: var(--text); box-shadow: 0 0 0 1px var(--text); }
.theme-choix .apercu { height: 64px; border-radius: 8px; border: 1px solid var(--border); display: grid; grid-template-columns: 28% 1fr; overflow: hidden; }
.theme-choix .apercu.c { background: #f6f3f9; }
.theme-choix .apercu.c i { background: #fff; border-right: 1px solid #e4dcec; }
.theme-choix .apercu.s { background: #120a19; }
.theme-choix .apercu.s i { background: #2a2036; border-right: 1px solid #42354f; }
:root[data-theme="dark"] .theme-choix .apercu { border-color: var(--border-strong); }
.theme-choix .apercu.y { background: linear-gradient(135deg, #f6f3f9 50%, #120a19 50%); }
.theme-choix .apercu.y i { background: transparent; }
.theme-choix .apercu b { display: block; margin: 12px; height: 8px; width: 50%; border-radius: 4px; background: #92e32a; }

/* ---------------------------------------------------------------- Responsive */
@media (max-width: 1180px) {
  .kpis, .tuiles { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .kpi { border-top: 1px solid var(--border); }
  .kpi:nth-child(-n+3) { border-top: 0; }
  .kpi:nth-child(3n+1) { border-left: 0; }
  .colonnes { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 900px) {
  :root { --rail: 0px; }
  .app { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 30;
    flex-direction: row; padding: 6px 6px calc(6px + env(safe-area-inset-bottom)); border-right: 0; border-top: 1px solid var(--border);
    background: color-mix(in srgb, var(--surface) 94%, transparent); backdrop-filter: blur(12px);
  }
  .rail .marque, .rail .rail-pied { display: none; }
  .nav { flex-direction: row; width: 100%; justify-content: space-around; }
  .nav a { flex: 1; flex-direction: column; gap: 3px; min-height: 52px; padding: 6px 2px; justify-content: center; font-size: 0.6875rem; border-radius: 12px; }
  .nav a[aria-current="page"]::before { left: 30%; right: 30%; top: 0; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .nav .compte, .nav .compte.alerte { position: absolute; top: 0; left: calc(50% + 8px); right: auto; margin: 0; font-size: 0.625rem; background: var(--bad); color: #fff; border-radius: 999px; min-width: 16px; height: 16px; display: grid; place-items: center; padding: 0 4px; }
  :root[data-theme="dark"] .nav .compte.alerte { background: var(--bad-dot); color: #2a0306; }
  .nav .compte:not(.alerte) { display: none; }
  .entete-mobile {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    padding: 10px 16px; border-bottom: 1px solid var(--border); background: var(--surface); position: sticky; top: 0; z-index: 20;
  }
  .entete-mobile .marque { padding: 0; }
  .entete-mobile .marque svg { width: 28px; height: 28px; }
  .vue { padding: 18px 16px calc(var(--nav-bas) + 40px); }
  h1 { font-size: 1.5rem; }
  .tete { margin-bottom: 18px; align-items: flex-start; }
  .tete-actions { width: 100%; }
  .tete-actions .seg { flex: 1; }
  .tete-actions .seg button { flex: 1; padding: 0 8px; }
  .colonnes.egal, .classement, .grille-2, .plat-cols { grid-template-columns: minmax(0, 1fr); }
  .plat-col { border-left: 0; padding: 14px 0; border-top: 1px solid var(--border); }
  .plat-col:first-child { border-top: 0; padding-top: 0; }
  .app { background: none; }
  .classement > div + div { border-left: 0; border-top: 1px solid var(--border); }
  .vue.vue-carte { height: calc(100vh - 57px); grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; padding: 0; }
  .carte-liste { order: 2; border-right: 0; border-top: 1px solid var(--border); max-height: 42vh; padding-bottom: calc(var(--nav-bas) + 10px); }
  .carte-liste .tete { padding: 14px 16px 8px; }
  #carte-leaflet { min-height: 0; }
  .carte-zone { order: 1; }
  .carte-liste .avert { display: none; }
  .carte-liste .tete .sous { font-size: 0.75rem; }
  .trajets-choix { flex-wrap: nowrap; }
  .jour-nav .num { min-width: 0; }
  .jour-nav .btn.icone, .puce, .leaflet-bar a { min-width: 44px !important; min-height: 44px !important; }
  .leaflet-bar a { line-height: 44px !important; }
  .puces { flex-wrap: nowrap; overflow-x: auto; }
  td:has(> .trajet) { white-space: normal; min-width: 110px; }
  .table-boite th, .table-boite td { padding-left: 8px; padding-right: 8px; }
  .table-boite th:first-child, .table-boite td:first-child { padding-left: 16px; }
  .table-boite th:last-child, .table-boite td:last-child { padding-right: 16px; }
  .table-boite .qui .av { display: none; }
  .table-boite td:first-child { white-space: normal; min-width: 72px; }
  .table-boite td .sec { font-size: 0.6875rem; }
  td .trajet { white-space: normal; display: block; max-width: none; }
  .carte-reglages { padding: 0 16px 10px; }
  #carte-legende .legende-trajets { bottom: 10px; left: 8px; padding: 4px 10px; gap: 2px 10px; }
  .autorisations { grid-template-columns: minmax(0, 1fr); }
  .trajets-carte { height: 340px; }
  .trajets-pied { padding: 10px 16px 14px; }
  .ligne-info { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  dialog { width: 100vw; max-width: 100vw; margin: auto 0 0; border-radius: var(--r-xl) var(--r-xl) 0 0; max-height: 92vh; }
  .toasts { bottom: calc(var(--nav-bas) + 20px); }
  .masque-mobile { display: none !important; }
  .seul-mobile, .qui .seul-mobile, td .seul-mobile { display: block; margin-top: 2px; font-size: 0.75rem; }
}
@media (max-width: 560px) {
  .kpis, .tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .kpi { padding: 16px; border-top: 1px solid var(--border) !important; border-left: 1px solid var(--border) !important; }
  .kpi:nth-child(-n+2) { border-top: 0 !important; }
  .kpi:nth-child(2n+1) { border-left: 0 !important; }
  .kpi.hero { grid-column: 1 / -1; border-left: 0 !important; }
  .kpi.hero + .kpi { border-top: 1px solid var(--border) !important; border-left: 0 !important; }
  .kpi.hero ~ .kpi:nth-child(2n+1) { border-left: 1px solid var(--border) !important; }
  .kpi.hero ~ .kpi:nth-child(2n) { border-left: 0 !important; }
  .kpi.hero ~ .kpi:nth-child(-n+3) { border-top: 1px solid var(--border) !important; }
  .kpi .val { font-size: 1.625rem; }
  .theme-choix { grid-template-columns: minmax(0, 1fr); }
  .offres-grille { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .fiche-tete { padding: 18px; }
  .alerte { grid-template-columns: auto minmax(0, 1fr); }
  .alerte .quand { grid-column: 2; }
}
