/* ===== Composants communs du panneau (refonte validée le 17/11/2026) =====
   Deux familles cohabitent :
   - les briques de la refonte (lib/ui/kit.dart) : en-tête de section .heros, .chiffres, .onglets, .puces, .liste, .etat, .tiroir… ;
   - les classes des écrans pas encore refaits (.card, .stats, .btn.primary, .badge, .chip, .tabs, tableaux…), qui prennent
     le nouveau style sans changer de nom. Chaque écran refait peut passer aux briques à son rythme. */

/* ---------- En-tête de section (« héros ») : sur-titre, titre, phrase, actions, emblème en volume ---------- */
.heros { position: relative; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 24px; padding: 26px 0; min-height: 196px; }
.heros-txt { min-width: 0; }
.sur { margin: 0 0 10px; font: 500 11.5px/1 var(--font-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sur .fil { color: var(--faint); } .sur a { text-decoration: none; } .sur a:hover { color: var(--text); }
.heros h1 { font-size: clamp(30px, 3.6vw, 46px); line-height: 1.05; font-weight: 700; text-wrap: balance; overflow-wrap: anywhere; }
.accent-txt, .heros h1 .accent { background: linear-gradient(100deg, var(--coral-300), var(--coral-500) 60%, #FFB199);
  -webkit-background-clip: text; background-clip: text; color: transparent; }
.heros .phrase { margin: 12px 0 0; max-width: 640px; font-size: 16px; line-height: 1.45; color: var(--muted); }
.heros .phrase b { color: var(--text); font-weight: 600; }
.heros .phrase .t-bad { color: var(--bad); font-weight: 600; }
.heros-actes { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.embleme { position: relative; width: 200px; height: 200px; margin: -30px 0 -24px; view-transition-name: embleme; pointer-events: none; }
.embleme::before { content: ""; position: absolute; inset: 14%; border-radius: 50%; background: radial-gradient(closest-side, var(--accent-halo), transparent); }
.embleme img { position: relative; width: 100%; height: 100%; object-fit: contain; display: block;
  transform: translate3d(calc(var(--px, 0) * 10px), calc(var(--py, 0) * 8px), 0) rotate(calc(var(--px, 0) * 3deg));
  transition: transform .6s var(--ease); }
.embleme .entree, .embleme .flotte { position: absolute; inset: 0; }
.embleme .flotte { animation: flotte 7s ease-in-out infinite; }
@keyframes flotte { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-9px); } }
.embleme-s { width: 64px; height: 64px; object-fit: contain; flex: none; }

/* ---------- En-tête de page (écrans pas encore refaits : pageHead) ---------- */
.page-head { display: flex; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 14px 0 24px; }
.page-head:has(> .avatar) { align-items: center; }
.page-head h1 { font-size: clamp(26px, 2.6vw, 34px); line-height: 1.1; }
.page-head .sub { color: var(--muted); margin: 6px 0 0; font-size: 14.5px; }
.page-head .eyebrow { margin-bottom: 6px; }
.head-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-weight: 500; margin-top: 8px; }
.back:hover { color: var(--text); }
/* Un seul titre par page glisse d'une page à l'autre. */
#contenu > .heros h1, #contenu > .page-head:not(.heros ~ .page-head) h1 { view-transition-name: titre; }
#contenu > .heros ~ .page-head h1 { view-transition-name: none; }

/* ---------- Onglets : témoin qui glisse ----------
   .onglets (brique) et .tabs (écrans pas encore refaits) ont le même aspect.
   Témoin : dans le lien actif (navigation par adresse, il glisse d'une page à l'autre),
   ou frère des liens (onglets changés par script : effets.js le place, aussi après document.fonts.ready). */
.onglets, .tabs { position: relative; display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--r-s); background: var(--surface-2);
  border: 1px solid var(--border); margin: 0 0 18px; max-width: 100%; overflow-x: auto; scrollbar-width: none; vertical-align: top; }
.onglets a, .onglets button, .tabs a { position: relative; z-index: 1; display: flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: var(--r-xs);
  border: 0; background: none; font: 600 13px/18px var(--font-body); color: var(--muted); cursor: pointer; transition: color .2s;
  white-space: nowrap; text-decoration: none; }
.onglets a:hover, .onglets button:hover, .tabs a:hover { color: var(--text); }
.onglets a.on, .onglets button.on, .tabs a.on { color: var(--text); }
.onglets .temoin, .tabs a.on::before { position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 0; border-radius: var(--r-xs); background: var(--surface-solid);
  box-shadow: 0 1px 0 var(--line-top) inset, 0 4px 14px -6px rgba(0, 0, 0, .45);
  transition: transform .45s var(--spring), width .45s var(--spring); pointer-events: none; }
.tabs a.on::before { content: ""; inset: 0; z-index: -1; }
.onglets a > .temoin, .onglets button > .temoin { inset: 0; top: 0; bottom: 0; transition: none; }
.sec-tabs a > .temoin { view-transition-name: onglet; }
.onglets .vu { width: 6px; height: 6px; border-radius: 50%; background: var(--warn); }
.tabs .count, .onglets .count { background: var(--mute-soft); color: var(--muted); }
.tabs a.on .count, .onglets .on .count { background: var(--accent); color: var(--on-accent); }
.sec-tabs { margin: 2px 0 6px; }
.tab-warn { width: 7px; height: 7px; border-radius: 50%; background: var(--warn); display: inline-block; }

/* ---------- Cartes ---------- */
.carte, .card { position: relative; border-radius: var(--r-card); background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-1);
  isolation: isolate; min-width: 0; }
.card { padding: 20px; margin-bottom: 16px; }
.carte > .tete { display: flex; align-items: center; gap: 10px; padding: 18px 20px 6px; }
.carte > .tete h2 { font-size: 15.5px; font-weight: 600; }
.carte > .tete .doux { margin-left: auto; font: 500 11px var(--font-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.carte > .corps { padding: 12px 20px 20px; }
.card-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin: -2px 0 14px; }
.card-head h2 { display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; font-size: 15.5px; }
.card-head h2 .ic { color: var(--muted); }
.card-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 18px 20px 0; }
.card > .alert:last-child { margin: 16px 0 0; }
/* Lumière qui suit le pointeur (effets.js pose --mx, --my) et liseré corail. */
.lumiere::before { content: ""; position: absolute; inset: 0; border-radius: inherit; z-index: -1; opacity: 0; transition: opacity .35s; pointer-events: none;
  background: radial-gradient(420px circle at var(--mx, 50%) var(--my, 50%), var(--glow), transparent 60%); }
.lumiere:hover::before { opacity: 1; }
.lumiere::after { content: ""; position: absolute; inset: -1px; border-radius: inherit; z-index: -1; padding: 1px; opacity: 0; transition: opacity .35s; pointer-events: none;
  background: radial-gradient(260px circle at var(--mx, 50%) var(--my, 50%), color-mix(in srgb, var(--coral-500) 70%, transparent), transparent 70%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; }
.lumiere:hover::after { opacity: 1; }
a.carte, .carte.lien, a.card { text-decoration: none; color: inherit; transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
a.carte:hover, .carte.lien:hover, a.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }

/* ---------- Grilles ---------- */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr); }
.g-side { grid-template-columns: minmax(0, 1fr) 340px; }
.grid > .card { margin-bottom: 0; }
.grid.top { align-items: start; }
.section { margin-bottom: 16px; }
.grille2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.pile { display: grid; gap: 18px; align-content: start; }
.grille3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.side-stack { display: flex; flex-direction: column; gap: 16px; min-width: 0; } .side-stack > .card { margin: 0; }
.sep { height: 1px; background: var(--border); margin: 4px 0; }
.ligne-flex { display: flex; align-items: center; gap: 10px; }

/* ---------- Chiffres clés (brique .chiffres) et chiffres d'en-tête (.stats, écrans pas encore refaits) ---------- */
.chiffres { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-bottom: 18px; }
.chiffre { padding: 16px 18px 14px; display: grid; gap: 4px; overflow: hidden; align-content: start; }
.chiffre .lib { font: 500 11px/1.2 var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--muted); display: flex; align-items: center; gap: 8px; }
.chiffre .val { font: 700 28px/1.15 var(--font-display); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chiffre:has(.trace) .val, .chiffre:has(.anneau) .val { padding-right: 70px; }
.chiffre .sous { font-size: 12.5px; color: var(--muted); }
.chiffre:has(.trace) .sous { padding-right: 104px; }
.chiffre:has(.anneau) .sous { padding-right: 64px; }
.val.t-bad, .chiffre .val.t-bad { color: var(--bad); } .val.t-warn { color: var(--warn); } .val.t-ok { color: var(--ok); }
.chiffre svg.trace { position: absolute; right: 10px; bottom: 10px; width: 96px; height: 34px; overflow: visible; }
.trace path.l { fill: none; stroke: var(--coral-500); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.trace path.a { fill: var(--accent-soft); }
.anneau { position: absolute; right: 14px; top: 50%; translate: 0 -50%; width: 54px; height: 54px; }
.anneau circle { fill: none; stroke-width: 6; }
.anneau .fd { stroke: var(--surface-3); } .anneau .av { stroke: var(--coral-500); stroke-linecap: round; transform: rotate(-90deg); transform-origin: center; }
.anneau text { font: 600 12px var(--font-mono); fill: var(--text); text-anchor: middle; dominant-baseline: central; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 14px; margin: 0 0 18px; }
.stat { position: relative; display: flex; flex-direction: column; gap: 4px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-card);
  box-shadow: var(--shadow-1); padding: 16px 18px 14px; min-width: 0; text-decoration: none; color: var(--text);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease); }
a.stat:hover { transform: translateY(-3px); box-shadow: var(--shadow-2); }
.stat .caption { letter-spacing: .1em; }
.stat b { font: 700 26px/1.15 var(--font-display); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.stat b.t-bad { color: var(--bad); } .stat b.t-warn { color: var(--warn); } .stat b.t-ok { color: var(--ok); }
.stat small { color: var(--muted); font-size: 12.5px; line-height: 17px; }

/* ---------- Boutons ----------
   Un seul bouton corail par écran : .btn.primary (ou .btn.corail). .dark = .fonce, .ghost = .fantome, .sm = .petit. */
.btn { position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: var(--r-ctl);
  border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text); font: 600 13.5px/1 var(--font-body); cursor: pointer;
  white-space: nowrap; text-decoration: none; overflow: hidden; transition: transform .2s var(--ease), border-color .2s, background .2s; }
.btn:hover { transform: translateY(-1px); border-color: color-mix(in srgb, var(--text) 30%, transparent); }
.btn:active { transform: translateY(0) scale(.98); }
.btn.sm, .btn.petit { height: 32px; padding: 0 12px; border-radius: var(--r-xs); font-size: 12.5px; gap: 6px; }
.btn.primary, .btn.corail { border: 0; color: var(--on-accent); background: linear-gradient(180deg, var(--coral-300), var(--coral-500));
  box-shadow: 0 10px 24px -10px var(--accent-halo), 0 1px 0 rgba(255, 255, 255, .4) inset; }
.btn.primary:hover, .btn.corail:hover { border: 0; }
/* Reflet qui passe sur le bouton corail au survol. */
.btn.primary::after, .btn.corail::after { content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .45) 50%, transparent 65%);
  transform: translateX(-120%); transition: transform .7s var(--ease); }
.btn.primary:hover::after, .btn.corail:hover::after { transform: translateX(120%); }
.btn.dark, .btn.fonce { border-color: transparent; background: var(--text); color: var(--bg); }
.btn.ghost, .btn.fantome { background: transparent; border-color: transparent; color: var(--muted); }
.btn.ghost:hover, .btn.fantome:hover { color: var(--text); background: var(--surface-2); }
.btn.danger { color: var(--bad); border-color: color-mix(in srgb, var(--bad) 35%, var(--border-strong)); }
.btn.danger:hover { background: var(--bad-soft); border-color: var(--bad); }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; pointer-events: none; }
.btn.icon-only, .btn.icone { width: 40px; padding: 0; } .btn.sm.icon-only, .btn.icone.petit { width: 32px; }
.btn .ic { width: 18px; height: 18px; } .btn.sm .ic { width: 16px; height: 16px; }
.icon-btn { width: 40px; height: 40px; border-radius: var(--r-ctl); border: 1px solid var(--border-strong); background: var(--surface-2); color: var(--text);
  display: grid; place-items: center; cursor: pointer; padding: 0; flex: none; transition: border-color var(--fast); }
.icon-btn:hover { border-color: color-mix(in srgb, var(--text) 30%, transparent); }

/* ---------- Puces de filtre (.puces brique, .chips écrans pas encore refaits) et champ de recherche ---------- */
.puces, .chips { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.puces { margin-bottom: 14px; }
.puce, .chip { display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 13px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); font: 600 12.5px/1 var(--font-body); color: var(--muted); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: color .25s var(--ease), background .25s var(--ease), border-color .25s var(--ease); }
.puce b, .chip .count { font: 600 11px var(--font-mono); color: var(--faint); background: none; min-width: 0; padding: 0; height: auto; line-height: 1; }
.puce:hover, .chip:hover { color: var(--text); }
.puce.on, .chip.on { background: var(--text); color: var(--bg); border-color: var(--text); }
.puce.on b, .chip.on .count { color: color-mix(in srgb, var(--bg) 60%, transparent); }
.champ-recherche, .search { position: relative; flex: 1; min-width: 200px; display: flex; align-items: center; gap: 9px; height: 40px; }
.champ-recherche { padding: 0 14px; border-radius: var(--r-ctl); border: 1px solid var(--border-strong); background: var(--surface); color: var(--faint); }
.champ-recherche input { flex: 1; min-width: 0; border: 0; background: none; outline: none; color: var(--text); font: inherit; padding: 0; height: 100%; box-shadow: none; }
.champ-recherche input:focus { box-shadow: none; }
.champ-recherche:focus-within { border-color: var(--coral-500); box-shadow: 0 0 0 4px var(--accent-soft); }
.search { min-width: 300px; flex: 0 1 auto; }
.search .ic { position: absolute; left: 13px; color: var(--faint); pointer-events: none; }
.search input { padding-left: 40px; height: 40px; }
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .search.grow { flex: 1 1 240px; min-width: 220px; }
.sort label { display: flex; align-items: center; gap: 6px; font-size: 13px; white-space: nowrap; }
.sort label .ic { color: var(--muted); }
.sort select { width: auto; height: 40px; }

/* ---------- États : pastilles et témoins lumineux ----------
   .etat (brique etat()) et .badge (badge(), écrans pas encore refaits) : une pastille arrondie, couleur de l'état.
   Seul l'urgent (.k-bd / .t-bad sur .etat) pulse. */
.etat, .badge { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 999px; font: 600 12px/1 var(--font-body);
  white-space: nowrap; vertical-align: middle; }
.badge { padding: 0 10px 0 8px; }
.badge .ic { width: 14px; height: 14px; }
.etat i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; position: relative; flex: none; }
.k-ok, .t-ok.badge, .t-ok.etat { color: var(--ok); background: var(--ok-soft); }
.k-wa, .t-warn.badge, .t-warn.etat { color: var(--warn); background: var(--warn-soft); }
.k-bd, .t-bad.badge, .t-bad.etat { color: var(--bad); background: var(--bad-soft); }
.k-in, .t-info.badge, .t-info.etat { color: var(--info); background: var(--info-soft); }
.k-nw, .t-accent.badge, .t-accent.etat { color: var(--accent-text); background: var(--accent-soft); }
.k-mu, .t-mute.badge, .t-mute.etat { color: var(--mute); background: var(--mute-soft); }
.orbe.t-ok { color: var(--ok); } .orbe.t-warn { color: var(--warn); } .orbe.t-bad { color: var(--bad); } .orbe.t-info { color: var(--info); }
.orbe.t-accent { color: var(--coral-500); } .orbe.t-mute { color: var(--mute); }
.etat.k-bd i::after, .etat.t-bad i::after, .orbe.k-bd::after, .orbe.t-bad::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: currentColor; animation: onde 2s var(--ease) infinite; }
@keyframes onde { from { transform: scale(1); opacity: .7; } to { transform: scale(3.2); opacity: 0; } }
.orbe { position: relative; width: 9px; height: 9px; border-radius: 50%; flex: none; background: currentColor !important; box-shadow: 0 0 12px currentColor; }
.etiq, .tag { display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px; background: var(--surface-3); color: var(--muted);
  font: 500 10.5px/1 var(--font-mono); letter-spacing: .04em; text-transform: uppercase; vertical-align: middle; }
.tag { margin-right: 4px; }
.alert { display: flex; gap: 12px; align-items: flex-start; border-radius: var(--r-s); padding: 12px 14px; margin-bottom: 16px; border: 1px solid; color: var(--text); }
.alert .ic { margin-top: 1px; }
.alert.t-bad { background: var(--bad-soft); border-color: color-mix(in srgb, var(--bad) 35%, transparent); } .alert.t-bad > .ic { color: var(--bad); }
.alert.t-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 35%, transparent); } .alert.t-warn > .ic { color: var(--warn); }
.alert.t-info { background: var(--info-soft); border-color: color-mix(in srgb, var(--info) 30%, transparent); } .alert.t-info > .ic { color: var(--info); }
.alert.t-ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); } .alert.t-ok > .ic { color: var(--ok); }
.error-box { background: var(--bad-soft); color: var(--bad); padding: 11px 14px; border-radius: var(--r-ctl); font-weight: 600; display: flex; gap: 8px; align-items: flex-start; }
.bulk { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 10px 14px; margin: 0 0 12px; border-radius: var(--r-ctl); background: var(--bad-soft); font-size: 13.5px; }
.bulk > .ic { color: var(--bad); }

/* ---------- Avatars (initiales) ---------- */
.ini, .avatar { width: 40px; height: 40px; border-radius: var(--r-ctl); display: grid; place-items: center; flex: none; font: 700 13px var(--font-display);
  background: linear-gradient(135deg, color-mix(in srgb, var(--coral-500) 24%, var(--surface-3)), var(--surface-3)); color: var(--accent-text);
  box-shadow: 0 0 0 1px var(--border) inset; }
.avatar.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 19px; }
.avatar.ic-av { background: var(--mute-soft); color: var(--muted); }
.avatar.ic-av.t-warn { background: var(--warn-soft); color: var(--warn); } .avatar.ic-av.t-bad { background: var(--bad-soft); color: var(--bad); }
.avatar.ic-av.t-info { background: var(--info-soft); color: var(--info); } .avatar.ic-av.t-ok { background: var(--ok-soft); color: var(--ok); }
.avatar.ic-av.t-accent { background: var(--accent-soft); color: var(--accent-text); }

/* ---------- Listes (brique liste()) : des lignes qui réagissent ---------- */
.liste { overflow: hidden; margin-bottom: 18px; }
.liste .entete, .liste .ligne { display: grid; grid-template-columns: var(--cols, minmax(0, 1fr) auto); align-items: center; gap: 16px; padding: 0 20px; }
.liste .entete { height: 44px; font: 500 10.5px var(--font-mono); letter-spacing: .1em; text-transform: uppercase; color: var(--faint); border-bottom: 1px solid var(--border); }
.liste .entete .d, .liste .ligne .d { text-align: right; justify-self: end; }
.liste .groupe { padding: 14px 20px 8px; font: 500 10.5px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); display: flex; gap: 10px; align-items: center; }
.liste .groupe::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.liste .ligne { position: relative; min-height: 68px; padding-top: 10px; padding-bottom: 10px; color: inherit; text-decoration: none; transition: background .2s; }
.liste a.ligne, .liste .ligne[data-href], .liste .ligne[data-drawer] { cursor: pointer; }
.liste .ligne + .ligne::before { content: ""; position: absolute; left: 20px; right: 20px; top: 0; height: 1px; background: var(--border); }
.liste .ligne:hover { background: color-mix(in srgb, var(--surface-3) 55%, transparent); }
.liste .ligne .va { opacity: 0; transform: translateX(-6px); transition: opacity .25s var(--ease), transform .25s var(--ease); color: var(--muted); justify-self: end; }
.liste .ligne:hover .va, .liste .ligne:focus-visible .va { opacity: 1; transform: translateX(0); }
.qui { display: flex; align-items: center; gap: 12px; min-width: 0; }
.qui > span { min-width: 0; }
.qui b { display: block; font-weight: 600; font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qui small { display: flex; gap: 6px; align-items: center; color: var(--muted); font-size: 12.5px; margin-top: 2px; flex-wrap: wrap; }
.ligne .montant { font: 500 13.5px var(--font-mono); text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ligne .meta { color: var(--muted); font-size: 12.5px; }
.pied-liste, .more-rows { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border);
  color: var(--muted); font-size: 12.5px; }
.more-rows:empty { display: none; }
.liste .vide { border-top: 1px solid var(--border); }

/* ---------- Tableaux (écrans pas encore refaits) ---------- */
.table-wrap { overflow-x: auto; margin: 0 -20px; padding: 0 20px; }
.card.flush .table-wrap { margin: 0; padding: 0; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font: 500 10.5px/16px var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--faint);
  padding: 12px; border-bottom: 1px solid var(--border); white-space: nowrap; }
td { padding: 14px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr { transition: background .2s; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-3) 55%, transparent); }
tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
tfoot td { font-weight: 700; border-top: 1px solid var(--border-strong); border-bottom: 0; }
td .title { font-weight: 600; }
td a { text-decoration: none; } td a:hover { text-decoration: underline; }
td.act { text-align: right; white-space: nowrap; width: 1%; }
th.pick, td.pick { width: 36px; padding-right: 0; }
td.go { width: 28px; color: var(--muted); text-align: right; }
td .why { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
td .why.t-bad, td b.t-bad { color: var(--bad); }
.card.flush th:first-child, .card.flush td:first-child { padding-left: 20px; }
.card.flush th:last-child, .card.flush td:last-child { padding-right: 16px; }
table.rows tr[data-href] { cursor: pointer; }
tr.grp td { background: transparent; font: 500 10.5px/16px var(--font-mono); text-transform: uppercase; letter-spacing: .12em; color: var(--muted); padding: 16px 12px 8px; }
tbody tr.grp:hover { background: transparent; }
a.who { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--text); min-width: 0; }
a.who:hover { text-decoration: none; } a.who:hover .title { text-decoration: underline; }
a.who .title, a.who .muted { display: block; }
.list { display: flex; flex-direction: column; }
.item { display: flex; align-items: center; gap: 12px; padding: 11px 8px; border-top: 1px solid var(--border); text-decoration: none; border-radius: var(--r-xs); transition: background .2s; }
.item:first-child { border-top-color: transparent; }
a.item:hover { background: var(--surface-2); }
.item .title { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ---------- Formulaires ---------- */
.form { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px 16px; }
.form .full, .full, .form .plein { grid-column: 1 / -1; }
.form.form-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.field, .champ { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span, .champ > label { font-weight: 600; font-size: 13px; color: var(--text); }
.field small, .champ label small { font-weight: 400; color: var(--muted); }
input, select, textarea, .saisie { font: 400 14px/20px var(--font-body); color: var(--text); padding: 11px 14px; border: 1px solid var(--border-strong);
  border-radius: var(--r-ctl); background: color-mix(in srgb, var(--surface-solid) 70%, transparent); min-width: 0; width: 100%;
  transition: border-color .2s, box-shadow .2s; }
input[type=checkbox], input[type=radio] { width: 18px; height: 18px; accent-color: var(--accent); padding: 0; }
input:hover, select:hover, textarea:hover { border-color: color-mix(in srgb, var(--text) 25%, transparent); }
input:focus, select:focus, textarea:focus, .saisie:focus { outline: none; border-color: var(--coral-500); box-shadow: 0 0 0 4px var(--accent-soft); }
::placeholder { color: var(--faint); }
textarea { resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 34px; }
select option { background: var(--surface-solid); color: var(--text); }
.check { display: flex; flex-direction: row; align-items: center; gap: 10px; font-weight: 500; cursor: pointer; }
.checks { display: flex; flex-wrap: wrap; gap: 8px; }
.checks label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border-strong); border-radius: var(--r-xs); padding: 7px 12px; cursor: pointer; font-weight: 500; }
.checks label:has(input:checked) { border-color: var(--coral-500); background: var(--accent-soft); }
.pick { display: flex; flex-direction: column; gap: 10px; max-height: 240px; overflow: auto; border: 1px solid var(--border-strong); border-radius: var(--r-xs); padding: 10px 12px; }
.pick .check.off { opacity: .55; cursor: default; }
.only-cible { display: none; }
form:has(select[name=canal] option[value=cible]:checked) .only-cible { display: flex; }
form:has(select[name=canal] option[value=cible]:checked) .not-cible { display: none; }
.form-actions { grid-column: 1 / -1; display: flex; gap: 8px; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-top: 4px; }
.form-actions .muted { margin-right: auto; }
fieldset { border: 1px solid var(--border-strong); border-radius: var(--r-s); padding: 14px 16px 16px; margin: 0; min-width: 0; }
legend { padding: 0 6px; font: 500 11px var(--font-mono); text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.set-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 0; border-top: 1px solid var(--border); }
.set-row:first-of-type { border-top: 0; }
.set-row b { font-weight: 600; }
fieldset .set-row { border-top: 0; padding: 0; }
.set-row select { width: auto; }
.formfoot { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin: 4px 0 16px; }
.formfoot .grow { flex: 1 1 200px; }
/* Choix segmenté et interrupteur */
.seg { display: inline-flex; flex-wrap: wrap; gap: 2px; padding: 3px; border: 1px solid var(--border); border-radius: var(--r-ctl); background: var(--surface-2); }
.seg label { position: relative; }
.seg input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg span { display: block; padding: 6px 12px; border-radius: 9px; font-weight: 600; font-size: 13px; color: var(--muted); cursor: pointer; transition: color .2s; }
.seg input:checked + span { background: var(--surface-solid); color: var(--text); box-shadow: 0 2px 8px -3px rgba(0, 0, 0, .4); }
.seg input:focus-visible + span { outline: 2px solid var(--focus); outline-offset: 1px; }
.bascule { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-top: 1px solid var(--border); }
.bascule:first-child { border-top: 0; }
.bascule .txt { flex: 1; } .bascule .txt b { display: block; font-weight: 600; } .bascule .txt small { color: var(--muted); }
.interr { position: relative; width: 44px; height: 26px; border-radius: 99px; background: var(--surface-3); border: 1px solid var(--border-strong); cursor: pointer;
  flex: none; transition: background .3s; padding: 0; }
.interr::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .3); transition: transform .35s var(--spring); }
.interr[aria-checked="true"], input.interr:checked { background: var(--coral-500); border-color: var(--coral-500); }
.interr[aria-checked="true"]::after, input.interr:checked::after { transform: translateX(18px); }
input.interr { appearance: none; -webkit-appearance: none; width: 44px; height: 26px; margin: 0; }
details.more { border-top: 1px solid var(--border); margin-top: 14px; padding-top: 12px; }
details.more > summary { cursor: pointer; font-weight: 600; list-style: none; display: flex; align-items: center; gap: 8px; color: var(--text); }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary::after { content: ""; margin-left: auto; width: 8px; height: 8px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform var(--fast); }
details.more[open] > summary::after { transform: rotate(-135deg); }
details.more > div { padding-top: 14px; }
.composer { border-top: 1px solid var(--border); margin-top: 16px; padding-top: 16px; }

/* ---------- Divers des écrans (repris du panneau, nouveau style) ---------- */
.kv, .defs { display: grid; grid-template-columns: minmax(110px, 36%) minmax(0, 1fr); gap: 9px 14px; margin: 0; font-size: 14px; }
.kv dt, .defs dt { color: var(--muted); }
.kv dd, .defs dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.defs { grid-template-columns: auto minmax(0, 1fr); gap: 9px 18px; font-size: 13.5px; } .defs dd { text-align: right; font-weight: 500; }
.kv dd small { display: block; color: var(--muted); font-size: 12.5px; margin-top: 1px; }
.kv dd small.t-bad { color: var(--bad); }
.kv-mini { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 16px; margin: 14px 0 0; font-size: 14px; }
.kv-mini dt { color: var(--muted); } .kv-mini dd { margin: 0; text-align: right; font-weight: 600; } .kv-mini dd.t-bad { color: var(--bad); }
.facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin: 14px 0; }
.fact { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-ctl); padding: 10px 12px; min-width: 0; }
.fact b { display: block; margin-top: 2px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.meter { height: 6px; border-radius: 3px; background: var(--mute-soft); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: linear-gradient(90deg, var(--coral-300), var(--coral-500)); border-radius: 3px; }
.steps { list-style: none; margin: 0 0 6px; padding: 0; }
.steps li { display: grid; grid-template-columns: 28px minmax(0, 1fr) auto; gap: 12px; align-items: start; position: relative; padding-bottom: 16px; }
.steps li:not(:last-child)::before { content: ""; position: absolute; left: 13px; top: 30px; bottom: 2px; width: 2px; background: var(--border-strong); }
.steps li.done:not(:last-child)::before { background: var(--ok); }
.steps .dot { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border-strong);
  font: 600 12px var(--font-mono); color: var(--muted); background: var(--surface-solid); }
.steps .done .dot { background: var(--ok); border-color: var(--ok); color: var(--surface-solid); }
.steps .now .dot { border-color: var(--coral-500); color: var(--accent-text); box-shadow: 0 0 0 4px var(--accent-soft); }
.steps .stopped .dot { background: var(--bad); border-color: var(--bad); color: var(--surface-solid); }
.steps b { display: block; font-weight: 600; padding-top: 3px; }
.steps .todo b { color: var(--muted); font-weight: 500; }
.steps .stopped b { color: var(--bad); }
.steps small { display: block; color: var(--muted); font-size: 12.5px; line-height: 17px; overflow-wrap: anywhere; }
.steps .when { font-size: 12.5px; color: var(--muted); padding-top: 5px; white-space: nowrap; }
.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li { display: flex; gap: 12px; position: relative; padding: 0 0 14px; }
.timeline li::before { content: ""; position: absolute; left: 5px; top: 14px; bottom: 0; width: 2px; background: var(--border); }
.timeline li:last-child::before { display: none; }
.timeline .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--muted); background: var(--surface-solid); flex: none; margin-top: 4px; z-index: 1; }
.timeline .t-ok .dot { border-color: var(--ok); background: var(--ok); } .timeline .t-bad .dot { border-color: var(--bad); background: var(--bad); }
.timeline .t-warn .dot { border-color: var(--warn); } .timeline .t-info .dot { border-color: var(--info); }
.timeline .t-accent .dot { border-color: var(--coral-500); background: var(--coral-500); }
.timeline b { font-weight: 600; }
.strip { display: flex; gap: 3px; margin-top: 8px; }
.strip i { flex: 1; height: 18px; border-radius: 4px; background: var(--mute-soft); min-width: 4px; }
.strip i.on { background: var(--ok); }
.strip-legend { display: flex; justify-content: space-between; font-size: 11.5px; color: var(--muted); margin-top: 4px; }
.empty:not(td), .vide { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 40px 20px; color: var(--muted); }
.empty:not(td) b, .vide b { color: var(--text); font: 600 15px var(--font-display); }
.empty:not(td) p, .vide p { max-width: 420px; margin: 0 0 8px; }
.empty-ic { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; background: var(--surface-3); color: var(--muted); margin-bottom: 6px;
  box-shadow: 0 0 0 1px var(--border) inset; }
pre.result { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-xs); padding: 10px; overflow-x: auto; max-height: 320px; font: 12px/1.5 var(--font-mono); }
.token { font-family: var(--font-mono); font-size: 12.5px; word-break: break-all; min-height: 130px; }
.qr { border-radius: var(--r-ctl); border: 1px solid var(--border); }
.hash { font: 11px/1.5 var(--font-mono); color: var(--muted); word-break: break-all; margin-top: 4px; }
.powered { display: flex; align-items: center; gap: 8px; justify-content: center; opacity: .6; font: 500 11px var(--font-mono); letter-spacing: .08em;
  text-transform: uppercase; margin-top: 28px; color: var(--muted); }
.powered img { height: 18px; }
.danger-zone { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; margin-top: 16px; border: 1px dashed var(--border-strong);
  border-radius: var(--r-ctl); color: var(--muted); font-size: 13.5px; }
.danger-zone + .danger-zone { margin-top: 8px; }
.danger-zone > .ic { color: var(--bad); }
details.acc { border: 1px solid var(--border); border-radius: var(--r-s); background: var(--surface); margin: 0 0 10px; }
details.acc > summary { display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer; font-weight: 600; list-style: none; border-radius: var(--r-s); }
details.acc > summary::-webkit-details-marker { display: none; }
details.acc > summary:hover { background: var(--surface-2); }
details.acc > summary > .ic { color: var(--muted); }
details.acc > summary .r { display: flex; align-items: center; gap: 6px; font-weight: 500; color: var(--muted); font-size: 13px; }
details.acc > summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted);
  transform: rotate(45deg); transition: transform var(--fast); margin: 0 4px 3px 2px; flex: none; }
details.acc[open] > summary::after { transform: rotate(-135deg); margin-bottom: -3px; }
.acc-b { padding: 2px 14px 16px; }

/* ---------- Graphiques ---------- */
.chart { margin: 0; position: relative; }
.chart svg, .graph { width: 100%; height: auto; display: block; overflow: visible; }
.chart .grid { stroke: var(--border); stroke-width: 1; shape-rendering: crispEdges; }
.chart .axis, .graph .lib { font: 500 10.5px var(--font-mono); fill: var(--faint); }
.chart .line, .graph .courbe { fill: none; stroke: var(--coral-500); stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.chart .last { fill: var(--coral-500); stroke: var(--surface-solid); stroke-width: 2; }
.chart .hit rect { fill: transparent; }
.chart .hit .cross { stroke: var(--border-strong); stroke-width: 1; opacity: 0; }
.chart .hit circle { fill: var(--coral-500); stroke: var(--surface-solid); stroke-width: 2; opacity: 0; }
.chart .hit:hover .cross, .chart .hit:hover circle { opacity: 1; }
.chart .bar { fill: var(--graphite-400); opacity: .45; transition: opacity var(--fast); }
.chart .bar.now { fill: var(--coral-500); opacity: 1; }
.chart .hit:hover .bar { opacity: 1; }
.graph .grille line { stroke: var(--border); }
.graph .aire { fill: var(--accent-soft); }
.graph .pt { fill: var(--coral-500); stroke: var(--surface-solid); stroke-width: 3; }
.graph .pt-halo { fill: var(--coral-500); opacity: .25; transform-box: fill-box; transform-origin: center; animation: onde 2.4s var(--ease) infinite; }
.barres { display: flex; align-items: end; gap: 10px; height: 160px; padding-top: 10px; }
.barres > div { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; gap: 8px; height: 100%; }
.barres i { display: block; width: 100%; max-width: 42px; border-radius: 9px 9px 4px 4px; height: var(--h); transform-origin: bottom;
  background: linear-gradient(180deg, var(--surface-3), color-mix(in srgb, var(--surface-3) 60%, transparent)); }
.barres .on i { background: linear-gradient(180deg, var(--coral-300), var(--coral-500)); box-shadow: 0 10px 24px -8px var(--accent-halo); }
.barres span { font: 500 10.5px var(--font-mono); color: var(--faint); }
.donut-wrap { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.donut { width: 150px; flex: none; }
.donut .track { fill: none; stroke: var(--mute-soft); stroke-width: 16; }
.donut .seg { fill: none; stroke-width: 16; transition: stroke-width var(--fast); }
.donut .seg:hover { stroke-width: 20; }
.donut-total { font: 700 26px var(--font-display); fill: var(--text); }
.donut-label { font: 500 10px var(--font-mono); fill: var(--muted); text-transform: uppercase; letter-spacing: .08em; }
.seg.t-ok { stroke: var(--ok); } .seg.t-warn { stroke: var(--warn); } .seg.t-bad { stroke: var(--bad); } .seg.t-info { stroke: var(--info); }
.seg.t-mute { stroke: var(--graphite-400); } .seg.t-accent { stroke: var(--coral-500); }
.legend { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 2px; }
.legend-row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-radius: 8px; text-decoration: none; }
a.legend-row:hover { background: var(--surface-2); }
.swatch { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.swatch.t-ok { background: var(--ok); } .swatch.t-warn { background: var(--warn); } .swatch.t-bad { background: var(--bad); }
.swatch.t-info { background: var(--info); } .swatch.t-mute { background: var(--graphite-400); } .swatch.t-accent { background: var(--coral-500); }
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(90px, 150px) 1fr auto; gap: 12px; align-items: center; text-decoration: none; }
.hbar-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.hbar .track { height: 8px; border-radius: 4px; background: var(--mute-soft); overflow: hidden; }
.hbar .track i { display: block; height: 100%; border-radius: 4px; background: var(--graphite-400); }
.hbar.first .track i { background: linear-gradient(90deg, var(--coral-300), var(--coral-500)); }
a.hbar:hover .hbar-label { text-decoration: underline; }
#tip, .bulle { position: fixed; z-index: 60; pointer-events: none; background: var(--text); color: var(--bg); font: 500 12.5px/18px var(--font-body);
  padding: 6px 10px; border-radius: 9px; box-shadow: var(--shadow-2); opacity: 0; transition: opacity 90ms; max-width: 280px; }
#tip.on, .bulle.on { opacity: 1; }

/* ---------- Panneau de détail : glisse depuis la droite, feuille du bas sur téléphone ----------
   <dialog class="drawer"> (écrans actuels, panneau.js l'ouvre par [data-drawer]) et <dialog class="tiroir"> (brique) :
   même aspect que la maquette (.tiroir, .t-haut, .t-corps, .t-pied). */
dialog { border: 0; padding: 0; border-radius: var(--r-card); background: var(--surface-solid); color: var(--text); box-shadow: var(--shadow-3);
  max-width: calc(100vw - 32px); border: 1px solid var(--border-strong); }
dialog::backdrop { background: var(--scrim); }
dialog[open] { animation: dialogue .35s var(--spring) both; }
@keyframes dialogue { from { transform: translateY(-10px) scale(.96); opacity: 0; } }
dialog.drawer, dialog.tiroir { position: fixed; inset: 12px 12px 12px auto; margin: 0; height: auto; max-height: none; width: min(560px, 100vw - 24px);
  border-radius: 24px; overflow-y: auto; overscroll-behavior: contain; display: none; flex-direction: column; }
dialog.tiroir { width: min(460px, 100vw - 24px); overflow: hidden; }
dialog.drawer[open], dialog.tiroir[open] { display: flex; animation: tiroir .5s var(--ease) both; }
@keyframes tiroir { from { transform: translateX(40px); opacity: 0; } }
.tiroir .t-haut { padding: 22px 22px 16px; border-bottom: 1px solid var(--border); position: relative; overflow: hidden; flex: none; }
.tiroir .t-haut::before, .drawer .dr-h::before { content: ""; position: absolute; inset: -40% -10% auto auto; width: 280px; height: 280px; border-radius: 50%;
  background: radial-gradient(closest-side, var(--accent-halo), transparent); opacity: .5; pointer-events: none; }
.tiroir .t-corps { padding: 18px 22px; overflow: auto; flex: 1; display: grid; gap: 16px; align-content: start; }
.tiroir .t-pied { padding: 14px 22px; border-top: 1px solid var(--border); display: flex; gap: 8px; flex-wrap: wrap; flex: none; }
.tiroir .fermer { position: absolute; top: 16px; right: 16px; z-index: 1; }
.tiroir h2 { font-size: 21px; margin-top: 12px; }
.drawer .lic { border: 0; border-radius: 0; box-shadow: none; margin: 0; padding: 0; background: none; }
.drawer .lic:target { box-shadow: none; }
.dr-h { position: sticky; top: 0; z-index: 2; background: var(--surface-solid); border-bottom: 1px solid var(--border); padding: 18px 22px 16px; overflow: hidden; }
.dr-top { position: relative; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 8px; }
.dr-h h2 { position: relative; display: flex; align-items: center; gap: 6px; }
.dr-h .serial { font-size: 19px; }
.dr-b { padding: 16px 22px 32px; }
.dr-b > .alert { margin: 0 0 12px; }
.dialog-body { padding: 22px 24px 18px; width: 440px; max-width: 100%; }
.dialog-body h3 { font-size: 17px; margin-bottom: 6px; }
.dialog-actions { display: flex; gap: 8px; justify-content: flex-end; padding: 0 24px 20px; }

/* ---------- Palette de commandes (Ctrl K) ---------- */
#palette { width: min(620px, 100vw - 24px); margin-top: 14vh; max-height: 70vh; border-radius: 22px;
  box-shadow: var(--shadow-3), 0 0 0 8px color-mix(in srgb, var(--coral-500) 8%, transparent); }
#palette[open] { display: flex; flex-direction: column; }
.pal-input { display: flex; align-items: center; gap: 12px; padding: 0 18px; height: 60px; border-bottom: 1px solid var(--border); flex: none; }
.pal-input .ic { color: var(--muted); }
.pal-input input { border: 0; box-shadow: none; padding: 6px 0; font: 500 17px var(--font-body); background: transparent; }
.pal-input input:focus { box-shadow: none; }
.pal-results { overflow-y: auto; padding: 8px; max-height: 52vh; }
.pal-group { padding: 10px 12px 6px; font: 500 10.5px var(--font-mono); letter-spacing: .12em; text-transform: uppercase; color: var(--faint); }
.pal-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--r-ctl); text-decoration: none; cursor: pointer; }
.pal-item .ic { color: var(--muted); }
.pal-item small { color: var(--faint); margin-left: auto; font: 500 11px var(--font-mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 45%; }
.pal-item.on { background: var(--accent-soft); } .pal-item.on .ic { color: var(--accent-text); }
.pal-foot { display: flex; gap: 14px; flex-wrap: wrap; padding: 10px 18px; border-top: 1px solid var(--border); color: var(--muted); font-size: 12px; flex: none; }
.pal-empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- Menus (compte, création, notifications) : <details class="menu"> + .menu-pop ---------- */
details.menu { position: relative; }
details.menu > summary { list-style: none; }
details.menu > summary::-webkit-details-marker { display: none; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 10px); z-index: 45; min-width: 240px; border-radius: 18px; background: var(--surface-solid);
  border: 1px solid var(--border-strong); box-shadow: var(--shadow-2); padding: 8px; transform-origin: top right; }
details.menu[open] > .menu-pop { animation: menu .3s var(--spring) both; }
@keyframes menu { from { transform: scale(.92) translateY(-6px); opacity: 0; } }
.menu-pop a, .menu-pop button.m-el, .menu-pop form > button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 10px 12px; border-radius: 11px;
  border: 0; background: none; cursor: pointer; text-align: left; font: 500 14px/20px var(--font-body); color: var(--text); text-decoration: none; }
.menu-pop a:hover, .menu-pop button.m-el:hover, .menu-pop form > button:hover { background: var(--surface-2); }
.menu-pop a[aria-current="page"] { background: var(--accent-soft); }
.menu-pop .ic { color: var(--muted); }
.menu-pop hr { margin: 6px 0; }
.m-tete { display: flex; flex-direction: column; padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.m-tete b { display: block; font: 600 15px var(--font-display); } .m-tete small { color: var(--muted); font-size: 12.5px; }
.m-pied { padding: 8px 12px 4px; font: 500 10.5px var(--font-mono); color: var(--faint); letter-spacing: .1em; text-transform: uppercase; }
.m-rang { display: flex; align-items: center; gap: 12px; padding: 6px 12px; font: 500 14px var(--font-body); }
.m-rang .ic { color: var(--muted); }
.menu-pop .langs { margin-left: auto; display: flex; gap: 4px; }
.menu-pop .langs a { width: auto; padding: 3px 8px; font: 600 12px/18px var(--font-mono); letter-spacing: .04em; border-radius: 7px; color: var(--muted); }
.menu-pop .langs a.on { background: var(--surface-3); color: var(--text); }
.choix3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 4px; padding: 4px; margin: 4px 0; border-radius: var(--r-ctl); background: var(--surface-2); }
.choix3 button { border: 0; background: none; padding: 7px 0; border-radius: 9px; font: 600 12px/16px var(--font-body); color: var(--muted); cursor: pointer;
  display: flex; gap: 6px; align-items: center; justify-content: center; min-width: 0; }
.choix3 button .ic { width: 15px; height: 15px; color: inherit; }
.choix3 button[aria-pressed="true"] { background: var(--surface-solid); color: var(--text); box-shadow: 0 2px 8px -3px rgba(0, 0, 0, .4); }
.notif-pop { width: 320px; }
.notif-pop a { align-items: flex-start; }
.notif-pop a .orbe { margin-top: 6px; }
.notif-pop a span b { display: block; font-weight: 600; }
.notif-pop a span small { color: var(--muted); }
.notif-pop .vide { padding: 22px 12px; }

/* ---------- Toasts : le message de confirmation après une action ---------- */
.toasts { position: fixed; z-index: 60; right: 20px; bottom: 20px; display: grid; gap: 10px; justify-items: end; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 12px; padding: 12px 16px 12px 12px; border-radius: 16px; background: var(--text); color: var(--bg); box-shadow: var(--shadow-2);
  font-weight: 600; position: relative; overflow: hidden; animation: toast .5s var(--spring) both; min-width: 260px; max-width: 440px; pointer-events: auto; }
.toast > .ic, .toast .ok { width: 28px; height: 28px; padding: 4px; border-radius: 9px; display: grid; place-items: center; background: var(--ok); color: #0B1F14; flex: none; }
.toast button { margin-left: auto; border: 0; background: none; color: var(--coral-500); font-weight: 700; cursor: pointer; }
.toast::after { content: ""; position: absolute; left: 0; bottom: 0; height: 3px; width: 100%; background: var(--coral-500); transform-origin: left; animation: decompte 4.2s linear forwards; }
.toast.out, .toast.sort { animation: toastSort .3s var(--ease-in) forwards; }
@keyframes toast { from { transform: translateY(20px) scale(.9); opacity: 0; } }
@keyframes toastSort { to { transform: translateX(30px); opacity: 0; } }
@keyframes decompte { to { transform: scaleX(0); } }
@keyframes apparait { to { opacity: 1; } }

/* ---------- Fenêtres étroites ---------- */
@media (max-width: 1180px) {
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-main, .g-side { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 1080px) {
  .chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grille2 { grid-template-columns: minmax(0, 1fr); }
  .grille3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  h1 { font-size: 24px; line-height: 30px; }
  .heros { grid-template-columns: minmax(0, 1fr) 96px; padding: 18px 0 16px; min-height: 0; gap: 10px; align-items: center; }
  .heros h1 { font-size: 28px; }
  .heros .phrase { font-size: 14.5px; margin-top: 8px; }
  .heros-actes { grid-column: 1 / -1; margin-top: 8px; }
  .heros-actes .btn { flex: 1 1 auto; }
  .embleme { width: 96px; height: 96px; margin: 0; align-self: start; }
  .page-head { margin: 10px 0 18px; }
  .page-head h1 { font-size: 26px; }
  .head-actions { flex-basis: 100%; } .head-actions .btn { flex: 1 1 auto; }
  .chiffres { gap: 10px; }
  .chiffre { padding: 13px 14px 12px; } .chiffre .val { font-size: 22px; padding-right: 0 !important; } .chiffre .sous { padding-right: 0 !important; }
  .chiffre svg.trace, .anneau { display: none; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .stat { padding: 13px 14px 12px; } .stat b { font-size: 20px; }
  .g2, .g3, .grille3 { grid-template-columns: minmax(0, 1fr); }
  .card { padding: 16px; } .table-wrap { margin: 0 -16px; padding: 0 16px; }
  .onglets, .tabs { display: flex; }
  .form, .form.form-4 { grid-template-columns: minmax(0, 1fr); }
  .formfoot > .grow:empty { display: none; } .formfoot .btn { flex: 1 1 auto; justify-content: center; }
  /* Les lignes de liste deviennent des fiches empilées. */
  .liste .entete { display: none; }
  .liste .ligne { grid-template-columns: minmax(0, 1fr) auto; gap: 6px 10px; padding: 14px 16px; }
  .liste .ligne > .col-tel-cache { display: none; }
  .liste .ligne > .col-tel-bas { grid-column: 1 / -1; padding-left: 52px; }
  .liste .ligne .va { display: none; }
  .liste .ligne + .ligne::before { left: 16px; right: 16px; }
  .puces, .toolbar .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
  .puces { margin-right: -16px; padding-right: 16px; }
  .puce, .toolbar .chips .chip { flex: none; }
  .champ-recherche, .search, .toolbar .search.grow { min-width: 0; width: 100%; flex-basis: 100%; }
  .sort, .sort label { width: 100%; } .sort select { flex: 1; }
  .pied-liste { flex-direction: column; gap: 10px; }
  .hide-sm { display: none; }
  table.resp thead { display: none; }
  table.resp tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; }
  table.resp td { display: flex; gap: 8px; border: 0; padding: 3px 4px; text-align: left; }
  table.resp td.num { justify-content: flex-start; }
  table.resp td[data-label]::before { content: attr(data-label); color: var(--muted); font-size: 12.5px; min-width: 90px; }
  table.resp tfoot td { border: 0; }
  table.resp td.hide-sm, table.resp td.empty { display: none; }
  table.resp td.act { justify-content: flex-start; width: auto; } table.resp td.act:empty, table.resp td.pick:empty { display: none; }
  table.resp tr:has(td.pick input) { position: relative; } table.resp td.pick { position: absolute; top: 12px; right: 16px; padding: 0; width: auto; }
  .card.flush table.resp tr { padding: 10px 16px; }
  .card.flush table.resp td { padding: 3px 0; }
  table.resp tr.grp { padding: 0; }
  .card.flush table.resp tr.grp td, table.resp tr.grp td { display: block; padding: 12px 16px 6px; }
  .bulk > .grow { flex-basis: calc(100% - 30px); }
  .kv { grid-template-columns: minmax(0, 1fr); gap: 2px; } .kv dd { margin-bottom: 8px; }
  dialog.drawer, dialog.tiroir { inset: auto 8px 8px 8px; width: auto; max-height: 86vh; border-radius: 26px; }
  dialog.drawer[open], dialog.tiroir[open] { animation-name: feuille; }
  .dr-h::after, .tiroir .t-haut::after { content: ""; position: absolute; top: 8px; left: 50%; width: 40px; height: 4px; margin-left: -20px; border-radius: 4px; background: var(--border-strong); }
  .dr-h { padding: 18px 16px 14px; } .dr-b { padding: 12px 16px 28px; }
  #palette { margin-top: 16px; }
  .menu-pop { position: fixed; top: calc(var(--bar-h) + 4px); right: 12px; left: 12px; min-width: 0; width: auto !important; max-height: calc(100vh - var(--bar-h) - 120px); overflow-y: auto; }
  .toasts { left: 12px; right: 12px; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); justify-items: stretch; }
  .toast { min-width: 0; max-width: none; }
}
@keyframes feuille { from { transform: translateY(60%); opacity: 0; } }
