/* Tri — interface. Barre latérale encre, contenu papier, accent violet électrique. Clair et sombre. */
:root {
  color-scheme: light;
  --page: #f4f3ef; --surface: #ffffff; --surface-2: #f3f1ec; --survol: #edebe5;
  --encre: #16132d; --encre-2: #595570; --encre-3: #8d89a0; --trait: rgba(22, 19, 45, .08); --trait-fort: rgba(22, 19, 45, .15);
  --barre: #16132d; --barre-2: #211d3f; --barre-texte: #ece9fb; --barre-texte-2: #a7a2c6; --barre-survol: rgba(255, 255, 255, .07); --barre-actif: rgba(255, 255, 255, .13);
  --accent: #6d4aff; --accent-fort: #5533e8; --accent-doux: #efeaff; --sur-accent: #ffffff; --accent-texte: #5533e8;
  --degrade: linear-gradient(135deg, #6d4aff 0%, #a64cf0 52%, #e0469c 100%);
  --s-decider: #4f6bf6; --s-sensible: #ef7a3a; --s-info: #1fa971; --s-verifier: #e0a100; --s-sans: #a8a59d;
  --bon: #17a34a; --attention: #f2a60c; --critique: #d9443c; --bon-texte: #0f7a36; --critique-texte: #b3261e;
  --ombre: 0 1px 2px rgba(22, 19, 45, .05), 0 1px 1px rgba(22, 19, 45, .03);
  --ombre-haute: 0 18px 40px rgba(22, 19, 45, .14), 0 3px 8px rgba(22, 19, 45, .06);
  --ombre-accent: 0 8px 22px rgba(109, 74, 255, .32);
  --rayon: 16px; --rayon-petit: 11px;
  --assistant: 420px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --page: #0e0c1a; --surface: #17152b; --surface-2: #1f1c37; --survol: #262243;
    --encre: #f1effa; --encre-2: #b6b1cf; --encre-3: #817c9c; --trait: rgba(255, 255, 255, .08); --trait-fort: rgba(255, 255, 255, .15);
    --barre: #0a0914; --barre-2: #15132a;
    --accent: #8b6dff; --accent-fort: #a78bff; --accent-doux: rgba(139, 109, 255, .16); --accent-texte: #b7a4ff;
    --s-decider: #6b83ff; --s-sensible: #f08a4f; --s-info: #2cc084; --s-verifier: #e9b21a; --s-sans: #6c6985;
    --bon-texte: #3ccf73; --critique-texte: #ff8078;
    --ombre: 0 1px 2px rgba(0, 0, 0, .4); --ombre-haute: 0 18px 40px rgba(0, 0, 0, .55); --ombre-accent: 0 8px 24px rgba(139, 109, 255, .35);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --page: #0e0c1a; --surface: #17152b; --surface-2: #1f1c37; --survol: #262243;
  --encre: #f1effa; --encre-2: #b6b1cf; --encre-3: #817c9c; --trait: rgba(255, 255, 255, .08); --trait-fort: rgba(255, 255, 255, .15);
  --barre: #0a0914; --barre-2: #15132a;
  --accent: #8b6dff; --accent-fort: #a78bff; --accent-doux: rgba(139, 109, 255, .16); --accent-texte: #b7a4ff;
  --s-decider: #6b83ff; --s-sensible: #f08a4f; --s-info: #2cc084; --s-verifier: #e9b21a; --s-sans: #6c6985;
  --bon-texte: #3ccf73; --critique-texte: #ff8078;
  --ombre: 0 1px 2px rgba(0, 0, 0, .4); --ombre-haute: 0 18px 40px rgba(0, 0, 0, .55); --ombre-accent: 0 8px 24px rgba(139, 109, 255, .35);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { height: 100%; }
body { margin: 0; background: var(--page); color: var(--encre); font: 14px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent-texte); text-underline-offset: 2px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
::selection { background: color-mix(in srgb, var(--accent) 28%, transparent); }
.ico { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---- Structure -------------------------------------------------------------------------------- */
.appli { display: grid; grid-template-columns: 260px minmax(0, 1fr); min-height: 100vh; }
body.avec-assistant .appli { grid-template-columns: 260px minmax(0, 1fr) var(--assistant); }
.barre { background: var(--barre); color: var(--barre-texte); padding: 18px 12px 14px; display: flex; flex-direction: column; gap: 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, .15) transparent; }
.marque { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.marque .logo { width: 32px; height: 32px; border-radius: 10px; background: var(--degrade); color: #fff; display: grid; place-items: center; box-shadow: 0 6px 16px rgba(160, 76, 240, .35); flex: none; }
.marque b { font-size: 17px; letter-spacing: -.02em; }
.marque span { display: block; font-size: 12px; color: var(--encre-3); line-height: 1.2; }
.barre .marque span { color: var(--barre-texte-2); }

/* Sélecteur de boîte */
.selecteur-boite { position: relative; }
.selecteur-boite > button { width: 100%; display: flex; align-items: center; gap: 10px; padding: 9px 10px; border: 0; border-radius: 13px; background: var(--barre-2); color: var(--barre-texte); cursor: pointer; text-align: left; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .06); }
.selecteur-boite > button:hover { background: #29254b; }
.selecteur-boite .qui { min-width: 0; flex: 1; }
.selecteur-boite .qui b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.selecteur-boite .qui span { display: block; font-size: 12px; color: var(--barre-texte-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.menu-boites { position: absolute; left: 0; right: 0; top: calc(100% + 6px); z-index: 20; background: var(--surface); color: var(--encre); border-radius: 14px; box-shadow: var(--ombre-haute), inset 0 0 0 1px var(--trait); padding: 6px; display: grid; gap: 2px; min-width: 250px; }
.menu-boites .boite { display: flex; align-items: center; gap: 10px; padding: 8px; border-radius: 10px; border: 0; background: none; cursor: pointer; text-align: left; width: 100%; color: inherit; text-decoration: none; }
.menu-boites .boite:hover { background: var(--survol); }
.menu-boites .boite .qui { min-width: 0; flex: 1; }
.menu-boites .boite b { display: block; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-boites .boite span { display: block; font-size: 12px; color: var(--encre-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-boites .boite > .ico { color: var(--accent-texte); }
.menu-boites hr { border: 0; border-top: 1px solid var(--trait); margin: 4px 2px; }
.pastille-etat { width: 8px; height: 8px; border-radius: 50%; background: var(--encre-3); flex: none; }
.pastille-etat.bon { background: var(--bon); } .pastille-etat.en-cours { background: var(--accent); animation: pulse 1.2s infinite; } .pastille-etat.critique { background: var(--critique); } .pastille-etat.attention { background: var(--attention); }
@keyframes pulse { 50% { opacity: .35; } }

.nav { display: grid; gap: 1px; }
.nav h4 { margin: 14px 10px 5px; font-size: 11px; font-weight: 650; color: var(--barre-texte-2); letter-spacing: .06em; text-transform: uppercase; opacity: .8; }
.nav a { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 10px; color: var(--barre-texte-2); text-decoration: none; font-weight: 520; }
.nav a:hover { background: var(--barre-survol); color: var(--barre-texte); }
.nav a.actif { background: var(--barre-actif); color: #fff; }
.nav a.actif .ico { color: #c9bbff; }
.nav a .n { margin-left: auto; font-size: 12px; color: var(--barre-texte-2); font-variant-numeric: tabular-nums; }
.nav a .n.fort { background: var(--degrade); color: #fff; border-radius: 999px; padding: 0 8px; font-weight: 650; }
.nav .point { width: 8px; height: 8px; border-radius: 3px; flex: none; }
.nav .ico { width: 17px; height: 17px; }
.bas-barre { margin-top: auto; display: grid; gap: 2px; }
.bas-barre .bouton { justify-content: flex-start; color: var(--barre-texte-2); }
.bas-barre .bouton:hover { background: var(--barre-survol); color: var(--barre-texte); }

.principal { min-width: 0; display: flex; flex-direction: column; }
.haut { position: sticky; top: 0; z-index: 6; background: color-mix(in srgb, var(--page) 86%, transparent); backdrop-filter: saturate(1.4) blur(12px); border-bottom: 1px solid var(--trait); padding: 12px 28px; display: flex; align-items: center; gap: 14px; }
.haut .titre { min-width: 0; }
.haut .titre h1 { font-size: 19px; font-weight: 720; letter-spacing: -.02em; white-space: nowrap; }
.haut .titre p { font-size: 13px; color: var(--encre-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 46ch; }
.haut .droite { display: flex; align-items: center; gap: 10px; }
.synchro-texte { font-size: 12px; color: var(--encre-3); text-align: right; line-height: 1.3; white-space: nowrap; }
.bouton.menu-mobile { display: none; }
.contenu { padding: 24px 28px 64px; max-width: 1280px; width: 100%; }

/* Barre de commande : « Demande à Tri » */
.commande { position: relative; flex: 1; max-width: 460px; min-width: 200px; margin-left: auto; }
.commande input { width: 100%; border: 0; border-radius: 12px; padding: 10px 70px 10px 38px; background: var(--surface); box-shadow: var(--ombre), inset 0 0 0 1px var(--trait-fort); transition: box-shadow .15s; }
.commande input:focus { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 25%, transparent), inset 0 0 0 1px var(--accent); }
.commande > .ico { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--accent-texte); width: 17px; height: 17px; }
.commande .kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); }
.kbd { font: 11px/1 ui-monospace, SFMono-Regular, Menlo, monospace; color: var(--encre-3); border-radius: 6px; padding: 3px 6px; box-shadow: inset 0 0 0 1px var(--trait-fort); background: var(--surface-2); }

/* ---- Boutons, champs -------------------------------------------------------------------------- */
a.bouton { text-decoration: none; }
.bouton { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: var(--rayon-petit); padding: 8px 14px; cursor: pointer; font-weight: 580; background: var(--surface); color: var(--encre); box-shadow: var(--ombre), inset 0 0 0 1px var(--trait-fort); white-space: nowrap; transition: background .12s, box-shadow .12s, transform .08s; }
.bouton:hover { background: var(--survol); }
.bouton:active { transform: translateY(1px); }
.bouton.principal-b { background: var(--accent); color: var(--sur-accent); box-shadow: var(--ombre-accent); }
.bouton.principal-b:hover { background: var(--accent-fort); color: #fff; }
.bouton.degrade { background: var(--degrade); color: #fff; box-shadow: var(--ombre-accent); }
.bouton.degrade:hover { filter: brightness(1.06); }
.bouton.danger { color: var(--critique-texte); }
.bouton.plein-danger { background: var(--critique); color: #fff; box-shadow: none; }
.bouton.discret { box-shadow: none; background: transparent; color: var(--encre-2); }
.bouton.discret:hover { background: var(--survol); color: var(--encre); }
.bouton.petit { padding: 5px 10px; font-size: 13px; border-radius: 9px; }
.bouton.rond { width: 36px; height: 36px; padding: 0; border-radius: 11px; }
.bouton:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.bouton .ico { width: 16px; height: 16px; }
.tourne { animation: tourne 1s linear infinite; }
@keyframes tourne { to { transform: rotate(360deg); } }
.champ { width: 100%; border: 0; border-radius: var(--rayon-petit); padding: 9px 12px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--trait-fort); }
.champ:focus { outline: 2px solid var(--accent); outline-offset: 0; }
textarea.champ { resize: vertical; min-height: 90px; line-height: 1.55; }
.filtre { position: relative; max-width: 340px; margin-bottom: 12px; }
.filtre .ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--encre-3); width: 16px; height: 16px; }
.filtre .champ { padding-left: 34px; }
label.etiquette-champ { display: block; font-weight: 600; margin-bottom: 6px; }
.aide { color: var(--encre-3); font-size: 13px; margin-top: 4px; }
.case { appearance: none; width: 18px; height: 18px; border-radius: 6px; margin: 0; flex: none; cursor: pointer; box-shadow: inset 0 0 0 1.5px var(--trait-fort); background: var(--surface); display: inline-grid; place-items: center; transition: background .1s; }
.case:checked { background: var(--accent); box-shadow: none; }
.case:checked::after { content: ""; width: 9px; height: 5px; border-left: 2px solid #fff; border-bottom: 2px solid #fff; transform: translateY(-1px) rotate(-45deg); }
.case:indeterminate { background: var(--accent); box-shadow: none; }
.case:indeterminate::after { content: ""; width: 8px; height: 2px; background: #fff; border-radius: 1px; }

/* ---- Cartes ------------------------------------------------------------------------------------ */
.carte { background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre), inset 0 0 0 1px var(--trait); padding: 18px 20px; }
.carte > h2, .carte-titre { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 12px; letter-spacing: -.01em; }
.carte-titre a, .carte-titre .droite { margin-left: auto; font-size: 13px; font-weight: 550; text-decoration: none; }
.grille-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 16px; }
.pile { display: grid; gap: 16px; }

/* ---- Accueil ---------------------------------------------------------------------------------- */
.hero { position: relative; overflow: hidden; border-radius: 22px; padding: 26px 28px 22px; color: #fff; background: radial-gradient(120% 140% at 100% 0%, #e0469c 0%, rgba(224, 70, 156, 0) 55%), radial-gradient(90% 120% at 0% 100%, #3b2bbf 0%, rgba(59, 43, 191, 0) 60%), linear-gradient(135deg, #2a1f7a 0%, #6d4aff 60%, #a64cf0 100%); box-shadow: 0 20px 44px rgba(76, 52, 200, .28); margin-bottom: 20px; }
.hero::after { content: ""; position: absolute; inset: 0; background: radial-gradient(rgba(255, 255, 255, .09) 1px, transparent 1px); background-size: 18px 18px; -webkit-mask-image: linear-gradient(to left, #000, transparent 70%); mask-image: linear-gradient(to left, #000, transparent 70%); pointer-events: none; }
.hero > * { position: relative; z-index: 1; }
.hero .bonjour { font-size: 12px; font-weight: 650; letter-spacing: .08em; text-transform: uppercase; opacity: .8; }
.hero h2 { font-size: clamp(22px, 3vw, 30px); font-weight: 760; letter-spacing: -.03em; margin: 4px 0 6px; max-width: 32ch; line-height: 1.15; }
.hero p { opacity: .9; max-width: 64ch; }
.hero .commande-hero { margin-top: 18px; display: flex; gap: 8px; max-width: 660px; }
.hero .commande-hero input { flex: 1; min-width: 0; border: 0; border-radius: 13px; padding: 12px 14px; background: rgba(255, 255, 255, .96); color: #16132d; box-shadow: 0 6px 18px rgba(20, 10, 60, .25); }
.hero .commande-hero input::placeholder { color: #7d7894; }
.hero .commande-hero input:focus { outline: 3px solid rgba(255, 255, 255, .45); }
.hero .commande-hero .bouton { background: #16132d; color: #fff; box-shadow: none; }
.hero .commande-hero .bouton:hover { background: #000; }
.hero .suggestions { margin-top: 12px; }
.suggestions { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; background: var(--surface-2); color: var(--encre-2); box-shadow: inset 0 0 0 1px var(--trait); text-align: left; }
.chip:hover { background: var(--accent-doux); color: var(--encre); }
.chip .ico { width: 14px; height: 14px; color: var(--accent-texte); }
.hero .chip { background: rgba(255, 255, 255, .14); color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22); }
.hero .chip .ico { color: #fff; }
.hero .chip:hover { background: rgba(255, 255, 255, .24); }
.salut h2 { font-size: 26px; font-weight: 720; letter-spacing: -.02em; }
.salut p { color: var(--encre-2); font-size: 15px; margin-top: 4px; max-width: 72ch; }
.tuiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; margin: 0 0 20px; }
.tuile { text-align: left; border: 0; cursor: pointer; background: var(--surface); color: var(--encre); border-radius: var(--rayon); box-shadow: var(--ombre), inset 0 0 0 1px var(--trait); padding: 16px; display: grid; gap: 4px; transition: transform .14s ease, box-shadow .14s ease; }
.tuile:hover { transform: translateY(-2px); box-shadow: var(--ombre-haute), inset 0 0 0 1px var(--trait-fort); }
.tuile .tete { display: flex; align-items: center; gap: 8px; color: var(--encre-2); font-weight: 600; font-size: 13px; }
.tuile .rond { width: 30px; height: 30px; border-radius: 10px; display: grid; place-items: center; color: var(--encre); }
.tuile .valeur { font-size: 36px; font-weight: 760; letter-spacing: -.03em; line-height: 1.1; font-variant-numeric: tabular-nums; margin-top: 4px; }
.tuile .sous { color: var(--encre-3); font-size: 12px; }
.tuile.vedette { background: var(--degrade); color: #fff; box-shadow: var(--ombre-accent); }
.tuile.vedette .tete, .tuile.vedette .sous { color: rgba(255, 255, 255, .88); }
.tuile.vedette .rond { background: rgba(255, 255, 255, .2); color: #fff; }
.bandeau { display: flex; gap: 14px; align-items: center; padding: 14px 16px; border-radius: var(--rayon); background: var(--surface); box-shadow: var(--ombre), inset 0 0 0 1px var(--trait), inset 4px 0 0 var(--accent); margin-bottom: 16px; }
.bandeau.critique { box-shadow: var(--ombre), inset 0 0 0 1px var(--trait), inset 4px 0 0 var(--critique); }
.bandeau.attention { box-shadow: var(--ombre), inset 0 0 0 1px var(--trait), inset 4px 0 0 var(--attention); }
.bandeau b { display: block; }
.bandeau p { color: var(--encre-2); font-size: 13px; }
.bandeau .droite { margin-left: auto; display: flex; gap: 8px; }
.jauge-progres { height: 6px; border-radius: 3px; background: var(--surface-2); overflow: hidden; margin-top: 8px; }
.jauge-progres i { display: block; height: 100%; background: var(--degrade); border-radius: 3px; transition: width .4s ease; }
.etapes { display: grid; gap: 10px; margin-top: 14px; }
.etape { display: flex; gap: 12px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.etape .num { flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--trait-fort); }
.etape.faite .num { background: var(--bon); color: #fff; box-shadow: none; }
.etape .droite { margin-left: auto; }
.form-client { display: grid; gap: 8px; margin-top: 10px; max-width: 520px; }
.form-client .rangee { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.form-client .bouton.discret { white-space: normal; text-align: left; }

/* Catégories */
.grille-categories { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.tuile-categorie { display: flex; gap: 12px; align-items: center; text-align: left; border: 0; cursor: pointer; background: var(--surface); color: var(--encre); border-radius: 14px; padding: 14px; box-shadow: var(--ombre), inset 0 0 0 1px var(--trait); transition: transform .14s, box-shadow .14s; text-decoration: none; }
.tuile-categorie:hover { transform: translateY(-2px); box-shadow: var(--ombre-haute), inset 0 0 0 1px var(--trait-fort); }
.tuile-categorie .rond { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex: none; }
.tuile-categorie b { display: block; font-size: 14px; }
.tuile-categorie span { display: block; font-size: 12px; color: var(--encre-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tuile-categorie .n { margin-left: auto; font-size: 20px; font-weight: 740; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tuile-categorie > div { min-width: 0; }

/* ---- Listes de messages ------------------------------------------------------------------------ */
.lecture { display: grid; grid-template-columns: minmax(310px, 430px) minmax(0, 1fr); gap: 16px; align-items: start; }
.liste { background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre), inset 0 0 0 1px var(--trait); overflow: hidden; }
.outils-liste { display: flex; gap: 8px; align-items: center; padding: 8px 12px; border-bottom: 1px solid var(--trait); font-size: 13px; color: var(--encre-3); }
.outils-liste .espace { flex: 1; }
.liste-vide { padding: 40px 24px; text-align: center; color: var(--encre-3); }
.liste-vide .ico { width: 28px; height: 28px; margin-bottom: 8px; }
.ligne { display: grid; grid-template-columns: 20px 36px minmax(0, 1fr); gap: 10px; padding: 12px 14px; cursor: pointer; border-top: 1px solid var(--trait); text-decoration: none; color: inherit; position: relative; align-items: start; }
.ligne > .case { margin-top: 9px; }
.ligne:first-child { border-top: 0; }
.ligne:hover { background: var(--survol); }
.ligne.choisie { background: var(--accent-doux); }
.ligne.cochee { background: color-mix(in srgb, var(--accent) 9%, var(--surface)); }
.ligne.choisie::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: 0 3px 3px 0; background: var(--accent); }
.ligne.non-lu .nom, .ligne.non-lu .objet { font-weight: 720; }
.avatar { width: 36px; height: 36px; border-radius: 12px; display: grid; place-items: center; font-weight: 700; font-size: 13px; color: #fff; flex: none; }
.ligne .l1 { display: flex; gap: 8px; align-items: baseline; }
.ligne .nom { font-weight: 620; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne .date { margin-left: auto; font-size: 12px; color: var(--encre-3); white-space: nowrap; }
.ligne .objet { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne .extrait { color: var(--encre-3); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ligne .puces, .puces { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.puce { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--encre-2); background: var(--surface-2); border-radius: 999px; padding: 1px 8px; white-space: nowrap; }
.puce .point { width: 7px; height: 7px; border-radius: 50%; }
.puce .ico { width: 12px; height: 12px; }
.puce.pret { background: var(--accent-doux); color: var(--accent-texte); font-weight: 650; }
.puce.alerte { background: color-mix(in srgb, var(--attention) 20%, transparent); color: var(--encre); }
.puce.protege { background: color-mix(in srgb, var(--s-sensible) 16%, transparent); color: var(--encre); white-space: normal; }
.puce.bon { background: color-mix(in srgb, var(--bon) 16%, transparent); color: var(--bon-texte); }
.importance { display: inline-flex; gap: 2px; align-items: center; }
.importance i { width: 4px; height: 10px; border-radius: 2px; background: var(--trait-fort); }
.importance i.plein { background: var(--s-decider); }

/* Barre de sélection */
.barre-selection { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 25; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; padding: 10px 12px; border-radius: 16px; background: #16132d; color: #fff; box-shadow: 0 16px 40px rgba(10, 6, 40, .4); max-width: calc(100vw - 32px); animation: monte .18s ease; }
.barre-selection b { padding: 0 6px; }
.barre-selection .bouton { background: rgba(255, 255, 255, .1); color: #fff; box-shadow: none; }
.barre-selection .bouton:hover { background: rgba(255, 255, 255, .2); }
.barre-selection .bouton.degrade { background: var(--degrade); }
@keyframes monte { from { transform: translate(-50%, 12px); opacity: 0; } }
@media (min-width: 1101px) {
  body.avec-assistant .barre-selection { left: calc(260px + (100vw - 260px - var(--assistant)) / 2); max-width: calc(100vw - 260px - var(--assistant) - 32px); }
}

/* ---- Détail d'un message --------------------------------------------------------------------- */
.detail { background: var(--surface); border-radius: var(--rayon); box-shadow: var(--ombre), inset 0 0 0 1px var(--trait); padding: 22px 24px; position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; }
.detail .fermer { display: none; }
.detail h2 { font-size: 20px; font-weight: 720; letter-spacing: -.02em; line-height: 1.3; }
.entete-message { display: flex; gap: 12px; align-items: center; margin: 14px 0; flex-wrap: wrap; }
.entete-message .qui { min-width: 0; }
.entete-message .qui b { display: block; }
.entete-message .qui span { color: var(--encre-3); font-size: 13px; overflow-wrap: anywhere; }
.entete-message .droite { margin-left: auto; display: flex; gap: 8px; }
.pourquoi { display: flex; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); font-size: 13px; color: var(--encre-2); align-items: flex-start; flex-wrap: wrap; }
.pourquoi > .ico { color: var(--accent-texte); }
.pourquoi b { color: var(--encre); }
.pourquoi .reclasser { margin-left: auto; display: flex; gap: 6px; align-items: center; }
.pourquoi select { border: 0; border-radius: 8px; padding: 4px 8px; background: var(--surface); box-shadow: inset 0 0 0 1px var(--trait-fort); }
.corps { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.62; margin: 18px 0; font-size: 14.5px; }
.fil-precedent { margin-top: 18px; display: grid; gap: 8px; }
.fil-precedent .msg { font-size: 13px; color: var(--encre-2); padding: 10px 12px; border-radius: 10px; background: var(--surface-2); }
.fil-precedent .msg b { color: var(--encre); }

/* Réponse préparée */
.reponse { border-radius: 16px; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); padding: 16px; background: linear-gradient(180deg, var(--accent-doux), transparent 120px), var(--surface); }
.reponse .tete { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; font-weight: 700; flex-wrap: wrap; }
.reponse .tete .ico { color: var(--accent-texte); }
.reponse .tete .puce { margin-left: auto; }
.reponse textarea { min-height: 180px; font-size: 14.5px; background: var(--surface); }
.reponse .actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; align-items: center; }
.reponse .actions .espace { flex: 1; }
.reponse .a { font-size: 13px; color: var(--encre-2); margin: -4px 0 8px; overflow-wrap: anywhere; }
.a-completer { display: grid; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--encre-2); }
.a-completer .titre { display: flex; gap: 6px; align-items: center; color: var(--encre); font-weight: 600; }
.a-completer .titre .ico { color: var(--attention); }
.trou { display: flex; gap: 8px; align-items: center; }
.trou label { flex: none; max-width: 45%; font-size: 12px; color: var(--encre); background: color-mix(in srgb, var(--attention) 22%, transparent); border-radius: 8px; padding: 4px 8px; }
.trou .champ { padding: 6px 10px; }

/* Cartes « réponses à valider » */
.pile-reponses { display: grid; gap: 16px; }
.carte-reponse { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr); gap: 0; padding: 0; overflow: hidden; }
.carte-reponse .recu { padding: 18px 20px; border-right: 1px solid var(--trait); min-width: 0; }
.carte-reponse .recu .entete-message { margin: 0 0 10px; }
.carte-reponse .recu h3 { font-size: 16px; letter-spacing: -.01em; margin-bottom: 8px; }
.carte-reponse .recu .texte { color: var(--encre-2); font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; max-height: 220px; overflow: auto; }
.carte-reponse .reponse { border-radius: 0; box-shadow: none; }

/* ---- Échéances --------------------------------------------------------------------------------- */
.agenda { display: grid; gap: 18px; }
.jour-agenda h3 { font-size: 13px; color: var(--encre-3); font-weight: 650; margin-bottom: 8px; text-transform: capitalize; }
.evenement { display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 12px; background: var(--surface); box-shadow: var(--ombre), inset 0 0 0 1px var(--trait); cursor: pointer; margin-bottom: 8px; }
.evenement:hover { box-shadow: var(--ombre-haute), inset 0 0 0 1px var(--trait-fort); }
.evenement .heure { width: 54px; font-weight: 700; font-variant-numeric: tabular-nums; }
.evenement .quoi b { display: block; }
.evenement .quoi span { color: var(--encre-3); font-size: 13px; }
.mini-evenement { display: flex; gap: 12px; padding: 10px 0; border-top: 1px solid var(--trait); cursor: pointer; }
.mini-evenement:first-child { border-top: 0; }
.date-bloc { width: 44px; text-align: center; border-radius: 11px; padding: 5px 0; background: var(--accent-doux); color: var(--accent-texte); line-height: 1.1; flex: none; }
.date-bloc b { display: block; font-size: 17px; }
.date-bloc span { font-size: 10px; text-transform: uppercase; }

/* ---- Graphique --------------------------------------------------------------------------------- */
.legende { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-bottom: 10px; font-size: 13px; color: var(--encre-2); padding: 0; list-style: none; }
.legende li { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; border-radius: 6px; padding: 2px 4px; }
.legende li:hover { background: var(--survol); color: var(--encre); }
.legende .carre { width: 10px; height: 10px; border-radius: 3px; }
.legende b { color: var(--encre); font-weight: 650; }
.graphique svg { display: block; width: 100%; height: auto; }
.graphique text { fill: var(--encre-3); font-size: 11px; font-variant-numeric: tabular-nums; }
.graphique .colonne:hover .fond { fill: var(--survol); }
.bulle { position: fixed; z-index: 30; pointer-events: none; background: var(--surface); box-shadow: var(--ombre-haute), inset 0 0 0 1px var(--trait); border-radius: 10px; padding: 10px 12px; font-size: 13px; min-width: 170px; }
.bulle .rang { display: grid; grid-template-columns: 14px 1fr auto; gap: 8px; align-items: center; }
.bulle .rang i { height: 2px; border-radius: 1px; }
.bulle .rang b { text-align: right; font-variant-numeric: tabular-nums; }
.bulle .t { color: var(--encre-2); margin-bottom: 4px; }

/* ---- Assistant ------------------------------------------------------------------------------- */
.assistant { position: sticky; top: 0; height: 100vh; display: none; flex-direction: column; background: var(--surface); border-left: 1px solid var(--trait); min-width: 0; }
body.avec-assistant .assistant { display: flex; }
.assistant .tete-assistant { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-bottom: 1px solid var(--trait); }
.assistant .tete-assistant .logo { width: 30px; height: 30px; border-radius: 10px; background: var(--degrade); color: #fff; display: grid; place-items: center; flex: none; }
.assistant .tete-assistant b { display: block; font-size: 15px; letter-spacing: -.01em; }
.assistant .tete-assistant span { display: block; font-size: 12px; color: var(--encre-3); }
.assistant .tete-assistant .droite { margin-left: auto; display: flex; gap: 2px; }
.fil-assistant { flex: 1; overflow-y: auto; padding: 16px 14px; display: flex; flex-direction: column; gap: 14px; }
.accueil-assistant { margin: auto 0; display: grid; gap: 14px; padding: 8px 2px; }
.accueil-assistant h3 { font-size: 20px; letter-spacing: -.02em; }
.accueil-assistant p { color: var(--encre-2); }
.accueil-assistant .suggestions { flex-direction: column; align-items: stretch; }
.accueil-assistant .chip { border-radius: 12px; padding: 9px 12px; }
.msg-moi { align-self: flex-end; max-width: 85%; background: var(--accent); color: #fff; padding: 9px 13px; border-radius: 16px 16px 4px 16px; white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: var(--ombre-accent); }
.msg-tri { align-self: stretch; display: grid; gap: 10px; }
.msg-tri > .texte { display: flex; gap: 10px; align-items: flex-start; }
.msg-tri > .texte .logo { width: 26px; height: 26px; border-radius: 9px; background: var(--degrade); color: #fff; display: grid; place-items: center; flex: none; margin-top: 1px; }
.msg-tri > .texte .logo .ico { width: 14px; height: 14px; }
.msg-tri > .texte p { white-space: pre-wrap; overflow-wrap: anywhere; }
.msg-tri.erreur > .texte p { color: var(--critique-texte); }
.msg-tri .suggestions { padding-left: 36px; }
.ecrit { display: inline-flex; gap: 4px; align-items: center; color: var(--encre-3); font-size: 13px; }
.ecrit i { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); animation: saute 1.2s infinite; }
.ecrit i:nth-child(2) { animation-delay: .15s; } .ecrit i:nth-child(3) { animation-delay: .3s; }
.ecrit span { margin-left: 6px; }
@keyframes saute { 0%, 60%, 100% { transform: translateY(0); opacity: .5; } 30% { transform: translateY(-4px); opacity: 1; } }
.saisie { border-top: 1px solid var(--trait); padding: 12px; display: grid; gap: 8px; }
.saisie form { display: flex; gap: 8px; align-items: flex-end; background: var(--surface-2); border-radius: 14px; padding: 6px 6px 6px 12px; box-shadow: inset 0 0 0 1px var(--trait-fort); }
.saisie form:focus-within { box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent), inset 0 0 0 1px var(--accent); }
.saisie textarea { flex: 1; border: 0; background: transparent; resize: none; min-height: 24px; max-height: 140px; padding: 6px 0; line-height: 1.45; outline: none; }
.saisie .note { font-size: 11.5px; color: var(--encre-3); text-align: center; }
.contexte-gmail { display: flex; gap: 10px; align-items: center; padding: 10px 12px; border-radius: 12px; background: var(--accent-doux); font-size: 13px; }
.contexte-gmail > .ico { color: var(--accent-texte); }
.contexte-gmail b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contexte-gmail span { display: block; color: var(--encre-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.contexte-gmail > div { min-width: 0; flex: 1; }

/* Cartes dans l'assistant */
.carte-tri { background: var(--surface); border-radius: 14px; box-shadow: var(--ombre), inset 0 0 0 1px var(--trait-fort); overflow: hidden; }
.carte-tri > .tete { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--trait); font-weight: 650; font-size: 13px; }
.carte-tri > .tete .ico { color: var(--accent-texte); }
.carte-tri > .tete .droite { margin-left: auto; font-weight: 500; color: var(--encre-3); display: flex; gap: 6px; align-items: center; }
.carte-tri .mini { display: grid; grid-template-columns: 20px 30px minmax(0, 1fr); gap: 8px; padding: 9px 12px; border-top: 1px solid var(--trait); align-items: start; }
.carte-tri .mini.sans-case { grid-template-columns: 30px minmax(0, 1fr); }
.carte-tri .mini:first-of-type { border-top: 0; }
.carte-tri .mini:hover { background: var(--survol); }
.carte-tri .mini .avatar { width: 30px; height: 30px; border-radius: 10px; font-size: 11px; }
.carte-tri .mini .case { margin-top: 6px; }
.carte-tri .mini .corps-mini { min-width: 0; cursor: pointer; }
.carte-tri .mini .l1 { display: flex; gap: 6px; align-items: baseline; font-size: 13px; }
.carte-tri .mini .l1 b { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-tri .mini .l1 span { margin-left: auto; color: var(--encre-3); font-size: 11.5px; white-space: nowrap; }
.carte-tri .mini .objet { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.carte-tri .mini .raisons { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.carte-tri .mini .actions-mini { display: flex; gap: 6px; margin-top: 6px; flex-wrap: wrap; }
.carte-tri .pied { display: flex; gap: 6px; flex-wrap: wrap; padding: 10px 12px; border-top: 1px solid var(--trait); background: var(--surface-2); align-items: center; }
.carte-tri .pied .espace { flex: 1; }
.carte-tri .plus { padding: 8px 12px; font-size: 12.5px; color: var(--encre-3); border-top: 1px solid var(--trait); }
.carte-tri .avertissement { padding: 8px 12px; font-size: 12.5px; background: color-mix(in srgb, var(--attention) 14%, transparent); color: var(--encre); display: flex; gap: 8px; align-items: flex-start; }
.carte-tri .avertissement .ico { color: var(--attention); width: 15px; height: 15px; margin-top: 2px; }
.carte-tri .reponse { border-radius: 0; box-shadow: none; }
.carte-tri .reponse textarea { min-height: 160px; }

.groupe-op { border-top: 1px solid var(--trait); }
.groupe-op:first-of-type { border-top: 0; }
.groupe-op > .ligne-groupe { display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 8px; align-items: start; padding: 10px 12px; }
.groupe-op > .ligne-groupe > .case { margin-top: 3px; }
.groupe-op .nom-groupe { min-width: 0; }
.groupe-op .nom-groupe > button { border: 0; background: none; padding: 0; cursor: pointer; text-align: left; width: 100%; color: inherit; display: flex; gap: 6px; align-items: baseline; }
.groupe-op .nom-groupe b { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.groupe-op .nom-groupe em { font-style: normal; margin-left: auto; font-size: 12px; color: var(--encre-3); white-space: nowrap; }
.groupe-op .nom-groupe > span { display: block; font-size: 12px; color: var(--encre-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.groupe-op .interrupteurs { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.bascule { display: inline-flex; align-items: center; gap: 5px; border: 0; border-radius: 999px; padding: 3px 9px; font-size: 12px; cursor: pointer; background: var(--surface-2); color: var(--encre-3); box-shadow: inset 0 0 0 1px var(--trait); }
.bascule .ico { width: 13px; height: 13px; }
.bascule.actif { background: var(--accent-doux); color: var(--accent-texte); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 40%, transparent); font-weight: 600; }
.bascule:disabled { opacity: .5; cursor: not-allowed; }
.messages-groupe { padding: 0 12px 10px 40px; display: grid; gap: 2px; }
.messages-groupe label { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; gap: 8px; align-items: center; font-size: 12.5px; padding: 4px 6px; border-radius: 8px; cursor: pointer; }
.messages-groupe label:hover { background: var(--survol); }
.messages-groupe label span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.messages-groupe label em { font-style: normal; color: var(--encre-3); font-size: 11.5px; white-space: nowrap; }
.messages-groupe .protege { grid-column: 2 / -1; justify-self: start; }
.rapport { display: grid; gap: 6px; padding: 12px; font-size: 13px; }
.rapport .ligne-rapport { display: flex; gap: 8px; align-items: flex-start; }
.rapport .ligne-rapport .ico { color: var(--bon-texte); margin-top: 2px; width: 16px; height: 16px; }
.rapport .ligne-rapport.attention .ico { color: var(--attention); }
.rapport .ligne-rapport.erreur .ico { color: var(--critique-texte); }
.rapport .ligne-rapport a { overflow-wrap: anywhere; }

/* Agenda */
.evenement-agenda { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px; padding: 9px 12px; border-top: 1px solid var(--trait); align-items: start; font-size: 13px; }
.carte .evenement-agenda:first-child { border-top: 0; }
.evenement-agenda .heure { font-weight: 700; font-variant-numeric: tabular-nums; color: var(--accent-texte); }
.evenement-agenda b { display: block; }
.evenement-agenda span:not(.heure) { display: block; color: var(--encre-3); font-size: 12px; }
.evenement-agenda.libre { opacity: .65; }
.libres { padding: 10px 12px; display: grid; gap: 6px; border-top: 1px solid var(--trait); }
.carte .libres { padding: 10px 0 0; }
.rdv { display: flex; gap: 10px; align-items: center; justify-content: space-between; padding: 12px; flex-wrap: wrap; }
.rdv .quand b { display: block; font-size: 15px; text-transform: capitalize; }
.rdv .quand span { color: var(--encre-3); font-size: 12.5px; }
.chip .case { width: 15px; height: 15px; }

/* ---- Réglages et réponses types --------------------------------------------------------------- */
.section-reglage { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 24px; padding: 22px 0; border-top: 1px solid var(--trait); }
.section-reglage:first-child { border-top: 0; padding-top: 0; }
.section-reglage h3 { font-size: 15px; font-weight: 700; }
.section-reglage .explication { color: var(--encre-3); font-size: 13px; margin-top: 4px; }
.interrupteur { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; cursor: pointer; }
.interrupteur input { appearance: none; width: 38px; height: 22px; border-radius: 999px; background: var(--trait-fort); position: relative; flex: none; cursor: pointer; transition: background .15s; margin: 0; }
.interrupteur input::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; box-shadow: 0 1px 2px rgba(0, 0, 0, .25); }
.interrupteur input:checked { background: var(--accent); }
.interrupteur input:checked::after { transform: translateX(16px); }
.interrupteur b { display: block; font-weight: 600; }
.interrupteur span { color: var(--encre-3); font-size: 13px; }
.modele-reponse { border-radius: 12px; box-shadow: inset 0 0 0 1px var(--trait-fort); padding: 14px; display: grid; gap: 8px; margin-bottom: 10px; background: var(--surface); }
.modele-reponse .ligne-titre { display: flex; gap: 8px; }
.statut-ligne { display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); flex-wrap: wrap; }
.statut-ligne .droite { margin-left: auto; }
.etapes-extension { margin: 8px 0 0; padding-left: 18px; color: var(--encre-2); display: grid; gap: 6px; }
.etapes-extension b { color: var(--encre); }
.code-lien { font: 12px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--surface-2); border-radius: 10px; padding: 8px 10px; overflow-wrap: anywhere; margin-top: 8px; }

/* ---- Journal, tableaux ------------------------------------------------------------------------- */
.tableau { width: 100%; border-collapse: collapse; font-size: 13px; }
.tableau th { text-align: left; color: var(--encre-3); font-weight: 550; padding: 8px 10px; border-bottom: 1px solid var(--trait-fort); }
.tableau td { padding: 9px 10px; border-bottom: 1px solid var(--trait); vertical-align: top; }
.tableau-conteneur { overflow-x: auto; }
.statut-passage { display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }

/* ---- Toasts et fenêtres ------------------------------------------------------------------------ */
.toasts { position: fixed; bottom: 20px; right: 20px; display: grid; gap: 8px; z-index: 50; }
body.avec-assistant .toasts { right: calc(var(--assistant) + 20px); }
.toast { background: #16132d; color: #fff; padding: 10px 14px; border-radius: 12px; box-shadow: var(--ombre-haute); font-size: 13.5px; display: flex; gap: 10px; align-items: center; animation: entre .18s ease; max-width: 440px; }
.toast .ico { color: #b9a8ff; }
.toast.erreur { background: var(--critique); }
.toast.erreur .ico { color: #fff; }
.toast .bouton { margin-left: 6px; padding: 4px 10px; background: rgba(255, 255, 255, .14); color: #fff; box-shadow: none; }
.toast .bouton:hover { background: rgba(255, 255, 255, .26); }
@keyframes entre { from { transform: translateY(8px); opacity: 0; } }
.voile { position: fixed; inset: 0; background: rgba(10, 8, 30, .45); display: grid; place-items: center; z-index: 40; padding: 16px; backdrop-filter: blur(2px); }
.fenetre { background: var(--surface); border-radius: 18px; box-shadow: var(--ombre-haute); padding: 22px; width: min(480px, 100%); display: grid; gap: 12px; }
.fenetre h3 { font-size: 17px; }
.fenetre .apercu { white-space: pre-wrap; font-size: 13px; color: var(--encre-2); background: var(--surface-2); border-radius: 10px; padding: 10px 12px; max-height: 200px; overflow: auto; }
.fenetre .actions { display: flex; justify-content: flex-end; gap: 8px; }
.chargement { color: var(--encre-3); padding: 30px 0; text-align: center; }

/* ---- Panneau latéral de Gmail (extension Chrome) ---------------------------------------------- */
.tete-panneau { position: sticky; top: 0; z-index: 12; display: none; align-items: center; gap: 6px; padding: 8px 10px; height: 54px; background: var(--barre); color: var(--barre-texte); }
body.panneau .tete-panneau { display: flex; }
body.panneau .appli, body.panneau.avec-assistant .appli { grid-template-columns: minmax(0, 1fr); min-height: calc(100vh - 54px); }
body.panneau .barre, body.panneau .haut { display: none; }
body.panneau .contenu { padding: 12px 12px 90px; }
body.panneau .assistant { position: fixed; top: 54px; left: 0; right: 0; bottom: 0; height: auto; border-left: 0; z-index: 8; }
.tete-panneau .selecteur-boite { flex: 1; min-width: 0; }
.tete-panneau .selecteur-boite > button { padding: 6px 8px; }
.tete-panneau .onglets { display: flex; gap: 2px; }
.tete-panneau .onglets button, .tete-panneau .onglets a { border: 0; background: none; color: var(--barre-texte-2); padding: 7px; border-radius: 9px; cursor: pointer; display: inline-grid; place-items: center; }
.tete-panneau .onglets .actif, .tete-panneau .onglets button:hover, .tete-panneau .onglets a:hover { background: var(--barre-actif); color: #fff; }
body.panneau .lecture { grid-template-columns: minmax(0, 1fr); }
body.panneau .detail { position: fixed; top: 54px; left: 0; right: 0; bottom: 0; max-height: none; border-radius: 0; z-index: 9; padding: 16px 14px 40px; }
body.panneau .detail.cache-mobile { display: none; }
body.panneau .detail .fermer { display: inline-flex; margin-bottom: 8px; }
body.panneau .carte-reponse { grid-template-columns: minmax(0, 1fr); }
body.panneau .carte-reponse .recu { border-right: 0; border-bottom: 1px solid var(--trait); }
body.panneau .toasts, body.panneau.avec-assistant .toasts { right: 12px; left: 12px; bottom: 96px; }
body.panneau .barre-selection { bottom: 12px; }
body.panneau .hero { padding: 18px; }

/* ---- Écrans étroits -------------------------------------------------------------------------- */
@media (max-width: 1320px) {
  :root { --assistant: 380px; }
  body.avec-assistant:not(.panneau) .appli { grid-template-columns: 236px minmax(0, 1fr) var(--assistant); }
}
@media (max-width: 1100px) {
  .grille-2 { grid-template-columns: minmax(0, 1fr); }
  .section-reglage { grid-template-columns: minmax(0, 1fr); gap: 10px; }
  .carte-reponse { grid-template-columns: minmax(0, 1fr); }
  .carte-reponse .recu { border-right: 0; border-bottom: 1px solid var(--trait); }
  .appli, body.avec-assistant:not(.panneau) .appli { grid-template-columns: minmax(0, 1fr); }
  body.avec-assistant:not(.panneau) .assistant { position: fixed; top: 0; right: 0; bottom: 0; width: min(430px, 100vw); height: auto; z-index: 32; box-shadow: var(--ombre-haute); }
  body.avec-assistant .toasts { right: 20px; }
  .barre { position: fixed; left: 0; top: 0; bottom: 0; width: 272px; z-index: 35; transform: translateX(-100%); transition: transform .2s ease; }
  .barre.ouverte { transform: none; box-shadow: var(--ombre-haute); }
  .bouton.menu-mobile { display: inline-flex; }
}
@media (max-width: 900px) {
  .haut { padding: 10px 14px; gap: 10px; }
  .haut .titre p { display: none; }
  .contenu { padding: 16px 16px 90px; }
  .commande .kbd, .synchro-texte, .texte-actualiser { display: none; }
  .commande { min-width: 0; }
  .commande input { padding-right: 12px; }
  .lecture { grid-template-columns: minmax(0, 1fr); }
  .detail { position: fixed; inset: 0; top: 0; max-height: none; border-radius: 0; z-index: 30; padding: 18px 16px 40px; }
  .detail.cache-mobile { display: none; }
  .detail .fermer { display: inline-flex; margin-bottom: 8px; }
  .hero { padding: 20px; border-radius: 18px; }
  .hero .commande-hero { flex-direction: column; }
}
@media (max-width: 560px) {
  .haut .titre { display: none; }
  .commande { max-width: none; }
  .tuiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .tuile .valeur { font-size: 28px; }
}

/* ---- Hors session : mise en route, connexion, conditions --------------------------------------- */
body.hors-session .appli { grid-template-columns: minmax(0, 1fr); }
body.hors-session .barre, body.hors-session .haut, body.hors-session .assistant, body.hors-session .tete-panneau { display: none; }
body.hors-session { background: radial-gradient(90% 60% at 50% -10%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 70%), var(--page); }
.ecran-connexion { max-width: 620px; margin: 6vh auto 40px; padding: 0 16px; display: grid; gap: 16px; }
.marque.grande { padding: 0; margin-bottom: 4px; }
.marque.grande .logo { width: 42px; height: 42px; border-radius: 13px; }
.marque.grande b { font-size: 23px; }
.marque.grande span { font-size: 13px; }
.carte-connexion { display: grid; gap: 14px; padding: 26px; border-radius: 20px; }
.carte-connexion h2 { font-size: 22px; letter-spacing: -.02em; }
.carte-connexion > p { color: var(--encre-2); }
.carte-connexion > .bouton { justify-self: start; }
.bouton.grand { padding: 11px 18px; font-size: 15px; }
.aide.legal { font-size: 12px; }
ul.garanties { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
ul.garanties li { display: flex; gap: 10px; align-items: flex-start; color: var(--encre-2); }
ul.garanties li .ico { color: var(--bon-texte); margin-top: 2px; }
ul.garanties li b { color: var(--encre); }
label.accord { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); cursor: pointer; }
label.accord input { margin-top: 3px; }
.form-cle { display: flex; gap: 8px; margin-top: 10px; max-width: 520px; }
.form-code { display: grid; gap: 6px; }
.form-code label { font-weight: 550; }
.code-acces { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .06em; text-transform: uppercase; }
/* Le champ d'entrée prend un code ou une adresse Gmail : pas de majuscules forcées, le serveur normalise le code. */
.champ-code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; letter-spacing: .03em; }
.separateur { display: flex; align-items: center; gap: 10px; color: var(--encre-3); font-size: 13px; }
.separateur::before, .separateur::after { content: ""; flex: 1; height: 1px; background: var(--trait-fort); }
.carte-connexion > a.bouton { justify-self: start; }
.form-nouveau-code { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin: 12px 0; }
.champ-etiquete { display: grid; gap: 4px; }
.champ-etiquete .champ { width: 11em; }
.champ-etiquete input[type=number] { width: 6em; }
.rangee { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.rangee .champ { flex: 1; min-width: 200px; }

/* Consommation, données, administration */
.jauge-conso .chiffres b { font-size: 18px; font-variant-numeric: tabular-nums; }
.jauge-conso .jauge-progres { margin-top: 8px; }
.jauge-progres.haute i { background: var(--attention); }
.tableau-donnees th { width: 42%; font-weight: 550; color: var(--encre); }
.tableau-donnees td { font-variant-numeric: tabular-nums; }
.zone-danger { box-shadow: var(--ombre), inset 0 0 0 1px color-mix(in srgb, var(--critique) 40%, transparent); }
.etat-compte { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.actions-ligne { white-space: nowrap; text-align: right; }
@media (max-width: 720px) {
  .form-cle { flex-direction: column; }
  .ecran-connexion { margin-top: 3vh; }
  .carte-connexion { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* Consignes */
.ligne-consigne { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; padding: 10px 0; border-top: 1px solid var(--trait); }
.ligne-consigne:first-of-type { border-top: 0; }
.ligne-consigne > div { min-width: 0; display: grid; gap: 2px; }
.ligne-consigne b { font-weight: 600; overflow-wrap: anywhere; }
.ligne-consigne span { color: var(--encre-2); font-size: 13px; }
.carte-tri .ligne-consigne { padding: 10px 14px; }
.encart-depasses { margin-bottom: 14px; }
.encart-depasses .tete { display: flex; align-items: center; gap: 8px; }
.encart-depasses .tete .droite { margin-left: auto; }
.encart-depasses ul { margin: 10px 0 6px; padding-left: 18px; display: grid; gap: 4px; }
.encart-depasses li span { color: var(--encre-2); }

/* Lecture d'un mail */
.lecteur { margin: 6px 0 16px; }
.outils-lecture { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; align-items: center; }
.cadre-mail { width: 100%; min-height: 220px; height: 420px; border: 1px solid var(--trait-fort); border-radius: 14px; background: #fff; display: block; }
.pieces { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.piece { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--trait-fort); border-radius: 10px; color: inherit; text-decoration: none; max-width: 100%; }
.piece .nom { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }
.piece .taille { color: var(--encre-3); font-size: 12px; }
.piece:hover { border-color: var(--accent); }

/* Offres d'emploi */
.synthese-emploi .synthese { font-size: 15px; line-height: 1.55; margin: 6px 0 0; }
.chiffres-emploi { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.chiffres-emploi div { background: color-mix(in srgb, var(--accent) 7%, transparent); border-radius: 12px; padding: 10px 12px; display: grid; }
.chiffres-emploi b { font-size: 22px; }
.chiffres-emploi span { color: var(--encre-2); font-size: 12px; }
.liste-offres { display: grid; gap: 2px; }
.offre { display: grid; grid-template-columns: 44px 1fr auto; gap: 12px; align-items: start; padding: 12px 4px; border-top: 1px solid var(--trait); }
.offre:first-child { border-top: 0; }
.offre .score { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; font-weight: 700;
  color: var(--c); background: color-mix(in srgb, var(--c) 14%, transparent); }
.offre.compacte .score { width: 34px; height: 34px; font-size: 13px; }
.offre .quoi { min-width: 0; display: grid; gap: 3px; }
.offre .quoi b { overflow-wrap: anywhere; }
.offre .ou { color: var(--encre-2); font-size: 13px; }
.offre .motifs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.offre .motif { font-size: 12px; padding: 2px 8px; border-radius: 999px; background: color-mix(in srgb, var(--encre) 6%, transparent); color: var(--encre-2); }
.offre .actions { display: flex; gap: 6px; align-items: center; }
.alerte-forem { color: var(--s-decider); }
.ecartees summary, details.carte > summary { cursor: pointer; font-weight: 600; }
.ecartees ul { margin: 10px 0 0; padding-left: 18px; display: grid; gap: 4px; color: var(--encre-2); font-size: 13px; }
.profil-emploi { display: grid; gap: 14px; margin-top: 12px; }
.champ-profil { display: grid; gap: 4px; }
@media (max-width: 640px) {
  .chiffres-emploi { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .offre { grid-template-columns: 38px 1fr; }
  .offre .actions { grid-column: 2; }
}
