/* CRM Grovia — le langage du centre des alertes (tools/centre/centre.css) : un seul rayon
   (14 px), l'ambre seule couleur d'action, UN bouton plein par écran, l'élévation par la valeur
   du fond (une seule ombre : ce qui flotte), Inter partout y compris les chiffres (tabulaires),
   Plex Mono pour les @ seulement, Sora pour le wordmark. Jetons : ceux du produit
   (dashboard/static/css/tokens.css), sombre ET clair, recopiés en VALEURS. */
@font-face { font-family: 'Inter'; src: url('polices/InterVariable.woff2') format('woff2-variations'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Sora'; src: url('polices/Sora-latin.woff2') format('woff2'); font-weight: 700 800; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('polices/IBMPlexMono-400.woff2') format('woff2'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'IBM Plex Mono'; src: url('polices/IBMPlexMono-500.woff2') format('woff2'); font-weight: 500 700; font-display: swap; }

:root {
  /* clair (défaut) — contrastes mesurés dans tokens.css */
  --bg-app: #EEF0EC; --bg-sidebar: #F4F6F2; --bg-surface: #FFFFFF; --bg-raised: #F7F9F4; --bg-hover: #E9EFE9; --bg-actif: #E0EAE2;
  --border-subtle: rgba(26,24,21,.08); --border-strong: rgba(26,24,21,.14); --bord-carte: rgba(26,24,21,.07);
  --field-bg: #FBFAF7; --focus-ring: 0 0 0 3px rgba(31,122,82,.30);
  --shadow-overlay: 0 24px 64px rgba(26,24,21,.18), 0 2px 8px rgba(26,24,21,.06);
  --text-primary: #1A1815; --text-secondary: #585249; --text-muted: #6F695E;
  --accent: #1F7A52; --accent-hover: #17633F; --accent-bg: rgba(31,122,82,.12); --accent-t: #1F7A52; --accent-fg: #FFFFFF;
  --success: #3D7A4F; --warning: #8A5D0B; --danger: #BE4338; --info: #2A5FB4;
  --success-bg: rgba(61,122,79,.11); --warning-bg: rgba(138,93,11,.11); --danger-bg: rgba(190,67,56,.10); --info-bg: rgba(42,95,180,.10);
  --voile: rgba(26,24,21,.28);
  --r: 14px;
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --t-ctl: 120ms; --t-surf: 220ms;
  color-scheme: light;
}
:root[data-theme="sombre"] {
  --bg-app: #111410; --bg-sidebar: #171B15; --bg-surface: #1B1E17; --bg-raised: #23261E; --bg-hover: #262B22; --bg-actif: #2B3127;
  --border-subtle: rgba(255,255,255,.11); --border-strong: rgba(255,255,255,.16); --bord-carte: transparent;
  --field-bg: #171512; --focus-ring: 0 0 0 3px rgba(70,176,126,.30);
  --shadow-overlay: 0 24px 64px rgba(0,0,0,.65);
  --text-primary: #EDEAE3; --text-secondary: #A9A49A; --text-muted: #908A80;
  --accent: #46B07E; --accent-hover: #64C695; --accent-bg: rgba(70,176,126,.16); --accent-t: #64C695; --accent-fg: #0B140E;
  --success: #4BD48A; --warning: #F2B441; --danger: #FF7A6B; --info: #7FB2FF;
  --success-bg: rgba(75,212,138,.12); --warning-bg: rgba(242,180,65,.12); --danger-bg: rgba(255,122,107,.12); --info-bg: rgba(127,178,255,.12);
  --voile: rgba(0,0,0,.5);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg-app); color: var(--text-primary); font-family: var(--font);
  font-size: 13.5px; line-height: 1.45; font-variant-numeric: tabular-nums; -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent-t); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
h1, h2, h3 { letter-spacing: -.01em; }
.num { font-variant-numeric: tabular-nums; }
.at { font-family: var(--mono); font-weight: 500; font-size: 13px; color: var(--text-primary); word-break: break-all; }
.muet { color: var(--text-muted); } .second { color: var(--text-secondary); }
.petit-texte { font-size: 12px; } .aide { font-size: 12.5px; margin: 0; }
.pousse { margin-left: auto; }
.lecteur { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.saut { position: absolute; left: 8px; top: -48px; z-index: 90; background: var(--accent); color: var(--accent-fg); padding: 8px 12px; border-radius: var(--r); }
.saut:focus { top: 8px; }
kbd { font-family: var(--mono); font-size: 12px; padding: 2px 8px; border-radius: 8px; background: var(--bg-raised); border: 1px solid var(--border-strong); }

/* ── icônes (Lucide, sprite en ligne) ── */
.ic { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
:root[data-theme="sombre"] .si-clair, :root:not([data-theme="sombre"]) .si-sombre { display: none; }

/* ── coquille : barre latérale + zone ── */
.shell { display: grid; grid-template-columns: 240px minmax(0,1fr); min-height: 100vh;
  /* la colonne de la barre garde son fond sous une page plus haute que l'écran */
  background: linear-gradient(to right, var(--bg-sidebar) 239px, var(--border-subtle) 239px 240px, transparent 240px); }
.barre { background: var(--bg-sidebar); padding: 20px 12px 12px; display: flex; flex-direction: column; gap: 4px;
  position: sticky; top: 0; height: 100vh; border-right: 1px solid var(--border-subtle); z-index: 10; }
.barre-haut { padding: 0 8px 20px; }
.marque { display: flex; align-items: center; gap: 12px; font-family: 'Sora', var(--font); font-weight: 800; font-size: 17px; letter-spacing: -.01em; }
.marque-crm { color: var(--accent-t); margin-left: 4px; }
.marque-pic { width: 32px; height: 32px; border-radius: var(--r); display: inline-flex; align-items: center; justify-content: center;
  background: var(--accent-bg); color: var(--accent-t); }
.barre-nav { display: flex; flex-direction: column; gap: 4px; }
.barre-sep { font-size: 11px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); padding: 16px 12px 4px; }
.nav { display: flex; align-items: center; gap: 12px; padding: 8px 12px; min-height: 40px; border-radius: var(--r);
  color: var(--text-secondary); text-decoration: none; transition: background var(--t-ctl), color var(--t-ctl); }
.nav:hover { background: var(--bg-hover); color: var(--text-primary); text-decoration: none; }
.nav.actif { background: var(--bg-actif); color: var(--text-primary); font-weight: 550; }
.nav.actif .ic { color: var(--accent-t); }
.nav .lib { flex: 1; }
.compte { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-flex; align-items: center;
  justify-content: center; font-size: 11px; font-weight: 650; background: var(--warning-bg); color: var(--warning); }
.barre-pied { margin-top: auto; padding: 12px 2px 0 4px; border-top: 1px solid var(--border-subtle); display: flex; align-items: center; gap: 6px; }
.barre-pied .avatar { width: 30px; height: 30px; }
.barre-pied .qui-moi { flex: 1 1 64px; }
.barre-pied .outils { flex: none; }
.barre-pied .btn.icone { width: 30px; }
.barre-pied .sortie { flex: none; }
.qui-moi { display: flex; flex-direction: column; min-width: 0; flex: 1; font-size: 12.5px; line-height: 1.3; }
.qui-moi .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 550; }
.outils { display: inline-flex; align-items: center; gap: 0; }
.outils form { margin: 0; display: inline-flex; }
.avatar { width: 32px; height: 32px; border-radius: 50%; flex: none; display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-actif); color: var(--text-primary); font-size: 12px; font-weight: 650; }
.avatar.petit { width: 24px; height: 24px; font-size: 10.5px; }
.avatar.eteint { color: var(--text-muted); background: var(--bg-raised); }
.zone { min-width: 0; display: flex; flex-direction: column; }
.tete { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 16px; flex-wrap: wrap;
  padding: 20px 40px 16px; background: var(--bg-app); border-bottom: 1px solid var(--border-subtle); }
.tete-titre { flex: 1; min-width: 180px; }
.tete h1 { font-size: 22px; font-weight: 650; margin: 0; }
.tete-sous { color: var(--text-muted); font-size: 12.5px; margin-top: 2px; display: flex; gap: 12px; flex-wrap: wrap; align-items: center; min-height: 18px; }
.tete-sous:empty { display: none; }
.tete-droite { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.tete-outils { display: none; }
.corps { padding: 24px 40px 40px; min-width: 0; width: 100%; max-width: 1480px; display: flex; flex-direction: column; gap: 16px; }
.corps:focus { outline: none; }

/* ── boutons : UN modèle ; le plein est unique par écran ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 16px;
  border-radius: var(--r); border: 1px solid var(--border-strong); background: var(--bg-surface); cursor: pointer; text-decoration: none;
  color: var(--text-primary); transition: background var(--t-ctl), border-color var(--t-ctl), color var(--t-ctl); white-space: nowrap; }
.btn:hover { background: var(--bg-hover); text-decoration: none; }
.btn.plein { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); font-weight: 600; }
.btn.plein:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
/* le geste principal d'une LIGNE : teinté, jamais plein (il y a une ligne par contact) */
.btn.accent { background: var(--accent-bg); border-color: color-mix(in srgb, var(--accent) 45%, transparent); color: var(--accent-t); font-weight: 600; }
.btn.accent:hover { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.btn.rouge { background: var(--danger-bg); border-color: color-mix(in srgb, var(--danger) 35%, transparent); color: var(--danger); font-weight: 600; }
.btn.rouge:hover { background: color-mix(in srgb, var(--danger) 22%, transparent); }
.btn.lien { border-color: transparent; background: none; color: var(--accent-t); padding: 0 8px; }
.btn.lien:hover { background: var(--accent-bg); }
.btn.petit { min-height: 28px; padding: 0 10px; font-size: 12.5px; gap: 6px; }
.btn.petit .ic { width: 14px; height: 14px; }
.btn.icone { padding: 0; width: 36px; border-color: transparent; background: none; color: var(--text-secondary); }
.btn.icone.petit { width: 28px; }
.btn.icone:hover { background: var(--bg-hover); color: var(--text-primary); }
.btn.large { width: 100%; }
.btn:disabled, .btn[disabled] { opacity: .5; cursor: not-allowed; }
.nav:focus-visible, .btn:focus-visible, .seg a:focus-visible, a:focus-visible, .carte-contact:focus-visible,
summary:focus-visible, .coche input:focus-visible { outline: none; box-shadow: var(--focus-ring); }

/* ── champs ── */
.champ { background: var(--field-bg); border: 1px solid var(--border-strong); border-radius: var(--r); color: var(--text-primary);
  padding: 8px 12px; min-height: 36px; outline: none; transition: border-color var(--t-ctl), box-shadow var(--t-ctl); min-width: 0; }
.champ:focus { border-color: var(--accent); box-shadow: var(--focus-ring); }
.champ::placeholder { color: var(--text-muted); opacity: 1; }
textarea.champ { width: 100%; min-height: 80px; resize: vertical; }
.champ.petit { min-height: 32px; padding: 4px 8px; font-size: 12.5px; }
.champ.nombre { width: 96px; text-align: right; }
.bloc-champ { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-secondary); font-weight: 550; }
.bloc-champ .champ { font-weight: 400; font-size: 13.5px; }
.champ-mdp { position: relative; display: flex; }
.champ-mdp .champ { flex: 1; padding-right: 44px; }
.champ-mdp .voir-mdp { position: absolute; right: 2px; top: 50%; transform: translateY(-50%); }
.recherche-boite { display: flex; align-items: center; gap: 8px; background: var(--field-bg); border: 1px solid var(--border-strong);
  border-radius: var(--r); padding: 0 12px; min-height: 36px; width: min(320px, 100%); color: var(--text-muted);
  transition: border-color var(--t-ctl), box-shadow var(--t-ctl); }
.recherche-boite:focus-within { border-color: var(--accent); box-shadow: var(--focus-ring); }
.recherche-boite .champ { border: 0; background: none; box-shadow: none; padding: 0; flex: 1; min-width: 0; min-height: 34px; }
.coche { display: inline-flex; align-items: center; gap: 8px; color: var(--text-primary); cursor: pointer; }
.coche input, input[type=checkbox] { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); flex: none; }
.erreur { color: var(--danger); font-size: 12.5px; margin: 0; }
.erreur:empty { display: none; }

/* ── onglets (segments), filtres ── */
.seg { display: inline-flex; background: var(--bg-surface); border: 1px solid var(--bord-carte); border-radius: var(--r); padding: 4px; gap: 4px; flex-wrap: wrap; align-self: flex-start; max-width: 100%; }
.seg a { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px; border-radius: 10px; color: var(--text-secondary);
  text-decoration: none; transition: background var(--t-ctl), color var(--t-ctl); }
.seg a:hover { color: var(--text-primary); background: var(--bg-hover); }
.seg a.actif { background: var(--bg-actif); color: var(--text-primary); font-weight: 550; }
.seg-n { color: var(--text-muted); font-size: 12px; }
.filtres-l {
  display: flex;
  flex-direction: column;
  gap: 0;
  background: var(--bg-surface);
  border: 1px solid var(--bord-carte);
  border-radius: var(--r);
  overflow: hidden;
}
.filtres-rang {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  padding: 9px 12px;
}
.filtres-rang + .filtres-rang {
  border-top: 1px solid var(--border-subtle);
  background: var(--bg-raised);
  padding: 7px 12px;
}
.filtres-l .recherche-boite { flex: 1 1 180px; max-width: 260px; }
.filtres-l .champ.petit { flex: 0 1 auto; max-width: 165px; height: 30px; min-height: 30px; padding: 3px 8px; font-size: 12.5px; }
.filtres-droite { margin-left: auto; display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }

/* ── bandeaux ── */
.bandeau { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--r); padding: 12px 16px; margin: 0;
  background: var(--warning-bg); color: var(--text-primary); flex-wrap: wrap; }
.bandeau .ic { margin-top: 2px; color: var(--warning); }
.bandeau.info { background: var(--info-bg); } .bandeau.info .ic { color: var(--info); }
.bandeau.alerte { background: var(--danger-bg); } .bandeau.alerte .ic { color: var(--danger); }
.bandeau .pousse { margin-left: auto; }
.bandeau > span { flex: 1 1 200px; min-width: 0; }

/* ── cartes, tuiles ── */
.carte { background: var(--bg-surface); border-radius: var(--r); border: 1px solid var(--bord-carte); min-width: 0; }
.carte-tete { display: flex; align-items: center; gap: 12px; padding: 16px 20px 12px; }
.carte-tete h2 { font-size: 15px; font-weight: 600; margin: 0; flex: 1; }
.carte-ic { width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg-raised); color: var(--text-secondary); flex: none; }
.carte-ic .ic { width: 15px; height: 15px; }
.carte-corps { padding: 4px 20px 20px; }
.carte-corps > .aide { margin-top: 12px; }
.h-carte { font-size: 15px; font-weight: 600; margin: 0; }
.pile { display: flex; flex-direction: column; gap: 16px; }
.pile-s { display: flex; flex-direction: column; gap: 12px; padding-top: 20px; }
.pile-form { display: flex; flex-direction: column; gap: 16px; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.tuile { background: var(--bg-surface); border: 1px solid var(--bord-carte); border-radius: var(--r); padding: 16px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.tuile-lib { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-secondary); }
.tuile-lib .ic { width: 14px; height: 14px; color: var(--text-muted); }
/* ⚠ boîte de hauteur FIXE, contenu centré : « — » et un chiffre sur la même ligne (§ e ter). */
.tuile-val { font-size: 24px; font-weight: 650; min-height: 32px; display: flex; align-items: center; gap: 2px; line-height: 1; letter-spacing: -.02em; }
.tuile-val .unite, .unite { font-size: .6em; color: var(--text-muted); font-weight: 500; margin-left: 2px; }
.tuile-pied { font-size: 11.5px; color: var(--text-muted); }
.vide { display: flex; align-items: center; gap: 12px; padding: 16px 20px; color: var(--text-secondary); }
.vide .ic { color: var(--text-muted); }
.vide-l { padding: 8px 0; }
.lien-une-fois { display: flex; flex-direction: column; gap: 8px; background: var(--accent-bg); border-radius: var(--r); padding: 12px 16px; }
.url-ligne { display: flex; align-items: center; gap: 8px; background: var(--bg-surface); border-radius: var(--r); padding: 6px 6px 6px 12px; min-width: 0; }
.url-ligne code { flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; word-break: break-all; color: var(--text-secondary); }

/* ── pastilles d'état (un point + un mot) ── */
.etat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 550; padding: 2px 8px 2px 6px;
  border-radius: 999px; white-space: nowrap; line-height: 1.4; }
.etat::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none; }
.etat.neutre { background: var(--bg-actif); color: var(--text-secondary); }
.etat.info { background: var(--info-bg); color: var(--info); }
.etat.warning { background: var(--warning-bg); color: var(--warning); }
.etat.ok { background: var(--success-bg); color: var(--success); }
.etat.rouge { background: var(--danger-bg); color: var(--danger); }
.etat.violet { background: rgba(142, 68, 173, 0.12); color: #8E44AD; }
:root[data-theme="sombre"] .etat.violet { background: rgba(187, 134, 252, 0.15); color: #BB86FC; }

/* ── Barre de filtres CRM (langage du Centre des Alertes) ── */
.filtres-l {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r);
  padding: 8px 12px;
}
.filtres-rang {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.filtres-rang + .filtres-rang {
  padding-top: 6px;
  border-top: 1px solid var(--border-subtle);
}
.filtres-droite {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.recherche-boite {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--field-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r);
  padding: 0 12px;
  min-height: 32px;
  width: min(320px, 100%);
  color: var(--text-muted);
  transition: border-color var(--t-ctl), box-shadow var(--t-ctl);
}
.recherche-boite:focus-within {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}
.recherche-boite .champ {
  border: 0;
  background: none;
  box-shadow: none;
  padding: 0;
  flex: 1;
  min-width: 0;
  min-height: 30px;
}

/* ── Tabulator habillé (Design sobre et épuré du Centre des Alertes) ── */
.table-boite { min-width: 0; width: 100%; }
.tabulator {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: var(--r);
  font-size: 13.5px;
  overflow: hidden;
  color: var(--text-primary);
}
.tabulator .tabulator-header {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  color: var(--text-muted);
  font-size: 11.5px;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
}
.tabulator .tabulator-header .tabulator-col {
  background: transparent;
  border-right: 0;
}
.tabulator .tabulator-header .tabulator-col .tabulator-col-content {
  padding: 10px 12px;
}
.tabulator .tabulator-header .tabulator-col .tabulator-col-title {
  font-size: 11.5px;
}
.tabulator .tabulator-header .tabulator-col.tabulator-sortable:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}
.tabulator .tabulator-header .tabulator-col .tabulator-col-content .tabulator-col-sorter .tabulator-arrow {
  border-bottom-color: var(--border-strong);
}
/* Aucune barre déplaçable ni séparateur disgracieux */
.tabulator .tabulator-col-resize-handle,
.tabulator .tabulator-col-resize-handle:hover {
  display: none !important;
  width: 0 !important;
  pointer-events: none !important;
}
.tabulator .tabulator-tableholder {
  background: var(--bg-surface);
  overflow-x: hidden !important; /* pas de scrollbar horizontale forcée */
}
.tabulator .tabulator-tableholder .tabulator-table {
  background: var(--bg-surface);
  color: var(--text-primary);
  width: 100% !important;
}
.tabulator-row {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-subtle);
  min-height: 50px;
  transition: background var(--t-ctl);
}
.tabulator-row.tabulator-row-even {
  background: var(--bg-surface);
}
.tabulator-row:hover, .tabulator-row.tabulator-row-even:hover {
  background: var(--bg-hover) !important;
  cursor: pointer;
}
.tabulator-row.tabulator-selected, .tabulator-row.tabulator-selected:hover {
  background: color-mix(in srgb, var(--accent) 14%, var(--bg-surface)) !important;
}
.tabulator-row.courante {
  box-shadow: inset 3px 0 0 var(--accent);
}
.tabulator-row .tabulator-cell {
  padding: 12px;
  border-right: 0;
  display: inline-flex;
  align-items: center;
}
.tabulator-row .tabulator-cell.tabulator-editing {
  border: 0;
  box-shadow: inset 0 0 0 2px var(--accent);
  padding: 4px;
}
.tabulator-row .tabulator-cell.tabulator-editing input,
.tabulator-row .tabulator-cell.tabulator-editing select,
.tabulator-row .tabulator-cell.tabulator-editing textarea {
  border-radius: 10px;
  padding: 4px 8px;
  background: var(--field-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-strong);
}
.tabulator .tabulator-footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}
.tabulator .tabulator-tableholder .tabulator-placeholder .tabulator-placeholder-contents,
.tabulator .tabulator-placeholder .tabulator-placeholder-contents {
  color: var(--text-secondary);
  font-weight: 450;
  font-size: 13.5px;
  padding: 24px;
  text-align: left;
  display: block;
  white-space: normal;
}
.tabulator .tabulator-tableholder .tabulator-placeholder {
  justify-content: flex-start;
}
.tabulator-edit-list {
  background: var(--bg-surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  box-shadow: var(--shadow-overlay);
  color: var(--text-primary);
}
.tabulator-edit-list .tabulator-edit-list-item {
  color: var(--text-primary);
  padding: 8px 12px;
}
.tabulator-edit-list .tabulator-edit-list-item.active,
.tabulator-edit-list .tabulator-edit-list-item:hover,
.tabulator-edit-list .tabulator-edit-list-item.focused {
  background: var(--accent-bg);
  color: var(--text-primary);
  outline: 0;
}
.tabulator-row.nouvelle {
  animation: apparait var(--t-surf);
}
.cliquable {
  cursor: pointer;
  user-select: none;
  transition: transform var(--t-ctl), opacity var(--t-ctl);
}
.cliquable:hover {
  transform: scale(1.05);
  opacity: 0.9;
}

/* ── historique global (panneau coulissant) ── */
.histo-liste {
  display: flex;
  flex-direction: column;
  gap: 0;
  max-height: calc(100vh - 200px);
  overflow-y: auto;
  padding-right: 2px;
  position: relative;
}
/* ligne de timeline */
.histo-liste::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 20px;
  bottom: 20px;
  width: 1px;
  background: var(--border-subtle);
  pointer-events: none;
}
.carte-histo {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 10px 12px 10px 40px;
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
  transition: background var(--t-ctl);
}
.carte-histo:last-child { border-bottom: 0; }
.carte-histo:hover { background: var(--bg-hover); }
/* point timeline coloré par type */
.carte-histo::before {
  content: "";
  position: absolute;
  left: 9px;
  top: 14px;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--border-strong);
  border: 2px solid var(--bg-surface);
  z-index: 1;
}
.carte-histo[data-quoi="bot"]::before { background: #8E44AD; }
.carte-histo[data-quoi="statut"]::before { background: var(--info); }
.carte-histo[data-quoi="temperature"]::before { background: var(--warning); }
.carte-histo[data-quoi="reattribue"]::before { background: var(--success); }
.carte-histo[data-quoi="notes"]::before { background: var(--accent-t); }
.carte-histo[data-quoi="relance"]::before { background: var(--danger); }
.carte-histo.est-annule { opacity: 0.5; }
.carte-histo.est-annule::before { background: var(--border-strong) !important; }
.histo-haut {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}
.histo-qui {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-weight: 600;
}
.at-lien {
  color: var(--accent-t);
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  background: var(--accent-bg);
  padding: 1px 6px;
  border-radius: 999px;
}
.at-lien:hover { text-decoration: underline; }
.histo-bas {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.histo-action {
  flex: 1;
  color: var(--text-secondary);
  font-size: 12.5px;
}
.cellule-contact { display: flex; flex-direction: column; gap: 4px; min-width: 0; width: 100%; padding: 2px 0; }
.ligne-at { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; min-width: 0; }
.sous-l { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted); min-width: 0; }
.sous-txt { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; max-width: 100%; }
.a-ecrit { font-size: 11.5px; font-weight: 550; color: var(--success); background: var(--success-bg); border-radius: 999px; padding: 0 8px; white-space: nowrap; }
.vu { font-size: 11.5px; color: var(--text-secondary); background: var(--bg-actif); border-radius: 999px; padding: 0 8px; white-space: nowrap; }
.expire { display: inline-flex; align-items: flex-start; gap: 4px; white-space: normal; font-size: 12px; font-weight: 600; color: var(--danger); }
.expire .ic { width: 13px; height: 13px; }
.actions-ligne { display: flex; gap: 8px; justify-content: flex-end; width: 100%; flex-wrap: wrap; }
/* invites d'édition VISIBLES au repos (audit 29/09 : transparentes hors survol, donc jamais vues
   au toucher ni au clavier) — plus marquées au survol de la ligne */
.vide-edit { color: var(--text-muted); font-size: 12.5px; transition: color var(--t-ctl); }
.tabulator-row:hover .vide-edit { color: var(--accent-t); }
.note-texte { display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; white-space: normal; font-size: 13px; }

/* ── cartes contact (téléphone) ── */
.liste-cartes { display: grid; gap: 8px; }
.carte-contact { padding: 16px; display: grid; gap: 8px; cursor: pointer; transition: background var(--t-ctl); }
.carte-contact:hover { background: var(--bg-hover); }
.carte-contact.choisie { background: var(--accent-bg); }
.carte-contact .ligne-at .etat { margin-left: auto; }
.carte-contact .coche-carte { width: 20px; height: 20px; }
.carte-contact .actions-ligne { justify-content: flex-start; }
.carte-contact .actions-ligne .btn { min-height: 40px; padding: 0 16px; font-size: 13.5px; }
.note-carte { font-size: 13px; color: var(--text-secondary); white-space: pre-wrap; word-break: break-word; }

/* ── en-tête Contacts : quota, prendre ── */
.quota { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--text-secondary); }
.quota b { color: var(--text-primary); }
.info-file { display: inline-flex; align-items: center; gap: 8px; }
.info-file b { color: var(--text-primary); }
.prendre-boite { display: inline-flex; flex-direction: column; align-items: flex-end; gap: 4px; max-width: 360px; }
.prendre-raison { font-size: 12px; text-align: right; }
.jauge { height: 8px; background: var(--bg-actif); border-radius: 999px; overflow: hidden; position: relative; }
.jauge i { display: block; height: 100%; background: var(--accent); border-radius: 999px; width: 100%; transform: scaleX(0); transform-origin: left;
  transition: transform 400ms cubic-bezier(.2,.7,.2,1); }
.jauge.indet i { width: 35%; animation: balaye 1.4s ease-in-out infinite; }
.jauge.mini { display: inline-block; width: 90px; height: 6px; }
.jauge.mini.pleine i { background: var(--danger); }

/* ── barre de lot (ce qui flotte : l'ombre) ── */
.lot { position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, calc(100% + 56px)); visibility: hidden;
  background: color-mix(in srgb, var(--bg-surface) 96%, var(--accent));
  color: var(--text-primary); border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent); border-radius: 999px;
  padding: 6px 6px 6px 18px; display: flex; align-items: center; gap: 6px; box-shadow: var(--shadow-overlay), 0 0 0 4px color-mix(in srgb, var(--accent) 15%, transparent);
  transition: transform var(--t-surf), visibility var(--t-surf); z-index: 30; flex-wrap: nowrap; max-width: calc(100vw - 32px); }
.lot.visible { transform: translate(-50%, 0); visibility: visible; }
.lot-n { font-weight: 700; margin-right: 4px; white-space: nowrap; }
.lot .btn.petit { border-radius: 999px; }

/* ── tiroir (dialogue) ── */
.voile { position: fixed; inset: 0; background: var(--voile); opacity: 0; pointer-events: none; transition: opacity var(--t-surf); z-index: 40; }
.voile.ouvert { opacity: 1; pointer-events: auto; }
.tiroir { position: fixed; top: 12px; right: 12px; bottom: 12px; width: min(560px, calc(100vw - 24px)); background: var(--bg-surface);
  border-radius: var(--r); box-shadow: var(--shadow-overlay); z-index: 41; display: flex; flex-direction: column;
  transform: translateX(24px); opacity: 0; visibility: hidden; transition: transform var(--t-surf), opacity var(--t-surf), visibility var(--t-surf); }
/* visible TOUT DE SUITE à l'ouverture : le focus ne se pose pas sur un élément encore caché */
.tiroir.ouvert { transform: none; opacity: 1; visibility: visible; transition: transform var(--t-surf), opacity var(--t-surf), visibility 0s; }
.tiroir-tete { padding: 20px 16px 12px 24px; display: flex; gap: 12px; align-items: flex-start; }
.tiroir-tete h2 { flex: 1; margin: 4px 0 0; font-size: 17px; font-weight: 600; line-height: 1.35; word-break: break-word; font-family: var(--font); }
.tiroir-tete h2:focus { outline: none; }
.tiroir-corps { padding: 0 24px 24px; overflow: auto; flex: 1; display: flex; flex-direction: column; gap: 16px; }
.tiroir-corps > * { flex-shrink: 0; }
.meta-l { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.resume { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1px; border-radius: var(--r); overflow: hidden; background: var(--bg-raised);
  box-shadow: inset 0 0 0 1px var(--border-subtle); }
.resume .fait { box-shadow: 1px 1px 0 var(--border-subtle); }
.fait { display: flex; flex-direction: column; gap: 4px; padding: 12px 16px; background: var(--bg-raised); min-width: 0; }
.fait-lib { font-size: 11px; color: var(--text-muted); font-weight: 550; }
.fait-val { font-size: 13px; font-weight: 550; min-height: 20px; overflow: hidden; text-overflow: ellipsis; }
.explication { color: var(--text-secondary); background: var(--bg-raised); border-radius: var(--r); padding: 12px 16px; white-space: pre-wrap; word-break: break-word; }
.explication blockquote { margin: 8px 0 0; font-size: 13px; }
.t-sec { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; border-top: 1px solid var(--border-subtle); }
.t-sec-titre { display: flex; align-items: center; gap: 8px; margin: 0; font-size: 13px; font-weight: 600; }
.t-sec-titre .ic { width: 15px; height: 15px; color: var(--text-muted); }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form .plein-l { grid-column: 1 / -1; }
.actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.actions form { margin: 0; }
.motifs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.motifs .btn { justify-content: flex-start; min-height: 44px; }
.histo { font-size: 12.5px; display: flex; flex-direction: column; gap: 8px; }
.histo-l { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 12px; }
.histo .quand { color: var(--text-muted); }
.kv { display: grid; grid-template-columns: 120px minmax(0,1fr); gap: 8px 12px; font-size: 13px; margin: 0; align-items: center; }
.kv dt { color: var(--text-muted); } .kv dd { margin: 0; }
.pile-cases { display: flex; flex-direction: column; gap: 12px; }

/* ── toasts ── */
.toasts { position: fixed; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px)); z-index: 60; display: flex;
  flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast { display: inline-flex; align-items: center; gap: 8px; padding: 8px 8px 8px 14px; min-height: 40px; border-radius: var(--r); background: var(--bg-surface);
  color: var(--text-primary); border: 1px solid var(--border-strong); box-shadow: var(--shadow-overlay); font-size: 13px; opacity: 0; transform: translateY(8px);
  transition: opacity var(--t-surf), transform var(--t-surf); pointer-events: auto; max-width: min(520px, calc(100vw - 32px)); }
.toast > span { padding-right: 6px; }
.toast .ic { color: var(--success); }
.toast.err { border-color: color-mix(in srgb, var(--danger) 45%, transparent); }
.toast.err .ic { color: var(--danger); }
.toast.ouvert { opacity: 1; transform: none; }

/* ── Extraction ── */
.grille-groupes { display: grid; gap: 8px; }
.groupe-carte { display: grid; gap: 12px; padding: 16px 20px; }
.groupe-carte .ligne { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.groupe-carte h3 { margin: 0; font-size: 14.5px; font-weight: 600; }
.groupe-carte .pct { margin-left: auto; font-size: 22px; font-weight: 650; }
.groupe-carte.en-cours { background: var(--bg-surface); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
.groupe-carte.compacte { padding: 12px 16px; }
.metriques { display: flex; gap: 8px 20px; flex-wrap: wrap; color: var(--text-secondary); font-size: 12.5px; }
.metriques b { color: var(--text-primary); font-weight: 600; }
.groupe-carte.compacte .metriques { font-size: 12px; }
.rang { width: 24px; height: 24px; border-radius: 50%; background: var(--info-bg); color: var(--info); display: inline-grid; place-items: center; font-size: 12px; font-weight: 650; flex: none; }
.limites { display: flex; gap: 8px; flex-wrap: wrap; } .limites .etat { cursor: help; }
.sous-titre { font-size: 12px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--text-muted); margin: 8px 0 -8px; }
.repli summary { cursor: pointer; color: var(--text-secondary); font-weight: 550; padding: 8px 4px; list-style: none; display: flex; align-items: center; gap: 8px; border-radius: var(--r); }
details > summary::-webkit-details-marker { display: none; }
details > summary::before { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(-45deg); transition: transform var(--t-ctl); flex: none; }
details[open] > summary::before { transform: rotate(45deg); }
.repli .grille-groupes { margin-top: 8px; }

/* ── Équipe ── */
.tableau-simple { width: 100%; border-collapse: collapse; }
.tableau-simple th { font-size: 12px; color: var(--text-muted); font-weight: 550; text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border-subtle); white-space: nowrap; }
.tableau-simple td { padding: 12px; border-top: 1px solid var(--border-subtle); vertical-align: middle; }
.tableau-simple tbody tr:first-child td { border-top: 0; }
.tableau-simple tr:hover td { background: var(--bg-hover); }
.tableau-simple th.num, .tableau-simple td.num { text-align: right; }
.tableau-simple th:first-child, .tableau-simple td:first-child { padding-left: 20px; }
.tableau-simple th:last-child, .tableau-simple td:last-child { padding-right: 20px; }
.tableau-simple.serre td, .tableau-simple.serre th { padding-left: 8px; padding-right: 8px; }
.tableau-simple tr.inactif td { color: var(--text-muted); }
.tableau-simple .titre-l { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.droite-l { text-align: right; }
.qui-l { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.defile { overflow-x: auto; }
.deux-colonnes { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 16px; }
.barres { display: grid; gap: 8px; }
.barre-ligne { display: grid; grid-template-columns: minmax(0,1fr) 90px 40px; align-items: center; gap: 12px; font-size: 13px; }
.barre-ligne b { text-align: right; }
.plus-l { padding: 0 20px 12px; } .plus-l summary { cursor: pointer; color: var(--text-secondary); padding: 8px 0; display: flex; align-items: center; gap: 8px; }
.ligne-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin: 0; }
.ligne-form input[name=pseudo], #excl-motif { flex: 1; min-width: 200px; }
.mobile-seul { display: none; }
.setter-carte { display: flex; flex-direction: column; gap: 8px; padding: 16px 20px; border-top: 1px solid var(--border-subtle); }
.setter-carte.inactif { color: var(--text-muted); }
.etats-l:empty { display: none; }
.mini-chiffres { display: grid; grid-template-columns: repeat(4, minmax(0,1fr)); gap: 8px; margin: 0; }
.mini-chiffres div { display: flex; flex-direction: column; gap: 2px; }
.mini-chiffres dt { font-size: 11px; color: var(--text-muted); }
.mini-chiffres dd { margin: 0; font-size: 16px; font-weight: 650; min-height: 22px; display: flex; align-items: center; }

/* ── Réglages ── */
.grille-reglages { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; }
.seuil { display: inline-flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.etat-sauve { font-size: 12px; }
.liste-exclusions { display: flex; flex-direction: column; }
.exclu-ligne { display: flex; align-items: center; gap: 12px; padding: 8px 0; border-top: 1px solid var(--border-subtle); flex-wrap: wrap; }
.exclu-ligne .btn { margin-left: auto; }

/* ── guide ── */
.guide-trou { position: fixed; border-radius: var(--r); box-shadow: 0 0 0 9999px rgba(18,17,16,.55); transition: all var(--t-surf); pointer-events: none; z-index: 80; }
.guide-bulle { position: fixed; z-index: 81; width: min(340px, calc(100vw - 32px)); background: var(--bg-surface); color: var(--text-primary);
  border-radius: var(--r); box-shadow: var(--shadow-overlay); padding: 16px 20px; transition: top var(--t-surf), left var(--t-surf); animation: apparait var(--t-surf); }
.guide-bulle h4 { margin: 0 0 8px; font-size: 15px; } .guide-bulle p { margin: 0 0 16px; color: var(--text-secondary); }
.guide-bulle .pied { display: flex; align-items: center; gap: 8px; } .guide-bulle .pied .etape { font-size: 12px; color: var(--text-muted); margin-right: auto; }

/* ── pages seules (connexion, invitation, erreur sans session) ── */
.seul { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 16px; }
.boite { background: var(--bg-surface); border: 1px solid var(--bord-carte); border-radius: var(--r); padding: 32px; width: min(400px, 100%);
  display: flex; flex-direction: column; gap: 16px; }
.boite h1 { font-size: 20px; margin: 0; }
.boite p { margin: 0; }
.boite .champ { width: 100%; }
.code-err { font-size: 12px; font-weight: 650; letter-spacing: .06em; text-transform: uppercase; color: var(--text-muted); margin: 0; }
.erreur-page { max-width: 560px; }
.erreur-page .carte-corps { padding: 24px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.erreur-page h2 { margin: 0; font-size: 20px; }
.erreur-page p { margin: 0; }

@keyframes apparait { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
@keyframes balaye { 0% { transform: translateX(-100%); } 100% { transform: translateX(300%); } }

/* ── étroit : la barre passe en bas, icône + mot ── */
@media (max-width: 1100px) {
  .deux-colonnes { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .barre { position: fixed; top: auto; bottom: 0; left: 0; right: 0; height: auto; z-index: 20; flex-direction: row;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom, 0px)); border-right: 0; border-top: 1px solid var(--border-subtle); }
  .barre-haut, .barre-sep, .barre-pied, .lib-long { display: none; }
  .barre-nav { flex-direction: row; flex: 1; justify-content: space-around; gap: 0; }
  .nav { flex-direction: column; gap: 2px; padding: 6px 4px; font-size: 11px; position: relative; min-height: 0; flex: 1; text-align: center; min-width: 0; }
  .nav .lib { flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
  .nav .ic { width: 20px; height: 20px; }
  .nav .compte { position: absolute; top: 0; left: calc(50% + 6px); min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
  .zone { padding-bottom: 72px; }
  .shell { background: none; }
  .tete { padding: 12px 16px; gap: 12px; position: static; }
  .tete h1 { font-size: 19px; }
  .tete-outils { display: flex; order: 2; }
  .tete-titre { order: 1; }
  .filtres-rang { padding: 7px 10px; }
  .filtres-rang + .filtres-rang { gap: 6px; }
  .tete-droite { order: 3; width: 100%; }
  .tete-droite .btn.plein { flex: 1; }
  .prendre-boite { flex: 1; align-items: stretch; max-width: none; }
  .prendre-raison { text-align: left; }
  .corps { padding: 16px; gap: 12px; }
  .recherche-boite { width: 100%; flex-basis: 100%; }
  .filtres-l .champ.petit { flex: 1 1 140px; }
  .filtres-droite { margin-left: 0; }
  .bureau, .bureau-seul { display: none !important; }
  .mobile-seul { display: block; }
  .seg { width: 100%; }
  .seg a { flex: 1 1 auto; justify-content: center; padding: 6px 8px; }
  .form, .motifs { grid-template-columns: 1fr; }
  .resume { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lot { bottom: 76px; left: 16px; right: 16px; transform: translateY(calc(100% + 120px)); max-width: none; }
  .lot.visible { transform: none; }
  .toasts { bottom: 80px; left: 16px; right: 16px; align-items: stretch; }
  .toast { max-width: none; }
  .tuiles { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .tuile-val { font-size: 21px; }
  .tiroir { top: auto; left: 0; right: 0; bottom: 0; width: 100%; max-height: 92vh; border-radius: var(--r) var(--r) 0 0; transform: translateY(24px); }
  .tiroir-corps { padding: 0 16px 24px; }
  .tiroir-tete { padding: 16px 12px 8px 16px; }
  .groupe-carte { padding: 16px; }
  .groupe-carte .pct { font-size: 19px; }
  .tableau-simple th:first-child, .tableau-simple td:first-child { padding-left: 16px; }
  .tableau-simple th:last-child, .tableau-simple td:last-child { padding-right: 16px; }
  .histo-l { grid-template-columns: 1fr; gap: 0; }
  .carte-tete { padding: 16px 16px 8px; }
  .carte-corps { padding: 4px 16px 16px; }
  .setter-carte { padding: 16px; }
}
/* ── 08/10 : activité, intention, journée du setter, classement ──────────────────────────────── */
/* L'activité dit la date du DERNIER message (serveur : contacts.tier_activite). Le vert ne veut dire
   que « vivant » ; plus c'est vieux, plus ça s'efface. */
.act { font-size: 11.5px; font-weight: 550; border-radius: 999px; padding: 0 8px; white-space: nowrap; line-height: 1.6;
  background: var(--bg-actif); color: var(--text-secondary); }
.act-maintenant, .act-aujourd_hui { background: var(--success-bg); color: var(--success); }
.act-maintenant { font-weight: 650; }
.act-maintenant::before { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: currentColor;
  margin-right: 6px; vertical-align: 1px; }
.act-ce_mois { color: var(--text-muted); }
.act-ancien, .act-inconnu { background: none; color: var(--text-muted); padding: 0; font-weight: 500; }
/* ce qu'il a écrit : une ligne, coupée proprement — le tiroir le montre en entier */
.extrait-l { font-size: 12.5px; color: var(--text-secondary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.tabulator .actions-ligne { flex-wrap: nowrap; }

/* l'en-tête du setter : objectif (cible) · série · rang */
.journee { display: inline-flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.journee-obj { display: inline-flex; align-items: center; gap: 12px; min-height: 36px; padding: 0 16px; border-radius: 999px;
  background: var(--bg-surface); border: 1px solid var(--bord-carte); font-size: 13px; color: var(--text-secondary); }
.journee-chiffre b { font-size: 16px; font-weight: 650; color: var(--text-primary); }
.journee-obj .jauge { width: 120px; }
.journee-obj.faite .jauge i, .jauge.mini.faite i { background: var(--success); }
.journee-mot { font-size: 12px; color: var(--text-muted); white-space: nowrap; }
.journee-obj.faite .journee-mot { color: var(--success); font-weight: 600; }
.puce-jeu { display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 12px; border-radius: 999px; font: inherit;
  font-size: 13px; font-weight: 600; background: var(--bg-surface); border: 1px solid var(--bord-carte); color: var(--text-primary); white-space: nowrap; }
button.puce-jeu { cursor: pointer; transition: background var(--t-ctl); }
button.puce-jeu:hover { background: var(--bg-hover); }
.puce-jeu .ic { width: 15px; height: 15px; color: var(--text-muted); }
.puce-jeu.serie .ic, .serie .ic { color: var(--warning); }
.puce-jeu sup, .rang-l sup, .mini-chiffres sup { font-size: .65em; }

/* tableau de bord : la journée, la série, le rang de chacun */
.jour-l { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.serie { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; }
.serie .ic { width: 14px; height: 14px; }
.rang-l { color: var(--text-muted); font-size: 12px; margin-left: 4px; }
.tuile-cle .jauge { margin-top: 4px; }
.classement { list-style: none; margin: 0; padding: 4px 20px 20px; display: grid; gap: 4px; }
.pile > .classement { padding: 0; }
.classement li { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: var(--r); font-size: 13.5px; min-width: 0; }
.classement li.moi { background: var(--bg-actif); }
.classement li.tete .rang { background: var(--accent-bg); color: var(--accent-t); }
.classement .pousse { font-weight: 600; }
.classement .muet { min-width: 88px; text-align: right; font-size: 12.5px; }
.barre-ligne.vv-maintenant .jauge i, .barre-ligne.vv-aujourd_hui .jauge i { background: var(--success); }
.barre-ligne.vv-cette_semaine .jauge i, .barre-ligne.vv-ce_mois .jauge i { background: color-mix(in srgb, var(--success) 40%, var(--text-muted)); }
.barre-ligne.vv-ancien .jauge i, .barre-ligne.vv-inconnu .jauge i { background: var(--text-muted); }
.outils-icones { gap: 2px; }
.ecoute-l { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 16px 0 0; font-size: 12.5px; }

/* « Prendre » et le choix du groupe sur UNE ligne : le groupe collait sous le bouton, contre le bord
   de l'en-tête (vu par Ugo, 08/10). La raison d'un bouton grisé passe dessous, sur toute la largeur. */
.prendre-boite { display: grid; grid-template-columns: minmax(0, 240px) auto; grid-template-areas: "groupe bouton" "raison raison";
  align-items: center; column-gap: 8px; row-gap: 4px; max-width: none; }
.prendre-boite #prendre { grid-area: bouton; }
.prendre-boite #prendre-groupe { grid-area: groupe; width: 100%; min-height: 36px; }
.prendre-boite .prendre-raison { grid-area: raison; }

/* La liste qui s'ouvre au clic : à notre style (rayon, ombre de ce qui flotte, ambre pour le choix),
   plus le menu système bleu et carré. Navigateurs qui ne savent pas faire : menu natif, inchangé. */
@supports (appearance: base-select) {
  select.champ, select.champ::picker(select) { appearance: base-select; }
  select.champ { display: inline-flex; align-items: center; justify-content: space-between; gap: 8px; cursor: pointer;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  select.champ::picker-icon { color: var(--text-muted); transition: rotate var(--t-ctl); }
  select.champ:open::picker-icon { rotate: 180deg; }
  select.champ::picker(select) { border: 1px solid var(--bord-carte); border-radius: var(--r); background: var(--bg-surface);
    box-shadow: var(--shadow-overlay); padding: 4px; margin-block: 4px; max-height: min(420px, 60vh); max-width: 380px; }
  select.champ option { padding: 8px 12px; border-radius: calc(var(--r) - 4px); font-size: 13px; color: var(--text-primary);
    cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  select.champ option:hover, select.champ option:focus-visible { background: var(--bg-hover); outline: none; }
  select.champ option:checked { background: var(--accent-bg); color: var(--accent-t); font-weight: 600; }
  select.champ option::checkmark { display: none; }
}

@media (max-width: 900px) {
  .journee { width: 100%; }
  .journee-obj { flex: 1 1 100%; justify-content: space-between; }
  .journee-obj .jauge { flex: 1; width: auto; }
  .prendre-boite { grid-template-columns: 1fr; grid-template-areas: "bouton" "groupe" "raison"; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: 1ms !important; transition-duration: 1ms !important; } }
