/* Nowtif CRM : système décrit dans crm/DESIGN.md. Mode Operate, référence Catalyst.
   90 % neutre, un seul accent (le bleu action Nowtif #2251C8), le vermillon seulement au point du
   logo (MARQUE.md). Grille de 4 px, rayon 8 px (6 px petits contrôles), filets de 1 px, ombres
   seulement pour ce qui flotte. Aucune ressource externe, aucun style en ligne. */
@font-face {
  font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 400; font-display: swap;
  src: url("/static/marque/schibsted-grotesk-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Schibsted Grotesk"; font-style: normal; font-weight: 600; font-display: swap;
  src: url("/static/marque/schibsted-grotesk-latin-600-normal.woff2") format("woff2");
}

/* Thème clair, celui par défaut (référence Finexy) : fond gris perle, grand panneau clair aux coins
   très arrondis, cartes blanches ; encre marine pour la pilule active, cobalt profond pour l'action,
   bleu ciel doux pour la série hachurée et les teintes */
:root {
  --background: oklch(1 0 0);
  --foreground: oklch(0.235 0.035 264);
  --card: oklch(1 0 0);
  --card-foreground: oklch(0.235 0.035 264);
  --popover: oklch(1 0 0);
  --popover-foreground: oklch(0.235 0.035 264);
  --primary: oklch(0.485 0.2 265);
  --primary-foreground: oklch(1 0 0);
  --secondary: oklch(0.955 0.006 255);
  --secondary-foreground: oklch(0.235 0.035 264);
  --muted: oklch(0.958 0.005 255);
  --muted-foreground: oklch(0.5 0.022 262);
  --accent: oklch(0.94 0.008 255);
  --accent-foreground: oklch(0.235 0.035 264);
  --destructive: oklch(0.52 0.19 27);
  --destructive-foreground: oklch(1 0 0);
  --border: oklch(0.925 0.006 255);
  --input: oklch(0.885 0.008 255);
  --ring: oklch(0.485 0.2 265);
  --chart-1: oklch(0.485 0.2 265);
  --chart-2: oklch(0.79 0.095 237);
  --chart-3: oklch(0.66 0.025 262);
  --chart-4: oklch(0.62 0.12 168);
  --chart-5: oklch(0.74 0.13 75);
  --sidebar: oklch(0.976 0.004 255);
  --sidebar-foreground: oklch(0.235 0.035 264);
  --sidebar-primary: oklch(0.235 0.045 264);
  --sidebar-primary-foreground: oklch(1 0 0);
  --sidebar-accent: oklch(0.935 0.007 255);
  --sidebar-accent-foreground: oklch(0.235 0.035 264);
  --sidebar-border: oklch(0.915 0.006 255);
  --sidebar-ring: oklch(0.485 0.2 265);
  --succes: oklch(0.5 0.13 152);
  --avert: oklch(0.52 0.11 70);
  --bleu: oklch(0.485 0.2 265);
  --primary-hover: oklch(0.415 0.18 266);
  --fond: oklch(0.935 0.007 255);
  --ciel: oklch(0.8 0.085 237);
  --ciel-doux: oklch(0.945 0.03 237);
  --vedette-a: oklch(0.56 0.19 262);
  --vedette-b: oklch(0.36 0.16 267);
  --logo-encre: #0F1E3A; --logo-point: #F0531C;
  --input-bg: oklch(1 0 0);
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%236B7385' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 10l4-4 4 4M8 14l4 4 4-4'/%3E%3C/svg%3E");
  --ombre-flotte: 0 12px 32px -12px oklch(0.3 0.04 262 / 0.22), 0 1px 3px oklch(0.3 0.04 262 / 0.08);
  --voile: oklch(0.2 0.03 262 / 0.4);
  color-scheme: light;
}

/* Thème sombre, au choix : encre de nuit, panneau bleuté, pilule active claire (écrit deux fois à l'identique) */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: oklch(0.2 0.018 262);
    --foreground: oklch(0.97 0.005 262);
    --card: oklch(0.215 0.02 262);
    --card-foreground: oklch(0.97 0.005 262);
    --popover: oklch(0.245 0.022 262);
    --popover-foreground: oklch(0.97 0.005 262);
    --primary: oklch(0.565 0.205 261);
    --primary-foreground: oklch(1 0 0);
    --secondary: oklch(0.265 0.022 262);
    --secondary-foreground: oklch(0.97 0.005 262);
    --muted: oklch(0.255 0.02 262);
    --muted-foreground: oklch(0.735 0.022 262);
    --accent: oklch(0.29 0.024 262);
    --accent-foreground: oklch(0.97 0.005 262);
    --destructive: oklch(0.72 0.17 22);
    --destructive-foreground: oklch(0.16 0.01 262);
    --border: oklch(0.86 0.03 262 / 10%);
    --input: oklch(0.86 0.03 262 / 16%);
    --ring: oklch(0.72 0.15 258);
    --chart-1: oklch(0.66 0.18 260);
    --chart-2: oklch(0.82 0.09 237);
    --chart-3: oklch(0.6 0.03 262);
    --chart-4: oklch(0.8 0.13 165);
    --chart-5: oklch(0.84 0.12 88);
    --sidebar: oklch(0.17 0.017 262);
    --sidebar-foreground: oklch(0.95 0.008 262);
    --sidebar-primary: oklch(0.96 0.01 255);
    --sidebar-primary-foreground: oklch(0.2 0.035 264);
    --sidebar-accent: oklch(0.255 0.02 262);
    --sidebar-accent-foreground: oklch(0.97 0.005 262);
    --sidebar-border: oklch(0.86 0.03 262 / 9%);
    --sidebar-ring: oklch(0.72 0.15 258);
    --succes: oklch(0.8 0.15 158);
    --avert: oklch(0.83 0.13 80);
    --bleu: oklch(0.76 0.13 250);
    --primary-hover: oklch(0.61 0.2 259);
    --fond: oklch(0.12 0.014 262);
    --ciel: oklch(0.74 0.1 240);
    --ciel-doux: oklch(0.3 0.05 255);
    --vedette-a: oklch(0.55 0.2 262);
    --vedette-b: oklch(0.33 0.15 267);
    --logo-encre: #FFFFFF;
    --input-bg: oklch(0.86 0.03 262 / 4%);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239AA3B5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 10l4-4 4 4M8 14l4 4 4-4'/%3E%3C/svg%3E");
    --ombre-flotte: 0 12px 32px -8px oklch(0.05 0.02 262 / 0.7), 0 1px 3px oklch(0.05 0.02 262 / 0.5);
    --voile: oklch(0.08 0.02 262 / 0.66);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
    --background: oklch(0.2 0.018 262);
    --foreground: oklch(0.97 0.005 262);
    --card: oklch(0.215 0.02 262);
    --card-foreground: oklch(0.97 0.005 262);
    --popover: oklch(0.245 0.022 262);
    --popover-foreground: oklch(0.97 0.005 262);
    --primary: oklch(0.565 0.205 261);
    --primary-foreground: oklch(1 0 0);
    --secondary: oklch(0.265 0.022 262);
    --secondary-foreground: oklch(0.97 0.005 262);
    --muted: oklch(0.255 0.02 262);
    --muted-foreground: oklch(0.735 0.022 262);
    --accent: oklch(0.29 0.024 262);
    --accent-foreground: oklch(0.97 0.005 262);
    --destructive: oklch(0.72 0.17 22);
    --destructive-foreground: oklch(0.16 0.01 262);
    --border: oklch(0.86 0.03 262 / 10%);
    --input: oklch(0.86 0.03 262 / 16%);
    --ring: oklch(0.72 0.15 258);
    --chart-1: oklch(0.66 0.18 260);
    --chart-2: oklch(0.82 0.09 237);
    --chart-3: oklch(0.6 0.03 262);
    --chart-4: oklch(0.8 0.13 165);
    --chart-5: oklch(0.84 0.12 88);
    --sidebar: oklch(0.17 0.017 262);
    --sidebar-foreground: oklch(0.95 0.008 262);
    --sidebar-primary: oklch(0.96 0.01 255);
    --sidebar-primary-foreground: oklch(0.2 0.035 264);
    --sidebar-accent: oklch(0.255 0.02 262);
    --sidebar-accent-foreground: oklch(0.97 0.005 262);
    --sidebar-border: oklch(0.86 0.03 262 / 9%);
    --sidebar-ring: oklch(0.72 0.15 258);
    --succes: oklch(0.8 0.15 158);
    --avert: oklch(0.83 0.13 80);
    --bleu: oklch(0.76 0.13 250);
    --primary-hover: oklch(0.61 0.2 259);
    --fond: oklch(0.12 0.014 262);
    --ciel: oklch(0.74 0.1 240);
    --ciel-doux: oklch(0.3 0.05 255);
    --vedette-a: oklch(0.55 0.2 262);
    --vedette-b: oklch(0.33 0.15 267);
    --logo-encre: #FFFFFF;
    --input-bg: oklch(0.86 0.03 262 / 4%);
    --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239AA3B5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M8 10l4-4 4 4M8 14l4 4 4-4'/%3E%3C/svg%3E");
    --ombre-flotte: 0 12px 32px -8px oklch(0.05 0.02 262 / 0.7), 0 1px 3px oklch(0.05 0.02 262 / 0.5);
    --voile: oklch(0.08 0.02 262 / 0.66);
    color-scheme: dark;
}

/* Jetons dérivés : espace, rayons, teintes d'état, échelle de chaleur */
:root {
  --e1: 4px; --e2: 8px; --e3: 12px; --e4: 16px; --e5: 20px; --e6: 24px; --e8: 32px; --e10: 40px; --e12: 48px;
  --r: 8px; --r-sm: 6px;
  --gouttiere: 32px;
  --border-soft: color-mix(in srgb, var(--border) 70%, transparent);
  --border-strong: color-mix(in srgb, var(--foreground) 20%, var(--background));
  --input-strong: color-mix(in srgb, var(--foreground) 34%, var(--background));
  --anneau: 0 0 0 3px color-mix(in srgb, var(--ring) 28%, transparent);
  --teinte-gris: var(--muted);
  --teinte-vert: color-mix(in srgb, var(--succes) 12%, var(--background));
  --teinte-rouge: color-mix(in srgb, var(--destructive) 10%, var(--background));
  --teinte-ambre: color-mix(in srgb, var(--avert) 12%, var(--background));
  --teinte-bleu: color-mix(in srgb, var(--bleu) 10%, var(--background));
  --chaud-0: var(--muted);
  --chaud-1: color-mix(in srgb, var(--chart-1) 22%, var(--muted));
  --chaud-2: color-mix(in srgb, var(--chart-1) 45%, var(--muted));
  --chaud-3: color-mix(in srgb, var(--chart-1) 70%, var(--muted));
  --chaud-4: var(--chart-1);
  --wa: var(--succes); --mail: var(--muted-foreground);
  --heure: 48px;
  --courbe: cubic-bezier(.23, 1, .32, 1);
  --courbe-glisse: cubic-bezier(.77, 0, .175, 1);
  --courbe-tiroir: cubic-bezier(.32, .72, 0, 1);
  --f: "Schibsted Grotesk", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  --loupe: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238B8B94' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
}

/* Base */
* { box-sizing: border-box; border-color: var(--border); }
html, body { height: 100%; }
body {
  margin: 0; background: var(--sidebar); color: var(--foreground); font-family: var(--f); font-size: 14px; line-height: 20px;
  font-synthesis: none; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility;
  padding-left: env(safe-area-inset-left, 0px); padding-right: env(safe-area-inset-right, 0px);
  -webkit-tap-highlight-color: transparent;
}
::selection { background: color-mix(in srgb, var(--bleu) 22%, transparent); color: var(--foreground); }
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
[hidden] { display: none !important; }
b, strong { font-weight: 600; }
h1, h2, h3, h4 { font-weight: 600; text-wrap: balance; }
p { text-wrap: pretty; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; padding: 0; }
button:disabled { opacity: .5; cursor: not-allowed; }
input, select, textarea { font: inherit; color: var(--foreground); caret-color: var(--bleu); }
:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
a { color: var(--bleu); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
::placeholder { color: var(--muted-foreground); opacity: 1; }
kbd { font-family: inherit; font-size: 12px; line-height: 16px; }
.mono { font-variant-numeric: lining-nums; }
.muted, .faint { color: var(--muted-foreground); }
.vide { color: var(--muted-foreground); font-size: 14px; padding: var(--e8) var(--e4); text-align: center; margin: 0; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg { flex: none; }
.logo { color: var(--logo-encre); flex: none; }
.logo .logo-point { fill: var(--logo-point); }
.sec, .petit-titre { font-size: 12px; font-weight: 600; line-height: 16px; color: var(--muted-foreground); }
.produit {
  font-size: 12px; font-weight: 600; color: var(--muted-foreground); border: 1px solid var(--border); border-radius: var(--r-sm);
  padding: 0 6px; line-height: 20px;
}

/* Champs */
.champ { display: grid; gap: var(--e2); font-size: 13px; }
.champ > span { color: var(--foreground); font-size: 14px; font-weight: 600; line-height: 20px; }
.champ small { color: var(--muted-foreground); font-size: 13px; line-height: 20px; }
.champ small.erreur-txt { color: var(--destructive); padding: 6px 10px; }
.inp {
  width: 100%; min-width: 0; min-height: 36px; padding: 7px 12px; font-size: 14px; line-height: 20px;
  background: var(--input-bg); border: 1px solid var(--input); border-radius: var(--r);
  transition: border-color .15s var(--courbe), box-shadow .15s var(--courbe);
}
.inp:hover:not(:disabled):not(:focus-visible) { border-color: var(--input-strong); }
textarea.inp { resize: vertical; min-height: 72px; }
select.inp {
  appearance: none; -webkit-appearance: none; padding-right: 32px; cursor: pointer;
  background-image: var(--chevron); background-repeat: no-repeat; background-position: right 8px center; background-size: 16px;
}
select.inp option { background: var(--popover); color: var(--popover-foreground); }
.inp:focus-visible { outline: none; border-color: var(--ring); box-shadow: var(--anneau); }
.inp[aria-invalid="true"] { border-color: var(--destructive); box-shadow: 0 0 0 3px color-mix(in srgb, var(--destructive) 18%, transparent); }
.inp:disabled { opacity: .5; cursor: not-allowed; }
.grille2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--e3); align-items: start; }
.case { display: flex; gap: var(--e2); align-items: center; font-size: 14px; cursor: pointer; min-height: 32px; }
.case input, .dlg input[type="checkbox"]:not([role="switch"]), .form-reglages input[type="checkbox"]:not([role="switch"]):not(.sw) {
  appearance: none; -webkit-appearance: none; margin: 0; width: 16px; height: 16px; flex: none; cursor: pointer;
  border: 1px solid var(--input-strong); border-radius: 4px; background: var(--input-bg);
  display: inline-grid; place-items: center; transition: background-color .15s var(--courbe), border-color .15s var(--courbe);
}
.case input::after, .dlg input[type="checkbox"]:not([role="switch"])::after, .form-reglages input[type="checkbox"]:not([role="switch"]):not(.sw)::after {
  content: ""; width: 8px; height: 4px; border: solid var(--primary-foreground); border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg); opacity: 0;
}
.case input:checked, .dlg input[type="checkbox"]:not([role="switch"]):checked, .form-reglages input[type="checkbox"]:not([role="switch"]):not(.sw):checked { background: var(--primary); border-color: var(--primary); }
.case input:checked::after, .dlg input[type="checkbox"]:not([role="switch"]):checked::after, .form-reglages input[type="checkbox"]:not([role="switch"]):not(.sw):checked::after { opacity: 1; }
fieldset { border: 0; padding: 0; margin: 0; display: grid; gap: var(--e4); min-width: 0; }
legend { padding: 0; }
details > summary { cursor: pointer; font-size: 13px; color: var(--muted-foreground); }

/* Boutons : primaire bleu, secondaire, contour (défaut), fantôme, destructif, lien, icône */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--e2); white-space: nowrap;
  min-height: 36px; padding: 7px 12px; font-size: 14px; font-weight: 600; line-height: 20px; text-decoration: none;
  border: 1px solid var(--input); border-radius: var(--r); background: var(--input-bg); color: var(--foreground);
  -webkit-user-select: none; user-select: none;
  transition: background-color .15s var(--courbe), border-color .15s var(--courbe), color .15s var(--courbe), transform .1s var(--courbe);
}
.btn:hover:not(:disabled) { background: var(--accent); color: var(--accent-foreground); text-decoration: none; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn:focus-visible { outline: none; border-color: var(--ring); box-shadow: var(--anneau); }
.btn[aria-busy="true"] { color: var(--muted-foreground); cursor: progress; }
.btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.btn.pri { background: var(--primary); border-color: var(--primary); color: var(--primary-foreground); }
.btn.pri:hover:not(:disabled) { background: var(--primary-hover); border-color: var(--primary-hover); color: var(--primary-foreground); }
.btn.pri:focus-visible { border-color: var(--primary); }
.btn.sec { background: var(--secondary); border-color: transparent; color: var(--secondary-foreground); }
.btn.sec:hover:not(:disabled) { background: var(--accent); }
.btn.danger { color: var(--destructive); border-color: transparent; background: color-mix(in srgb, var(--destructive) 10%, transparent); }
.btn.danger:hover:not(:disabled) { background: color-mix(in srgb, var(--destructive) 16%, transparent); color: var(--destructive); }
.btn.danger.plein { background: var(--destructive); color: var(--destructive-foreground); }
.btn.petit { min-height: 32px; padding: 5px 10px; font-size: 13px; gap: 6px; }
.btn.grand { min-height: 40px; padding: 9px 16px; }
.btn.discret { background: transparent; border-color: transparent; color: var(--muted-foreground); }
.btn.discret:hover:not(:disabled) { background: var(--accent); color: var(--accent-foreground); }
.btn.lien { border: 0; background: none; min-height: 0; padding: 0; color: var(--bleu); font-weight: 600; }
.btn.lien:hover:not(:disabled) { background: none; color: var(--bleu); text-decoration: underline; }
.btn.icone { min-height: 36px; min-width: 36px; padding: 0; }
.btn.icone svg { width: 16px; height: 16px; stroke-width: 1.75; }
.btn.icone.discret { min-height: 32px; min-width: 32px; }
.aide { font-size: 13px; color: var(--muted-foreground); background: var(--muted); padding: 8px 12px; border-radius: var(--r); margin: 0; }
.alerte {
  font-size: 13px; color: var(--foreground); background: var(--teinte-ambre); padding: 8px 12px; border-radius: var(--r);
  border: 1px solid color-mix(in srgb, var(--avert) 30%, transparent);
}
.erreur-txt { font-size: 13px; color: var(--destructive); background: var(--teinte-rouge); padding: 8px 12px; border-radius: var(--r); overflow-wrap: anywhere; }
.copie { display: flex; gap: 6px; align-items: stretch; min-width: 0; }
.copie code {
  flex: 1; min-width: 0; font-family: var(--mono); font-size: 12px; background: var(--muted); border: 1px solid var(--border);
  padding: 8px 12px; border-radius: var(--r); overflow-wrap: anywhere;
}

/* Interrupteur */
.sw, .interrupteur input {
  appearance: none; -webkit-appearance: none; margin: 0; width: 32px; height: 20px; border-radius: 999px; background: var(--input);
  position: relative; flex: none; cursor: pointer; border: 0; transition: background-color .15s var(--courbe);
}
.sw::before, .interrupteur input::before { content: ""; position: absolute; inset: -12px -6px; }
.sw::after, .interrupteur input::after {
  content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: oklch(1 0 0);
  box-shadow: 0 1px 2px oklch(0 0 0 / 0.2); transition: transform .15s var(--courbe);
}
.sw[aria-checked="true"], .sw:checked, .interrupteur input:checked { background: var(--primary); }
.sw[aria-checked="true"]::after, .sw:checked::after, .interrupteur input:checked::after { transform: translateX(12px); }
.sw:focus-visible, .interrupteur input:focus-visible { outline: none; box-shadow: var(--anneau); }
.interrupteur { display: flex; gap: var(--e3); align-items: center; font-weight: 600; cursor: pointer; }
.toggle { margin-left: auto; display: flex; align-items: center; gap: var(--e2); font-size: 13px; color: var(--muted-foreground); }

/* Onglets soulignés (Catalyst) */
.onglets { display: flex; gap: var(--e6); border-bottom: 1px solid var(--border); align-items: stretch; }
.onglet {
  position: relative; display: inline-flex; align-items: center; gap: var(--e2); min-height: 40px; padding: 0; margin-bottom: -1px;
  font-size: 14px; font-weight: 600; color: var(--muted-foreground); white-space: nowrap; border-bottom: 2px solid transparent;
  transition: color .15s var(--courbe), border-color .15s var(--courbe);
}
.onglet:hover { color: var(--foreground); }
.onglet[aria-selected="true"] { color: var(--foreground); border-bottom-color: var(--foreground); }
.onglet:focus-visible { outline-offset: -2px; border-radius: var(--r-sm); }
.onglet .compte-pastille {
  min-width: 20px; padding: 0 6px; border-radius: var(--r-sm); background: var(--muted); color: var(--muted-foreground);
  font-size: 12px; line-height: 20px; text-align: center; font-variant-numeric: proportional-nums;
}
.onglet[aria-selected="true"] .compte-pastille { color: var(--foreground); }

/* Sélecteur segmenté */
.segments { display: inline-flex; padding: 2px; gap: 2px; background: var(--muted); border-radius: var(--r); align-items: stretch; }
.segment {
  min-height: 28px; padding: 3px 10px; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; color: var(--muted-foreground);
  border: 1px solid transparent; display: inline-flex; align-items: center; justify-content: center; gap: 6px; white-space: nowrap;
  transition: background-color .15s var(--courbe), color .15s var(--courbe);
}
.segment:hover { color: var(--foreground); }
.segment[aria-checked="true"] { background: var(--background); border-color: var(--border); color: var(--foreground); }
:root[data-theme="dark"] .segment[aria-checked="true"] { background: var(--accent); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .segment[aria-checked="true"] { background: var(--accent); } }

/* Badges : teinte sans bordure */
.tag, .st, .badge {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 6px; font-size: 12px; font-weight: 600; line-height: 20px;
  border-radius: var(--r-sm); white-space: nowrap; border: 0; background: var(--muted); color: var(--muted-foreground);
}
.tag svg, .badge svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.t-reservation, .st.new, .st.nouvelle { background: var(--teinte-bleu); color: var(--bleu); }
.t-devis { background: var(--teinte-vert); color: var(--succes); }
.t-urgent, .t-annulation { background: var(--teinte-rouge); color: var(--destructive); }
.t-pub { background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.st.ok, .st.confirmee { background: var(--teinte-vert); color: var(--succes); }
.st.wait, .st.a_confirmer { background: var(--teinte-ambre); color: var(--avert); }
.st.bad, .st.annulee { color: var(--muted-foreground); text-decoration: line-through; text-decoration-thickness: 1px; }
.tag.ia { background: transparent; color: var(--foreground); box-shadow: inset 0 0 0 1px var(--border); }
.tag.ia::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--bleu); }

/* Filtres : bord pointillé (shadcn tasks), plein une fois choisis */
.filtres { display: flex; gap: var(--e2); flex-wrap: wrap; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; font-size: 13px; font-weight: 600;
  border: 1px dashed var(--input-strong); border-radius: var(--r); color: var(--foreground); background: transparent;
  transition: background-color .15s var(--courbe), border-color .15s var(--courbe);
}
.chip:hover { background: var(--accent); }
.chip[aria-pressed="true"] { border-style: solid; border-color: var(--foreground); background: var(--accent); }
.chip .c { font-size: 12px; color: var(--muted-foreground); font-weight: 400; font-variant-numeric: proportional-nums; }

/* Connexion (Linear, Vercel) : page blanche centrée, logo seul, un formulaire sans cadre */
.auth {
  min-height: 100%; display: grid; grid-template-rows: minmax(0, 1fr) auto; justify-items: center;
  padding: var(--e12) var(--e4) calc(var(--e6) + env(safe-area-inset-bottom, 0px)); background: var(--background);
}
.auth-boite { align-self: center; width: 100%; max-width: 352px; display: grid; gap: var(--e8); }
.auth-marque { display: flex; align-items: center; justify-content: center; gap: var(--e2); }
.auth-marque .logo { height: 22px; width: auto; aspect-ratio: 625.139 / 135; }
.auth-entree, .auth-invitation { display: grid; gap: var(--e6); }
.auth-tete { display: grid; gap: var(--e1); text-align: center; }
.auth-tete h1 { margin: 0; font-size: 20px; line-height: 28px; letter-spacing: -.01em; }
.chapo { margin: 0; color: var(--muted-foreground); font-size: 14px; }
.chapo b { color: var(--foreground); }
.auth form { display: grid; gap: var(--e4); }
.auth .champ > span { font-size: 13px; }
.auth .btn.pri { min-height: 40px; margin-top: var(--e1); }
.auth input[readonly] { background: var(--muted); color: var(--muted-foreground); cursor: default; }
.auth-bascule { margin: 0; padding-top: var(--e5); border-top: 1px solid var(--border); text-align: center; }
.auth-lien {
  display: inline-flex; gap: 4px; align-items: center; min-height: 32px; padding: 0 var(--e2); border-radius: var(--r-sm);
  font-size: 13px; color: var(--muted-foreground);
}
.auth-lien b { color: var(--foreground); }
.auth-lien:hover b { text-decoration: underline; text-underline-offset: 3px; }
.auth-pied { max-width: 352px; margin: var(--e10) 0 0; font-size: 12px; line-height: 16px; color: var(--muted-foreground); text-align: center; }
.auth-etat { display: grid; justify-items: center; gap: var(--e3); text-align: center; }
.auth-etat h1 { margin: 0; font-size: 20px; line-height: 28px; }
.auth-etat .etat-vide-picto { margin: 0; }
.auth-tete[aria-busy] { justify-items: center; gap: var(--e3); }
.auth-tete[aria-busy] .squelette { justify-self: center; }
.auth-sq-titre { height: 24px; }

/* Coquille : barre latérale grise, surface de travail blanche posée à 8 px (Catalyst) */
.app { display: grid; grid-template-columns: 240px minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); height: 100%; overflow: hidden; }
.rail {
  display: flex; flex-direction: column; min-height: 0; overflow-y: auto; padding: var(--e2);
  background: var(--sidebar); color: var(--sidebar-foreground);
}
.rail-tete { display: grid; gap: 2px; padding-bottom: var(--e2); margin: 0 calc(-1 * var(--e2)) var(--e2); padding-inline: var(--e2); border-bottom: 1px solid var(--sidebar-border); }
.equipe {
  display: flex; align-items: center; gap: var(--e3); width: 100%; min-height: 44px; padding: 6px var(--e2); border-radius: var(--r);
  text-align: left; color: var(--sidebar-foreground); margin-bottom: var(--e1);
}
.equipe:hover, .equipe[aria-expanded="true"] { background: var(--sidebar-accent); }
.equipe-logo {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm);
  background: var(--background); border: 1px solid var(--border);
}
.equipe-logo .logo { width: 14px; height: 14px; }
.equipe-nom { display: grid; min-width: 0; flex: 1; line-height: 16px; }
.equipe-nom b { font-size: 14px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.equipe-nom small { font-size: 12px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chevrons { width: 16px; height: 16px; fill: none; stroke: var(--muted-foreground); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; margin-left: auto; }

.nav-liste { display: grid; gap: 2px; align-content: start; }
.groupe-nav { margin: 0; padding: var(--e5) var(--e2) var(--e1); font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.groupe-nav:first-child { padding-top: var(--e2); }
.nav {
  position: relative; display: flex; align-items: center; gap: var(--e3); width: 100%; min-height: 36px; padding: 0 var(--e2);
  border-radius: var(--r); color: var(--sidebar-foreground); font-size: 14px; text-align: left; text-decoration: none;
  transition: background-color .15s var(--courbe);
}
.nav:hover { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); text-decoration: none; }
.nav svg { width: 16px; height: 16px; fill: none; stroke: var(--muted-foreground); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.nav[aria-current="page"] { font-weight: 600; color: var(--sidebar-foreground); }
.nav[aria-current="page"] svg { stroke: var(--sidebar-foreground); }
.nav[aria-current="page"]::before {
  content: ""; position: absolute; left: calc(-1 * var(--e2)); top: 8px; bottom: 8px; width: 2px; border-radius: 0 2px 2px 0; background: var(--sidebar-foreground);
}
.nav .lib { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav .lib-court { display: none; }
.nav .n, .raccourci-k {
  margin-left: auto; min-width: 20px; padding: 0 6px; font-size: 12px; line-height: 20px; font-weight: 600; text-align: center;
  border-radius: var(--r-sm); color: var(--muted-foreground); font-variant-numeric: proportional-nums;
}
.raccourci-k { font-weight: 400; border: 1px solid var(--sidebar-border); line-height: 18px; background: var(--background); }
.nav-plus { display: none; }
.sous { display: none; gap: 2px; padding: 2px 0 var(--e1) 28px; position: relative; }
.sous.on { display: grid; }
.sous::before { content: ""; position: absolute; left: 15px; top: 4px; bottom: 8px; width: 1px; background: var(--sidebar-border); }
.sous-lien {
  display: flex; align-items: center; justify-content: space-between; gap: var(--e2); width: 100%; min-height: 32px; padding: 0 var(--e2);
  border-radius: var(--r); color: var(--muted-foreground); font-size: 13px; text-align: left;
}
.sous-lien:hover { background: var(--sidebar-accent); color: var(--sidebar-accent-foreground); }
.sous-lien[aria-current="true"] { color: var(--sidebar-foreground); font-weight: 600; background: var(--sidebar-accent); }
.sous-lien .c { font-size: 12px; color: var(--muted-foreground); font-variant-numeric: proportional-nums; font-weight: 400; }
.rail-bas { margin-top: auto; display: grid; gap: 2px; padding-top: var(--e4); }
.compte {
  position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) 16px; gap: var(--e3); align-items: center;
  width: 100%; margin-top: var(--e3); padding: var(--e2); border-radius: var(--r); text-align: left;
}
.compte::before { content: ""; position: absolute; left: calc(-1 * var(--e2)); right: calc(-1 * var(--e2)); top: calc(-1 * var(--e2) + 1px); height: 1px; background: var(--sidebar-border); }
.compte:hover, .compte[aria-expanded="true"] { background: var(--sidebar-accent); }
.compte-txt { display: grid; min-width: 0; line-height: 16px; }
.compte-txt b { font-size: 14px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compte-txt small { font-size: 12px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compte-txt small:empty { display: none; }

main { min-width: 0; min-height: 0; height: 100%; display: flex; flex-direction: column; padding: var(--e2) var(--e2) var(--e2) 0; }
.surface {
  flex: 1; min-height: 0; display: flex; flex-direction: column; position: relative; overflow: hidden;
  background: var(--background); border: 1px solid var(--border); border-radius: var(--r);
}
.tete-mobile { display: none; }
.top, .bandeau-demo, .tete-mobile { flex: none; }
.bandeau-demo {
  display: flex; align-items: center; gap: var(--e2); padding: 6px var(--gouttiere); font-size: 12px; line-height: 16px;
  color: var(--muted-foreground); border-bottom: 1px solid var(--border); background: var(--muted);
}
.point-demo { width: 6px; height: 6px; border-radius: 50%; background: var(--avert); flex: none; }
.top { display: flex; align-items: center; gap: var(--e4); min-height: 64px; padding: var(--e3) var(--gouttiere); border-bottom: 1px solid var(--border); }
.top .titres { min-width: 0; flex: 1; }
.top h1 { margin: 0; font-size: 20px; line-height: 28px; letter-spacing: -.01em; }
.top .sub { margin: 0; color: var(--muted-foreground); font-size: 13px; line-height: 20px; }
.top .sub:empty { display: none; }
.creer { position: relative; flex: none; }
.vue { flex: 1; min-height: 0; display: none; }
.vue.on { display: grid; }

/* Menus */
.menu {
  position: absolute; right: 0; top: calc(100% + var(--e1)); z-index: 40; min-width: 224px; padding: var(--e1);
  background: var(--popover); color: var(--popover-foreground); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--ombre-flotte); display: grid; gap: 0; transform-origin: top right; animation: ouvre .14s var(--courbe);
}
.menu-outils, .menu-compte { position: fixed; right: auto; left: var(--menu-x, 8px); top: var(--menu-y, 56px); width: var(--menu-l, 240px); z-index: 60; transform-origin: top left; }
.menu.vers-haut { top: auto; bottom: var(--menu-y, 64px); transform-origin: bottom left; }
.menu-titre { margin: 0; padding: 6px var(--e2) var(--e1); font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.menu-item {
  display: flex; align-items: center; gap: var(--e2); width: 100%; min-height: 32px; padding: 6px var(--e2); border-radius: var(--r-sm);
  font-size: 14px; text-align: left; color: var(--popover-foreground); text-decoration: none;
}
.menu-item:hover, .menu-item:focus-visible { background: var(--accent); color: var(--accent-foreground); outline: none; text-decoration: none; }
.menu-item svg { width: 16px; height: 16px; fill: none; stroke: var(--muted-foreground); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.menu-item kbd { margin-left: auto; color: var(--muted-foreground); }
.menu-sep { height: 1px; background: var(--border); margin: var(--e1) calc(-1 * var(--e1)); }
.outil { min-height: 44px; gap: var(--e3); }
.outil-logo {
  width: 28px; height: 28px; flex: none; display: grid; place-items: center; border-radius: var(--r-sm);
  border: 1px solid var(--border); background: var(--muted); font-size: 12px; font-weight: 600;
}
.outil-txt { display: grid; min-width: 0; line-height: 16px; }
.outil-txt b { font-size: 14px; line-height: 20px; }
.outil-txt small { font-size: 12px; color: var(--muted-foreground); }
.outil .outil-coche { margin-left: auto; stroke: var(--bleu); stroke-width: 2; }
.outil.off { cursor: default; color: var(--muted-foreground); }
.outil.off:hover { background: none; }
.outil.off:focus-visible { background: var(--accent); }
@keyframes ouvre { from { opacity: 0; transform: scale(.97); } }

/* Cartes : filet, pas d'ombre */
.carte { border: 1px solid var(--border); background: var(--card); color: var(--card-foreground); border-radius: var(--r); padding: var(--e5); min-width: 0; }
.carte-tete { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--e3); flex-wrap: wrap; margin-bottom: var(--e4); }
.carte-tete > div { min-width: 0; }
.carte-tete h2, .carte-tete h3 { margin: 0; font-size: 14px; line-height: 20px; }
.carte-tete p { margin: 0; color: var(--muted-foreground); font-size: 13px; line-height: 20px; }

/* État vide, squelette */
.etat-vide { display: grid; justify-items: start; gap: var(--e2); max-width: 480px; margin: var(--e12) auto; padding: 0 var(--e4); }
.etat-vide-picto {
  width: 40px; height: 40px; display: grid; place-items: center; margin-bottom: var(--e2); border-radius: var(--r);
  border: 1px solid var(--border); background: var(--background); color: var(--muted-foreground);
}
.etat-vide-picto svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.etat-vide h2 { margin: 0; font-size: 16px; line-height: 24px; }
.etat-vide p { margin: 0; color: var(--muted-foreground); font-size: 14px; }
.etat-vide .etat-vide-note { font-size: 13px; }
.etat-vide .btn { margin-top: var(--e3); }
.squelette { display: block; height: 12px; border-radius: var(--r-sm); background: var(--muted); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .55; } }

/* Messages (Front, Intercom) : liste dense, fil au centre, fiche contact repliable à droite */
#v-messages { position: relative; grid-template-columns: 320px minmax(0, 1fr) 300px; }
#v-messages.fiche-fermee { grid-template-columns: 320px minmax(0, 1fr); }
#v-messages.fiche-fermee .side { display: none; }
.liste { border-right: 1px solid var(--border); overflow: auto; min-width: 0; display: flex; flex-direction: column; background: var(--background); }
.liste-tete { position: sticky; top: 0; z-index: 2; display: grid; gap: var(--e2); padding: var(--e3); background: var(--background); border-bottom: 1px solid var(--border); }
.recherche { display: flex; gap: 6px; flex-wrap: wrap; }
.recherche .inp:not(select) { flex: 1 1 150px; min-width: 0; }
.recherche select.inp { width: auto; flex: none; }
#q-messages {
  min-height: 32px; padding: 5px 10px 5px 32px; font-size: 13px;
  background-image: var(--loupe); background-repeat: no-repeat; background-position: 10px center; background-size: 14px;
}
.filtres-ligne { display: flex; gap: var(--e2); flex-wrap: wrap; }
.filtres-ligne select.inp { width: auto; flex: 1 1 0; min-width: 0; max-width: 200px; min-height: 32px; padding-top: 5px; padding-bottom: 5px; font-size: 13px; }
.filtre-select { display: contents; }
.seul-mobile { display: none !important; }
.item {
  position: relative; display: grid; grid-template-columns: 32px minmax(0, 1fr) 8px; gap: var(--e3); width: 100%;
  padding: 10px var(--e3); text-align: left; border-bottom: 1px solid var(--border-soft);
  transition: background-color .12s var(--courbe);
}
@media (hover: hover) { .item:hover { background: var(--accent); } }
.item:focus-visible { outline-offset: -2px; border-radius: var(--r-sm); }
.item[aria-current="true"], .item[aria-current="true"]:hover { background: var(--muted); }
.item .corps { min-width: 0; display: grid; gap: 2px; }
.item .nm { display: flex; align-items: baseline; gap: var(--e2); min-width: 0; font-weight: 400; }
.item .nm .x { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.non-lu .nm .x { font-weight: 600; }
.item .quand { flex: none; margin-left: auto; font-size: 12px; line-height: 16px; color: var(--muted-foreground); font-variant-numeric: proportional-nums; }
.item.non-lu .quand { color: var(--foreground); }
.item .ligne2 { display: flex; align-items: center; gap: var(--e2); min-width: 0; }
.item .pv { flex: 1 1 auto; min-width: 0; color: var(--muted-foreground); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item.non-lu .pv { color: var(--foreground); }
.item.traite .nm .x, .item.traite .pv { color: var(--muted-foreground); }
/* Catégorie discrète : un point de couleur et le mot en gris, pas un badge plein */
.item .tag { --pt: var(--chart-3); flex: none; height: 16px; padding: 0; gap: 6px; background: none; box-shadow: none; color: var(--muted-foreground); font-weight: 400; line-height: 16px; }
.item .tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--pt); }
.item .t-reservation { --pt: var(--bleu); }
.item .t-urgent, .item .t-annulation { --pt: var(--destructive); }
.item .t-devis { --pt: var(--succes); }
.item .t-question { --pt: var(--avert); }
.item .meta { display: grid; justify-items: end; padding-top: 6px; }
.unread {
  min-width: 18px; height: 18px; padding: 0 5px; display: grid; place-items: center; border-radius: 999px;
  background: var(--bleu); color: var(--background); font-size: 12px; line-height: 16px; font-weight: 600; font-variant-numeric: proportional-nums;
}
.item .unread { justify-self: center; }
.unread:empty { min-width: 0; width: 8px; height: 8px; padding: 0; }
.items-attente { display: grid; }
.item-squelette { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: var(--e3); padding: var(--e3); border-bottom: 1px solid var(--border-soft); }
.squelette-lignes { display: grid; gap: var(--e2); align-content: center; }
.squelette.rond { width: 32px; height: 32px; border-radius: 50%; }
.squelette.l30 { width: 30%; } .squelette.l40 { width: 40%; } .squelette.l50 { width: 50%; } .squelette.l70 { width: 70%; } .squelette.l90 { width: 90%; }
.liste-vide { display: grid; justify-items: center; gap: var(--e3); padding: var(--e8) var(--e6); text-align: center; color: var(--muted-foreground); }
.liste-vide p { margin: 0; max-width: 34ch; }
.av {
  position: relative; flex: none; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  font-size: 12px; font-weight: 600; background: var(--muted); color: var(--foreground); box-shadow: inset 0 0 0 1px var(--border);
}
.av.petit { width: 24px; height: 24px; font-size: 12px; }
.av.carre { border-radius: var(--r-sm); width: 32px; height: 32px; }
.av .ch { position: absolute; right: -2px; bottom: -2px; width: 10px; height: 10px; border-radius: 50%; border: 2px solid var(--background); background: var(--muted-foreground); }
.av .ch.k-mail { background: var(--mail); }
.av .ch.k-whatsapp, .av .ch.k-whatsapp_meta, .av .ch.k-whatsapp_web { background: var(--wa); }

.conv { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--background); }
.conv-vide { margin: auto; display: grid; justify-items: center; gap: var(--e2); max-width: 380px; padding: var(--e6); text-align: center; }
.conv-vide .etat-vide-picto { margin-bottom: var(--e2); }
.conv-vide h2 { margin: 0; font-size: 16px; line-height: 24px; }
.conv-vide p { margin: 0; color: var(--muted-foreground); }
.conv-vide .btn { margin-top: var(--e2); }
.conv-attente { display: flex; flex-direction: column; flex: 1; min-height: 0; }
.conv-attente .conv-h .squelette.l30 { width: 160px; }
.conv-attente-fil { display: flex; flex-direction: column; gap: var(--e3); padding: var(--e6); }
.squelette.bulle { height: 44px; width: 55%; max-width: 420px; border-radius: var(--r); }
.squelette.bulle.moi { align-self: flex-end; width: 45%; }
.squelette.bulle.court { width: 30%; }
.conv-h { display: flex; align-items: center; gap: var(--e3); flex-wrap: nowrap; min-height: 56px; padding: var(--e2) var(--e4) var(--e2) var(--e6); border-bottom: 1px solid var(--border); }
.conv-h .titre { min-width: 0; flex: 1 1 0; }
.conv-h .titre b { display: block; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.conv-h .via { display: flex; gap: 6px; align-items: center; flex-wrap: nowrap; min-width: 0; overflow: hidden; white-space: nowrap; font-size: 12px; line-height: 20px; color: var(--muted-foreground); }
.conv-h .act { margin-left: auto; flex: none; display: flex; gap: 6px; align-items: center; }
.conv-h select.inp { width: auto; min-height: 32px; padding: 5px 30px 5px 10px; font-size: 13px; }
.conv-h #btn-fiche[aria-expanded="true"] { background: var(--accent); color: var(--foreground); }

/* Fil à plat (par défaut) : une colonne de lecture centrée, la carte IA dans le fil, la réponse en bas */
.conv-scene { flex: 1; min-height: 0; }
.conv-scene.plat { display: flex; flex-direction: column; overflow: hidden; background: var(--background); --marge-fil: max(var(--e6), calc((100% - 720px) / 2)); }
.conv-scene.plat .tel, .conv-scene.plat .tel-corps, .conv-scene.plat .tel-ecran, .conv-scene.plat .conv-cote { display: contents; }
.conv-scene.plat .tel-coque, .conv-scene.plat .tel-ilot, .conv-scene.plat .tel-tete { display: none; }
.conv-scene.plat .msgs { order: 1; padding: var(--e6) var(--marge-fil) var(--e4); gap: var(--e3); }
.conv-scene.plat .sugg { order: 2; flex: none; max-height: 34%; overflow: auto; padding: var(--e2) var(--marge-fil) 0; }
.conv-scene.plat > .compose { order: 3; margin: var(--e2) var(--marge-fil) var(--e4); }
.conv-scene.plat .msgs > .ai-card { align-self: stretch; margin: var(--e2) 0; }

/* Fil dans un téléphone dessiné en CSS 3D : carte IA et réponses à côté, réponse sur toute la largeur */
.conv-scene.telephone {
  display: grid; grid-template-columns: auto minmax(220px, 1fr); grid-template-rows: minmax(0, 1fr) auto;
  gap: var(--e5); padding: var(--e5) var(--e6); overflow: hidden; background: var(--muted);
}
.tel {
  --rx: 0deg; --ry: 0deg; --bord-tel: 8px;
  --coque: oklch(0.26 0.004 286); --coque-tranche: oklch(0.18 0.004 286);
  position: relative; width: clamp(250px, 21vw, 320px); height: 100%; max-height: 720px; min-height: 0;
  perspective: 1500px; isolation: isolate; align-self: center;
}
.tel-corps { position: absolute; inset: 0; transform: rotateX(calc(2deg + var(--rx))) rotateY(calc(-5deg + var(--ry))); transform-origin: 50% 50%; }
.tel-coque {
  position: absolute; inset: 0; border-radius: 42px; background: var(--coque);
  box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.08), 0 16px 32px -20px oklch(0 0 0 / 0.35);
}
.tel-coque::before, .tel-coque::after { content: ""; position: absolute; left: -2px; width: 3px; border-radius: 2px 0 0 2px; background: var(--coque-tranche); }
.tel-coque::before { top: 120px; height: 40px; }
.tel-coque::after { top: 172px; height: 64px; }
.tel-ecran { position: absolute; inset: var(--bord-tel); z-index: 1; border-radius: 34px; overflow: hidden; background: var(--background); display: flex; flex-direction: column; min-height: 0; }
.tel-ilot { position: absolute; top: 10px; left: 50%; width: 84px; height: 22px; margin-left: -42px; border-radius: 999px; background: oklch(0.1 0 0); z-index: 3; }
.tel-tete { flex: none; display: grid; justify-items: center; gap: 2px; padding: 42px var(--e4) var(--e2); text-align: center; border-bottom: 1px solid var(--border); background: var(--background); }
.tel-tete .av { width: 36px; height: 36px; margin-bottom: 2px; }
.tel-tete b { font-size: 13px; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tel-tete span { font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.telephone .conv-cote { display: flex; flex-direction: column; gap: var(--e3); min-width: 0; min-height: 0; max-height: 100%; overflow-y: auto; padding: 2px; margin: -2px; }
.telephone .conv-cote > * { flex: none; min-width: 0; }
.telephone .conv-cote .sugg { border: 1px solid var(--border); border-radius: var(--r); padding: var(--e4); background: var(--card); }
.telephone .conv-cote .sugg .opts { display: grid; }
.telephone .opt { border-radius: var(--r); }
.telephone .opt span { white-space: normal; }
.telephone .conv-cote .btn { white-space: normal; text-align: center; }
.telephone .ai-card .row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.telephone .ai-card .h { flex-wrap: wrap; }
.telephone .ai-card .h .faint { order: 3; flex-basis: 100%; margin-left: 22px; }
.telephone > .compose { grid-column: 1 / -1; }
.telephone .msgs { padding: var(--e4) var(--e3); }
:root[data-theme="dark"] .tel { --coque: oklch(0.32 0.004 286); --coque-tranche: oklch(0.22 0.004 286); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tel { --coque: oklch(0.32 0.004 286); --coque-tranche: oklch(0.22 0.004 286); } }
@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) and (min-width: 821px) { .tel-corps { will-change: transform; } }
@media (max-width: 1180px) and (min-width: 821px) {
  .conv-scene.telephone { gap: var(--e4); padding: var(--e4); grid-template-columns: auto minmax(0, 1fr); }
  .tel { width: clamp(236px, 23vw, 300px); --bord-tel: 8px; }
  .tel-coque { border-radius: 40px; }
  .tel-ecran { border-radius: 32px; }
  .telephone .conv-cote .sugg, .telephone .conv-cote .ai-card { padding: var(--e3); }
  .telephone .conv-cote .ai-card .acts .btn { flex: 1 1 auto; }
}

.msgs { flex: 1; min-height: 0; overflow: auto; padding: var(--e4) var(--e3); display: flex; flex-direction: column; gap: var(--e2); overscroll-behavior: contain; }
.jour { align-self: center; display: flex; align-items: center; gap: var(--e3); width: 100%; font-size: 12px; line-height: 16px; color: var(--muted-foreground); font-weight: 600; margin: var(--e2) 0; }
.jour::before, .jour::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.b {
  max-width: 78%; padding: var(--e2) var(--e3); border-radius: var(--r) var(--r) var(--r) 2px; background: var(--muted); color: var(--foreground);
  white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14px; line-height: 20px;
}
.b.me { align-self: flex-end; background: var(--teinte-bleu); color: var(--foreground); border-radius: var(--r) var(--r) 2px var(--r); }
.b.me.ia { background: var(--background); box-shadow: inset 0 0 0 1px var(--border-strong); }
.b.echec { box-shadow: inset 0 0 0 1px var(--destructive); background: var(--teinte-rouge); color: var(--foreground); }
.b .tm { display: flex; gap: 6px; justify-content: flex-end; align-items: center; flex-wrap: wrap; margin-top: var(--e1); font-size: 12px; line-height: 16px; color: var(--muted-foreground); white-space: normal; }
.b .tag { height: 18px; line-height: 18px; }
.b.mail { max-width: 92%; }
.b .subj { font-weight: 600; margin-bottom: var(--e1); white-space: normal; }
.ico-ia { width: 14px; height: 14px; fill: none; stroke: var(--bleu); stroke-width: 1.75; stroke-linejoin: round; flex: none; }

/* Carte IA : une note sobre, champs en liste de définitions, créneaux en rangées à filets */
.ai-card { display: grid; gap: var(--e3); padding: var(--e4); border: 1px solid var(--border); border-radius: var(--r); background: var(--card); }
.ai-card .h { display: flex; align-items: baseline; gap: var(--e2); font-size: 13px; font-weight: 600; color: var(--foreground); }
.ai-card .h .ico-ia { align-self: center; }
.ai-card .ai-titre { flex: 1 1 auto; min-width: 0; }
.ai-card .h .faint { margin-left: auto; font-weight: 400; font-size: 12px; white-space: nowrap; }
.ai-card > .muted { font-size: 13px; }
.ai-card .row { display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr)); gap: var(--e2) var(--e4); margin: 0; font-size: 13px; }
.ai-card .row div { min-width: 0; }
.ai-card .row dt { font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.ai-card .row dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.ai-card .acts { display: flex; gap: 6px; flex-wrap: wrap; }
.propositions { display: grid; gap: 0; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.propositions p { margin: 0; padding: var(--e2) var(--e3); font-size: 13px; color: var(--muted-foreground); background: var(--muted); }
.propositions p b { color: var(--foreground); }
.propositions ul { list-style: none; margin: 0; padding: 0; display: grid; }
.propositions li { display: flex; gap: var(--e2) var(--e4); align-items: center; flex-wrap: wrap; padding: var(--e2) var(--e3); border-top: 1px solid var(--border); font-size: 13px; }
.propositions li b { min-width: 0; flex: 1 1 160px; }
.propositions .confirmer-seul { padding: var(--e2) var(--e3); border-top: 1px solid var(--border); }
.confirmer-seul { display: flex; gap: var(--e2); align-items: center; flex-wrap: wrap; font-size: 13px; color: var(--muted-foreground); }

/* Réponses proposées : pastilles d'une ligne, discrètes, qui remplissent la réponse */
.sugg { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--e2); min-width: 0; }
.sugg .h { display: flex; align-items: center; gap: var(--e2); flex-wrap: wrap; font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.sugg .h b { display: inline-flex; align-items: center; gap: 6px; color: var(--foreground); font-weight: 600; }
.sugg .opts { display: flex; gap: var(--e2); flex-wrap: wrap; }
.opt {
  display: inline-flex; align-items: center; max-width: 100%; min-height: 28px; padding: 3px var(--e3); font-size: 13px; line-height: 20px;
  text-align: left; color: var(--foreground); background: var(--background); border: 1px solid var(--border); border-radius: 999px;
  transition: background-color .12s var(--courbe), border-color .12s var(--courbe);
}
.opt span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.opt:hover { background: var(--accent); border-color: var(--border-strong); }
.opt:focus-visible { outline: none; border-color: var(--ring); box-shadow: var(--anneau); }

/* Zone de réponse (Linear) : un seul cadre, le texte puis une barre avec le raccourci et Envoyer */
.compose {
  flex: none; display: grid; grid-template-columns: minmax(0, 1fr); border: 1px solid var(--input); border-radius: var(--r);
  background: var(--input-bg); transition: border-color .15s var(--courbe), box-shadow .15s var(--courbe);
}
.compose:hover:not(:focus-within) { border-color: var(--input-strong); }
.compose:focus-within { border-color: var(--ring); box-shadow: var(--anneau); }
.compose:has(textarea.prepare) { border-color: var(--bleu); }
.compose textarea {
  width: 100%; min-width: 0; resize: none; min-height: 64px; max-height: 180px; padding: var(--e3) var(--e3) var(--e1); line-height: 20px; font-size: 14px;
  background: transparent; border: 0; border-radius: var(--r) var(--r) 0 0; field-sizing: content;
}
.compose textarea:focus-visible { outline: none; }
.compose-pied { display: flex; align-items: center; gap: var(--e2); padding: var(--e1) var(--e2) var(--e2) var(--e3); }
.compose-aide { margin-right: auto; display: inline-flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.compose-aide kbd { padding: 0 4px; border: 1px solid var(--border); border-radius: 4px; background: var(--muted); color: var(--foreground); }

/* Fiche contact (panneau latéral) */
.side { display: flex; flex-direction: column; gap: var(--e6); min-width: 0; overflow: auto; padding: var(--e5); border-left: 1px solid var(--border); background: var(--background); }
.who { position: relative; display: flex; gap: var(--e3); align-items: center; min-width: 0; padding-right: var(--e8); }
.who .av { width: 40px; height: 40px; font-size: 14px; }
.who h3 { margin: 0; font-size: 16px; line-height: 24px; overflow-wrap: anywhere; }
.who .replier { position: absolute; right: calc(-1 * var(--e2)); top: calc(-1 * var(--e1)); }
.side > .btn { align-self: flex-start; }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--e2) var(--e4); font-size: 13px; margin: 0; }
.kv dt { color: var(--muted-foreground); }
.kv dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.sec { margin: 0 0 var(--e2); }
.mini { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: var(--e3); align-items: center; width: 100%; padding: var(--e2); text-align: left; border: 1px solid var(--border); border-radius: var(--r); background: var(--card); }
.mini:hover { background: var(--accent); }
.mini + .mini { margin-top: 6px; }
.date { display: grid; justify-items: center; line-height: 1; padding-right: var(--e2); border-right: 1px solid var(--border); }
.date small { font-size: 12px; line-height: 16px; color: var(--muted-foreground); font-weight: 600; }
.date b { font-size: 20px; line-height: 24px; font-weight: 600; font-variant-numeric: proportional-nums; }
.date em { font-style: normal; font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.notes { font-size: 13px; color: var(--muted-foreground); background: var(--muted); padding: var(--e2) var(--e3); border-radius: var(--r); white-space: pre-wrap; overflow-wrap: anywhere; }
.etiquettes { display: flex; gap: var(--e1); flex-wrap: wrap; }

/* Pages qui défilent */
.page { position: relative; grid-template-columns: minmax(0, 1fr); overflow: auto; align-content: start; gap: var(--e6); padding: var(--e6) var(--gouttiere) var(--e12); }
.barre { display: flex; gap: var(--e2); align-items: center; flex-wrap: wrap; }
.barre .pousse { margin-left: auto; }
.barre .inp { width: auto; min-width: 280px; }
#q-notes { width: 360px; max-width: 100%; }

/* Aperçu (Catalyst Home) : « Vue d'ensemble », chiffres sur filet sans carte, sections sans cadre */
#v-apercu.on { display: block; }
#v-apercu.page { padding-top: var(--e6); }
.accueil-barre { display: flex; align-items: center; justify-content: space-between; gap: var(--e3) var(--e4); flex-wrap: wrap; min-height: 36px; margin-bottom: var(--e5); }
.accueil-titre { margin: 0; font-size: 16px; line-height: 24px; }
.accueil-actions { display: flex; gap: var(--e2); flex-wrap: wrap; align-items: center; justify-content: flex-end; }
.accueil-actions select.periode { width: auto; min-width: 180px; min-height: 32px; padding-top: 5px; padding-bottom: 5px; font-size: 13px; }
.accueil-barre.edition { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.accueil-edition-txt { display: grid; gap: 2px; min-width: 0; }
.accueil-aide { margin: 0; font-size: 13px; color: var(--muted-foreground); max-width: 62ch; }
.grille-widgets { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); column-gap: var(--e8); row-gap: var(--e10); align-items: stretch; }
.widget { grid-column: span 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.widget > * { min-width: 0; }
.widget.taille-moyen { grid-column: span 2; }
.widget.taille-large { grid-column: 1 / -1; }
.widget-corps { display: grid; grid-template-columns: minmax(0, 1fr); min-width: 0; flex: 1 1 auto; }
.widget-corps > .carte { height: 100%; border: 0; border-radius: 0; padding: 0; background: none; }
.widget-corps .carte-tete { align-items: flex-end; margin-bottom: var(--e4); }
.widget-corps .carte-tete h2 { font-size: 16px; line-height: 24px; }
.widget-corps .carte-tete .btn.discret { margin-right: calc(-1 * var(--e2)); }
.grille-widgets.edition { row-gap: var(--e4); column-gap: var(--e4); }
.grille-widgets.edition .widget { gap: var(--e2); padding: var(--e3); border: 1px dashed var(--border-strong); border-radius: var(--r); background: var(--background); }
.grille-widgets.edition .widget-corps { opacity: .6; user-select: none; }
.widget-outils { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-width: 0; }
.widget-nom { flex: 1 1 60px; min-width: 0; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poignee-w, .btn-icone {
  flex: none; width: 32px; height: 32px; display: grid; place-items: center; border-radius: var(--r-sm);
  border: 1px solid var(--input); background: var(--background); color: var(--foreground);
  transition: background-color .12s var(--courbe);
}
.poignee-w { cursor: grab; touch-action: none; }
.poignee-w:active { cursor: grabbing; }
.poignee-w:focus-visible, .btn-icone:focus-visible { outline: none; border-color: var(--ring); box-shadow: var(--anneau); }
.poignee-w svg, .btn-icone svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.btn-icone svg { stroke-width: 1.75; }
@media (hover: hover) { .poignee-w:hover, .btn-icone:hover { background: var(--accent); } }
.taille-petit .widget-nom { display: none; }
.widget-outils .seg-taille { margin-left: auto; }
.seg-taille .segment { min-height: 28px; padding: 3px var(--e2); font-size: 12px; }
.widget.glisse { z-index: 20; transform: translate(var(--gx, 0), var(--gy, 0)); box-shadow: var(--ombre-flotte); opacity: .97; }
.widget.glisse .widget-corps { opacity: 1; }
.grille-widgets.en-glisse { cursor: grabbing; user-select: none; }
.accueil-vide { grid-column: 1 / -1; margin: var(--e6) 0; }
.w-attente { display: grid; gap: var(--e3); align-content: start; min-height: 96px; }
.squelette.haut { height: 28px; }
.squelette.bloc { height: 160px; border-radius: var(--r); }
.erreur-ligne {
  grid-column: 1 / -1; display: flex; align-items: center; justify-content: space-between; gap: var(--e3); flex-wrap: wrap;
  padding: var(--e2) var(--e2) var(--e2) var(--e4); border: 1px solid color-mix(in srgb, var(--destructive) 30%, transparent);
  border-radius: var(--r); background: var(--teinte-rouge); margin-bottom: calc(-1 * var(--e4));
}
.erreur-ligne p { margin: 0; font-size: 13px; }
.w-indispo .val, .w-indispo h2 { color: var(--muted-foreground); }
.w-lignes { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: minmax(0, 1fr); border-top: 1px solid var(--border); }
.w-lignes li { border-bottom: 1px solid var(--border-soft); }
.w-ligne { display: flex; align-items: baseline; gap: var(--e3); min-width: 0; padding: var(--e3) var(--e2); margin: 0 calc(-1 * var(--e2)); color: var(--foreground); text-decoration: none; font-size: 14px; border-radius: var(--r-sm); }
@media (hover: hover) { .w-ligne:hover { background: var(--accent); text-decoration: none; } }
.w-quand { flex: none; min-width: 76px; font-size: 13px; color: var(--muted-foreground); font-variant-numeric: proportional-nums; }
.w-quoi { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-quoi b { font-weight: 600; margin-right: var(--e2); }
.w-extrait { color: var(--muted-foreground); }
.w-note { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.w-plus { flex: none; font-size: 13px; color: var(--muted-foreground); font-variant-numeric: proportional-nums; }
.taille-petit .w-quand { min-width: 0; }
.taille-petit .w-ligne { flex-wrap: wrap; gap: 2px var(--e2); }
.taille-petit .w-quoi { flex-basis: 100%; order: 2; }
.taille-petit .w-extrait { display: none; }
.widget-corps .vide { padding: var(--e6) 0; text-align: left; border-top: 1px solid var(--border); font-size: 13px; }
.raccourcis { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: var(--e2); }
.raccourci { justify-content: flex-start; }
.catalogue { display: grid; gap: 0; max-height: min(60vh, 520px); overflow: auto; margin: var(--e1) 0; border: 1px solid var(--border); border-radius: var(--r); }
.catalogue-item { display: grid; gap: 2px; padding: var(--e3) var(--e4); text-align: left; color: var(--foreground); border-bottom: 1px solid var(--border); }
.catalogue-item:last-child { border-bottom: 0; }
.catalogue-item span { font-size: 13px; color: var(--muted-foreground); }
@media (hover: hover) { .catalogue-item:hover { background: var(--accent); } }

/* Chiffre sur filet : trait fin au dessus, libellé, valeur, variation en petit badge et sa phrase */
.kpi { display: grid; align-content: start; min-width: 0; padding-top: var(--e5); border-top: 1px solid var(--border); }
.kpi-titre { margin: 0; font-size: 14px; line-height: 20px; font-weight: 400; color: var(--foreground); }
.kpi .val { margin-top: var(--e3); font-size: 24px; line-height: 32px; font-weight: 600; letter-spacing: -.01em; font-variant-numeric: proportional-nums; }
.kpi-ecart { display: flex; align-items: center; gap: 6px var(--e2); flex-wrap: wrap; margin: var(--e3) 0 0; font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.kpi-ecart:empty { display: none; }
.kpi-detail { margin: var(--e1) 0 0; font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.tendance {
  display: inline-flex; align-items: center; gap: 3px; flex: none; height: 20px; padding: 0 6px; border-radius: var(--r-sm);
  font-size: 12px; font-weight: 600; background: var(--muted); color: var(--foreground); font-variant-numeric: proportional-nums;
}
.tendance.bien { background: var(--teinte-vert); color: var(--succes); }
.tendance.mal { background: var(--teinte-rouge); color: var(--destructive); }
.tendance svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* Courbe : deux traits simples, sans aire ni dégradé, grille en filets */
.tdb-courbe .carte-tete { margin-bottom: var(--e3); }
.legende-courbe { display: flex; gap: var(--e4); flex-wrap: wrap; margin: 0; font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.legende-courbe span { display: inline-flex; align-items: center; gap: 6px; }
.legende-courbe i { width: 12px; height: 2px; border-radius: 1px; }
.legende-courbe .s1 { background: var(--chart-1); }
.legende-courbe .s2 { background: var(--chart-3); }
.courbe { display: flex; flex-direction: column; position: relative; }
.courbe svg { display: block; width: 100%; height: 220px; overflow: visible; }
.courbe-axe { display: flex; justify-content: space-between; margin-top: var(--e2); font-size: 12px; color: var(--muted-foreground); font-variant-numeric: proportional-nums; }
.courbe-trait { fill: none; stroke: var(--chart-1); stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.courbe-trait.s2 { stroke: var(--chart-3); stroke-dasharray: 4 3; }
.courbe-aire { display: none; }
.courbe-grille { stroke: var(--border); stroke-width: 1; }
.courbe-explorer { display: flex; flex-direction: column; border-radius: var(--r-sm); cursor: crosshair; touch-action: pan-y; position: relative; }
.courbe-explorer:focus-visible { outline-offset: 4px; }
.courbe-repere { stroke: var(--border-strong); stroke-width: 1; opacity: 0; }
.courbe-point { position: absolute; left: var(--x, 100%); top: var(--y, 50%); width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--background); transform: translate(-50%, -50%); opacity: 0; pointer-events: none; }
.courbe-point.s1 { background: var(--chart-1); }
.courbe-point.s2 { background: var(--chart-3); }
.courbe-explorer.actif .courbe-repere, .courbe-explorer:hover .courbe-repere, .courbe-explorer:focus-visible .courbe-repere,
.courbe-explorer.actif .courbe-point, .courbe-explorer:hover .courbe-point, .courbe-explorer:focus-visible .courbe-point { opacity: 1; }
.courbe-valeur {
  position: absolute; top: var(--e1); left: var(--x, 100%); z-index: 2; transform: translateX(var(--decale, -50%)); pointer-events: none;
  margin: 0; min-width: 150px; padding: var(--e2) var(--e3); border: 1px solid var(--border); border-radius: var(--r);
  background: var(--popover); color: var(--popover-foreground); box-shadow: var(--ombre-flotte); font-size: 12px; line-height: 16px;
  opacity: 0; transition: opacity .12s var(--courbe);
}
.courbe-explorer.actif + .courbe-valeur, .courbe-explorer:hover + .courbe-valeur, .courbe-explorer:focus-visible + .courbe-valeur { opacity: 1; }
.courbe-valeur b { display: block; font-weight: 600; margin-bottom: var(--e1); }
.courbe-valeur .ligne-v { display: flex; align-items: center; gap: var(--e2); }
.courbe-valeur .ligne-v span { color: var(--muted-foreground); }
.courbe-valeur .ligne-v strong { margin-left: auto; font-weight: 600; font-variant-numeric: proportional-nums; }
.courbe-valeur i { width: 8px; height: 2px; flex: none; }
.courbe-valeur i.s1 { background: var(--chart-1); }
.courbe-valeur i.s2 { background: var(--chart-3); }
.stop-haut, .stop-bas, .s2 .stop-haut, .s2 .stop-bas { stop-color: var(--chart-1); stop-opacity: 0; }

.tdb-tableau .onglets { margin-bottom: 0; }
.tdb-tableau .carte-tete { margin-bottom: var(--e2); }
.widget-corps .tableau th:first-child, .widget-corps .tableau td:first-child { padding-left: 0; }
.widget-corps .tableau th:last-child, .widget-corps .tableau td:last-child { padding-right: 0; }
.widget-corps .tableau tbody tr:hover { background: none; }
.widget-corps .tableau td.qui-r a { color: var(--foreground); }
.widget-corps .tableau td.qui-r a:hover { color: var(--bleu); }
.tdb-tableau .vide { border-top: 0; }

/* Tableau de données */
.tableau-defile { overflow-x: auto; }
.tableau { width: 100%; border-collapse: collapse; font-size: 14px; }
.tableau th {
  height: 40px; padding: 0 var(--e3); text-align: left; white-space: nowrap; font-size: 13px; font-weight: 400; color: var(--muted-foreground);
  border-bottom: 1px solid var(--border);
}
.tableau td { height: 48px; padding: var(--e2) var(--e3); border-bottom: 1px solid var(--border-soft); vertical-align: middle; }
.tableau th:first-child, .tableau td:first-child { padding-left: var(--e1); }
.tableau tr:last-child td { border-bottom: 0; }
@media (hover: hover) { .tableau tbody tr:hover { background: var(--accent); } }
.tableau .num { text-align: right; }
.tableau td.num { font-variant-numeric: proportional-nums; }
.tableau td.qui-r { font-weight: 600; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tableau td .muted { font-size: 13px; }
.tableau-pied { display: flex; justify-content: space-between; align-items: center; gap: var(--e3); margin-top: var(--e3); font-size: 13px; color: var(--muted-foreground); }

/* Carte de chaleur : du gris au bleu */
.chaleur { width: 100%; border-collapse: separate; border-spacing: 3px; table-layout: fixed; }
.chaleur th { padding: 0; font-size: 12px; font-weight: 400; color: var(--muted-foreground); text-align: center; }
.chaleur th[scope="row"] { text-align: left; width: 40px; }
.chaleur td { padding: 0; }
.case-c { display: block; width: 100%; aspect-ratio: 1.25; min-height: 12px; max-height: 32px; border-radius: 4px; background: var(--chaud-0); }
button.case-c { cursor: pointer; }
button.case-c:hover { box-shadow: inset 0 0 0 2px var(--foreground); }
.case-c.n1 { background: var(--chaud-1); }
.case-c.n2 { background: var(--chaud-2); }
.case-c.n3 { background: var(--chaud-3); }
.case-c.n4 { background: var(--chaud-4); }
.chaleur .auj th[scope="row"] { color: var(--foreground); font-weight: 600; }
.legende-chaleur { display: flex; align-items: center; gap: 6px; justify-content: flex-end; margin-top: var(--e3); font-size: 12px; color: var(--muted-foreground); }
.legende-chaleur .case-c { width: 16px; min-height: 0; height: 12px; aspect-ratio: auto; border-radius: 3px; }

/* Groupe de boutons : contour collés, rayon aux deux bouts seulement */
.groupe-btn { display: inline-flex; align-items: stretch; flex: none; }
.groupe-btn > .btn { border-radius: 0; margin-left: -1px; min-height: 32px; font-size: 13px; padding-top: 5px; padding-bottom: 5px; }
.groupe-btn > .btn.icone { min-width: 32px; padding: 0; }
.groupe-btn > .btn:first-child { margin-left: 0; border-radius: var(--r) 0 0 var(--r); }
.groupe-btn > .btn:last-child { border-radius: 0 var(--r) var(--r) 0; }
.groupe-btn > .btn:hover, .groupe-btn > .btn:focus-visible { position: relative; z-index: 1; }

/* Agenda (Cal.com, Notion Calendar) : la grille remplit la page et défile dans son cadre */
#v-agenda.on { display: flex; flex-direction: column; gap: var(--e4); overflow: hidden; padding-bottom: var(--e4); }
#v-agenda.on > * { flex: none; min-width: 0; }
.barre-agenda { display: flex; align-items: center; gap: var(--e3); min-width: 0; }
.agenda-titre { display: flex; align-items: baseline; gap: var(--e2); min-width: 0; margin: 0 auto 0 0; font-size: 16px; line-height: 24px; font-weight: 400; }
.agenda-titre b { min-width: 0; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.agenda-plage { color: var(--muted-foreground); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.barre-agenda .segment { min-height: 26px; }
.agenda-etat:empty { display: none; }
.agenda-vide { display: flex; align-items: center; gap: var(--e3); flex-wrap: wrap; margin: 0; font-size: 13px; color: var(--muted-foreground); }
.agenda-vide > span { flex: 1 1 280px; min-width: 0; }
.agenda-vide b { color: var(--foreground); font-weight: 600; }
.alerte-action { display: flex; align-items: center; gap: var(--e3); flex-wrap: wrap; }
.alerte-action > span { flex: 1 1 240px; min-width: 0; }
.legend { display: flex; gap: var(--e2) var(--e4); flex-wrap: wrap; align-items: center; font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.legend > span { display: inline-flex; align-items: center; gap: 6px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.legend .l-resa { background: color-mix(in srgb, var(--chart-1) 14%, var(--card)); box-shadow: inset 2px 0 0 var(--chart-1); }
.legend .l-rdv { background: color-mix(in srgb, var(--foreground) 8%, var(--card)); box-shadow: inset 2px 0 0 var(--foreground); }
.legend .l-tampon { background: repeating-linear-gradient(135deg, var(--card) 0 2px, var(--input-strong) 2px 3px); box-shadow: inset 0 0 0 1px var(--border); }
.legend .astuce { margin-left: auto; text-align: right; }

.cal-wrap {
  position: relative; flex: 0 1 auto !important; min-height: 240px; overflow: auto; overscroll-behavior: contain;
  border: 1px solid var(--border); border-radius: var(--r); background: var(--card);
}
.cal { display: grid; grid-template-columns: 56px repeat(7, minmax(110px, 1fr)); min-width: 820px; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.cal .hd {
  position: sticky; top: 0; z-index: 3; display: flex; gap: 6px; align-items: center; height: 44px; padding: 0 var(--e3);
  font-size: 12px; color: var(--muted-foreground); background: var(--card); border-bottom: 1px solid var(--border); border-left: 1px solid var(--border-soft);
}
.cal .hd:first-child { border-left: 0; left: 0; z-index: 4; }
.cal .hd b { min-width: 24px; height: 24px; display: grid; place-items: center; font-size: 14px; font-weight: 600; color: var(--foreground); font-variant-numeric: proportional-nums; border-radius: var(--r-sm); }
.cal .hd.auj { color: var(--bleu); font-weight: 600; }
.cal .hd.auj b { padding: 0 4px; color: var(--primary-foreground); background: var(--primary); }
.cal .heures { display: grid; position: sticky; left: 0; z-index: 2; background: var(--card); border-right: 1px solid var(--border-soft); }
.cal .hr { position: relative; height: var(--heure); }
.cal .hr span { position: absolute; top: -8px; right: var(--e2); font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.cal .hr:first-child span { top: 4px; }
.cal .col {
  position: relative; border-left: 1px solid var(--border-soft);
  background-image:
    linear-gradient(to bottom, transparent calc(var(--heure) - 1px), var(--border-soft) calc(var(--heure) - 1px)),
    linear-gradient(to bottom, transparent calc(var(--heure) / 2 - 1px), color-mix(in srgb, var(--border-soft) 45%, transparent) calc(var(--heure) / 2 - 1px), color-mix(in srgb, var(--border-soft) 45%, transparent) calc(var(--heure) / 2), transparent calc(var(--heure) / 2));
  background-size: 100% var(--heure);
}
.cal .heures + .col { border-left: 0; }
.cal .col.we, .cal .hd.we { background-color: color-mix(in srgb, var(--foreground) 2.5%, var(--card)); }
.maintenant { position: absolute; left: -1px; right: 0; z-index: 3; height: 0; border-top: 1px solid var(--bleu); pointer-events: none; }
.maintenant::before { content: ""; position: absolute; left: -4px; top: -4.5px; width: 8px; height: 8px; border-radius: 50%; background: var(--bleu); }
.ev-sq { position: absolute; left: 4px; right: 4px; border-radius: 4px; pointer-events: none; background: color-mix(in srgb, var(--foreground) 7%, var(--card)); }

.ev {
  position: absolute; padding: 3px 6px 3px 7px; font-size: 12px; line-height: 16px; overflow: hidden; text-align: left; color: var(--foreground);
  border-radius: 4px; border: 0; border-left: 2px solid; box-shadow: 0 0 0 1px var(--card);
  transition: background-color .12s var(--courbe);
}
.ev b { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-weight: 600; overflow: hidden; overflow-wrap: anywhere; }
.ev.court b { -webkit-line-clamp: 1; }
.ev span { display: block; color: color-mix(in srgb, var(--foreground) 72%, var(--card)); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev.g-reservation { background: color-mix(in srgb, var(--chart-1) 10%, var(--card)); border-left-color: var(--chart-1); --teinte-ev: var(--chart-1); }
.ev.g-rdv { background: color-mix(in srgb, var(--foreground) 6%, var(--card)); border-left-color: var(--foreground); --teinte-ev: var(--foreground); }
.ev.g-tampon {
  background: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--foreground) 10%, transparent) 4px 5px), var(--card);
  border-left-color: transparent; color: var(--muted-foreground); box-shadow: inset 0 0 0 1px var(--border-soft), 0 0 0 1px var(--card);
}
.ev.g-tampon b { font-weight: 400; }
@media (hover: hover) {
  .ev.g-reservation:hover { background: color-mix(in srgb, var(--chart-1) 16%, var(--card)); }
  .ev.g-rdv:hover { background: color-mix(in srgb, var(--foreground) 10%, var(--card)); }
}
.ev:hover, .ev:focus-visible { z-index: 2; }
.ev:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.ev.court { padding-top: 1px; padding-bottom: 1px; }
.ev.court span, .ev.moyen span { display: none; }
.ev.deplacable { cursor: grab; }
.ev .poignee { position: absolute; left: 0; right: 0; height: 8px; cursor: ns-resize; }
.ev .poignee.haut { top: 0; }
.ev .poignee.bas { bottom: 0; }
.ev .poignee::after { content: ""; position: absolute; left: 50%; width: 16px; height: 2px; margin-left: -8px; border-radius: 1px; background: var(--teinte-ev, currentColor); opacity: 0; transition: opacity .12s var(--courbe); }
.ev .poignee.haut::after { top: 2px; }
.ev .poignee.bas::after { bottom: 2px; }
@media (hover: hover) { .ev.deplacable:hover .poignee::after { opacity: .5; } }
.ev.deplacable:focus-visible .poignee::after { opacity: .5; }
.ev.en-geste { opacity: .35; }
.geste-agenda, .geste-agenda * { cursor: grabbing !important; }
.ev-fantome {
  position: absolute; left: 2px; right: 2px; z-index: 5; pointer-events: none; padding: 3px 6px 3px 7px; font-size: 12px; line-height: 16px; overflow: hidden;
  background: var(--popover); color: var(--foreground); border: 1px dashed var(--bleu); border-left: 2px solid var(--bleu); border-radius: 4px; box-shadow: var(--ombre-flotte);
}
.ev-fantome b { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev-fantome span { display: block; color: var(--muted-foreground); }
.ev-fantome.tampon { background: repeating-linear-gradient(135deg, transparent 0 4px, color-mix(in srgb, var(--foreground) 10%, transparent) 4px 5px), var(--popover); border: 1px dashed var(--input-strong); box-shadow: none; }
.ev-fantome.conflit { border-color: var(--avert); border-style: solid; }
.ev-fantome .fantome-conflit { color: var(--avert); font-weight: 600; }

.mois {
  flex: 1 1 auto !important; min-height: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-template-rows: auto repeat(6, minmax(96px, 1fr));
  overflow: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--card);
}
.mois[hidden] { display: none; }
.mois .jsem { padding: 0 var(--e3); height: 36px; display: flex; align-items: center; font-size: 12px; color: var(--muted-foreground); border-bottom: 1px solid var(--border); border-left: 1px solid var(--border-soft); }
.mois .jsem:first-child { border-left: 0; }
.mjour {
  min-width: 0; min-height: 0; display: flex; flex-direction: column; gap: 2px; padding: 6px var(--e2) var(--e2); text-align: left; color: var(--foreground); overflow: hidden;
  border-top: 1px solid var(--border-soft); border-left: 1px solid var(--border-soft); transition: background-color .12s var(--courbe);
}
.mjour:nth-child(7n + 1) { border-left: 0; }
.mjour:nth-child(-n + 14) { border-top: 0; }
.mjour.we { background: color-mix(in srgb, var(--foreground) 2.5%, var(--card)); }
.mjour.hors { background: color-mix(in srgb, var(--foreground) 4%, var(--card)); }
.mjour.hors .num { color: var(--muted-foreground); font-weight: 400; }
@media (hover: hover) { .mjour:hover { background: var(--accent); } }
.mjour:focus-visible { outline: 2px solid var(--ring); outline-offset: -2px; border-radius: 0; }
.mjour .num { min-width: 24px; height: 24px; margin-bottom: 2px; padding: 0 4px; display: grid; place-items: center; align-self: flex-start; border-radius: var(--r-sm); font-size: 13px; font-weight: 600; font-variant-numeric: proportional-nums; }
.mjour.auj .num { background: var(--primary); color: var(--primary-foreground); }
.mjour .pt { display: block; padding: 1px 4px; font-size: 12px; line-height: 16px; border-radius: 4px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--foreground); }
.mjour .pt::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 6px; border-radius: 50%; background: var(--chart-1); vertical-align: 1px; }
.mjour .pt.g-rdv::before { background: var(--foreground); }
.mjour .pt-h { color: var(--muted-foreground); }
.mjour .squelette { margin: 2px 4px; }
.mjour .encore { padding-left: 4px; font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.mjour .points { display: none; gap: 3px; flex-wrap: wrap; }
.mjour .points i { width: 6px; height: 6px; border-radius: 50%; background: var(--chart-1); }
.mjour .points i.g-rdv { background: var(--foreground); }
.chaleur-agenda .carte-tete { margin-bottom: var(--e2); }
.jour-liste { display: grid; margin: 0; padding: 0; list-style: none; border: 1px solid var(--border); border-radius: var(--r); }
.jour-liste li { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: var(--e3); align-items: baseline; padding: var(--e3); border-bottom: 1px solid var(--border-soft); position: relative; }
.jour-liste li:last-child { border-bottom: 0; }
.jour-liste li::before { content: ""; position: absolute; left: 0; top: var(--e3); bottom: var(--e3); width: 2px; background: var(--chart-1); }
.jour-liste li.g-rdv::before { background: var(--foreground); }
.jour-liste li.g-tampon { color: var(--muted-foreground); }
.jour-liste li.g-tampon::before { background: var(--input-strong); }

/* Bloc-notes (Linear, Apple Notes) : saisie rapide, onglets, rangées denses groupées */
#v-notes.on { justify-items: stretch; gap: var(--e5); }
#v-notes > * { width: 100%; max-width: 960px; }
.note-saisie { display: grid; gap: var(--e2); padding: var(--e2) var(--e3) var(--e2) var(--e4); border: 1px solid var(--input); border-radius: var(--r); background: var(--input-bg); transition: border-color .15s var(--courbe), box-shadow .15s var(--courbe); }
.note-saisie:hover:not(:focus-within) { border-color: var(--input-strong); }
.note-saisie textarea.inp { min-height: 28px; max-height: 260px; padding: 4px 0; resize: none; overflow-y: auto; font-size: 15px; line-height: 22px; background: transparent; border-color: transparent; }
.note-saisie textarea.inp:hover, .note-saisie textarea.inp:focus-visible { box-shadow: none; border-color: transparent; }
.note-saisie:focus-within { border-color: var(--ring); box-shadow: var(--anneau); }
.note-saisie-pied { display: flex; gap: var(--e3); align-items: center; justify-content: space-between; }
.note-saisie-pied small { flex: 1; min-width: 0; font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.note-saisie-pied kbd, .note-edition-aide kbd { padding: 0 4px; border: 1px solid var(--border); border-radius: 4px; background: var(--muted); color: var(--foreground); }
.note-saisie-pied .btn { flex: none; }
.notes-outils { display: flex; align-items: flex-end; gap: var(--e4); border-bottom: 1px solid var(--border); }
.notes-outils .onglets { flex: 1; min-width: 0; gap: var(--e5); border-bottom: 0; overflow-x: auto; scrollbar-width: none; }
.notes-outils .onglets::-webkit-scrollbar { display: none; }
.notes-outils .onglet { min-height: 40px; font-size: 13px; }
.notes-recherche { width: 240px; margin-bottom: var(--e2); }
.liste-notes { display: grid; grid-template-columns: minmax(0, 1fr); margin-top: calc(-1 * var(--e5)); }
.liste-notes[aria-busy="true"] > :not(.notes-sq) { opacity: .6; transition: opacity .15s var(--courbe); }
.notes-groupe {
  display: flex; align-items: center; gap: var(--e2); height: 32px; margin: 0; padding: 0 var(--e3);
  font-size: 12px; line-height: 16px; font-weight: 600; color: var(--foreground); background: var(--muted); border-bottom: 1px solid var(--border-soft);
}
.notes-groupe .c { font-weight: 400; color: var(--muted-foreground); font-variant-numeric: proportional-nums; }
.note {
  display: grid; grid-template-columns: 104px minmax(0, 1fr) auto auto; grid-template-areas: "tag corps quand acts";
  align-items: start; gap: 0 var(--e3); min-width: 0; min-height: 44px; padding: 10px var(--e2) 10px var(--e3);
  border-bottom: 1px solid var(--border-soft); transition: background-color .12s var(--courbe);
}
@media (hover: hover) { .note:not(.note-edition):not(.note-sq):hover { background: color-mix(in srgb, var(--accent) 60%, transparent); } }
.note > .tag { grid-area: tag; justify-self: start; margin-top: 1px; }
.tag-point { gap: 6px; background: transparent; color: var(--muted-foreground); box-shadow: inset 0 0 0 1px var(--border); font-weight: 400; }
.tag-point::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--chart-3); flex: none; }
.cat-a_faire::before { background: var(--bleu); }
.cat-rdv::before { background: var(--foreground); }
.cat-idee::before { background: var(--avert); }
.cat-info::before { background: var(--chart-2); }
.note-corps { grid-area: corps; display: grid; gap: 4px; min-width: 0; }
.note-texte {
  margin: 0; font-size: 14px; line-height: 22px; white-space: pre-wrap; overflow-wrap: anywhere; cursor: text;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 3; overflow: hidden;
}
.note.epinglee .note-texte { font-weight: 600; }
.note-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px var(--e3); min-width: 0; font-size: 13px; line-height: 20px; color: var(--muted-foreground); }
.note-rdv { display: flex; align-items: center; gap: 4px 6px; min-width: 0; max-width: 100%; }
.note-rdv > span { flex: 0 1 auto; min-width: 0; }
.note-rdv .btn { flex: none; }
.note-rdv b { color: var(--foreground); font-weight: 600; }
.note-rdv .ic { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.note-rdv.fait .ic { color: var(--succes); }
.note-rdv.a-preciser .ic { color: var(--avert); }
.note-rdv a { font-weight: 600; }
.note-rdv .btn.petit { min-height: 28px; padding: 3px 8px; font-size: 12px; margin-left: 2px; }
.etiquettes { display: inline-flex; flex-wrap: wrap; gap: 4px var(--e2); }
.etiquette { color: var(--muted-foreground); }
.note-rdv-choix { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: var(--e2) var(--e3); align-items: end; width: 100%; padding: var(--e3); margin-top: 2px; border: 1px solid var(--border); border-radius: var(--r); background: var(--card); }
.note-rdv-choix .ligne { grid-column: 1 / -1; display: flex; gap: var(--e2); justify-content: flex-end; }
.note-chev { margin: 0; font-size: 13px; color: var(--avert); }
.note > .quand { grid-area: quand; padding-top: 2px; font-size: 12px; line-height: 20px; color: var(--muted-foreground); white-space: nowrap; }
.note-acts { grid-area: acts; display: flex; gap: 2px; margin: -4px 0; }
.note-acts .btn.icone.petit { min-width: 28px; min-height: 28px; }
.note-acts svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.note-acts .epingle[aria-pressed="true"] { color: var(--foreground); }
.note-acts .epingle[aria-pressed="true"] svg { fill: currentColor; }
.note-acts .supprimer:hover:not(:disabled), .note-acts .supprimer:focus-visible { color: var(--destructive); background: var(--teinte-rouge); }
@media (hover: hover) and (pointer: fine) {
  .note-acts .btn { opacity: 0; transition: opacity .12s var(--courbe), background-color .12s var(--courbe); }
  .note:hover .note-acts .btn, .note:focus-within .note-acts .btn, .note-acts .epingle[aria-pressed="true"] { opacity: 1; }
}
.note-edition { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; gap: var(--e2); margin: var(--e2) 0; padding: var(--e2) var(--e3); border: 1px solid var(--ring); border-radius: var(--r); box-shadow: var(--anneau); background: var(--input-bg); }
.note-edition textarea.inp { min-height: 66px; max-height: 320px; field-sizing: content; resize: none; padding: 4px 0; border-color: transparent; background: transparent; font-size: 14px; line-height: 22px; }
.note-edition textarea.inp:hover, .note-edition textarea.inp:focus-visible { border-color: transparent; box-shadow: none; }
.note-edition-pied { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e2) var(--e3); }
.note-edition-cat { display: inline-flex; align-items: center; gap: var(--e2); font-size: 13px; color: var(--muted-foreground); }
.note-edition-cat select.inp { width: auto; min-height: 32px; padding-top: 5px; padding-bottom: 5px; font-size: 13px; }
.note-edition-aide { flex: 1; min-width: 0; font-size: 12px; color: var(--muted-foreground); }
.note-edition .ligne { display: flex; gap: var(--e2); margin-left: auto; }
.note-sq { align-items: center; }
.note-sq-tag { grid-area: tag; width: 72px; height: 20px; }
.note-sq-texte { grid-area: corps; }
.notes-groupe .squelette { width: 96px; background: color-mix(in srgb, var(--foreground) 8%, var(--muted)); }
.note-sq-quand { width: 40px; grid-area: quand; }
.notes-vide { display: grid; justify-items: start; gap: var(--e2); padding: var(--e8) var(--e3); }
.notes-vide h2 { margin: 0; font-size: 14px; line-height: 20px; }
.notes-vide p { margin: 0; font-size: 13px; color: var(--muted-foreground); }
.notes-vide .btn { margin-top: var(--e2); }
.liste-notes > .alerte { margin-top: var(--e5); }
.liste-notes > .etat-vide { margin-top: var(--e10); }
.plus { display: flex; justify-content: center; }
.plus:empty { display: none; }

/* Paramètres (Catalyst Settings, Linear) : colonne de sections, rangées libellé et champ, aperçu */
.reglages { grid-template-columns: 224px minmax(0, 1fr) 320px; overflow: hidden; }
#v-canaux.reglages, .reglages.sans-apercu { grid-template-columns: 224px minmax(0, 1fr); }
.reglages-nav { display: grid; gap: 1px; align-content: start; overflow-y: auto; padding: var(--e5) var(--e3) var(--e6); border-right: 1px solid var(--border); }
.reglages-recherche { position: relative; margin-bottom: var(--e2); }
.reglages-recherche svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 14px; height: 14px; fill: none; stroke: var(--muted-foreground); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.reglages-recherche .inp { min-height: 32px; padding: 5px 10px 5px 30px; font-size: 13px; }
.groupe-titre { padding: var(--e4) var(--e2) var(--e1); font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted-foreground); }
.groupe-titre:first-of-type { padding-top: var(--e2); }
.rnav {
  display: flex; align-items: center; justify-content: space-between; gap: var(--e2); width: 100%; min-height: 32px; padding: 6px var(--e2);
  border-radius: var(--r-sm); color: var(--muted-foreground); font-size: 14px; text-decoration: none; text-align: left;
  transition: background-color .12s var(--courbe), color .12s var(--courbe);
}
@media (hover: hover) { .rnav:hover { background: var(--accent); color: var(--foreground); text-decoration: none; } }
.rnav:focus-visible { outline-offset: -2px; }
.rnav[aria-current="page"] { background: var(--accent); color: var(--foreground); font-weight: 600; }
.rnav.bientot { color: color-mix(in srgb, var(--muted-foreground) 70%, var(--background)); cursor: default; }
.rnav.bientot:hover { background: none; color: color-mix(in srgb, var(--muted-foreground) 70%, var(--background)); }
.rnav .bientot-tag { font-size: 12px; line-height: 18px; padding: 0 6px; border-radius: var(--r-sm); color: var(--muted-foreground); box-shadow: inset 0 0 0 1px var(--border); }
.rnav .fl { display: none; color: var(--muted-foreground); }
.rnav .fl svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.rnav small { display: block; font-size: 12px; line-height: 16px; color: var(--muted-foreground); font-weight: 400; }
.rnav-res { display: grid; gap: 1px; }
.reglages-centre { overflow-y: auto; padding: var(--e8) var(--e8) 0; min-width: 0; }
.form-reglages { display: block; }
.section-reglages { max-width: 768px; gap: 0; }
.section-tete { max-width: 768px; margin-bottom: 0; padding-bottom: var(--e5); border-bottom: 1px solid var(--border); }
.section-tete h2 { margin: 0; font-size: 16px; line-height: 24px; }
.section-tete p { margin: var(--e1) 0 0; color: var(--muted-foreground); max-width: 60ch; }
.section-tete.avec-action { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--e4); }
.section-tete.avec-action .btn { flex: none; }
.reglage {
  display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); gap: var(--e2) var(--e8); align-items: start;
  padding: var(--e6) 0; border-bottom: 1px solid var(--border); min-width: 0;
}
.reglage-tete { display: grid; gap: var(--e1); align-content: start; padding-top: 8px; font-size: 14px; font-weight: 600; color: var(--foreground); }
.reglage-val { min-width: 0; display: grid; gap: var(--e2); align-content: start; }
.reglage-aide { margin: 0; font-size: 13px; line-height: 20px; font-weight: 400; color: var(--muted-foreground); max-width: 60ch; }
.reglage.large { grid-template-columns: minmax(0, 1fr); gap: var(--e4); }
.reglage.large .reglage-tete { padding-top: 0; }
.reglage-val .valeur { font-size: 14px; line-height: 20px; font-weight: 400; }
.reglage-val > .valeur:only-child, .reglage-val > .valeur:first-child { display: flex; align-items: center; min-height: 36px; }
.reglage-ligne { display: flex; align-items: center; justify-content: space-between; gap: var(--e3) var(--e4); flex-wrap: wrap; min-height: 36px; }
.reglage-ligne > :first-child { min-width: 0; overflow-wrap: anywhere; }
.reglage small.aide-s { display: block; margin-top: var(--e1); font-size: 13px; color: var(--muted-foreground); }
.reglage .inp { max-width: 480px; }
.inp.gros { font-size: 14px; }
select.inp.gros option { font-size: 14px; }
.duo { display: flex; gap: var(--e6); flex-wrap: wrap; }
.duo .champ > span { font-size: 13px; font-weight: 400; color: var(--muted-foreground); }
.unite { display: flex; align-items: center; gap: var(--e2); }
.unite .inp.gros { width: 96px; }
.unite span { color: var(--muted-foreground); font-size: 14px; }
.reglage .case { min-height: 36px; }
.reglage-val > .segments { justify-self: start; }
/* Barre d'enregistrement : collée en bas du cadre, dit quand il reste des changements */
.reglages-centre { container-type: inline-size; }
@container (max-width: 520px) {
  .reglage { grid-template-columns: minmax(0, 1fr); gap: var(--e3); padding: var(--e5) 0; }
  .reglage-tete { padding-top: 0; }
}
.reglages-pied {
  position: sticky; bottom: 0; z-index: 3; display: flex; gap: var(--e2); align-items: center; max-width: 768px;
  margin: -1px 0 0; padding: var(--e4) 0 var(--e5); background: var(--background); border-top: 1px solid var(--border);
}
.reglages-pied .pied-etat { order: 1; }
.reglages-pied #btn-annuler-reglages { order: 2; }
.reglages-pied .btn.pri { order: 3; }
.form-reglages:has(.reglages-pied[hidden]), #v-canaux .reglages-centre { padding-bottom: var(--e10); }
.pied-etat { display: flex; align-items: center; gap: var(--e2); margin: 0 auto 0 0; min-width: 0; }
.pied-etat small { font-size: 13px; line-height: 20px; color: var(--muted-foreground); }
.pied-point { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--border-strong); transition: background-color .15s var(--courbe); }
.reglages-pied.modifie .pied-point { background: var(--avert); }
.reglages-pied.modifie .pied-etat small { color: var(--foreground); }
.retour-reglages { display: none; }
.etat-ia { display: flex; align-items: center; gap: var(--e2); }
.etat-ia i { width: 8px; height: 8px; border-radius: 50%; background: var(--muted-foreground); flex: none; }
.etat-ia i.ok { background: var(--succes); }
.canal-auto { display: flex; align-items: center; justify-content: space-between; gap: var(--e3); min-height: 44px; padding: var(--e2) var(--e3); border-top: 1px solid var(--border); }
.canal-auto:first-child { border-top: 0; }
.reglage-val > div:has(> .canal-auto) { border: 1px solid var(--border); border-radius: var(--r); max-width: 480px; }
.canal-auto label { display: flex; gap: var(--e2); align-items: center; min-width: 0; font-weight: 600; }
.repondeur-ligne { display: flex; align-items: center; gap: var(--e3); min-height: 36px; flex-direction: row-reverse; justify-content: flex-end; }
.repondeur-ligne .valeur { color: var(--muted-foreground); }
/* Aperçu du répondeur : colonne blanche à filet, le message dans un cadre gris */
.reglages-apercu { display: grid; gap: var(--e3); align-content: start; overflow-y: auto; padding: var(--e8) var(--e6); border-left: 1px solid var(--border); background: var(--background); }
.reglages-apercu h2 { margin: 0; font-size: 14px; line-height: 20px; }
.reglages-apercu > p { margin: 0; color: var(--muted-foreground); font-size: 13px; }
.telephone { display: grid; gap: var(--e3); padding: var(--e4); border: 1px solid var(--border); border-radius: var(--r); background: var(--sidebar); }
.telephone .quand { justify-self: center; padding: 0 var(--e2); font-size: 12px; line-height: 20px; color: var(--muted-foreground); text-align: center; }
.bulle-l { display: flex; gap: var(--e2); align-items: flex-end; }
.bulle-l.moi { flex-direction: row-reverse; }
.bulle-l .av { width: 24px; height: 24px; font-size: 12px; }
.bulle { max-width: 84%; margin: 0; padding: var(--e2) var(--e3); font-size: 13px; line-height: 20px; overflow-wrap: anywhere; background: var(--background); box-shadow: inset 0 0 0 1px var(--border); border-radius: var(--r) var(--r) var(--r) 2px; }
.bulle-l.moi .bulle { background: var(--primary); color: var(--primary-foreground); box-shadow: none; border-radius: var(--r) var(--r) 2px var(--r); }
.bulle-l.moi.coupe .bulle { background: var(--muted); color: var(--muted-foreground); box-shadow: inset 0 0 0 1px var(--border); }
.bulle-tag { justify-self: end; margin-top: calc(-1 * var(--e1)); font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.apercu-note { margin: 0; font-size: 13px; color: var(--muted-foreground); }
.apercu-note.att { color: var(--avert); }

/* Canaux (Vercel Integrations, Intercom Channels) : rangées dans un cadre, détail sous la rangée */
.liste-canaux { max-width: 768px; margin-top: var(--e6); }
.canaux { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r); }
.canal { border-bottom: 1px solid var(--border); min-width: 0; }
.canal:last-child { border-bottom: 0; }
.canal-ligne {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) auto auto auto; gap: var(--e4); align-items: center; padding: var(--e4);
}
.canal-picto {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: var(--r); flex: none;
  background: var(--background); box-shadow: inset 0 0 0 1px var(--border); color: var(--foreground);
}
.canal-picto svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.canal-picto.k-whatsapp_meta { color: var(--succes); }
.canal-picto-sq { width: 36px; height: 36px; border-radius: var(--r); }
.canal-qui { min-width: 0; display: grid; gap: 2px; }
.canal-qui h3 { margin: 0; font-size: 14px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canal-qui p { margin: 0; font-size: 13px; line-height: 20px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.canal-qui .canal-releve { font-size: 12px; line-height: 16px; font-variant-numeric: proportional-nums; }
.canal.en-pause .canal-qui h3 { color: var(--muted-foreground); }
.canal-auto-zone .toggle { margin: 0; }
.canal-auto-zone .toggle label { white-space: nowrap; cursor: pointer; }
.canal-actions { display: flex; gap: var(--e1); align-items: center; }
.canal-details { display: grid; gap: var(--e3); padding: 0 var(--e4) var(--e4) calc(var(--e4) + 36px + var(--e4)); }
.canal-details .champ > span { font-size: 13px; font-weight: 400; color: var(--muted-foreground); }
.canal-details .copie, .lien-unique .copie { align-items: center; }
.canal-details .copie code, .lien-unique .copie code { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; overflow-wrap: normal; }
.canal-details .alerte b, .canal-details .erreur-txt b { font-weight: 600; }
.qr-bloc { display: flex; gap: var(--e4); align-items: center; flex-wrap: wrap; }
.qr-bloc p { margin: 0; max-width: 32ch; font-size: 13px; color: var(--muted-foreground); }
.st.bad-err { background: var(--teinte-rouge); color: var(--destructive); }
.dot { width: 8px; height: 8px; border-radius: 50%; flex: none; background: var(--muted-foreground); }
.dot.k-mail { background: var(--mail); }
.dot.k-whatsapp_meta, .dot.k-whatsapp_web { background: var(--wa); }
.dot.k-err { background: var(--destructive); }
.qr { justify-self: start; padding: var(--e3); background: #fff; border-radius: var(--r); box-shadow: inset 0 0 0 1px var(--border); }
.qr img { display: block; width: 220px; height: 220px; image-rendering: pixelated; }
.liste-canaux.chargement .canal-ligne { grid-template-columns: 36px minmax(0, 1fr); }
.liste-canaux.chargement .canal-qui { gap: var(--e2); }
.etat-vide-cadre { max-width: none; margin: 0; padding: var(--e10) var(--e6); border: 1px dashed var(--border-strong); border-radius: var(--r); justify-items: center; text-align: center; }
.etat-vide-cadre p { max-width: 52ch; }
/* Ajout d'un canal en fenêtre : l'option officielle en tête, le QR code séparé et grisé */
.dlg-sous { margin: calc(-1 * var(--e2)) 0 0; color: var(--muted-foreground); }
.choix-canaux { display: grid; gap: var(--e2); }
.choix-canal {
  display: grid; grid-template-columns: 36px minmax(0, 1fr) 16px; gap: var(--e3); align-items: center; width: 100%; padding: var(--e3);
  text-align: left; border: 1px solid var(--border); border-radius: var(--r); background: var(--popover);
  transition: background-color .12s var(--courbe), border-color .12s var(--courbe);
}
.choix-canal:hover { background: var(--accent); border-color: var(--border-strong); }
.choix-canal:focus-visible { outline: none; border-color: var(--ring); box-shadow: var(--anneau); }
.choix-canal:active { transform: scale(.99); }
.choix-canal-txt { display: grid; gap: 2px; min-width: 0; }
.choix-canal-txt b { display: flex; align-items: center; gap: var(--e2); flex-wrap: wrap; font-size: 14px; }
.choix-canal-txt small { font-size: 13px; line-height: 20px; color: var(--muted-foreground); }
.choix-fl { width: 16px; height: 16px; fill: none; stroke: var(--muted-foreground); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.tag.t-reco { background: var(--teinte-bleu); color: var(--bleu); }
.choix-sep { display: flex; align-items: center; gap: var(--e3); margin: var(--e3) 0 var(--e1); font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted-foreground); }
.choix-sep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.choix-canal.risque { background: transparent; border-style: dashed; }
.choix-canal.risque b { color: var(--muted-foreground); }
.choix-canal.risque .canal-picto { color: var(--muted-foreground); }

/* Heures d'ouverture : frise 0 h à 24 h et repli en champs */
.horaires { display: grid; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--card); }
.jour-h { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: var(--e3); align-items: start; padding: var(--e3) var(--e4); border-bottom: 1px solid var(--border-soft); }
.jour-h:last-child { border-bottom: 0; }
.jour-h.ferme { background: var(--muted); }
.jour-h .nom-jour { display: flex; align-items: center; min-height: 40px; font-weight: 600; }
.jour-h .plages { display: grid; gap: 6px; }
.jour-h .tete-plages { display: flex; gap: var(--e3); align-items: center; flex-wrap: wrap; min-height: 40px; }
.jour-h .ferme-txt { color: var(--muted-foreground); font-size: 13px; }
.plage { display: flex; gap: var(--e2); align-items: center; flex-wrap: nowrap; }
.bloc-horaires { display: grid; gap: var(--e3); min-width: 0; }
.horaires-outils { display: flex; gap: var(--e2) var(--e4); align-items: center; flex-wrap: wrap; }
.aide-frise-visible { font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.bloc-horaires:has(.mode-champs) .aide-frise-visible { display: none; }
.horaires .plages-boite { display: none; }
.horaires.mode-champs .plages-boite { display: grid; gap: 6px; }
.horaires.mode-champs .piste, .horaires.mode-champs .axe-frise { display: none; }
.axe-frise { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: var(--e3); padding: var(--e2) var(--e4) 0; }
.axe-heures { position: relative; height: 16px; }
.graduation { position: absolute; left: var(--g); top: 0; transform: translateX(-50%); font-size: 12px; line-height: 16px; color: var(--muted-foreground); font-variant-numeric: proportional-nums; white-space: nowrap; }
.graduation:first-child { transform: none; }
.graduation:last-child { transform: translateX(-100%); }
.horaires:not(.mode-champs) .ferme-txt { display: none; }
.piste {
  position: relative; height: 40px; border-radius: var(--r-sm); background-color: var(--muted); touch-action: pan-y; cursor: crosshair;
  user-select: none; -webkit-user-select: none; -webkit-touch-callout: none;
  background-image: repeating-linear-gradient(to right, var(--border) 0 1px, transparent 1px calc(100% / 8));
  box-shadow: inset 0 0 0 1px var(--border);
}
.piste:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.jour-h.ferme .piste { background-color: var(--card); }
.plage-bloc {
  position: absolute; top: 4px; bottom: 4px; left: calc(var(--g) + 1px); width: calc(var(--l) - 2px); min-width: 6px;
  border-radius: 4px; background: var(--primary); color: var(--primary-foreground); container-type: inline-size; touch-action: none;
}
.plage-bloc.en-geste { box-shadow: var(--ombre-flotte); }
.plage-corps {
  position: absolute; inset: 0; width: 100%; display: flex; align-items: center; justify-content: center; padding: 0 6px;
  border-radius: inherit; color: inherit; font-size: 12px; font-weight: 600; cursor: grab; white-space: nowrap; overflow: hidden;
}
.plage-corps:focus-visible { outline: 2px solid var(--ring); outline-offset: 2px; }
.geste-frise, .geste-frise * { cursor: grabbing !important; user-select: none; -webkit-user-select: none; }
.plage-txt { display: flex; align-items: center; overflow: hidden; font-variant-numeric: proportional-nums; white-space: pre; }
@container (max-width: 92px) {
  .plage-corps { padding: 0 2px; }
  .plage-txt { flex-direction: column; font-size: 12px; line-height: 13px; }
  .plage-txt .a { display: none; }
}
@container (max-width: 30px) { .plage-txt { display: none; } }
.aide-frise-visible .si-doigt { display: none; }
@media (pointer: coarse) { .aide-frise-visible .si-souris { display: none; } .aide-frise-visible .si-doigt { display: inline; } }
.plage-bloc .bord { position: absolute; top: 0; bottom: 0; width: 10px; cursor: ew-resize; z-index: 1; }
.plage-bloc .bord.g { left: -3px; }
.plage-bloc .bord.d { right: -3px; }
.plage-bloc .bord::after { content: ""; position: absolute; top: 50%; left: 50%; width: 2px; height: 12px; margin: -6px 0 0 -1px; border-radius: 1px; background: currentColor; opacity: .6; }
.plage-croix {
  position: absolute; top: -10px; right: -10px; z-index: 2; width: 20px; height: 20px; display: grid; place-items: center; border-radius: 50%;
  background: var(--background); color: var(--foreground); border: 1px solid var(--border); box-shadow: var(--ombre-flotte);
  opacity: 0; visibility: hidden; transition: opacity .12s var(--courbe), visibility .12s;
}
.plage-croix svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.plage-bloc:focus-within .plage-croix { opacity: 1; visibility: visible; }
@media (hover: hover) { .plage-bloc:hover .plage-croix { opacity: 1; visibility: visible; } }
@media (pointer: coarse) {
  .piste { height: 48px; }
  .plage-bloc .bord { width: 18px; }
  .plage-bloc .bord.g { left: -8px; }
  .plage-bloc .bord.d { right: -8px; }
  .plage-croix { width: 28px; height: 28px; top: -14px; right: -10px; }
}
.copie-jours { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--e1) var(--e3); margin: var(--e3) 0 0; padding: 0; border: 0; }
.plage select.inp { width: 100px; min-height: 36px; padding: 7px 28px 7px 10px; background-position: right 6px center; }
.plage .a { color: var(--muted-foreground); font-size: 13px; }

/* Fenêtres */
dialog {
  width: min(520px, calc(100vw - 32px)); max-height: calc(100dvh - 32px); padding: 0; border: 1px solid var(--border); border-radius: var(--r);
  background: var(--popover); color: var(--popover-foreground); box-shadow: var(--ombre-flotte);
}
dialog[open] { animation: ouvre .16s var(--courbe); }
dialog::backdrop { background: var(--voile); }
.dlg { display: grid; gap: var(--e4); padding: var(--e6); }
.dlg h2 { margin: 0; font-size: 16px; line-height: 24px; }
.dlg .pied { display: flex; gap: var(--e2); justify-content: flex-end; flex-wrap: wrap; padding-top: var(--e2); }
.dlg .pied .gauche { margin-right: auto; }
.menu-liste { display: grid; gap: 2px; margin: 0 calc(-1 * var(--e2)); }
.menu-lien {
  display: flex; align-items: center; gap: var(--e3); width: 100%; min-height: 44px; padding: var(--e2); border-radius: var(--r);
  color: var(--foreground); text-decoration: none; font-weight: 600; text-align: left;
}
@media (hover: hover) { .menu-lien:hover { background: var(--accent); color: var(--accent-foreground); text-decoration: none; } }
.menu-lien svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; color: var(--muted-foreground); }
.menu-lien .n { margin-left: auto; min-width: 20px; padding: 0 6px; font-size: 12px; line-height: 20px; text-align: center; border-radius: var(--r-sm); background: var(--muted); color: var(--foreground); font-variant-numeric: proportional-nums; }
.menu-lien small { display: block; font-size: 13px; font-weight: 400; color: var(--muted-foreground); }
.choix-conv { display: grid; gap: 2px; max-height: 320px; overflow-y: auto; margin: 0 calc(-1 * var(--e2)); }
.choix-conv .menu-lien { font-weight: 400; }
.choix-conv .menu-lien b { font-weight: 600; }
.choix-conv .menu-lien > span:last-child { min-width: 0; overflow: hidden; }
.choix-conv small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choix-conv .av { width: 32px; height: 32px; }

/* Palette de commandes (Linear) */
dialog.palette { width: min(600px, calc(100vw - 32px)); margin: 12vh auto auto; overflow: hidden; display: none; }
dialog.palette[open] { display: flex; flex-direction: column; max-height: min(560px, 76dvh); }
.palette-champ { display: flex; align-items: center; gap: var(--e3); padding: 0 var(--e4); border-bottom: 1px solid var(--border); flex: none; }
.palette-champ svg { width: 18px; height: 18px; fill: none; stroke: var(--muted-foreground); stroke-width: 1.75; stroke-linecap: round; }
.palette-champ input { flex: 1; min-width: 0; height: 52px; border: 0; background: transparent; font-size: 16px; outline: none; }
.palette-champ kbd, .palette-pied kbd {
  padding: 0 6px; font-size: 12px; line-height: 18px; color: var(--muted-foreground); border: 1px solid var(--border); border-radius: 4px; background: var(--muted);
}
.palette-res { flex: 1; min-height: 0; overflow-y: auto; padding: var(--e2); overscroll-behavior: contain; }
.palette-groupe { margin: 0; padding: var(--e2) var(--e2) var(--e1); font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.palette-item { display: flex; align-items: center; gap: var(--e3); min-height: 40px; padding: 6px var(--e2); border-radius: var(--r-sm); cursor: pointer; }
.palette-item[aria-selected="true"] { background: var(--accent); }
.palette-item > svg { width: 16px; height: 16px; fill: none; stroke: var(--muted-foreground); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; margin: 0 4px; }
.palette-item .av { width: 24px; height: 24px; font-size: 12px; }
.palette-txt { display: flex; align-items: baseline; gap: var(--e2); flex: 1; min-width: 0; }
.palette-txt b { font-weight: 400; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; max-width: 60%; }
.palette-txt small { min-width: 0; font-size: 13px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.palette-indice { flex: none; font-size: 12px; color: var(--muted-foreground); }
.palette-vide { margin: 0; padding: var(--e8) var(--e4); text-align: center; color: var(--muted-foreground); }
.palette-pied { display: flex; gap: var(--e4); padding: var(--e2) var(--e4); font-size: 12px; line-height: 16px; color: var(--muted-foreground); border-top: 1px solid var(--border); flex: none; }
.palette-pied span { display: inline-flex; align-items: center; gap: 4px; }

/* Toast */
.toast {
  position: fixed; right: var(--e6); bottom: calc(var(--e6) + env(safe-area-inset-bottom, 0px)); z-index: 70;
  display: flex; gap: var(--e3); align-items: flex-start; max-width: min(400px, calc(100vw - 32px)); padding: var(--e3) var(--e4);
  font-size: 14px; color: var(--popover-foreground); background: var(--popover); border: 1px solid var(--border); border-radius: var(--r);
  box-shadow: var(--ombre-flotte); overflow-wrap: anywhere; animation: monte .2s var(--courbe);
}
.toast::before { content: ""; width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; flex: none; background: var(--succes); }
.toast.err::before { background: var(--destructive); }
.toast.att::before { background: var(--avert); }
.toast-txt { flex: 1; min-width: 0; }
.toast .toast-action { flex: none; min-height: 20px; font-size: 14px; }
@keyframes monte { from { opacity: 0; transform: translateY(8px); } }
@keyframes glisse-g { from { transform: translateX(16px); opacity: 0; } }
@keyframes fondu { from { opacity: 0; transform: translateY(-4px); } }

/* Écrans moyens */
.retour { display: none; }
@media (max-width: 1536px) {
  #v-messages { grid-template-columns: 300px minmax(0, 1fr) 280px; }
  #v-messages.fiche-fermee { grid-template-columns: 300px minmax(0, 1fr); }
}
@media (max-width: 1280px) {
  .reglages { grid-template-columns: 220px minmax(0, 1fr) 300px; }
  #v-canaux.reglages, .reglages.sans-apercu { grid-template-columns: 220px minmax(0, 1fr); }
  .reglages-centre { padding: var(--e6) var(--e8) 0; }
}
@media (max-width: 1180px) {
  .app { grid-template-columns: 220px minmax(0, 1fr); }
  #v-messages, #v-messages.fiche-fermee { grid-template-columns: 300px minmax(0, 1fr); }
  .conv-h { padding: var(--e2) var(--e3) var(--e2) var(--e4); }
  /* La liste de catégorie, juste à côté, dit déjà la catégorie */
  .conv-h .via .tag, .conv-h .via .faint, .conv-h .via .sep { display: none; }
  .side { display: none; }
  /* Fiche contact en panneau par dessus le fil, fermé par défaut */
  #v-messages.fiche-dessus .side {
    display: flex; position: absolute; top: 57px; right: 0; bottom: 0; z-index: 15; width: min(320px, 100%);
    box-shadow: var(--ombre-flotte); animation: glisse-g .18s var(--courbe);
  }
  .reglages, #v-canaux.reglages, .reglages.sans-apercu { grid-template-columns: 220px minmax(0, 1fr); overflow-y: auto; }
  .reglages-centre { overflow: visible; }
  .reglages-pied { bottom: 0; }
  .reglages-apercu { grid-column: 2; border-left: 0; padding: 0 var(--e8) var(--e8); overflow: visible; max-width: 760px; background: transparent; }
  .reglages-nav { grid-row: 1 / span 2; }
  .grille-widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .widget.taille-moyen { grid-column: 1 / -1; }
  .accueil-barre.edition { grid-template-columns: minmax(0, 1fr); }
  .accueil-actions { justify-content: flex-start; }
}

/* Téléphone : en tête compact, barre du bas à cinq entrées */
@media (max-width: 820px) {
  :root { --gouttiere: 16px; }
  body { background: var(--background); }
  .app { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .rail { min-height: auto; }
  main { padding: 0; }
  .surface { border: 0; border-radius: 0; }
  .rail {
    order: 2; flex-direction: row; overflow: visible; padding: var(--e1) var(--e1) calc(var(--e1) + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border); background: var(--background);
  }
  .rail-tete, .rail-bas, .sous, .groupe-nav, .rail .nav:not([data-mobile]):not(.nav-plus) { display: none !important; }
  .nav-liste { display: flex; width: 100%; gap: 0; }
  .nav-plus { display: flex; }
  .nav {
    flex: 1 1 0; flex-direction: column; justify-content: center; gap: 2px; min-width: 0; min-height: 52px; padding: 6px 0 4px;
    font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted-foreground); border-radius: var(--r);
  }
  .nav:hover { background: transparent; color: var(--muted-foreground); }
  .nav[aria-current="page"], .nav[aria-current="page"]:hover { color: var(--foreground); }
  .nav[aria-current="page"]::before { left: 30%; right: 30%; top: calc(-1 * var(--e1) - 1px); bottom: auto; width: auto; height: 2px; border-radius: 0 0 2px 2px; }
  .nav svg { width: 22px; height: 22px; }
  .nav .lib { max-width: 100%; }
  .nav .lib-court { display: block; }
  .nav:has(.lib-court) .lib { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .nav .n {
    position: absolute; top: 2px; left: calc(50% + 4px); margin: 0; min-width: 18px; padding: 0 5px; line-height: 18px;
    background: var(--primary); color: var(--primary-foreground); border-radius: 999px;
  }
  .tete-mobile {
    display: flex; align-items: center; gap: var(--e2); padding: calc(var(--e2) + env(safe-area-inset-top, 0px)) var(--e3) var(--e2) var(--e2);
    border-bottom: 1px solid var(--border); background: var(--background);
  }
  .equipe.compact { width: auto; min-height: 40px; margin: 0; padding: 0 var(--e2); gap: var(--e2); }
  .equipe.compact .logo { width: 20px; height: 20px; }
  .equipe.compact .chevrons { margin-left: 0; }
  #btn-recherche-mobile { margin-left: auto; min-width: 40px; min-height: 40px; }
  .surface { overflow: hidden; }
  .top { padding: var(--e4) var(--gouttiere) var(--e3); min-height: 0; border-bottom: 0; align-items: flex-start; }
  .top h1 { font-size: 20px; }
  .creer .lib-creer { display: none; }
  .creer > .btn { min-width: 44px; padding: 0 var(--e3); }
  main:has(#v-messages.lecture.on) .top, main:has(#v-messages.lecture.on) .tete-mobile { display: none; }
  .bandeau-demo { padding: 6px var(--gouttiere); }
  #v-messages, #v-messages.fiche-fermee { grid-template-columns: minmax(0, 1fr); }
  #v-messages.lecture .liste { display: none; }
  #v-messages:not(.lecture) .conv { display: none; }
  .liste-tete { padding: var(--e3) var(--e4); }
  .item { padding: var(--e3) var(--e4); }
  .retour { display: inline-flex; }
  .page { padding: var(--e1) var(--gouttiere) var(--e8); gap: var(--e4); }
  .carte { padding: var(--e4); }
  .b { max-width: 88%; }
  .grille2, .duo { grid-template-columns: minmax(0, 1fr); }
  .barre .inp { min-width: 0; flex: 1; }
  .barre .pousse { margin-left: 0; }
  /* Toujours à plat (le script le décide) : la conversation prend tout l'écran */
  .conv-scene.plat { --marge-fil: var(--e4); }
  .conv-scene.plat .msgs { padding: var(--e4) var(--e4) var(--e3); }
  .conv-scene.plat .sugg { max-height: 30%; padding-top: var(--e3); border-top: 1px solid var(--border); }
  .conv-scene.plat > .compose { margin: var(--e2) var(--e3) calc(var(--e3) + env(safe-area-inset-bottom, 0px)); }
  .compose textarea { min-height: 44px; max-height: 120px; }
  .compose-aide { display: none; }
  .compose-pied { justify-content: flex-end; }
  .sugg .h > span:not(.toggle) { display: none; }
  .conv-h { flex-wrap: wrap; padding: var(--e2) var(--e3); gap: var(--e2); }
  .conv-h .act { flex-wrap: wrap; }
  #v-messages.fiche-dessus .side { top: 0; width: 100%; box-shadow: none; border-left: 0; }
  .inp, .compose textarea, .note-saisie textarea.inp, .palette-champ input { font-size: 16px; }
  .btn { min-height: 44px; }
  .btn.petit { min-height: 40px; }
  .chip { min-height: 36px; }
  .jour-h { grid-template-columns: minmax(0, 1fr); gap: var(--e1); }
  .axe-frise { grid-template-columns: minmax(0, 1fr); }
  .axe-frise > span:first-child { display: none; }
  .graduation.secondaire { display: none; }
  .jour-h .nom-jour { min-height: 0; }
  .toast { left: var(--e4); right: var(--e4); bottom: auto; top: calc(var(--e3) + env(safe-area-inset-top, 0px)); animation-name: fondu; }
  .dlg { padding: var(--e5) var(--e4); }
  dialog.feuille { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: var(--r) var(--r) 0 0; border-bottom: 0; padding-bottom: env(safe-area-inset-bottom, 0px); }
  dialog.palette { margin-top: var(--e3); }
  .palette-pied { display: none; }
  .grille-widgets { column-gap: var(--e4); row-gap: var(--e8); }
  .grille-widgets.edition { gap: var(--e3); }
  #v-apercu.page { padding-top: var(--e2); }
  .accueil-barre { margin-bottom: var(--e4); }
  .accueil-barre:not(.edition) .accueil-actions { width: 100%; justify-content: stretch; flex-wrap: nowrap; }
  .accueil-actions select.periode { flex: 1; min-width: 0; min-height: 40px; font-size: 16px; }
  .accueil-actions .btn { flex: 1 1 auto; }
  #btn-personnaliser { flex: none; }
  .grille-widgets.edition .widget { padding: 4px; }
  .widget-nom { display: none; }
  .seg-taille { flex: 1; }
  .seg-taille .segment { flex: 1; padding: 3px 4px; }
  .kpi { padding-top: var(--e4); }
  .kpi-titre { font-size: 13px; }
  .kpi .val { margin-top: var(--e2); font-size: 20px; line-height: 28px; }
  .kpi-ecart { margin-top: var(--e2); }
  .kpi-detail { display: none; }
  .widget-corps .carte-tete { align-items: flex-start; }
  .courbe svg { height: 170px; }
  .tdb-tableau .onglets { gap: var(--e4); overflow-x: auto; }
  .tableau .cache-mobile { display: none; }
  .chaleur { border-spacing: 2px; }
  .chaleur th[scope="row"] { width: 30px; }
  .case-c { min-height: 12px; aspect-ratio: .9; }
  .chaleur-defile { overflow-x: auto; margin: 0 calc(-1 * var(--e4)); padding: 0 var(--e4); overscroll-behavior-x: contain; }
  .chaleur.cliquable { width: max-content; table-layout: auto; border-spacing: 3px; }
  .chaleur.cliquable th[scope="row"] { position: sticky; left: 0; z-index: 1; background: var(--card); min-width: 34px; }
  .chaleur.cliquable button.case-c { width: 44px; height: 44px; min-height: 44px; max-height: none; aspect-ratio: auto; border-radius: var(--r-sm); }
  /* Les pages défilent avec leur en tête ; Messages et Agenda gardent leur plein écran */
  .surface:not(:has(#v-messages.on, #v-agenda.on)) { overflow-y: auto; overscroll-behavior-y: contain; }
  .surface:not(:has(#v-messages.on, #v-agenda.on)) > .vue.on { flex: none; min-height: auto; overflow: visible; }
  main:has(#v-agenda.on) .top .sub { display: none; }
  .ajout-page { display: none; }
  .seul-mobile { display: flex !important; }
  select.seul-mobile { display: block !important; }
  .filtres-ligne select.inp { max-width: none; }
  #v-agenda.on { padding-top: var(--e1); padding-bottom: var(--e3); gap: var(--e3); }
  .barre-agenda { flex-wrap: wrap; gap: var(--e2); }
  .agenda-titre { flex: 1 1 0; }
  .agenda-plage { display: none; }
  .groupe-btn > .btn { min-height: 40px; font-size: 14px; }
  .groupe-btn > .btn.icone { min-width: 40px; }
  .barre-agenda .segments { order: 3; flex: 1 1 100%; }
  .barre-agenda .segment { flex: 1; min-height: 34px; }
  .cal-wrap { min-height: 320px; }
  .legend { gap: 4px var(--e3); }
  .legend .astuce { margin-left: 0; text-align: left; flex-basis: 100%; }
  .mois { grid-template-rows: auto repeat(6, minmax(56px, 1fr)); }
  .mjour { padding: 6px 4px; align-items: center; }
  .mjour .num { align-self: center; }
  .mjour .pt, .mjour .encore, .mjour .squelette { display: none; }
  .mjour .points { display: flex; justify-content: center; }
  .mois .jsem { padding: 0 4px; justify-content: center; }
  .notes-outils { flex-direction: column-reverse; align-items: stretch; gap: var(--e3); }
  .notes-recherche { width: 100%; margin: 0; }
  .notes-outils .onglets { margin: 0 calc(-1 * var(--gouttiere)); padding: 0 var(--gouttiere); gap: var(--e5); }
  .notes-outils .onglet { min-height: 44px; font-size: 14px; }
  .note-saisie { padding: var(--e2) var(--e2) var(--e2) var(--e3); }
  .note-saisie textarea.inp { font-size: 16px; }
  .note-saisie-pied .btn.petit { min-height: 40px; }
  .note { grid-template-columns: minmax(0, 1fr) auto auto; grid-template-areas: "tag quand acts" "corps corps corps"; gap: 6px var(--e2); padding: var(--e3) 0 var(--e3) var(--e1); align-items: center; }
  .note-acts { margin: -6px -4px -6px 0; }
  .note-acts .btn.icone.petit { min-width: 40px; min-height: 40px; }
  .notes-groupe { margin: 0 calc(-1 * var(--gouttiere)); padding: 0 var(--gouttiere); }
  .note-edition { margin: var(--e2) 0; }
  .note-edition-aide { display: none; }
  .note-rdv { flex-wrap: wrap; align-items: flex-start; }
  .note-rdv .ic { margin-top: 3px; }
  .note-rdv > span { flex: 1 1 calc(100% - 20px); }
  .note-rdv .btn.petit { min-height: 36px; margin-left: 20px; }
  .jour-liste li { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .cc.ajout { grid-template-columns: minmax(0, 1fr); }
  .cc.ajout .acts { grid-column: 1; grid-row: auto; }
  .reglages, #v-canaux.reglages, .reglages.sans-apercu { grid-template-columns: minmax(0, 1fr); overflow-y: auto; }
  .reglages-nav { border-right: 0; padding: var(--e1) var(--e4) var(--e6); overflow: visible; grid-row: auto; }
  .reglages.sans-section .reglages-centre, .reglages.sans-section .reglages-apercu { display: none; }
  .reglages:not(.sans-section) .reglages-nav, #v-canaux .reglages-nav { display: none; }
  .reglages-centre { padding: 0 var(--e4) var(--e6); overflow: visible; }
  .reglages-apercu { grid-column: 1; padding: 0 var(--e4) var(--e8); }
  .retour-reglages { display: inline-flex; margin: 0 0 var(--e2) calc(-1 * var(--e3)); }
  .rnav { min-height: 52px; border-bottom: 1px solid var(--border-soft); border-radius: 0; padding-inline: 0; }
  .rnav[aria-current="page"] { background: none; font-weight: 400; }
  .rnav .fl { display: block; }
  .groupe-titre { padding: var(--e5) 0 var(--e1); }
  .reglages-pied { margin: 0; padding: var(--e3) 0 var(--e4); bottom: 0; flex-wrap: wrap; }
  .reglages-pied .pied-etat { flex-basis: 100%; }
  .reglages-pied .btn { flex: 1; }
  .etat-vide { margin: var(--e8) auto; padding: 0; }
}
/* Résumé chiffré compact : chiffres sur filet, sans carte */
.resume-chiffres { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--e8); }
.resume-chiffres:empty { display: none; }
.chiffre-c { display: block; min-width: 0; padding-top: var(--e3); border-top: 1px solid var(--border); text-align: left; }
.chiffre-c dl { margin: 0; display: grid; gap: 2px; }
.chiffre-c dt { font-size: 13px; line-height: 20px; color: var(--muted-foreground); }
.chiffre-c dd { margin: 0; font-size: 16px; line-height: 24px; font-weight: 600; font-variant-numeric: proportional-nums; }
.chiffre-c dd small { display: block; font-size: 12px; line-height: 16px; font-weight: 400; color: var(--muted-foreground); }
button.chiffre-c { border-radius: 0; transition: border-color .15s var(--courbe); }
button.chiffre-c:hover { border-top-color: var(--foreground); }
button.chiffre-c:hover dt { color: var(--foreground); }
button.chiffre-c:focus-visible { outline-offset: 4px; border-radius: var(--r-sm); }

/* Tableau de données (shadcn tasks, Catalyst Orders) */
.page-table { gap: var(--e6); }
.td { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--e3); min-width: 0; }
.td-outils, .td-groupe { display: flex; align-items: center; gap: var(--e2); min-height: 32px; flex-wrap: wrap; }
.td-recherche { position: relative; width: 256px; flex: none; }
.td-recherche svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; fill: none; stroke: var(--muted-foreground); stroke-width: 1.75; stroke-linecap: round; pointer-events: none; }
.td-recherche .inp { min-height: 32px; padding: 5px 10px 5px 32px; font-size: 14px; }
.td-facettes { display: flex; gap: var(--e2); align-items: center; flex-wrap: wrap; min-width: 0; }
.td-facette svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; color: var(--muted-foreground); }
.td-facette[aria-pressed="true"] { border-style: dashed; border-color: var(--input-strong); background: transparent; }
.td-facette[aria-pressed="true"]:hover { background: var(--accent); }
.td-facette-sep { width: 1px; height: 16px; margin: 0 2px; background: var(--border); }
.td-facette .tag { height: 20px; font-weight: 400; color: var(--foreground); }
.td-reinit svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.td-droite { margin-left: auto; display: flex; gap: var(--e2); align-items: center; }
.td-droite svg, .td-groupe svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.td-groupe { padding: 0; }
.td-groupe-n { font-size: 14px; font-weight: 600; font-variant-numeric: proportional-nums; margin-right: var(--e2); }
.td-groupe-actions { display: flex; gap: var(--e2); flex-wrap: wrap; }
.td-deselect { margin-left: auto; }
.td-cadre { min-width: 0; overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); background: var(--background); }
.td-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 14px; }
.td-table th {
  height: 40px; padding: 0 var(--e3); text-align: left; white-space: nowrap; font-size: 13px; line-height: 20px; font-weight: 400;
  color: var(--muted-foreground); border-bottom: 1px solid var(--border);
}
.td-table th[aria-sort="ascending"], .td-table th[aria-sort="descending"] { color: var(--foreground); }
.td-table td {
  height: 40px; padding: 0 var(--e3); border-bottom: 1px solid var(--border-soft); white-space: nowrap; vertical-align: middle;
  max-width: 200px; overflow: hidden; text-overflow: ellipsis;
}
.td-table td.td-tete-col { max-width: 280px; }
.td-table tbody tr:last-child td { border-bottom: 0; }
.td-table .num { text-align: right; font-variant-numeric: proportional-nums; }
.td-table td.mono { font-variant-numeric: proportional-nums; }
.td-table .td-case { width: 40px; padding: 0 0 0 var(--e3); }
.td-table .td-act { width: 48px; padding: 0 var(--e2) 0 0; text-align: right; }
.td-table .td-tete-col { min-width: 200px; }
.td-trier {
  display: inline-flex; align-items: center; gap: 4px; margin-left: calc(-1 * var(--e2)); min-height: 28px; padding: 0 var(--e2);
  border-radius: var(--r-sm); font-size: 13px; color: inherit; white-space: nowrap; transition: background-color .15s var(--courbe), color .15s var(--courbe);
}
.td-trier:hover { background: var(--accent); color: var(--foreground); }
.td-trier svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; opacity: .7; }
.td-table th.num .td-trier { margin-left: 0; margin-right: calc(-1 * var(--e2)); flex-direction: row-reverse; }
.td-table tbody tr { cursor: pointer; transition: background-color .12s var(--courbe); }
@media (hover: hover) { .td-table tbody tr:not(.td-sq):hover { background: var(--accent); } }
.td-table tbody tr.choisie { background: color-mix(in srgb, var(--bleu) 6%, var(--background)); }
.td-table tbody tr.ouverte, .td-table tbody tr.ouverte:hover { background: var(--accent); }
.td-table tbody tr.ouverte .td-nom { color: var(--foreground); }
.td-table tr.attenuee td:not(.td-case):not(.td-act) { color: var(--muted-foreground); }
.td-table tr.attenuee .td-nom { font-weight: 400; }
.td-ouvrir {
  display: inline-flex; align-items: center; gap: var(--e2); max-width: 100%; min-width: 0; min-height: 28px; text-align: left;
  font-weight: 600; color: var(--foreground); border-radius: var(--r-sm);
}
.td-ouvrir:focus-visible { outline-offset: 2px; }
.td-nom { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-sous { display: none; }
.td-ouvrir .av.carre { width: 24px; height: 24px; font-size: 11px; border-radius: var(--r-sm); }
.td-coupe { display: inline-block; max-width: 176px; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.td-canal { display: inline-flex; align-items: center; gap: 6px; }
.td-canal .dot { width: 6px; height: 6px; }
.td-tags { display: inline-flex; gap: 4px; flex-wrap: wrap; }
.td-tags .tag { font-weight: 400; }
.td-a-faire { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; }
.point-bleu { display: inline-block; flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--bleu); }
.td-menu { min-width: 28px !important; min-height: 28px !important; color: var(--muted-foreground); }
.td-menu svg, .btn-points svg { stroke-width: 3 !important; }
.td-menu[aria-expanded="true"] { background: var(--accent); color: var(--foreground); }
.td-coche, .menu-case .coche {
  appearance: none; -webkit-appearance: none; margin: 0; width: 16px; height: 16px; flex: none; cursor: pointer; vertical-align: middle;
  border: 1px solid var(--input-strong); border-radius: 4px; background: var(--input-bg);
  display: inline-grid; place-items: center; transition: background-color .15s var(--courbe), border-color .15s var(--courbe);
}
.td-coche::after, .menu-case .coche::after {
  content: ""; width: 8px; height: 4px; border: solid var(--primary-foreground); border-width: 0 0 2px 2px;
  transform: translateY(-1px) rotate(-45deg); opacity: 0;
}
.td-coche:checked, .td-coche:indeterminate, .menu-case[aria-checked="true"] .coche { background: var(--primary); border-color: var(--primary); }
.td-coche:checked::after, .menu-case[aria-checked="true"] .coche::after { opacity: 1; }
.td-coche:indeterminate::after { opacity: 1; width: 8px; height: 0; border-width: 0 0 2px 0; transform: none; }
.td-coche:focus-visible { outline: none; box-shadow: var(--anneau); }
.td-pied { display: flex; align-items: center; justify-content: space-between; gap: var(--e4); flex-wrap: wrap; font-size: 13px; color: var(--muted-foreground); }
.td-compte { margin: 0; font-variant-numeric: proportional-nums; }
.td-pages { display: flex; align-items: center; gap: var(--e6); flex-wrap: wrap; }
.td-pp { display: flex; align-items: center; gap: var(--e2); font-weight: 600; color: var(--foreground); }
.td-pp select.inp { width: 72px; min-height: 32px; padding: 5px 28px 5px 10px; font-size: 13px; }
.td-page-n { font-weight: 600; color: var(--foreground); font-variant-numeric: proportional-nums; min-width: 96px; text-align: center; }
.td-fleches { display: flex; gap: 4px; }
.btn.icone.petit { min-width: 32px; min-height: 32px; }
.td-vide { display: grid; justify-items: center; gap: var(--e2); padding: var(--e12) var(--e6); text-align: center; }
.td-vide h2 { margin: 0; font-size: 16px; line-height: 24px; }
.td-vide p { margin: 0; max-width: 420px; color: var(--muted-foreground); font-size: 14px; }
.td-vide .btn { margin-top: var(--e2); }
.td-vide-plein { margin: var(--e10) auto; }
.td-vide-plein .btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.td-erreur {
  display: flex; align-items: center; justify-content: space-between; gap: var(--e3); flex-wrap: wrap; margin: var(--e4); padding: var(--e3) var(--e4);
  border-radius: var(--r); border: 1px solid color-mix(in srgb, var(--destructive) 25%, transparent); background: var(--teinte-rouge); font-size: 13px;
}
.td-erreur p { margin: 0; }
.td-sq td { cursor: default; }
.td-sq-nom { display: flex; align-items: center; gap: var(--e2); }
.squelette.rond.petit { width: 24px; height: 24px; }
.td-sq .squelette { height: 10px; }
.td-sq .squelette.rond { height: 24px; }
.td-sq .squelette.l30 { width: 40px; } .td-sq .squelette.l40 { width: 56px; } .td-sq .squelette.l50 { width: 72px; }
.td-sq .squelette.l70 { width: 104px; } .td-sq .squelette.l90 { width: 136px; }
.td-sq-case { width: 16px; height: 16px !important; border-radius: 4px; }

/* Badge de statut à point */
.st { gap: 6px; }
.st-point { width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex: none; }

/* Menu flottant : position fixe, jamais coupé */
.menu.flottant { position: fixed; left: var(--fx, 8px); top: var(--fy, 8px); right: auto; z-index: 80; min-width: 208px; max-width: calc(100vw - 16px); max-height: min(420px, calc(100dvh - 16px)); overflow-y: auto; transform-origin: top; }
.menu-item.danger { color: var(--destructive); }
.menu-item.danger svg { stroke: currentColor; }
.menu-item:disabled { opacity: .5; cursor: not-allowed; }
.menu-case { gap: var(--e2); }
.menu-case-lib { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-nb { margin-left: auto; font-size: 12px; color: var(--muted-foreground); font-variant-numeric: proportional-nums; }
.menu-facette { width: 248px; }
.menu-facette-q { padding: 0 0 var(--e1); }
.menu-facette-q .inp { min-height: 32px; font-size: 13px; padding: 5px 10px; }
.menu-facette-liste { display: grid; }
.menu-vide { margin: 0; padding: var(--e2); font-size: 13px; color: var(--muted-foreground); }

/* Fiche en panneau latéral */
.panneau {
  position: fixed; top: var(--e2); right: var(--e2); bottom: var(--e2); z-index: 35; width: min(480px, calc(100vw - 16px));
  display: flex; flex-direction: column; background: var(--popover); color: var(--popover-foreground);
  border: 1px solid var(--border); border-radius: var(--r); box-shadow: var(--ombre-flotte); outline: none;
}
.panneau:not([hidden]) { animation: glisse-pn .2s var(--courbe); }
@keyframes glisse-pn { from { opacity: 0; transform: translateX(12px); } }
.pn-tete { display: flex; align-items: center; gap: var(--e3); min-height: 64px; padding: var(--e3) var(--e3) var(--e3) var(--e5); border-bottom: 1px solid var(--border); }
.pn-tete .av { width: 32px; height: 32px; }
.pn-tete .av.carre { border-radius: var(--r-sm); }
.pn-titres { flex: 1; min-width: 0; }
.pn-titres h2 { margin: 0; font-size: 16px; line-height: 24px; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.pn-titres p { margin: 0; font-size: 13px; line-height: 20px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-actions { display: flex; align-items: center; gap: var(--e1); flex: none; }
.pn-actions svg, .pn-pied svg, .pn-section svg, .pn-actions-bas svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.pn-corps { flex: 1; min-height: 0; overflow-y: auto; display: grid; align-content: start; gap: var(--e6); padding: var(--e5); }
.pn-pied { display: flex; justify-content: flex-end; gap: var(--e2); flex-wrap: wrap; padding: var(--e3) var(--e5); border-top: 1px solid var(--border); }
.pn-pied:empty { display: none; }
.pn-dl { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--e3) var(--e4); margin: 0; font-size: 14px; line-height: 20px; }
.pn-dl dt { color: var(--muted-foreground); }
.pn-dl dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
.pn-dl a { color: var(--foreground); text-decoration: underline; text-decoration-color: var(--border-strong); }
.pn-dl a:hover { text-decoration-color: currentColor; }
.pn-multi { white-space: pre-line; }
.pn-dd-ligne { display: inline-flex; align-items: baseline; gap: var(--e3); flex-wrap: wrap; }
.btn.lien.pn-dd-action { font-size: 13px; font-weight: 400; color: var(--muted-foreground); text-decoration: underline; text-decoration-color: var(--border-strong); text-underline-offset: 3px; }
.btn.lien.pn-dd-action:hover:not(:disabled) { color: var(--foreground); text-decoration-color: currentColor; }
.btn.lien.pn-lien-fiche { color: var(--foreground); }
.pn-section { display: grid; gap: var(--e3); padding-top: var(--e5); border-top: 1px solid var(--border); min-width: 0; }
.pn-section-tete { display: flex; align-items: center; justify-content: space-between; gap: var(--e3); }
.pn-section h3 { margin: 0; font-size: 14px; line-height: 20px; }
.pn-texte { margin: 0; font-size: 14px; white-space: pre-line; overflow-wrap: anywhere; }
.pn-statut { display: flex; align-items: center; justify-content: space-between; gap: var(--e3); }
.pn-statut-sel select.inp { margin: -6px 0; }
.pn-statut-sel select.inp { width: auto; min-height: 32px; padding: 5px 30px 5px 10px; font-size: 13px; }
.pn-liste { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; }
.pn-liste > li + li { border-top: 1px solid var(--border-soft); }
.pn-rangee {
  display: flex; align-items: center; gap: var(--e3); width: 100%; min-height: 44px; padding: var(--e2) var(--e3); text-align: left;
  font-size: 14px; transition: background-color .12s var(--courbe);
}
@media (hover: hover) { .pn-rangee:hover { background: var(--accent); } }
.pn-rangee:focus-visible { outline-offset: -2px; }
.pn-rangee > svg { color: var(--muted-foreground); }
.pn-rangee .muted { flex: none; font-size: 13px; }
.pn-rangee-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-rangee-t small { display: block; font-size: 13px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; }
.pn-conv-l1 { display: flex; align-items: center; gap: 6px; }
.pn-ligne { display: flex; align-items: center; gap: var(--e3); min-height: 52px; padding: var(--e2) var(--e3); }
.pn-ligne-t { flex: 1; min-width: 0; display: grid; justify-items: start; }
.pn-ligne-t small { max-width: 100%; font-size: 13px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pn-ligne-t .btn.lien, .pn-ligne-contact .btn.lien { color: var(--foreground); }
.pn-ligne-contact { display: flex; gap: var(--e3); align-items: flex-start; }
.pn-ligne-contact p { margin: 0; font-size: 13px; }
.pn-ligne-contact a { color: inherit; }
.pn-vide { display: grid; justify-items: start; gap: var(--e3); padding: var(--e4); border: 1px dashed var(--border-strong); border-radius: var(--r); }
.pn-vide p { margin: 0; font-size: 13px; color: var(--muted-foreground); }
.pn-actions-bas { display: flex; gap: var(--e2); }
.pn-ligne-info { margin: 0; font-size: 13px; }
.pn-resume { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--e4); }
.pn-onglets { margin-bottom: calc(-1 * var(--e2)); gap: var(--e5); overflow-x: auto; }
.pn-onglet { display: grid; gap: var(--e4); min-width: 0; }
.pn-onglet:focus-visible { outline-offset: 4px; border-radius: var(--r-sm); }
.pn-attente { display: grid; gap: var(--e6); }
.pn-dl-sq { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: var(--e4); }
.panneau .propositions { margin: 0; }

/* Rattacher des contacts : liste à cases */
.choix-contacts { max-height: min(360px, 50dvh); overflow-y: auto; border: 1px solid var(--border); border-radius: var(--r); }
.choix-contacts .vide { padding: var(--e6) var(--e4); }
.choix-contact { display: flex; align-items: center; gap: var(--e3); min-height: 48px; padding: var(--e2) var(--e3); cursor: pointer; border-bottom: 1px solid var(--border-soft); }
.choix-contact:last-child { border-bottom: 0; }
.choix-contact:hover { background: var(--accent); }
.choix-contact-t { min-width: 0; display: grid; }
.choix-contact-t b { font-size: 14px; }
.choix-contact-t small { font-size: 13px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.choix-compte { margin: 0; font-size: 13px; }

@media (max-width: 1180px) and (min-width: 821px) {
  .td-table [data-prio="3"] { display: none; }
}
@media (max-width: 1100px) and (min-width: 821px) {
  .td-recherche { width: 200px; }
  .td-droite .lib-col { display: none; }
}

@media (max-width: 820px) {
  .page-table { gap: var(--e4); }
  .resume-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--e3) var(--e4); }
  .td-outils { flex-wrap: nowrap; flex-direction: column; align-items: stretch; }
  .td-recherche { width: 100%; }
  .td-recherche .inp { min-height: 40px; font-size: 16px; }
  .td-facettes { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin: 0 calc(-1 * var(--gouttiere)); padding: 0 var(--gouttiere); }
  .td-facettes::-webkit-scrollbar { display: none; }
  .td-facettes > * { flex: none; }
  .td-facette { min-height: 36px; }
  .td-droite { display: none; }
  .td-groupe { min-height: 40px; }
  .td-table [data-prio="2"], .td-table [data-prio="3"], .td-table .td-case { display: none; }
  .td-table .td-tete-col { min-width: 0; width: 100%; max-width: 0; padding-left: var(--e3); }
  .td-table td { height: 56px; }
  .td-ouvrir { display: grid; grid-template-columns: 24px minmax(0, 1fr); column-gap: var(--e3); row-gap: 0; width: 100%; }
  .td-ouvrir .av { grid-row: 1 / span 2; align-self: center; }
  .td-sous { display: block; min-width: 0; font-size: 13px; line-height: 18px; font-weight: 400; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .td-pp { display: none; }
  .td-pages { gap: var(--e3); }
  .td-fleches .btn.icone.petit { min-width: 40px; min-height: 40px; }
  .panneau {
    inset: 0; width: auto; border: 0; border-radius: 0; z-index: 70; box-shadow: none;
    padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  .panneau:not([hidden]) { animation-name: monte-pn; }
  @keyframes monte-pn { from { opacity: 0; transform: translateY(16px); } }
  .pn-tete { padding: var(--e2) var(--e2) var(--e2) var(--e4); min-height: 56px; }
  .pn-tete .btn.icone.discret { min-width: 44px; min-height: 44px; }
  .pn-corps { padding: var(--e4); }
  .pn-actions .lib-btn { display: none; }
  .pn-actions .btn.petit { min-width: 40px; padding: 0; justify-content: center; }
  .pn-pied { padding: var(--e3) var(--e4); }
  .pn-pied .btn { flex: 1; }
  .pn-dl { grid-template-columns: 104px minmax(0, 1fr); }
  .pn-resume { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .choix-contact { min-height: 52px; }
}


/* Pages du compte (Équipe, Facturation) : une colonne de 960 px, sections sur filet */
.page-compte { padding-top: var(--e8); }
.compte-centre { width: 100%; max-width: 960px; display: grid; gap: var(--e6); align-content: start; }
.squelette.l10 { width: 10%; } .squelette.l60 { width: 60%; }
.equipe-note { display: flex; gap: var(--e2); align-items: flex-start; margin: 0; font-size: 13px; color: var(--muted-foreground); }
.equipe-note svg { width: 16px; height: 16px; margin-top: 2px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
/* Invitation sur une ligne (Vercel) : email, rôle, bouton ; le lien n'est montré qu'une fois */
.invite { display: grid; gap: var(--e3); padding: var(--e5); border: 1px solid var(--border); border-radius: var(--r); }
.invite-tete { display: flex; align-items: baseline; justify-content: space-between; gap: var(--e2) var(--e4); flex-wrap: wrap; }
.invite-tete h2 { margin: 0; font-size: 16px; line-height: 24px; }
.invite-places { display: flex; gap: var(--e1); align-items: baseline; margin: 0; font-size: 13px; color: var(--muted-foreground); }
.invite-places .mono { color: var(--foreground); font-weight: 600; font-variant-numeric: proportional-nums; }
.invite-places a { margin-left: var(--e2); font-weight: 600; }
.invite-ligne { display: grid; grid-template-columns: minmax(0, 1fr) 176px auto; gap: var(--e2); align-items: start; }
.invite-ligne .erreur-champ { grid-column: 1 / -1; grid-row: 2; }
.invite-aide { margin: 0; font-size: 13px; color: var(--muted-foreground); }
.zone-lien:empty { display: none; }
.lien-unique { display: grid; gap: var(--e3); padding: var(--e4); border: 1px solid var(--border); border-radius: var(--r); background: var(--muted); animation: fondu .18s var(--courbe); }
.lien-unique-tete { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: var(--e3); align-items: start; }
.lien-unique-tete p { margin: 2px 0 0; font-size: 13px; color: var(--muted-foreground); }
.lien-unique-picto { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--teinte-vert); color: var(--succes); }
.lien-unique-picto svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.lien-unique-tete .btn.icone { margin: -6px -6px 0 0; }
.lien-unique .copie code { background: var(--background); }
/* Tableau des membres (Catalyst Orders) : cadre à filet, personne en tête de rangée, rôle à droite */
.cadre-tableau { border: 1px solid var(--border); border-radius: var(--r); }
.cadre-tableau .tableau th:first-child, .cadre-tableau .tableau td:first-child { padding-left: var(--e4); }
.cadre-tableau .tableau th:last-child, .cadre-tableau .tableau td:last-child { padding-right: var(--e3); }
.cadre-tableau .tableau td { height: 60px; }
.qui-cell { display: flex; align-items: center; gap: var(--e3); min-width: 0; }
.qui-txt { display: grid; min-width: 0; }
.qui-txt b { display: flex; align-items: center; gap: var(--e2); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qui-txt small { font-size: 13px; line-height: 20px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tag.moi-tag { height: 18px; line-height: 18px; font-weight: 400; background: transparent; box-shadow: inset 0 0 0 1px var(--border); }
.tag.role-tag { background: var(--muted); color: var(--foreground); font-weight: 400; }
.cell-role { width: 1%; white-space: nowrap; }
.role-choix { width: 168px; }
.inp.petit { min-height: 32px; padding: 5px 30px 5px 10px; font-size: 13px; }
.cell-actions { width: 1%; text-align: right; white-space: nowrap; }
.av-attente { background: var(--background); color: var(--muted-foreground); }
.av-attente svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.equipe-panneau { display: grid; gap: var(--e4); }
.titre-liste { display: flex; align-items: center; gap: var(--e2); margin: var(--e2) 0 calc(-1 * var(--e2)); font-size: 16px; line-height: 24px; }
.titre-liste .compte-pastille { min-width: 20px; padding: 0 6px; border-radius: var(--r-sm); background: var(--muted); color: var(--muted-foreground); font-size: 12px; line-height: 20px; text-align: center; font-weight: 600; }
.equipe-panneau:focus { outline: none; }
/* Journal d'activité : rangées « nom, action, heure » */
.journal-outils { display: flex; align-items: center; justify-content: space-between; gap: var(--e3); flex-wrap: wrap; }
.journal-outils p { margin: 0; font-size: 13px; }
.journal-filtre { width: 200px; }
.journal { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r); }
.journal-ligne { display: grid; grid-template-columns: 24px minmax(0, 1fr) auto; gap: var(--e3); align-items: center; min-height: 48px; padding: var(--e2) var(--e4); border-bottom: 1px solid var(--border-soft); }
.journal-ligne:last-child { border-bottom: 0; }
.journal-ligne .av { width: 24px; height: 24px; font-size: 11px; }
.journal-ligne p { margin: 0; min-width: 0; overflow-wrap: anywhere; color: var(--muted-foreground); }
.journal-ligne p b { color: var(--foreground); }
.journal-ligne time { font-size: 13px; color: var(--muted-foreground); white-space: nowrap; font-variant-numeric: proportional-nums; }
.journal-ligne .squelette.rond { width: 24px; height: 24px; }
.journal-ligne .squelette.l10 { width: 64px; }
/* Squelette de l'équipe : la forme de ce qui arrive */
.equipe-sq { display: grid; gap: var(--e4); }
.invite-sq { display: grid; gap: var(--e3); padding: var(--e5); border: 1px solid var(--border); border-radius: var(--r); }
.invite-sq-champ { height: 36px; }
.onglets-sq { display: flex; gap: var(--e6); padding: var(--e3) 0; border-bottom: 1px solid var(--border); }
.onglets-sq .squelette { width: 80px; }
.membre-sq { display: grid; grid-template-columns: 32px minmax(0, 1fr) 120px; gap: var(--e3); align-items: center; padding: var(--e3) var(--e4); border-bottom: 1px solid var(--border-soft); }
.membre-sq .squelette.l10 { width: 100%; height: 32px; border-radius: var(--r); }
/* Facturation (Stripe Billing, Vercel Usage) : jauge de places, offre en définitions, un seul bandeau */
.bandeau { display: grid; grid-template-columns: 20px minmax(0, 1fr) auto; gap: var(--e3); align-items: start; padding: var(--e3) var(--e4); border: 1px solid var(--border); border-radius: var(--r); background: var(--muted); }
.bandeau > svg { width: 20px; height: 20px; fill: none; stroke: var(--muted-foreground); stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.bandeau b { font-weight: 600; }
.bandeau p { margin: 2px 0 0; font-size: 13px; color: var(--muted-foreground); }
.bandeau .bandeau-note { color: var(--foreground); }
.bandeau-erreur { background: var(--teinte-rouge); border-color: color-mix(in srgb, var(--destructive) 28%, transparent); }
.bandeau-erreur > svg { stroke: var(--destructive); }
.jauge { display: grid; gap: var(--e2); }
.jauge-tete, .bloc-factu-tete { display: flex; align-items: center; justify-content: space-between; gap: var(--e3); }
.jauge-tete h2, .bloc-factu-tete h2 { margin: 0; font-size: 16px; line-height: 24px; }
.jauge-chiffre { margin: var(--e1) 0 0; display: flex; align-items: baseline; gap: var(--e1); color: var(--muted-foreground); }
.jauge-chiffre b { font-size: 24px; line-height: 32px; color: var(--foreground); font-variant-numeric: proportional-nums; letter-spacing: -.01em; }
.jauge-barre { height: 6px; border-radius: 999px; background: var(--muted); box-shadow: inset 0 0 0 1px var(--border); overflow: hidden; max-width: 480px; }
.jauge-rempli { display: block; height: 100%; width: var(--part, 0%); border-radius: inherit; background: var(--primary); transition: width .3s var(--courbe); }
.jauge-rempli.plein { background: var(--avert); }
.jauge-note { margin: 0; font-size: 13px; color: var(--muted-foreground); }
.bloc-factu { display: grid; gap: var(--e3); padding-top: var(--e6); border-top: 1px solid var(--border); }
.defs { display: grid; grid-template-columns: minmax(0, 200px) minmax(0, 1fr); margin: 0; }
.defs dt, .defs dd { margin: 0; padding: var(--e3) 0; border-bottom: 1px solid var(--border-soft); min-height: 48px; display: flex; align-items: center; }
.defs dt { color: var(--muted-foreground); }
.defs dd { min-width: 0; overflow-wrap: anywhere; }
.defs dt:last-of-type, .defs dd:last-of-type { border-bottom: 0; }
.factu-action { display: flex; align-items: center; justify-content: space-between; gap: var(--e3) var(--e6); flex-wrap: wrap; }
.factu-action > div:first-child { display: grid; gap: 2px; min-width: 0; flex: 1 1 280px; }
.factu-action p { margin: 0; font-size: 13px; color: var(--muted-foreground); max-width: 60ch; }
.factu-souscrire { display: flex; align-items: center; gap: var(--e2); flex-wrap: wrap; }
.places-champ { width: 88px; text-align: right; font-variant-numeric: proportional-nums; }
.tag.t-test { background: var(--teinte-ambre); color: var(--avert); }
.vide.vide-gauche { text-align: left; padding: 0; font-size: 13px; }
.factu-sq { display: grid; gap: var(--e3); }
.jauge-sq { height: 6px; max-width: 480px; }
.def-sq { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: var(--e4); padding: var(--e3) 0; border-bottom: 1px solid var(--border-soft); }
.def-sq .squelette.l30 { width: 50%; }
/* Conversation : responsable et notes internes, sur fond ambre pâle (jamais envoyées au client) */
.side-equipe { display: grid; gap: var(--e5); }
.side-equipe > .squelette { margin-top: calc(-1 * var(--e3)); }
.side-champ { display: grid; gap: 0; }
.side-champ .inp { width: 100%; }
.sec-ni { display: flex; align-items: center; gap: var(--e2); }
.tag.t-interne { height: 18px; line-height: 18px; font-weight: 400; background: var(--teinte-ambre); color: var(--avert); }
.notes-internes { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--e2); }
.note-interne { padding: var(--e2) var(--e3); border-radius: var(--r); background: var(--teinte-ambre); border: 1px solid color-mix(in srgb, var(--avert) 22%, transparent); }
.ni-tete { display: flex; align-items: center; gap: var(--e2); font-size: 13px; min-width: 0; }
.ni-tete .av { width: 20px; height: 20px; font-size: 10px; background: var(--background); }
.ni-tete b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ni-tete time { margin-left: auto; font-size: 12px; color: var(--muted-foreground); white-space: nowrap; }
.ni-texte { margin: var(--e1) 0 0; font-size: 13px; white-space: pre-wrap; overflow-wrap: anywhere; }
.note-interne textarea { margin-top: var(--e2); }
.ni-actions { display: flex; gap: var(--e3); justify-content: flex-end; margin-top: var(--e1); }
.btn.lien.petit-lien { font-size: 12px; line-height: 16px; color: var(--muted-foreground); font-weight: 600; }
.btn.lien.petit-lien:hover:not(:disabled) { color: var(--foreground); }
.btn.lien.danger-lien:hover:not(:disabled) { color: var(--destructive); }
.vide-ni { font-size: 13px; color: var(--muted-foreground); }
.note-interne-saisie { display: grid; gap: var(--e2); margin-top: var(--e2); }
.note-interne-saisie textarea { min-height: 64px; font-size: 13px; }
.note-interne-pied { display: flex; align-items: center; justify-content: space-between; gap: var(--e2); }
.note-interne-pied small { font-size: 12px; color: var(--muted-foreground); }

@media (max-width: 820px) {
  .page-compte { padding-top: var(--e4); }
  .invite { padding: var(--e4); }
  .invite-ligne { grid-template-columns: minmax(0, 1fr) auto; }
  .invite-ligne .inp[type="email"] { grid-column: 1 / -1; }
  .invite-ligne .erreur-champ { grid-row: auto; }
  .cadre-tableau [data-prio="2"] { display: none; }
  .cadre-tableau .tableau th:first-child, .cadre-tableau .tableau td:first-child { padding-left: var(--e3); }
  .role-choix { width: 136px; }
  .canal-ligne { grid-template-columns: 36px minmax(0, 1fr) auto; gap: var(--e2) var(--e3); padding: var(--e3); }
  .canal-etat { grid-column: 3; grid-row: 1; }
  .canal-auto-zone { grid-column: 2 / -1; }
  .canal-actions { grid-column: 2 / -1; }
  .canal-details { padding: 0 var(--e3) var(--e3); }
  .section-tete.avec-action { flex-wrap: wrap; }
  .defs { grid-template-columns: minmax(0, 1fr); }
  .defs dt { border-bottom: 0; padding-bottom: 0; min-height: 0; font-size: 13px; }
  .defs dd { padding-top: var(--e1); min-height: 0; }
  .journal-ligne { grid-template-columns: 24px minmax(0, 1fr); padding: var(--e2) var(--e3); }
  .journal-ligne time { grid-column: 2; }
  .journal-filtre { width: 100%; }
  .bandeau { grid-template-columns: 20px minmax(0, 1fr); }
  .bandeau > .btn { grid-column: 2; justify-self: start; }
  .factu-souscrire .btn { flex: 1 1 100%; }
  .auth { padding-top: var(--e10); }
  .auth .inp { font-size: 16px; }
}


/* Allure « Finexy » (référence du dirigeant) : thème clair, fond gris perle, grand panneau clair aux
   coins très arrondis, navigation du haut en pilules (l'active en pilule d'encre pleine), barre
   d'icônes rondes à gauche, cartes blanches à grand rayon presque sans ombre, carte mise en avant en
   cobalt dégradé, barres arrondies avec une série hachurée. Formes : pilule pour tout ce qui se clique,
   20 px les cartes, 12 px les champs et les menus, rond les pastilles. Tout passe par les jetons. */
:root {
  --r: 12px; --r-sm: 9px; --r-carte: 20px; --r-panneau: 28px;
  --ombre-carte: 0 1px 2px oklch(0.3 0.04 262 / 0.04), 0 8px 24px -18px oklch(0.3 0.04 262 / 0.18);
  --anneau-doux: 0 0 0 1px var(--border);
  --hachure: repeating-linear-gradient(-45deg, var(--ciel) 0 3px, color-mix(in srgb, var(--ciel) 38%, var(--card)) 3px 6.5px);
}
:root[data-theme="dark"] { --ombre-carte: 0 1px 0 oklch(1 0 0 / 3%) inset, 0 10px 28px -18px oklch(0.02 0.02 262 / 0.7); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --ombre-carte: 0 1px 0 oklch(1 0 0 / 3%) inset, 0 10px 28px -18px oklch(0.02 0.02 262 / 0.7); } }
::selection { background: color-mix(in srgb, var(--ciel) 55%, transparent); color: var(--foreground); }
body { background: var(--sidebar); }

/* Pilules : boutons, segments, onglets, puces */
.btn { border-radius: 999px; padding-inline: 16px; }
.btn.petit { padding-inline: 12px; }
.btn.icone, .btn.icone.discret { padding: 0; border-radius: 50%; }
.btn:not(.pri):not(.discret):not(.lien):not(.danger) { background: var(--secondary); border-color: transparent; }
.btn:not(.pri):not(.discret):not(.lien):not(.danger):hover:not(:disabled) { background: color-mix(in srgb, var(--foreground) 9%, var(--card)); }
.btn.pri { box-shadow: 0 1px 0 oklch(1 0 0 / 18%) inset, 0 8px 18px -12px color-mix(in srgb, var(--primary) 90%, transparent); }
.groupe-btn > .btn:first-child { border-radius: 999px 0 0 999px; }
.groupe-btn > .btn:last-child { border-radius: 0 999px 999px 0; }
.groupe-btn > .btn + .btn { box-shadow: inset 1px 0 0 var(--border); }
.inp { border-radius: var(--r); }
.segments { padding: 4px; gap: 2px; border-radius: 999px; background: var(--muted); box-shadow: none; }
.segment { min-height: 32px; padding: 4px 14px; border-radius: 999px; border: 0; }
.segment[aria-checked="true"], :root[data-theme="dark"] .segment[aria-checked="true"] {
  background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); box-shadow: 0 6px 14px -10px oklch(0.2 0.04 264 / 0.8);
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .segment[aria-checked="true"] { background: var(--sidebar-primary); } }
.chip { border-radius: 999px; }
.tag, .st, .badge { border-radius: 999px; padding: 0 8px; }
.menu { border-radius: 16px; padding: 6px; }
.menu-item { border-radius: 10px; }
.carte { border-radius: var(--r-carte); border-color: var(--border); box-shadow: var(--ombre-carte); }
.av { box-shadow: none; background: var(--ciel-doux); color: var(--foreground); }
.av .ch { border-color: var(--card); }

/* Coquille sur écran large : un grand panneau posé sur le fond, la navigation en pilules en haut, la
   barre d'icônes à gauche, le contenu à droite */
.barre-icones { display: none; }
@media (min-width: 821px) {
  body { background: var(--fond); }
  .app {
    grid-template-columns: 76px minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr);
    height: calc(100% - 24px); margin: 12px; border-radius: var(--r-panneau); background: var(--sidebar);
    box-shadow: 0 0 0 1px var(--sidebar-border), 0 30px 60px -40px oklch(0.3 0.05 262 / 0.3);
  }
  .rail {
    grid-column: 1 / -1; grid-row: 1; flex-direction: row; align-items: center; gap: var(--e4);
    min-height: 0; overflow: visible; padding: 14px 18px 10px 16px; background: transparent;
  }
  .rail-tete { display: flex; align-items: center; flex: none; margin: 0; padding: 0; border: 0; }
  .equipe {
    width: auto; min-height: 44px; margin: 0; padding: 4px 12px 4px 5px; gap: 10px; border-radius: 999px;
    background: var(--card); box-shadow: var(--anneau-doux); transition: box-shadow .15s var(--courbe);
  }
  .equipe:hover, .equipe[aria-expanded="true"] { background: var(--card); box-shadow: 0 0 0 1px var(--input); }
  .equipe-logo { width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--sidebar-primary); }
  .equipe-logo .logo { width: 15px; height: 15px; color: var(--sidebar-primary-foreground); }
  .equipe-nom { max-width: 150px; }
  .equipe-nom b { font-size: 14px; }
  .equipe-nom small { font-size: 12px; }
  .equipe .chevrons { width: 14px; height: 14px; margin-left: 2px; }

  .nav-liste {
    display: flex; align-items: center; gap: 2px; flex: 0 1 auto; min-width: 0; margin: 0 auto; padding: 4px;
    border-radius: 999px; background: var(--card); box-shadow: var(--anneau-doux);
  }
  /* Les groupes (Principal, Clients, Travail) : un filet fin entre eux, leur nom reste lu par les
     lecteurs d'écran */
  .groupe-nav {
    flex: none; width: 1px; height: 20px; margin: 0 6px; padding: 0; overflow: hidden; white-space: nowrap;
    color: transparent; font-size: 1px; background: var(--border);
  }
  .rail .groupe-nav:first-child { position: absolute; width: 1px; height: 1px; margin: 0; clip: rect(0 0 0 0); background: none; }
  .rail .nav {
    width: auto; min-height: 36px; padding: 0 14px 0 12px; gap: 7px; border-radius: 999px; flex: none;
    font-size: 14px; color: color-mix(in srgb, var(--sidebar-foreground) 78%, transparent); white-space: nowrap;
    transition: background-color .15s var(--courbe), color .15s var(--courbe);
  }
  .rail .nav svg { flex: none; width: 17px; height: 17px; stroke: currentColor; stroke-width: 1.7; opacity: .85; }
  .rail .nav[aria-current="page"] svg { opacity: 1; }
  .rail .nav:hover { background: var(--sidebar-accent); color: var(--sidebar-foreground); }
  .rail .nav[aria-current="page"], .rail .nav[aria-current="page"]:hover {
    background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); font-weight: 600;
    box-shadow: 0 8px 16px -12px oklch(0.2 0.04 264 / 0.9);
  }
  .nav[aria-current="page"]::before { display: none; }
  .rail .nav .n {
    margin-left: 1px; min-width: 20px; height: 20px; padding: 0 6px; line-height: 20px; border-radius: 999px; font-variant-numeric: tabular-nums;
    background: var(--ciel-doux); color: var(--foreground);
  }
  .rail .nav[aria-current="page"] .n { background: oklch(1 0 0 / 18%); color: inherit; }

  .rail-bas { display: flex; align-items: center; gap: 10px; flex: none; margin: 0; padding: 0; }
  .ronds { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--card); box-shadow: var(--anneau-doux); }
  .rail .nav.rond { position: relative; width: 36px; min-width: 36px; min-height: 36px; padding: 0; justify-content: center; border-radius: 50%; color: var(--sidebar-foreground); }
  .rail .nav.rond svg { display: block; }
  .rail .nav.rond .lib, .rail .nav.rond .raccourci-k { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rail .nav.rond .n {
    position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 16px;
    background: var(--primary); color: var(--primary-foreground); box-shadow: 0 0 0 2px var(--card);
  }
  #btn-recherche { background: transparent; border: 0; margin: 0; }
  .compte {
    width: auto; margin: 0; padding: 4px 14px 4px 4px; gap: 10px; grid-template-columns: 36px minmax(0, auto) 14px;
    border-radius: 999px; background: var(--card); box-shadow: var(--anneau-doux);
  }
  .compte::before { display: none; }
  .compte:hover, .compte[aria-expanded="true"] { background: var(--card); box-shadow: 0 0 0 1px var(--input); }
  .compte .av { width: 36px; height: 36px; border-radius: 50%; background: var(--ciel-doux); color: var(--foreground); }
  .compte-txt { max-width: 180px; }
  .compte-txt b { font-size: 14px; line-height: 18px; }
  .compte .chevrons { width: 14px; height: 14px; }

  .barre-icones {
    grid-column: 1; grid-row: 2; display: flex; flex-direction: column; align-items: center; gap: var(--e4);
    min-height: 0; padding: 10px 0 16px;
  }
  .ic-groupe { display: flex; flex-direction: column; gap: 4px; padding: 4px; border-radius: 999px; background: var(--card); box-shadow: var(--anneau-doux); }
  .ic-bas { margin-top: auto; }
  .ic, .barre-icones .nav.ic {
    position: relative; width: 40px; height: 40px; min-height: 40px; padding: 0; display: grid; place-items: center; border-radius: 50%;
    color: var(--muted-foreground); text-decoration: none; transition: background-color .15s var(--courbe), color .15s var(--courbe);
  }
  .ic svg, .barre-icones .nav.ic svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
  .barre-icones .nav.ic .lib { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .ic:hover, .barre-icones .nav.ic:hover { background: var(--sidebar-accent); color: var(--sidebar-foreground); }
  .ic[aria-pressed="true"], .barre-icones .nav.ic[aria-current="page"], .barre-icones .nav.ic[aria-current="page"]:hover {
    background: var(--sidebar-primary); color: var(--sidebar-primary-foreground);
  }
  .ic:active, .barre-icones .nav.ic:active { transform: scale(.96); }

  main { grid-column: 2; grid-row: 2; padding: 0 14px 14px 2px; }
  /* Tous les écrans se posent sur le panneau, en cartes blanches : l'en tête, le bandeau et Créer vite
     restent à la même place d'un onglet à l'autre */
  .surface { border: 0; border-radius: 0; background: transparent; box-shadow: none; }
  .top { min-height: 0; padding: var(--e3) var(--e2) var(--e5); border-bottom: 0; align-items: flex-start; gap: var(--e4); }
  .top .titres { display: flex; flex-direction: column; min-height: 66px; }
  .top .creer, .top .sous-barre { align-self: center; }
  .top h1 { font-size: 26px; line-height: 32px; letter-spacing: -.025em; }
  .top .sub { margin-top: 2px; font-size: 14px; }
  .bandeau-demo {
    align-self: flex-start; margin: var(--e2) var(--e2) 0; padding: 6px 12px; border: 0; border-radius: 999px;
    background: var(--teinte-ambre); color: var(--foreground);
  }
  .page { padding: 0 var(--e2) var(--e8); }
  /* Listes denses (Demandes, Contacts, Sociétés) : le tableau dans une carte blanche, comme celui de l'Aperçu */
  .page-table { gap: var(--e4); }
  .page-table > [id^="liste-"] {
    min-width: 0; padding: var(--e5) var(--e5) var(--e4); border-radius: var(--r-carte);
    background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte);
  }

  /* Sous entrées de la vue (statut des messages, des réservations, mode de l'agenda) : pilules dans l'en tête */
  .sous-barre { flex: none; display: flex; }
  .sous, .sous.on { padding: 0; }
  .sous.on { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: var(--muted); }
  .sous::before { display: none; }
  /* L'agenda a déjà son sélecteur Semaine, Mois, Chaleur dans sa barre : pas de doublon dans l'en tête */
  .sous[data-pour="agenda"].on { display: none; }
  .sous-lien {
    width: auto; min-height: 32px; padding: 0 14px; gap: 8px; border-radius: 999px; font-size: 13px; font-weight: 600;
    color: var(--muted-foreground); white-space: nowrap;
  }
  .sous-lien:hover { background: transparent; color: var(--foreground); }
  .sous-lien[aria-current="true"] { background: var(--card); color: var(--foreground); box-shadow: 0 1px 2px oklch(0.3 0.04 262 / 0.12), 0 0 0 1px var(--border); }
  .sous-lien .c { min-width: 20px; padding: 0 6px; border-radius: 999px; background: var(--ciel-doux); color: var(--foreground); font-weight: 600; text-align: center; line-height: 18px; }
  .creer > .btn.pri { min-height: 44px; padding: 0 20px; }

  /* Aperçu et Messages : le contenu se pose directement sur le panneau, en cartes blanches */
  main:has(#v-apercu.on, #v-messages.on) .surface { background: transparent; box-shadow: none; border-radius: 0; overflow: visible; }
  main:has(#v-apercu.on) .top h1 { font-size: 34px; line-height: 40px; letter-spacing: -.035em; }
  main:has(#v-apercu.on) .top .sub { margin-top: var(--e1); font-size: 15px; line-height: 22px; }
  /* L'Aperçu défile d'un bloc, salutation comprise, comme la référence */
  main:has(#v-apercu.on) .surface { overflow-x: hidden; overflow-y: auto; overscroll-behavior-y: contain; }
  #v-apercu.page { flex: none; overflow: visible; padding: 0 var(--e2) var(--e6); }
  #v-messages { gap: var(--e3); padding: 0 var(--e2) 2px; }
  #v-messages .liste, #v-messages .conv, #v-messages .side {
    border: 0; border-radius: var(--r-carte); background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte); overflow: hidden;
  }
  #v-messages .liste, #v-messages .side { overflow-y: auto; }
}

/* Largeurs moyennes : la barre du haut se resserre pas à pas, sans jamais passer à la ligne ni déborder.
   Le compte passe en avatar, puis le sélecteur d'outil en logo, puis les libellés laissent place aux
   icônes seules (avec infobulle) ; sous 821 px, la barre du bas du téléphone prend le relais. */
@media (max-width: 1799px) and (min-width: 821px) {
  .compte-txt, .compte .chevrons { display: none; }
  .compte { padding: 4px; grid-template-columns: 36px; }
}
@media (max-width: 1599px) and (min-width: 821px) {
  .equipe-nom, .equipe .chevrons { display: none; }
  .equipe { padding: 4px; }
  .rail { gap: var(--e3); }
}
@media (max-width: 1499px) and (min-width: 821px) {
  .rail .nav { padding: 0 12px; gap: 6px; }
  .rail .nav svg { display: none; }
  .groupe-nav { margin: 0 4px; }
}
@media (max-width: 1219px) and (min-width: 821px) {
  .app { grid-template-columns: 68px minmax(0, 1fr); }
  .rail { padding-inline: 12px; }
  .rail .nav { padding: 0 11px; gap: 0; position: relative; }
  .rail .nav svg { display: block; opacity: 1; }
  .rail .nav .lib, .rail .nav .lib-court { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .rail .nav .n { position: absolute; z-index: 2; top: -2px; right: -4px; min-width: 16px; height: 16px; padding: 0 4px; font-size: 10px; line-height: 16px; box-shadow: 0 0 0 2px var(--card); }
  /* La pastille déborde de la pilule d'encre : en blanc détouré, elle reste lisible sur l'écran où l'on est */
  .rail .nav[aria-current="page"] .n { background: var(--card); color: var(--foreground); box-shadow: 0 0 0 2px var(--sidebar-primary); }
  .rail .nav[data-tip]:hover::after, .rail .nav[data-tip]:focus-visible::after { top: calc(100% + 10px); }
}

/* Infobulles : sous les icônes seules de la barre du haut, à droite de la barre d'icônes */
@media (min-width: 821px) {
  .rail .nav::after, .barre-icones [data-tip]::after, .epingle::after {
    content: attr(data-tip); position: absolute; z-index: 40; display: none; pointer-events: none; white-space: nowrap;
    padding: 5px 9px; border-radius: 8px; font-size: 12px; line-height: 16px; font-weight: 600;
    background: var(--foreground); color: var(--background); box-shadow: var(--ombre-flotte);
  }
  .rail .nav::after, .epingle::after { left: 50%; translate: -50% 0; top: calc(100% + 10px); }
  .barre-icones [data-tip]::after { left: calc(100% + 12px); top: 50%; translate: 0 -50%; }
  .barre-icones [data-tip]:hover::after, .barre-icones [data-tip]:focus-visible::after,
  .epingle:hover::after, .epingle:focus-visible::after { display: block; }
}
@media (max-width: 1219px) and (min-width: 821px) {
  .rail .nav[data-tip]:hover::after, .rail .nav[data-tip]:focus-visible::after { display: block; }
}

/* Épingle « Garder la barre ouverte » : au bout de la barre, seulement là où elle se range */
.epingle { display: none; }
@media (min-width: 821px) {
  .nav-survol .epingle {
    position: relative; display: grid; place-items: center; flex: none; width: 32px; height: 32px; margin-left: 4px; border-radius: 50%;
    color: var(--muted-foreground); transition: background-color .15s var(--courbe), color .15s var(--courbe);
  }
  .nav-survol .epingle::before { content: ""; position: absolute; left: -4px; top: 6px; bottom: 6px; width: 1px; background: var(--border); }
  .epingle svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: rotate .2s var(--courbe); rotate: 30deg; }
  .epingle:hover { background: var(--sidebar-accent); color: var(--sidebar-foreground); }
  .epingle[aria-pressed="true"] { color: var(--sidebar-foreground); background: var(--sidebar-accent); }
  .epingle[aria-pressed="true"] svg { rotate: 0deg; fill: currentColor; }
}

/* Barre rangée (souris, pas épinglée) : la pilule sort du haut du panneau ; une languette garde
   les pastilles en petit. Elle reste dehors au clavier et tant qu'un de ses menus est ouvert. */
.languette { display: none; }
@media (min-width: 821px) {
  /* Au dessus du contenu : les infobulles et la barre sortie passent devant le bandeau et l'en tête */
  .rail { position: relative; z-index: 20; }
  .nav-survol:not(.nav-epinglee) .nav-liste {
    translate: 0 calc(-100% - 22px); opacity: 0; pointer-events: none;
  }
  .nav-survol:not(.nav-epinglee).nav-sortie .nav-liste,
  .nav-survol:not(.nav-epinglee) .nav-liste:has(:focus-visible),
  .nav-survol:not(.nav-epinglee) .nav-liste:has([aria-expanded="true"]) {
    translate: 0 0; opacity: 1; pointer-events: auto;
  }
  .nav-survol:not(.nav-epinglee) .languette {
    position: absolute; z-index: 5; top: 0; left: 50%; translate: -50% 0; display: flex; align-items: center; gap: 4px;
    height: 16px; padding: 0 10px 2px; border-radius: 0 0 10px 10px; background: var(--card); box-shadow: var(--anneau-doux);
    cursor: pointer;
  }
  .nav-survol:not(.nav-epinglee) .languette::before { content: ""; position: absolute; inset: -6px -16px -10px; }
  .languette-trait { width: 28px; height: 3px; border-radius: 2px; background: var(--input-strong); }
  .languette-n {
    min-width: 14px; height: 12px; padding: 0 4px; border-radius: 999px; font-size: 9px; line-height: 12px; font-weight: 600;
    text-align: center; background: var(--primary); color: var(--primary-foreground); font-variant-numeric: tabular-nums;
  }
  .languette-n[hidden] { display: none; }
  .nav-survol:not(.nav-epinglee).nav-sortie .languette,
  .nav-survol:not(.nav-epinglee):has(.nav-liste :focus-visible) .languette { opacity: 0; pointer-events: none; }
}
@media (min-width: 821px) and (prefers-reduced-motion: no-preference) {
  /* Elle descend en 200 ms (courbe de sortie) et remonte un peu plus vite */
  .nav-survol .nav-liste { transition: translate .16s cubic-bezier(.4, 0, 1, 1), opacity .14s linear; }
  .nav-survol.nav-sortie .nav-liste, .nav-survol .nav-liste:has(:focus-visible) { transition: translate .2s var(--courbe), opacity .16s var(--courbe); }
  .languette { transition: opacity .16s var(--courbe); }
}

/* Interrupteur « Mode sombre » : en bas de la barre d'icônes (et dans « Plus » sur téléphone) */
.bascule-rail {
  position: relative; display: block; flex: none; width: 36px; height: 20px; border-radius: 999px; background: var(--input);
  transition: background-color .15s var(--courbe);
}
.bascule-bouton {
  position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: oklch(1 0 0);
  box-shadow: 0 1px 2px oklch(0 0 0 / 0.25);
}
[aria-checked="true"] > .bascule-rail { background: var(--primary); }
[aria-checked="true"] > .bascule-rail .bascule-bouton { translate: 16px 0; }
.bascule-theme { display: none; }
@media (min-width: 821px) {
  .bascule-theme {
    position: relative; display: grid; justify-items: center; gap: 5px; width: 60px; padding: 10px 0 8px; border-radius: 18px;
    background: var(--card); box-shadow: var(--anneau-doux); color: var(--muted-foreground);
  }
  .bascule-theme:hover { color: var(--sidebar-foreground); }
  .bascule-theme:focus-visible { outline: none; }
  .bascule-theme:focus-visible .bascule-rail { box-shadow: var(--anneau); }
  .bascule-lib { font-size: 11px; line-height: 14px; font-weight: 600; }
  .bascule-theme[aria-checked="true"] .bascule-lib { color: var(--sidebar-foreground); }
}
.lien-bascule .bascule-rail { margin-left: auto; }
@media (prefers-reduced-motion: no-preference) {
  .bascule-bouton { transition: translate .2s var(--courbe), scale .15s var(--courbe); }
  .bascule-theme:active .bascule-bouton, .lien-bascule:active .bascule-bouton { scale: 1.12 1; }
}

/* Aperçu : salutation, cartes chiffres, carte mise en avant, barres, tableau, carte de chaleur */
.accueil-barre { margin-bottom: var(--e4); }
.accueil-titre { font-size: 18px; line-height: 26px; color: var(--foreground); font-weight: 600; letter-spacing: -.01em; }
.accueil-barre .segments { background: var(--card); box-shadow: var(--anneau-doux); }
.accueil-actions .segments.periode .segment { min-width: 64px; }
.accueil-barre .btn:not(.pri) { background: var(--card); box-shadow: var(--anneau-doux); }
.grille-widgets { column-gap: var(--e4); row-gap: var(--e4); }
.widget-corps > .carte, .widget-corps > .kpi {
  height: 100%; border: 0; border-radius: var(--r-carte); background: var(--card); padding: var(--e5);
  box-shadow: var(--anneau-doux), var(--ombre-carte);
}
.widget-corps > .carte.tdb-courbe { padding: var(--e6) var(--e6) var(--e5); }
.widget-corps .carte-tete h2 { font-size: 17px; line-height: 24px; letter-spacing: -.01em; }
.widget-corps .carte-tete p { margin-top: 2px; }
.widget-corps .vide { border-top: 0; text-align: left; padding: var(--e4) 0; }
.w-lignes { border-top: 0; }
.w-lignes li { border-bottom: 1px solid var(--border-soft); }
.w-lignes li:last-child { border-bottom: 0; }
.w-ligne { border-radius: 12px; }
.grille-widgets.edition .widget { border-radius: var(--r-carte); background: transparent; }

.kpi { display: flex; flex-direction: column; gap: 0; border-top: 0; padding-top: 0; }
.kpi-haut { display: flex; align-items: center; justify-content: space-between; gap: var(--e2); min-height: 36px; }
.kpi-titre { font-size: 14px; line-height: 20px; color: var(--foreground); font-weight: 400; }
.kpi-ico { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--muted); color: var(--foreground); }
.kpi-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.kpi .val { margin-top: var(--e2); font-size: 32px; line-height: 38px; letter-spacing: -.035em; }
.kpi-ecart { display: flex; align-items: center; gap: 6px var(--e2); flex-wrap: wrap; margin-top: var(--e3); }
.kpi-ecart:empty { display: none; }
.kpi-phrase { color: var(--muted-foreground); font-weight: 400; }
.kpi-detail { margin-top: 4px; }
.mini-courbe { display: block; width: 100%; height: 38px; margin-top: var(--e3); overflow: visible; }
.mini-trait { fill: none; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; stroke: var(--chart-3); }
.mini-courbe .stop-haut { stop-color: var(--chart-3); stop-opacity: .3; }
.mini-courbe .stop-bas { stop-color: var(--chart-3); stop-opacity: 0; }
.c-msg .mini-trait { stroke: var(--chart-1); } .c-msg .stop-haut, .c-msg .stop-bas { stop-color: var(--chart-1); }
.c-resa .mini-trait { stroke: var(--chart-1); } .c-resa .stop-haut, .c-resa .stop-bas { stop-color: var(--chart-1); }
.c-temps .mini-trait { stroke: var(--chart-4); } .c-temps .stop-haut, .c-temps .stop-bas { stop-color: var(--chart-4); }
.mini-barres { display: grid; gap: 8px; margin-top: var(--e3); min-height: 44px; align-content: center; }
.mini-ligne { display: grid; grid-template-columns: auto minmax(24px, 1fr) auto; align-items: center; gap: var(--e2); font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.mini-lib { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mini-ligne b { color: var(--foreground); font-variant-numeric: proportional-nums; }
.mini-piste { display: block; height: 10px; }
.mini-barre { display: block; height: 100%; width: var(--part, 0%); border-radius: 999px; background: var(--chart-1); }
.mini-barre.c-heures { background: var(--chart-1); }
.mini-barre.c-avant { background: var(--hachure); }

.tendance { height: 22px; padding: 0 8px; gap: 3px; border-radius: 999px; background: var(--muted); box-shadow: none; color: var(--foreground); }
.tendance.bien { background: color-mix(in srgb, var(--succes) 13%, var(--card)); color: var(--succes); }
.tendance.mal { background: color-mix(in srgb, var(--destructive) 11%, var(--card)); color: var(--destructive); }

/* La carte mise en avant : les messages reçus, en cobalt dégradé, texte blanc */
.widget-corps > .kpi.kpi-messages {
  position: relative; isolation: isolate; overflow: hidden; color: oklch(1 0 0);
  background: radial-gradient(120% 90% at 100% 0%, color-mix(in srgb, var(--ciel) 55%, transparent) 0%, transparent 55%),
    linear-gradient(155deg, var(--vedette-a) 0%, var(--vedette-b) 100%);
  box-shadow: 0 18px 36px -22px color-mix(in srgb, var(--vedette-b) 85%, transparent);
}
.kpi-messages .kpi-titre { color: oklch(1 0 0 / 0.92); }
.kpi-messages .kpi-ico { background: oklch(1 0 0 / 0.16); color: oklch(1 0 0); box-shadow: inset 0 0 0 1px oklch(1 0 0 / 0.18); }
.kpi-messages .mini-trait { stroke: oklch(1 0 0); }
.kpi-messages .mini-courbe .stop-haut { stop-color: oklch(1 0 0); stop-opacity: .34; }
.kpi-messages .mini-courbe .stop-bas { stop-color: oklch(1 0 0); stop-opacity: 0; }
.kpi-messages .tendance, .kpi-messages .tendance.bien, .kpi-messages .tendance.mal { background: oklch(1 0 0 / 0.18); color: oklch(1 0 0); }
.kpi-messages .kpi-phrase, .kpi-messages .kpi-detail { color: oklch(1 0 0 / 0.8); }

/* Barres arrondies : messages hachurés, réservations pleines posées devant, graduations en pointillés */
.hero { align-items: flex-start; margin-bottom: var(--e5); }
.hero-txt { display: grid; gap: 2px; }
.hero-txt h2, .widget-corps .hero-txt h2 { font-size: 17px; line-height: 24px; color: var(--foreground); font-weight: 600; }
.carte-tete .hero-val { color: var(--foreground); }
.hero-val { display: flex; align-items: center; flex-wrap: wrap; gap: var(--e2) var(--e3); margin: var(--e2) 0 0; }
.hero-val b { font-size: 40px; line-height: 44px; letter-spacing: -.04em; font-variant-numeric: proportional-nums; }
.hero-unite { font-size: 15px; line-height: 22px; color: var(--muted-foreground); font-weight: 400; }
.carte-tete .hero-sous { margin-top: 2px; font-size: 13px; color: var(--muted-foreground); }
.legende-courbe { gap: var(--e4); padding: 6px 12px; border-radius: 999px; background: var(--muted); color: var(--foreground); font-size: 12px; }
.legende-courbe i { width: 10px; height: 10px; border-radius: 3px; }
.legende-courbe .s1, .courbe-valeur i.s1 { background: var(--hachure); }
.legende-courbe .s2, .courbe-valeur i.s2 { background: var(--chart-1); }
.barres-graphe { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: var(--e3); }
.barres-y { display: flex; flex-direction: column; justify-content: space-between; height: 240px; font-size: 12px; color: var(--muted-foreground); font-variant-numeric: proportional-nums; text-align: right; }
.barres-y span { display: flex; align-items: center; justify-content: flex-end; height: 0; }
.barres-zone { position: relative; min-width: 0; }
.courbe-explorer.barres { position: relative; height: 240px; cursor: default; touch-action: pan-y; border-radius: 12px; }
.barres-grille { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; }
.barres-grille i { display: block; height: 0; border-top: 1px dashed var(--border); }
.barres-grille i:last-child { border-top-style: solid; }
.barres-cols { position: absolute; inset: 0; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: stretch; }
.bcol { position: relative; display: block; transition: opacity .15s var(--courbe); }
.bb { position: absolute; bottom: 0; left: 50%; width: min(30px, 62%); height: var(--h, 0%); transform: translateX(-50%); border-radius: 999px; }
.bb.s1 { background: var(--hachure); }
.bb.s2 { background: var(--chart-1); box-shadow: 0 0 0 2.5px var(--card); }
.bb[style*="--h: 0.00%"] { display: none; }
.courbe-explorer.barres:is(.actif, :hover, :focus-visible) .bcol:not(.choisie) { opacity: .42; }
.barres-x { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin-top: var(--e2); font-size: 12px; line-height: 16px; color: var(--muted-foreground); font-variant-numeric: proportional-nums; }
.barres-x span { text-align: center; white-space: nowrap; overflow: visible; display: flex; justify-content: center; }
.courbe-valeur { top: -8px; border-radius: 14px; border: 0; box-shadow: var(--anneau-doux), var(--ombre-flotte); }
.courbe-valeur i { width: 10px; height: 10px; border-radius: 3px; }
.courbe svg { height: 240px; }
.courbe-aire { display: block; }

/* Tableau des prochaines réservations : en tête sur fond gris arrondi, statut à point, menu par ligne */
.tdb-tableau .onglets { width: max-content; max-width: 100%; gap: 2px; padding: 4px; margin-bottom: var(--e3); border: 0; border-radius: 999px; background: var(--muted); overflow-x: auto; }
.tdb-tableau .onglet { min-height: 32px; padding: 0 14px; margin: 0; border: 0; border-radius: 999px; font-size: 13px; }
.tdb-tableau .onglet[aria-selected="true"] { background: var(--card); box-shadow: 0 1px 2px oklch(0.3 0.04 262 / 0.12), 0 0 0 1px var(--border); }
.tdb-tableau .onglet .compte-pastille { border-radius: 999px; background: var(--ciel-doux); color: var(--foreground); }
.widget-corps .tableau th { height: 40px; background: var(--muted); border: 0; font-size: 12px; font-weight: 600; color: var(--muted-foreground); }
.widget-corps .tableau th:first-child { border-radius: 12px 0 0 12px; padding-left: var(--e4); }
.widget-corps .tableau th:last-child { border-radius: 0 12px 12px 0; padding-right: var(--e2); }
.widget-corps .tableau td { height: 54px; border-bottom: 1px solid var(--border-soft); }
.widget-corps .tableau td:first-child { padding-left: var(--e4); }
.widget-corps .tableau td:last-child { padding-right: var(--e2); }
.widget-corps .tableau tr:last-child td { border-bottom: 0; }
.widget-corps .tableau tbody tr { transition: background-color .12s var(--courbe); }
@media (hover: hover) { .widget-corps .tableau tbody tr:hover { background: var(--muted); } }
.tableau .td-act { width: 44px; text-align: right; }
.tableau .td-menu { min-width: 32px; min-height: 32px; }
.widget-corps .st { height: auto; padding: 0; gap: 7px; background: none; color: var(--foreground); font-weight: 400; font-size: 13px; }
.widget-corps .st::before { content: ""; width: 7px; height: 7px; flex: none; border-radius: 50%; background: var(--chart-3); }
.widget-corps .st.confirmee::before, .widget-corps .st.ok::before { background: var(--succes); }
.widget-corps .st.a_confirmer::before, .widget-corps .st.wait::before { background: var(--avert); }
.widget-corps .st.nouvelle::before, .widget-corps .st.new::before { background: var(--bleu); }
.widget-corps .st.annulee { color: var(--muted-foreground); }
.widget-corps .st.annulee::before { background: var(--destructive); }

/* Carte de chaleur : du gris perle au cobalt en passant par le ciel */
:root {
  --chaud-0: var(--muted);
  --chaud-1: color-mix(in srgb, var(--ciel) 45%, var(--card));
  --chaud-2: var(--ciel);
  --chaud-3: color-mix(in srgb, var(--chart-1) 62%, var(--ciel));
  --chaud-4: var(--chart-1);
}
.chaleur { border-spacing: 5px; }
.chaleur thead td:first-child { width: 40px; }
.case-c { border-radius: 8px; max-height: 30px; }
.legende-chaleur .case-c { border-radius: 4px; }
.tableau th { font-weight: 600; font-size: 12px; }
.onglet[aria-selected="true"] { border-bottom-color: var(--foreground); }

/* Messages : liste en rangées arrondies, fil sur blanc, bulles soignées, fiche à droite */
@media (min-width: 1537px) {
  #v-messages { grid-template-columns: 344px minmax(0, 1fr) 316px; }
  #v-messages.fiche-fermee { grid-template-columns: 344px minmax(0, 1fr); }
}
@media (max-width: 1536px) and (min-width: 1181px) {
  #v-messages { grid-template-columns: 316px minmax(0, 1fr) 292px; }
  #v-messages.fiche-fermee { grid-template-columns: 316px minmax(0, 1fr); }
}
.liste { background: var(--card); border-right: 0; }
.liste-tete { padding: var(--e4) var(--e4) var(--e3); background: var(--card); border-bottom: 0; }
#q-messages { min-height: 40px; border-radius: 999px; background-color: var(--muted); border-color: transparent; padding-left: 36px; background-position: 13px center; }
.filtres-ligne select.inp { border-radius: 999px; min-height: 34px; background-color: var(--muted); border-color: transparent; padding-left: 14px; }
#items { display: grid; gap: 2px; padding: 0 var(--e2) var(--e3); }
.item { border-bottom: 0; border-radius: 16px; padding: 11px var(--e3); grid-template-columns: 40px minmax(0, 1fr) 10px; }
.item .av { width: 40px; height: 40px; font-size: 13px; }
.item .nm .x { font-size: 14px; }
.item[aria-current="true"], .item[aria-current="true"]:hover { background: var(--ciel-doux); box-shadow: none; }
.unread { background: var(--primary); color: var(--primary-foreground); }
.unread:empty { background: var(--primary); }
.item .meta { padding-top: 8px; }
.av.teinte-0 { background: var(--ciel-doux); }
.av.teinte-1 { background: color-mix(in srgb, var(--chart-5) 20%, var(--card)); }
.av.teinte-2 { background: color-mix(in srgb, var(--chart-4) 20%, var(--card)); }
.av.teinte-3 { background: color-mix(in srgb, var(--chart-1) 14%, var(--card)); }
.av.teinte-4 { background: var(--muted); }

.conv { background: var(--card); border-left: 0; }
.conv-h { min-height: 68px; padding: var(--e3) var(--e4) var(--e3) var(--e5); background: var(--card); border-bottom: 1px solid var(--border-soft); }
.conv-h .titre b { font-size: 16px; }
.conv-h .av { width: 40px; height: 40px; }
.conv-h select.inp { border-radius: 999px; background-color: var(--muted); border-color: transparent; }
.conv-h #btn-fiche[aria-expanded="true"] { background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); }
.conv-scene.plat { background: transparent; }
.jour { font-size: 12px; font-weight: 600; }
.jour::before, .jour::after { background: var(--border-soft); }
.b { padding: 11px 15px; border-radius: 20px 20px 20px 6px; background: var(--muted); box-shadow: none; line-height: 21px; }
.b.me { background: var(--primary); color: var(--primary-foreground); border-radius: 20px 20px 6px 20px; box-shadow: 0 10px 20px -16px color-mix(in srgb, var(--primary) 90%, transparent); }
.b.me .tm { color: color-mix(in srgb, var(--primary-foreground) 80%, transparent); }
.b.me .tag { background: oklch(1 0 0 / 18%); color: var(--primary-foreground); }
.b.me.ia { background: var(--ciel-doux); color: var(--foreground); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ciel) 70%, transparent); }
.b.me.ia .tm { color: var(--muted-foreground); }
.b.me.ia .tag { background: var(--card); color: var(--foreground); box-shadow: none; }
.b.echec { background: var(--teinte-rouge); color: var(--foreground); box-shadow: inset 0 0 0 1px var(--destructive); }
.b.echec .tm { color: var(--muted-foreground); }

.ai-card {
  gap: var(--e3); padding: var(--e4) var(--e5); border-radius: var(--r-carte);
  border: 1px solid color-mix(in srgb, var(--ciel) 55%, var(--border)); background: color-mix(in srgb, var(--ciel-doux) 60%, var(--card));
}
.ai-card .h { font-size: 14px; }
.ai-card .row dd { font-size: 14px; }
.propositions { border-radius: 16px; border-color: var(--border); background: var(--card); }
.propositions p { background: transparent; border-bottom: 1px solid var(--border); }
.propositions li:first-child { border-top: 0; }
.propositions li b { font-size: 14px; }
.sugg .h b { font-size: 13px; }
.opt { min-height: 36px; padding: 6px 16px; background: var(--card); border-color: var(--border); }
.opt:hover { border-color: color-mix(in srgb, var(--primary) 45%, var(--border)); background: var(--ciel-doux); }
.compose { border-radius: var(--r-carte); background: var(--card); border-color: var(--border); box-shadow: var(--ombre-carte); }
.compose-pied .btn.pri { min-height: 38px; padding: 0 18px; }

.side { background: var(--card); gap: var(--e5); border-left: 0; }
.side .sec { font-size: 12px; }
.mini { border-radius: 16px; background: var(--card); }
.notes { border-radius: 14px; background: var(--muted); box-shadow: none; }

/* Téléphone : panneau clair, cartes empilées, barre du bas en pilule flottante */
@media (max-width: 820px) {
  body { background: var(--sidebar); }
  .sous-barre { display: none; }
  .rail {
    margin: 0 12px calc(10px + env(safe-area-inset-bottom, 0px)); padding: 6px; border: 0; border-radius: 999px;
    background: var(--card); box-shadow: var(--anneau-doux), 0 14px 30px -16px oklch(0.25 0.05 262 / 0.35);
  }
  .nav-liste { gap: 2px; }
  .nav, .nav:hover { background: transparent; box-shadow: none; }
  .nav { min-height: 52px; gap: 3px; padding: 4px 0; border-radius: 999px; font-size: 11px; color: var(--muted-foreground); transition: background-color .15s var(--courbe), color .15s var(--courbe); }
  .nav svg { position: relative; z-index: 1; width: 21px; height: 21px; stroke: currentColor; }
  .nav[aria-current="page"], .nav[aria-current="page"]:hover { background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); }
  .nav[aria-current="page"] svg { stroke: currentColor; }
  .nav[aria-current="page"]::before { display: none; }
  .nav:active { transform: scale(.96); }
  .nav .n { z-index: 2; left: calc(50% + 8px); top: 2px; box-shadow: 0 0 0 2px var(--card); }
  .nav[aria-current="page"] .n { background: var(--card); color: var(--foreground); box-shadow: none; }
  .tete-mobile { border-bottom: 0; background: transparent; padding-inline: var(--e3); }
  .equipe.compact { padding: 4px 12px 4px 10px; border-radius: 999px; background: var(--card); box-shadow: var(--anneau-doux); }
  #btn-recherche-mobile { border-radius: 50%; background: var(--card); box-shadow: var(--anneau-doux); }
  .surface { background: var(--card); }
  main:has(#v-apercu.on, #v-messages.on) .surface { background: transparent; }
  .bandeau-demo { margin: var(--e2) var(--gouttiere) 0; padding: 8px 12px; border: 0; border-radius: 14px; background: var(--teinte-ambre); color: var(--foreground); }
  .top { padding: var(--e3) var(--gouttiere) var(--e3); align-items: center; }
  .top h1 { font-size: 24px; line-height: 30px; letter-spacing: -.025em; }
  main:has(#v-apercu.on) .top h1 { font-size: 28px; line-height: 34px; }
  .top .sub { font-size: 13px; }
  .creer > .btn { border-radius: 50%; width: 48px; min-width: 48px; min-height: 48px; padding: 0; }
  .surface { border-radius: 0; }
  .accueil-barre:not(.edition) { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: var(--e3); }
  .accueil-barre:not(.edition) .accueil-actions { display: contents; }
  .accueil-barre:not(.edition) .segments.periode { grid-column: 1 / -1; grid-row: 2; display: flex; }
  .segments.periode .segment { flex: 1; min-width: 0; min-height: 36px; padding: 4px 6px; }
  .accueil-actions .segments.periode .segment { min-width: 0; }
  .grille-widgets { column-gap: var(--e3); row-gap: var(--e3); }
  .widget-corps > .carte, .widget-corps > .kpi { padding: var(--e4); border-radius: 18px; }
  .widget-corps > .carte.tdb-courbe { padding: var(--e5) var(--e4) var(--e4); }
  .kpi-haut { min-height: 32px; align-items: flex-start; }
  .kpi-ico { width: 32px; height: 32px; }
  .kpi-ico svg { width: 15px; height: 15px; }
  .kpi .val { font-size: 24px; line-height: 30px; margin-top: var(--e1); }
  .kpi-titre { font-size: 12px; line-height: 16px; padding-top: 2px; }
  .kpi-ecart { margin-top: var(--e2); }
  .kpi-phrase { display: none; }
  .mini-courbe { height: 32px; margin-top: var(--e2); }
  .mini-barres { min-height: 34px; margin-top: var(--e2); }
  .mini-ligne { grid-template-columns: minmax(0, 1fr) auto; }
  .mini-ligne .mini-piste { grid-column: 1 / -1; grid-row: 2; height: 8px; }
  .mini-lib { font-size: 11px; }
  .hero { margin-bottom: var(--e3); }
  .hero-val b { font-size: 34px; line-height: 38px; }
  .hero-unite { font-size: 14px; }
  .legende-courbe { padding: 5px 10px; gap: var(--e3); }
  .barres-y, .courbe-explorer.barres { height: 180px; }
  .barres-graphe { gap: var(--e2); }
  .bb { width: min(18px, 66%); }
  .bb.s2 { box-shadow: 0 0 0 2px var(--card); }
  .widget-corps .tableau th:first-child, .widget-corps .tableau td:first-child { padding-left: var(--e3); }
  .tdb-tableau .onglets { width: 100%; }
  .tdb-tableau .onglet { flex: 1; justify-content: center; }
  /* Messages : la liste en cartes posées sur le panneau, puis le fil en plein écran */
  .liste { background: transparent; }
  .liste-tete { background: var(--sidebar); padding: var(--e2) var(--gouttiere) var(--e3); }
  #q-messages, .filtres-ligne select.inp { background-color: var(--card); box-shadow: var(--anneau-doux); }
  #items { gap: var(--e2); padding: 0 var(--gouttiere) var(--e4); }
  .item { padding: var(--e3); border-radius: 18px; background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte); }
  .conv { border-left: 0; }
  main:has(#v-messages.lecture.on) .surface { background: var(--card); }
  main:has(#v-messages.lecture.on) .bandeau-demo { display: none; }
  .conv-h { padding: var(--e2) var(--e3); min-height: 60px; }
  .b { max-width: 86%; }
  .ai-card { padding: var(--e4); }
  .chaleur { border-spacing: 2px; }
  .chaleur th[scope="row"], .chaleur thead td:first-child { width: 34px; }
  .case-c { border-radius: 5px; aspect-ratio: .8; }
  .chaleur thead th { font-size: 11px; }
}

/* Mouvement réduit : plus aucun déplacement, seuls de courts fondus de couleur et d'opacité restent
   (voir la section « Mouvement » en fin de fichier) */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important; scroll-behavior: auto !important;
    transition-property: opacity, color, background-color, border-color, box-shadow, display, overlay !important;
    transition-duration: .14s !important;
  }
}

/* Réservations faites (façon TripIt, mis dans l'univers Finexy) : filtres en pilules, cartes de voyage
   blanches à grand rayon posées sur le panneau, frise des réservations à pastilles d'icône rondes */
@media (min-width: 821px) {
  main:has(#v-reservations.on) .surface { background: transparent; box-shadow: none; border-radius: 0; }
  main:has(#v-reservations.on) .top { padding: var(--e3) var(--e2) var(--e5); }
  main:has(#v-reservations.on) .bandeau-demo { margin: var(--e2) var(--e2) 0; }
  #v-reservations.page { padding: 0 var(--e2) var(--e8); gap: var(--e5); }
}
.resa-outils { display: grid; gap: var(--e3); min-width: 0; }
.resa-outils-l1 { display: flex; align-items: center; gap: var(--e3); flex-wrap: wrap; min-width: 0; }
.resa-outils-d { display: flex; align-items: center; gap: var(--e2); margin-left: auto; min-width: 0; }
.resa-vues { background: var(--card); box-shadow: var(--anneau-doux); }
.resa-vues .segment { gap: 6px; padding-inline: 16px; font-weight: 600; font-size: 13px; }
.seg-n { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--ciel-doux); color: var(--foreground); font-size: 12px; line-height: 20px; text-align: center; font-variant-numeric: proportional-nums; }
.segment[aria-checked="true"] .seg-n { background: oklch(1 0 0 / 18%); color: inherit; }
.resa-recherche { width: 260px; }
.resa-recherche .inp { min-height: 40px; border-radius: 999px; border-color: transparent; background-color: var(--card); box-shadow: var(--anneau-doux); padding-left: 36px; }
.resa-recherche svg { left: 13px; }
.btn.resa-ajout { min-height: 40px; background: var(--card) !important; box-shadow: var(--anneau-doux); }
.btn.resa-ajout:hover:not(:disabled) { background: var(--accent) !important; }
.resa-cats { display: flex; gap: var(--e2); flex-wrap: wrap; min-width: 0; }
.puce-cat {
  display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 0 14px 0 12px; border-radius: 999px;
  background: var(--card); box-shadow: var(--anneau-doux); color: var(--foreground); font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: background-color .15s var(--courbe), color .15s var(--courbe), box-shadow .15s var(--courbe);
}
.puce-cat:first-child { padding-left: 14px; }
.puce-cat svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; color: var(--muted-foreground); }
@media (hover: hover) { .puce-cat:hover { background: var(--accent); } }
.puce-cat:active { transform: scale(.97); }
.puce-cat[aria-pressed="true"] { background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); box-shadow: 0 6px 14px -10px oklch(0.2 0.04 264 / 0.8); }
.puce-cat[aria-pressed="true"] svg { color: currentColor; }
.puce-cat:focus-visible { outline: none; box-shadow: var(--anneau); }

.voyages-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: var(--e4); align-items: start; }
.carte.voyage {
  display: grid; gap: var(--e4); padding: var(--e5) var(--e5) var(--e3); border: 0; border-radius: var(--r-carte);
  background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte); min-width: 0;
}
.voyage-tete { display: flex; align-items: center; gap: var(--e3); min-width: 0; }
.voyage-pastille, .pastille-cat {
  flex: none; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; background: var(--muted); color: var(--foreground);
}
.voyage-pastille { background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); }
.voyage.hors .voyage-pastille { background: var(--muted); color: var(--foreground); }
.voyage-pastille svg, .pastille-cat svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pastille-cat.petite { width: 28px; height: 28px; }
.pastille-cat.petite svg { width: 14px; height: 14px; }
.pastille-cat.grande { width: 40px; height: 40px; }
.voyage-titres { flex: 1; min-width: 0; }
.voyage-titres h2 { margin: 0; font-size: 17px; line-height: 24px; letter-spacing: -.01em; overflow-wrap: anywhere; }
.voyage-titres p { margin: 2px 0 0; font-size: 13px; line-height: 20px; color: var(--muted-foreground); }
.voyage-chiffres { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--e3); flex-wrap: wrap; padding-bottom: var(--e1); }
.voyage-total { display: grid; gap: 0; }
.voyage-total span { font-size: 13px; color: var(--muted-foreground); }
.voyage-total b { font-size: 28px; line-height: 34px; letter-spacing: -.03em; font-variant-numeric: proportional-nums; }
.voyage-total b.muted { font-size: 15px; line-height: 34px; letter-spacing: 0; font-weight: 400; }
.voyage-pilules { display: flex; gap: var(--e2); flex-wrap: wrap; }
.pilule-info {
  display: inline-flex; align-items: center; gap: 5px; height: 26px; padding: 0 10px; border-radius: 999px;
  background: var(--muted); color: var(--foreground); font-size: 12px; font-weight: 600; white-space: nowrap;
}
.pilule-info svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.pilule-info.avert { background: var(--teinte-ambre); color: var(--avert); }

/* La frise : jour en tête, puis heure, pastille reliée par un trait, titre et détails, montant */
.frise { list-style: none; margin: 0 calc(-1 * var(--e2)); padding: 0; display: grid; }
.frise-jour {
  margin: var(--e2) var(--e2) 2px; padding: 4px 10px; justify-self: start; border-radius: 999px; background: var(--muted);
  font-size: 12px; line-height: 16px; font-weight: 600; color: var(--muted-foreground);
}
.frise-jour:first-child { margin-top: 0; }
.frise-item { position: relative; }
.frise-item + .frise-item::before {
  content: ""; position: absolute; left: calc(var(--e2) + 52px + var(--e3) + 13px); top: -14px; height: 28px; width: 2px; border-radius: 1px;
  background: var(--border);
}
.frise-rangee {
  position: relative; z-index: 1; display: grid; grid-template-columns: 52px 28px minmax(0, 1fr) auto; gap: var(--e3); align-items: center;
  width: 100%; min-height: 56px; padding: var(--e2); border-radius: 14px; text-align: left; color: var(--foreground);
  transition: background-color .12s var(--courbe);
}
@media (hover: hover) { .frise-rangee:hover { background: var(--muted); } }
.frise-rangee:active { transform: scale(.995); }
.frise-rangee:focus-visible { outline-offset: -2px; }
.frise-rangee.ouverte { background: var(--ciel-doux); }
.frise-heure { font-size: 13px; color: var(--muted-foreground); font-variant-numeric: proportional-nums; text-align: right; overflow-wrap: anywhere; line-height: 16px; }
.frise-noeud { display: grid; place-items: center; }
.frise-noeud .pastille-cat { width: 28px; height: 28px; box-shadow: 0 0 0 3px var(--card); }
.frise-rangee:hover .frise-noeud .pastille-cat { box-shadow: 0 0 0 3px var(--muted); }
.frise-rangee.ouverte .frise-noeud .pastille-cat { box-shadow: 0 0 0 3px var(--ciel-doux); background: var(--card); }
.frise-noeud .pastille-cat svg { width: 14px; height: 14px; }
.frise-corps { display: grid; gap: 1px; min-width: 0; }
.frise-titre { display: flex; align-items: center; gap: var(--e2); min-width: 0; flex-wrap: wrap; }
.frise-titre b { min-width: 0; font-size: 14px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
.frise-details { font-size: 13px; line-height: 18px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.frise-montant { font-size: 13px; font-weight: 600; font-variant-numeric: proportional-nums; white-space: nowrap; }
.frise-rangee.annulee .frise-titre b, .frise-rangee.annulee .frise-montant { color: var(--muted-foreground); text-decoration: line-through; text-decoration-thickness: 1px; }
.frise-rangee.annulee .pastille-cat { color: var(--muted-foreground); }
.st-f {
  display: inline-flex; align-items: center; gap: 4px; height: 20px; padding: 0 8px; border-radius: 999px; flex: none;
  font-size: 12px; line-height: 20px; font-weight: 600; background: var(--muted); color: var(--muted-foreground);
}
.st-f svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.st-f.modifiee { background: var(--teinte-bleu); color: var(--bleu); }
.st-f.a_verifier, .st-f.conflit { background: var(--teinte-ambre); color: var(--avert); }
.st-f.annulee { text-decoration: line-through; text-decoration-thickness: 1px; }
.squelette-carte { min-height: 260px; }
.frise-sq { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: var(--e3); align-items: center; }
.frise-sq .squelette.rond { width: 28px; height: 28px; }
.resa-vide { margin: var(--e10) auto; }

/* Fiche d'une réservation : le billet en tête, documents par rôle, historique en points */
.billet {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(56px, auto) minmax(0, 1fr); align-items: start; gap: var(--e3);
  padding: var(--e4); border-radius: 16px; background: var(--muted);
}
.billet.simple { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.billet-cote { display: grid; gap: 1px; min-width: 0; }
.billet-cote:last-child:not(:first-child) { text-align: right; }
.billet.simple .billet-cote:last-child { text-align: left; }
.billet-lib { font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.billet-heure { font-size: 26px; line-height: 32px; letter-spacing: -.03em; font-variant-numeric: proportional-nums; font-weight: 600; }
.billet-date { font-size: 13px; color: var(--muted-foreground); }
.billet-lieu { margin-top: 2px; font-size: 13px; line-height: 18px; font-weight: 600; overflow-wrap: anywhere; }
.billet-milieu { display: grid; justify-items: center; gap: 6px; padding-top: 22px; color: var(--muted-foreground); font-size: 12px; white-space: nowrap; }
.billet-milieu i { position: relative; display: block; width: 100%; min-width: 48px; height: 0; border-top: 2px dashed var(--border-strong); }
.billet-milieu i::after { content: ""; position: absolute; right: -2px; top: -5px; width: 8px; height: 8px; border-radius: 50%; background: var(--foreground); }
.billet-milieu i::before { content: ""; position: absolute; left: -2px; top: -5px; width: 8px; height: 8px; border-radius: 50%; border: 2px solid var(--foreground); background: var(--muted); box-sizing: border-box; }
.ref { letter-spacing: .04em; }
.alerte.avert .alerte-btns, .alerte-btns { display: flex; gap: var(--e2); flex-wrap: wrap; }
.panneau .alerte { border-radius: 14px; }
.pn-liste.docs .doc { display: flex; align-items: center; }
.pn-liste.docs .pn-rangee { flex: 1; min-width: 0; }
.doc-detacher { margin-right: var(--e2); opacity: .7; }
.doc:hover .doc-detacher, .doc-detacher:focus-visible { opacity: 1; }
.role-doc {
  flex: none; min-width: 96px; height: 22px; padding: 0 8px; border-radius: 999px; display: inline-grid; place-items: center;
  font-size: 12px; font-weight: 600; background: var(--muted); color: var(--foreground); white-space: nowrap;
}
.role-doc.r-confirmation { background: var(--teinte-vert); color: var(--succes); }
.role-doc.r-modification { background: var(--teinte-bleu); color: var(--bleu); }
.role-doc.r-annulation { background: var(--teinte-rouge); color: var(--destructive); }
.role-doc.r-facture { background: var(--ciel-doux); }
.role-doc.r-carte_embarquement { background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); }
.historique { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--e3); }
.histo { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: var(--e3); align-items: baseline; font-size: 13px; line-height: 20px; }
.histo-point { width: 8px; height: 8px; border-radius: 50%; background: var(--chart-3); transform: translateY(-1px); }
.histo.avert .histo-point { background: var(--avert); }
.histo-t { overflow-wrap: anywhere; }
.histo .muted { font-size: 12px; white-space: nowrap; }
.ev-puce { flex: none; width: 10px; height: 10px; border-radius: 3px; background: var(--teinte-faite); box-shadow: inset 2px 0 0 var(--bord-faite); }
.ev-puce.g-tampon { background: repeating-linear-gradient(135deg, var(--card) 0 2px, var(--input-strong) 2px 3px); box-shadow: inset 0 0 0 1px var(--border); }
.ev-puce.puce-bande { width: 16px; height: 8px; border-radius: 999px; background: var(--ciel-doux); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ciel) 60%, transparent); }
.choix-voyage { display: grid; gap: var(--e2); }
.choix-ligne { display: flex; gap: var(--e3); align-items: flex-start; padding: var(--e3); border-radius: 14px; background: var(--muted); cursor: pointer; }
.choix-ligne:has(input:checked) { background: var(--ciel-doux); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ciel) 70%, transparent); }
.choix-ligne input { margin-top: 3px; accent-color: var(--primary); }
.choix-ligne span { display: grid; min-width: 0; }
.choix-ligne small { font-size: 13px; color: var(--muted-foreground); }
.td-cat { display: inline-flex; align-items: center; gap: var(--e2); min-width: 0; }
.td-cat a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.td-cat-t { display: grid; min-width: 0; }
.td-cat-t small { font-weight: 400; font-size: 12px; line-height: 16px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tableau td.td-faite { max-width: 260px; }
.tableau td.td-faite .td-cat { display: flex; width: 100%; }
.tableau td.td-quand, .tableau td.num { white-space: nowrap; }

/* Carte « Rangé dans Réservations » d'une conversation de fournisseur */
.ai-card.rangee .rangee-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.rangee-r { display: flex; align-items: center; gap: var(--e3); width: 100%; padding: 6px 8px; border-radius: 12px; text-align: left; }
@media (hover: hover) { .rangee-r:hover { background: var(--muted); } }
.rangee-t { flex: 1; min-width: 0; display: grid; }
.rangee-t b { font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rangee-t small { font-size: 12px; color: var(--muted-foreground); }

/* Agenda : réservations faites (trajets, repas) en ciel, séjours en bandeau qui ne bloque rien */
:root {
  --teinte-faite: color-mix(in srgb, var(--ciel) 30%, var(--card));
  --bord-faite: color-mix(in srgb, var(--ciel) 55%, var(--chart-1));
}
.ev.g-trajet, .ev.g-repas, .ev.g-evenement, .ev.g-sejour { background: var(--teinte-faite); border-left-color: var(--bord-faite); --teinte-ev: var(--bord-faite); cursor: pointer; }
@media (hover: hover) { .ev.g-trajet:hover, .ev.g-repas:hover, .ev.g-evenement:hover, .ev.g-sejour:hover { background: color-mix(in srgb, var(--ciel) 42%, var(--card)); } }
.legend .l-faite { background: var(--teinte-faite); box-shadow: inset 2px 0 0 var(--bord-faite); }
.legend .l-bande { width: 18px; border-radius: 999px; background: var(--ciel-doux); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ciel) 60%, transparent); }
.cal .bd-lib, .cal .bd-jour {
  position: sticky; top: 44px; z-index: 3; min-height: 32px; padding: 4px 0; background: var(--card);
  border-bottom: 1px solid var(--border); border-left: 1px solid var(--border-soft);
}
.cal .bd-lib { left: 0; z-index: 4; border-left: 0; display: grid; place-items: center; color: var(--muted-foreground); }
.cal .bd-lib svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cal .bd-jour { display: grid; gap: 3px; align-content: start; }
.cal .bd-jour.we { background-color: color-mix(in srgb, var(--foreground) 2.5%, var(--card)); }
.bande {
  display: block; min-height: 22px; margin: 0 4px; padding: 2px 10px; border-radius: 999px; text-align: left;
  font-size: 12px; line-height: 18px; font-weight: 600; color: var(--foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  background: var(--ciel-doux); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--ciel) 60%, transparent);
  transition: background-color .12s var(--courbe);
}
.bande.suite { margin-left: -1px; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.bande.continue { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
@media (hover: hover) { .bande:hover { background: color-mix(in srgb, var(--ciel) 45%, var(--card)); } }
.bande:focus-visible { outline: 2px solid var(--ring); outline-offset: 1px; }
.mjour .pt.g-faite::before { background: var(--bord-faite); }
.mjour .pt.g-bande::before { width: 10px; border-radius: 999px; background: var(--ciel); }
.mjour .points i.g-faite { background: var(--bord-faite); }
.mjour .points i.g-bande { background: var(--ciel); }
.jour-liste li.g-trajet::before, .jour-liste li.g-repas::before, .jour-liste li.g-evenement::before { background: var(--bord-faite); }
.jour-liste li.bandeau::before { background: var(--ciel); }
.w-quoi:has(.pastille-cat) { display: flex; align-items: center; gap: var(--e2); }
.w-quoi > span:not(.pastille-cat) { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.w-ligne:has(.pastille-cat) { align-items: center; }
.w-bandeau .w-quoi > span:not(.pastille-cat) { color: var(--muted-foreground); }

@media (max-width: 820px) {
  main:has(#v-reservations.on) .surface { background: transparent; }
  #v-reservations.page { padding-top: var(--e1); gap: var(--e4); }
  .resa-outils-l1 { display: grid; grid-template-columns: minmax(0, 1fr); }
  .resa-vues { display: flex; width: 100%; }
  .resa-vues .segment { flex: 1; min-width: 0; min-height: 40px; padding-inline: 6px; justify-content: center; }
  .resa-outils-d { margin-left: 0; display: grid; grid-template-columns: minmax(0, 1fr) auto; }
  .resa-recherche { width: 100%; }
  .resa-recherche .inp { min-height: 44px; font-size: 16px; }
  .btn.resa-ajout { min-height: 44px; min-width: 44px; padding: 0; border-radius: 50%; }
  .resa-ajout .lib-ajout { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .frise-titre b { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .resa-cats { flex-wrap: nowrap; overflow-x: auto; margin: 0 calc(-1 * var(--gouttiere)); padding: 2px var(--gouttiere) 4px; scrollbar-width: none; }
  .puce-cat { min-height: 40px; flex: none; }
  .voyages-grille { gap: var(--e3); }
  .carte.voyage { padding: var(--e4) var(--e4) var(--e2); border-radius: 18px; gap: var(--e3); }
  .voyage-total b { font-size: 24px; line-height: 30px; }
  .frise-rangee { grid-template-columns: 44px 28px minmax(0, 1fr); grid-template-areas: "h n c" ". . m"; row-gap: 0; min-height: 56px; }
  .frise-heure { grid-area: h; }
  .frise-noeud { grid-area: n; }
  .frise-corps { grid-area: c; }
  .frise-montant { grid-area: m; justify-self: start; font-size: 12px; }
  .frise-montant:empty { display: none; }
  .frise-item + .frise-item::before { left: calc(var(--e2) + 44px + var(--e3) + 13px); }
  .frise-details { white-space: normal; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
  .billet { padding: var(--e3); }
  .billet-heure { font-size: 22px; line-height: 28px; }
}

/* Demandes de rendez vous : le tableau de l'Aperçu (en tête gris arrondi, statut en point, menu « … ») */
#v-demandes .td-cadre { border: 0; border-radius: 0; background: transparent; }
#v-demandes .td-table th { height: 40px; background: var(--muted); border-bottom: 0; font-size: 12px; font-weight: 600; }
#v-demandes .td-table th:first-child { border-radius: 12px 0 0 12px; }
#v-demandes .td-table th:last-child { border-radius: 0 12px 12px 0; }
#v-demandes .td-table td { height: 52px; }
#v-demandes .td-table .st { height: auto; padding: 0; gap: 7px; background: none; color: var(--foreground); font-weight: 400; font-size: 13px; }
#v-demandes .td-table .st .st-point { width: 7px; height: 7px; background: var(--chart-3); }
#v-demandes .td-table .st.confirmee .st-point { background: var(--succes); }
#v-demandes .td-table .st.a_confirmer .st-point { background: var(--avert); }
#v-demandes .td-table .st.nouvelle .st-point { background: var(--bleu); }
#v-demandes .td-table .st.annulee { color: var(--muted-foreground); }
#v-demandes .td-table .st.annulee .st-point { background: var(--destructive); }
.pn-actions .td-menu { min-width: 36px !important; min-height: 36px !important; }

/* Contacts et Sociétés : le tableau de l'Aperçu et des Demandes (en tête gris arrondi, statut en point,
   menu « … »), le résumé chiffré en tuiles grises, la fiche en panneau aux grands rayons */
.page-table .td-cadre { border: 0; border-radius: 0; background: transparent; }
.page-table .td-table th { height: 40px; background: var(--muted); border-bottom: 0; font-size: 12px; font-weight: 600; }
.page-table .td-table th:first-child { border-radius: 12px 0 0 12px; }
.page-table .td-table th:last-child { border-radius: 0 12px 12px 0; }
.page-table .td-table td { height: 52px; }
.page-table .td-ouvrir .av { width: 32px; height: 32px; font-size: 12px; }
.page-table .td-ouvrir .av.carre { width: 32px; height: 32px; font-size: 12px; border-radius: 10px; }
.page-table .td-canal { gap: 7px; font-size: 13px; }
.page-table .td-canal .dot { width: 7px; height: 7px; }
.st-act { display: inline-flex; align-items: center; gap: 7px; font-size: 13px; white-space: nowrap; }
.st-act .st-point { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--chart-3); }
.st-act.active .st-point { background: var(--succes); }
.st-act.calme .st-point { background: var(--avert); }
.st-act.aucune { color: var(--muted-foreground); }
.page-table .td-pied { padding: 0 var(--e1); }
.page-table .td-fleches .btn, .page-table .td-pp select.inp { border-radius: 999px; }
.page-table .td-recherche .inp { border-radius: 999px; padding-left: 34px; }
.page-table .td-recherche svg { left: 12px; }

@media (min-width: 821px) {
  .panneau { top: 12px; right: 12px; bottom: 12px; border: 0; border-radius: 24px; box-shadow: var(--anneau-doux), var(--ombre-flotte); overflow: hidden; }
}
.pn-tete { border-bottom-color: var(--border-soft); }
.pn-tete .av { width: 40px; height: 40px; font-size: 13px; }
.pn-tete .av.carre { border-radius: 12px; }
.pn-pied { border-top-color: var(--border-soft); }
/* Résumé en tête des listes denses : cartes chiffres de l'Aperçu en plus compact (pastille d'icône, chiffre de 24 px) */
.page-table > .resume-chiffres { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--e4); }
.page-table .chiffre-c {
  display: flex; align-items: flex-start; justify-content: space-between; gap: var(--e3); padding: var(--e4) var(--e5);
  border: 0; border-radius: var(--r-carte); background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte);
}
.page-table .chiffre-c dl { gap: var(--e1); min-width: 0; }
.page-table .chiffre-c dt { font-size: 14px; line-height: 20px; color: var(--foreground); }
.page-table .chiffre-c dd { font-size: 26px; line-height: 32px; letter-spacing: -.03em; }
.page-table .chiffre-c dd small { margin-top: 2px; font-size: 13px; line-height: 18px; letter-spacing: 0; }
.chiffre-ico { flex: none; width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--muted); color: var(--foreground); }
.chiffre-ico svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.page-table button.chiffre-c { text-align: left; transition: background-color .15s var(--courbe), transform .14s var(--courbe); }
.page-table button.chiffre-c:hover { background: color-mix(in srgb, var(--accent) 60%, var(--card)); }
.page-table button.chiffre-c:hover .chiffre-ico { background: var(--card); box-shadow: var(--anneau-doux); }
.page-table button.chiffre-c:active { transform: scale(.98); }
.page-table button.chiffre-c:focus-visible { outline: none; box-shadow: var(--anneau), var(--ombre-carte); border-radius: var(--r-carte); }
@media (max-width: 820px) {
  .page-table > .resume-chiffres { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--e3); }
  .page-table .chiffre-c { padding: var(--e3) var(--e4); border-radius: 18px; }
  .page-table .chiffre-c dt { font-size: 13px; line-height: 18px; }
  .page-table .chiffre-c dd { font-size: 22px; line-height: 28px; }
  .chiffre-ico { width: 32px; height: 32px; }
  /* Trois chiffres : le premier prend la rangée, les deux autres se partagent la suivante */
  .page-table > .resume-chiffres > :first-child:nth-last-child(3) { grid-column: 1 / -1; }
  main:has(.page-table.on) .surface { background: transparent; }
  .page-table > [id^="liste-"] {
    min-width: 0; padding: var(--e3) var(--e3) var(--e2); border-radius: 18px;
    background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte);
  }
  #v-demandes .td-sous { white-space: normal; text-overflow: clip; }
  /* Équipe : la personne garde toute la largeur, le rôle passe dessous */
  .cadre-tableau .tableau, .cadre-tableau .tableau tbody { display: block; width: 100%; min-width: 0; }
  .cadre-tableau .tableau thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cadre-tableau .tableau tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; column-gap: var(--e2); padding: var(--e3) var(--e2); border-bottom: 1px solid var(--border-soft); }
  .cadre-tableau .tableau tbody tr:last-child { border-bottom: 0; }
  .cadre-tableau .tableau tbody td { height: auto; padding: 0; border: 0; }
  .cadre-tableau .tableau tbody td:first-child { grid-column: 1; grid-row: 1; padding: 0; }
  .cadre-tableau .tableau tbody td.cell-actions { grid-column: 2; grid-row: 1; width: auto; }
  .cadre-tableau .tableau tbody td:not(:first-child):not(.cell-actions) { grid-column: 1 / -1; width: auto; padding: var(--e2) 0 0 calc(36px + var(--e3)); }
  .cadre-tableau .tableau tbody td.cell-role .role-choix { width: auto; min-width: 168px; max-width: 100%; }
  #v-equipe #equipe-corps > .onglets { width: 100%; }
  #v-equipe #equipe-corps > .onglets .onglet { flex: 1 1 auto; padding: 0 8px; gap: 6px; justify-content: center; }
  #v-demandes .td-table td { height: auto; padding-block: var(--e2); }
}
@media (max-width: 380px) {
  #v-equipe #equipe-corps > .onglets .onglet { padding: 0 6px; gap: 4px; font-size: 12px; }
  #v-equipe #equipe-corps > .onglets .onglet .compte-pastille { min-width: 18px; padding: 0 5px; }
}
.pn-resume { gap: var(--e2); }
.pn-resume .chiffre-c { padding: var(--e3); border: 0; border-radius: 14px; background: var(--muted); }
.pn-resume .chiffre-c dd { font-size: 18px; }
.pn-section { border-top-color: var(--border-soft); }
.pn-liste { border: 0; border-radius: 16px; background: var(--muted); padding: 4px; }
.pn-liste > li + li { border-top: 0; margin-top: 2px; }
.pn-rangee, .pn-ligne { border-radius: 12px; }
@media (hover: hover) { .pn-liste .pn-rangee:hover { background: var(--card); } }
/* Rangées « Dans l'agenda » : la date passe sous le titre quand la place manque, le titre garde deux lignes */
.pn-rangee:has(> .ev-puce) { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; column-gap: var(--e3); }
.pn-rangee:has(> .ev-puce) .pn-rangee-t { white-space: normal; overflow-wrap: anywhere; }
.pn-rangee:has(> .ev-puce) .pn-rangee-t small { white-space: nowrap; }
@media (max-width: 820px) {
  .pn-rangee:has(> .ev-puce) { grid-template-columns: 10px minmax(0, 1fr); row-gap: 2px; align-items: start; }
  .pn-rangee:has(> .ev-puce) > .ev-puce { margin-top: 6px; }
  .pn-rangee:has(> .ev-puce) > .muted { grid-column: 2; }
}
.pn-onglets { width: max-content; max-width: 100%; gap: 2px; padding: 4px; margin-bottom: 0; border: 0; border-radius: 999px; background: var(--muted); scrollbar-width: none; }
.pn-onglets .onglet { min-height: 32px; padding: 0 12px; margin: 0; border: 0; border-radius: 999px; font-size: 13px; }
.pn-onglets .onglet[aria-selected="true"] { background: var(--card); box-shadow: 0 1px 2px oklch(0.3 0.04 262 / 0.12), 0 0 0 1px var(--border); }
.pn-onglets .onglet .compte-pastille { border-radius: 999px; background: var(--ciel-doux); color: var(--foreground); }
.pn-vide { border: 0; border-radius: 16px; background: var(--muted); }

/* Agenda : posé sur le panneau, la grille dans une carte blanche à grand rayon, blocs arrondis */
@media (min-width: 821px) {
  main:has(#v-agenda.on, #v-notes.on) .surface { background: transparent; box-shadow: none; border-radius: 0; }
  main:has(#v-agenda.on, #v-notes.on) .top { padding: var(--e3) var(--e2) var(--e5); }
  main:has(#v-agenda.on, #v-notes.on) .bandeau-demo { margin: var(--e2) var(--e2) 0; }
  #v-agenda.page { padding: 0 var(--e2) var(--e2); }
  #v-notes.page { padding: 0 var(--e2) var(--e8); }
}
.cal-wrap, .mois { border: 0; border-radius: var(--r-carte); background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte); }
.cal .hd { height: 52px; border-bottom-color: var(--border-soft); }
.cal .hd b { min-width: 28px; height: 28px; border-radius: 999px; font-size: 15px; }
.cal .hd.auj b { padding: 0 6px; }
.cal .hd.auj { color: var(--primary); }
.cal .bd-lib, .cal .bd-jour { top: 52px; border-bottom-color: var(--border-soft); }
.cal .col.we, .cal .hd.we, .cal .bd-jour.we { background-color: color-mix(in srgb, var(--muted) 55%, var(--card)); }
.maintenant { border-top: 2px solid var(--primary); }
.maintenant::before { left: -5px; top: -6px; width: 10px; height: 10px; background: var(--primary); box-shadow: 0 0 0 2px var(--card); }
.ev { padding: 4px 8px 4px 9px; border-radius: 8px; border-left-width: 3px; box-shadow: 0 0 0 1.5px var(--card); }
.ev.g-reservation { background: color-mix(in srgb, var(--chart-1) 12%, var(--card)); }
.ev.g-reservation b { color: color-mix(in srgb, var(--chart-1) 80%, var(--foreground)); }
.ev.g-rdv { background: var(--muted); }
.ev.g-tampon { border-radius: 8px; }
.ev-fantome { border-radius: 8px; border-left-width: 3px; }
.ev-sq { border-radius: 8px; }
.legend { padding: 0 var(--e1); }
.barre-agenda .groupe-btn { padding: 3px; gap: 2px; border-radius: 999px; background: var(--card); box-shadow: var(--anneau-doux); }
.barre-agenda .groupe-btn > .btn { border: 0 !important; border-radius: 999px !important; background: transparent; box-shadow: none; }
.barre-agenda .groupe-btn > .btn:hover:not(:disabled) { background: var(--accent); }
.barre-agenda .groupe-btn > .btn:focus-visible { position: relative; z-index: 1; outline: none; box-shadow: var(--anneau), 0 0 0 1px var(--ring); }
.barre-agenda .segments { background: var(--card); box-shadow: var(--anneau-doux); }
.barre-agenda .btn.ajout-page { background: var(--card); box-shadow: var(--anneau-doux); }
.barre-agenda .btn.ajout-page:hover:not(:disabled) { background: var(--accent); }
.agenda-titre b { font-size: 20px; line-height: 28px; letter-spacing: -.02em; }
.mois .jsem { height: 40px; border-bottom-color: var(--border-soft); font-weight: 600; }
.mjour .num { min-width: 26px; height: 26px; border-radius: 999px; }
.mjour .pt { border-radius: 6px; }
.mjour.hors { background: color-mix(in srgb, var(--muted) 70%, var(--card)); }
.mjour.we { background: color-mix(in srgb, var(--muted) 45%, var(--card)); }
.chaleur-agenda { border: 0; border-radius: var(--r-carte); box-shadow: var(--anneau-doux), var(--ombre-carte); }

/* Bloc-notes : saisie rapide en carte blanche, filtres en pilules, une carte par groupe de notes */
#v-notes > * { max-width: none; }
.note-saisie { padding: var(--e4) var(--e4) var(--e3) var(--e5); border: 0; border-radius: var(--r-carte); background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte); }
.note-saisie:hover:not(:focus-within) { box-shadow: 0 0 0 1px var(--input-strong), var(--ombre-carte); }
.note-saisie:focus-within { box-shadow: var(--anneau), var(--ombre-carte); }
.note-saisie textarea.inp { font-size: 16px; line-height: 24px; }
.note-saisie-pied .btn.pri { min-height: 36px; padding: 0 18px; }
.notes-outils { align-items: center; border-bottom: 0; gap: var(--e3); }
.notes-outils .onglets { gap: var(--e2); padding: 2px; }
.notes-outils .onglet {
  min-height: 34px; padding: 0 14px; margin: 0; border: 0; border-radius: 999px; background: var(--card); box-shadow: var(--anneau-doux);
  color: var(--foreground); font-size: 13px; transition: background-color .15s var(--courbe), color .15s var(--courbe);
}
@media (hover: hover) { .notes-outils .onglet:hover { background: var(--accent); } }
.notes-outils .onglet:active { transform: scale(.97); }
.notes-outils .onglet[aria-selected="true"] { background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); box-shadow: 0 6px 14px -10px oklch(0.2 0.04 264 / 0.8); }
.notes-outils .onglet:focus-visible { outline: none; box-shadow: var(--anneau); border-radius: 999px; }
.notes-recherche { width: 260px; margin: 0; }
.notes-recherche .inp { min-height: 40px; border-radius: 999px; border-color: transparent; background-color: var(--card); box-shadow: var(--anneau-doux); padding-left: 36px; }
.notes-recherche svg { left: 13px; }
.liste-notes { margin-top: 0; gap: var(--e4); }
.notes-carte { display: grid; min-width: 0; padding: var(--e2) var(--e3) var(--e2); border-radius: var(--r-carte); background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte); }
.notes-carte .notes-groupe { height: 40px; margin: 0 0 2px; padding: 0 var(--e2); background: none; border-bottom: 0; font-size: 15px; line-height: 20px; letter-spacing: -.01em; }
.notes-carte .notes-groupe .c { min-width: 22px; height: 20px; padding: 0 7px; border-radius: 999px; background: var(--muted); color: var(--foreground); font-size: 12px; line-height: 20px; text-align: center; font-weight: 600; }
.notes-carte .note { padding: 12px var(--e2); border-radius: 14px; border-bottom: 0; }
.notes-carte .note + .note { box-shadow: 0 -1px 0 var(--border-soft); }
@media (hover: hover) { .notes-carte .note:not(.note-edition):not(.note-sq):hover { background: var(--muted); box-shadow: none; } .notes-carte .note:hover + .note { box-shadow: none; } }
.notes-carte .note-edition { margin: var(--e1) 0; border-radius: 16px; }
.notes-carte .tag-point { height: 24px; padding: 0 10px; background: var(--muted); box-shadow: none; color: var(--foreground); }
.notes-carte .note-acts .btn.icone.petit { border-radius: 999px; }
.notes-vide { padding: var(--e6); border-radius: var(--r-carte); background: var(--card); box-shadow: var(--anneau-doux); }

@media (max-width: 820px) {
  .page-table .td-recherche .inp { min-height: 44px; }
  .panneau { border-radius: 0; }
  .barre-agenda .groupe-btn > .btn { min-height: 36px; }
  .cal-wrap, .mois { border-radius: 18px; }
  .notes-outils { align-items: stretch; }
  .notes-outils .onglets { gap: var(--e2); padding: 2px var(--gouttiere) 4px; }
  .notes-outils .onglet { min-height: 40px; flex: none; }
  .notes-recherche { width: 100%; }
  .notes-recherche .inp { min-height: 44px; font-size: 16px; }
  .note-saisie { padding: var(--e3) var(--e3) var(--e2) var(--e4); border-radius: 18px; }
  .notes-carte { padding: var(--e1) var(--e2); border-radius: 18px; }
  .notes-carte .note { padding: var(--e3) var(--e1); }
}
.pn-corps { grid-template-columns: minmax(0, 1fr); }

/* Paramètres, Canaux, Équipe, Facturation : posés sur le panneau, en cartes blanches à grand rayon,
   colonne des sections en carte, rangée choisie en encre pleine, barre d'enregistrement flottante */
@media (min-width: 821px) {
  main:has(#v-reglages.on, #v-canaux.on, #v-equipe.on, #v-facturation.on) .surface { background: transparent; box-shadow: none; border-radius: 0; }
  main:has(#v-reglages.on, #v-canaux.on, #v-equipe.on, #v-facturation.on) .top { padding: var(--e3) var(--e2) var(--e5); }
  main:has(#v-reglages.on, #v-canaux.on, #v-equipe.on, #v-facturation.on) .bandeau-demo { margin: var(--e2) var(--e2) 0; }
  .reglages, #v-canaux.reglages, .reglages.sans-apercu { gap: var(--e4); padding: 0 var(--e2) var(--e2); }
  .reglages { grid-template-columns: 248px minmax(0, 1fr) 340px; }
  #v-canaux.reglages, .reglages.sans-apercu { grid-template-columns: 248px minmax(0, 1fr); }
  .reglages-nav {
    align-self: start; max-height: 100%; padding: var(--e3); border: 0; border-radius: var(--r-carte);
    background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte);
  }
  .reglages-centre { padding: 0 var(--e1) var(--e3); scroll-padding-bottom: 140px; }
  .reglages-apercu {
    align-self: start; max-height: 100%; padding: var(--e6); border: 0; border-radius: var(--r-carte);
    background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte);
  }
  .page-compte { padding: 0 var(--e2) var(--e8); }
}
@media (max-width: 1280px) and (min-width: 821px) {
  .reglages { grid-template-columns: 228px minmax(0, 1fr) 300px; }
  #v-canaux.reglages, .reglages.sans-apercu { grid-template-columns: 228px minmax(0, 1fr); }
}
@media (max-width: 1180px) and (min-width: 821px) {
  .reglages, #v-canaux.reglages, .reglages.sans-apercu { grid-template-columns: 228px minmax(0, 1fr); }
  .reglages-nav { position: sticky; top: 0; }
  .reglages-apercu { grid-column: 2; max-width: 768px; padding: var(--e6); background: var(--card); }
}
.reglages { scroll-padding-bottom: 160px; }
.reglages-recherche .inp { min-height: 36px; border-radius: 999px; padding-left: 32px; background-color: var(--muted); border-color: transparent; }
.reglages-recherche .inp:focus { background-color: var(--card); }
.reglages-recherche svg { left: 12px; }
.groupe-titre { padding: var(--e4) var(--e3) var(--e1); }
.rnav { min-height: 36px; padding: 6px var(--e3); border-radius: 12px; }
.rnav[aria-current="page"], .rnav[aria-current="page"]:hover {
  background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); box-shadow: 0 6px 14px -10px oklch(0.2 0.04 264 / 0.8);
}
.rnav .bientot-tag { border-radius: 999px; padding: 0 8px; background: var(--muted); box-shadow: none; }
.section-tete { padding: var(--e1) var(--e1) var(--e4); border-bottom: 0; }
.section-tete h2 { font-size: 20px; line-height: 28px; letter-spacing: -.02em; }
.section-tete p { font-size: 14px; }
.section-reglages { max-width: 800px; }
.reglages-carte {
  max-width: 800px; margin-bottom: var(--e4); padding: var(--e1) var(--e6); border-radius: var(--r-carte);
  background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte);
}
.reglages-carte-tete { padding: var(--e5) 0 var(--e1); }
.reglages-carte-tete h3 { margin: 0; font-size: 16px; line-height: 24px; letter-spacing: -.01em; }
.reglages-carte-tete p { margin: 2px 0 0; font-size: 13px; line-height: 20px; color: var(--muted-foreground); max-width: 62ch; }
.reglages-carte .reglage { padding: var(--e5) 0; border-bottom-color: var(--border-soft); }
.reglages-carte .reglage:last-child { border-bottom: 0; }
.reglages-carte > .case { padding-bottom: var(--e4); }
.reglages-carte .reglage-val > div:has(> .canal-auto) { border: 0; border-radius: 16px; background: var(--muted); padding: 2px var(--e1); }
.reglages-carte .canal-auto { border-top-color: var(--border); }
.reglages-carte .inp.gros:not(.mono) { max-width: 440px; }
.unite { gap: var(--e2); }
.unite .inp.gros { width: 92px; text-align: right; }
.reglages-pied {
  bottom: var(--e3); max-width: 800px; margin: 0; padding: var(--e2) var(--e2) var(--e2) var(--e5); border: 0; border-radius: 999px;
  background: var(--card); box-shadow: var(--anneau-doux), 0 18px 36px -22px oklch(0.25 0.05 262 / 0.5);
}
.reglages-pied.modifie { box-shadow: 0 0 0 1px color-mix(in srgb, var(--avert) 45%, var(--border)), 0 18px 36px -22px oklch(0.25 0.05 262 / 0.5); }
.reglages-apercu { gap: var(--e3); }
.reglages-apercu h2 { font-size: 16px; line-height: 24px; letter-spacing: -.01em; }
.telephone { gap: var(--e3); padding: var(--e4); border: 0; border-radius: 18px; background: var(--muted); }
.telephone .quand { justify-self: center; padding: 0 10px; border-radius: 999px; background: var(--card); }
.bulle { padding: 10px 14px; border-radius: 18px 18px 18px 6px; background: var(--card); box-shadow: none; }
.bulle-l.moi .bulle { border-radius: 18px 18px 6px 18px; }
.bulle-l.moi.coupe .bulle { background: var(--card); box-shadow: inset 0 0 0 1px var(--border); }
.bulle-l .av { width: 28px; height: 28px; }
.etat-ia i { width: 8px; height: 8px; }

/* Frise des horaires dans sa carte : la piste en gris perle, les plages en cobalt teinté */
.reglages-carte .reglage.large { padding-top: var(--e5); }
.reglages-carte .reglage:last-of-type { border-bottom: 0; }
.reglages-carte .horaires { border: 0; border-radius: 16px; background: var(--muted); padding: var(--e1); gap: 2px; }
.reglages-carte .jour-h { border-bottom: 0; border-radius: 12px; background: var(--card); padding: var(--e3) var(--e4); }
.reglages-carte .jour-h.ferme { background: color-mix(in srgb, var(--card) 45%, transparent); }
.reglages-carte .jour-h.ferme .nom-jour { color: var(--muted-foreground); }
.reglages-carte .axe-frise { padding: var(--e2) var(--e4) var(--e1); }
.reglages-carte .piste { height: 40px; border-radius: 12px; box-shadow: none; background-image: repeating-linear-gradient(to right, var(--border-soft) 0 1px, transparent 1px calc(100% / 8)); }
.reglages-carte .jour-h.ferme .piste { background-color: var(--card); box-shadow: inset 0 0 0 1px var(--border-soft); }
.reglages-carte .plage-bloc { top: 5px; bottom: 5px; border-radius: 8px; box-shadow: 0 6px 14px -10px color-mix(in srgb, var(--primary) 90%, transparent); }
.reglages-carte .plage-croix { border: 0; box-shadow: var(--anneau-doux), var(--ombre-flotte); }

/* Canaux : la liste en carte, pictogrammes dans des pastilles rondes, WhatsApp officiel mis en avant */
.liste-canaux { max-width: 800px; margin-top: 0; }
.canaux { border: 0; border-radius: var(--r-carte); background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte); padding: var(--e1) var(--e2); }
.canal { border-bottom-color: var(--border-soft); }
.canal-ligne { grid-template-columns: 40px minmax(0, 1fr) auto auto auto; padding: var(--e4) var(--e3); }
.canal-picto, .canal-picto.rond { width: 40px; height: 40px; border-radius: 50%; background: var(--muted); box-shadow: none; }
.canal-picto.k-whatsapp_meta { background: var(--teinte-vert); }
.canal-picto-sq { width: 40px; height: 40px; border-radius: 50%; }
.canal-details { padding: 0 var(--e3) var(--e4) calc(var(--e3) + 40px + var(--e4)); }
.canal-details .alerte { border-radius: 14px; }
.canal .st { gap: 7px; height: 24px; padding: 0 10px; background: var(--muted); color: var(--foreground); font-weight: 400; }
.canal .st::before { content: ""; width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--chart-3); }
.canal .st.ok::before { background: var(--succes); }
.canal .st.wait::before { background: var(--avert); }
.canal .st.bad-err::before { background: var(--destructive); }
.canaux-vide { display: grid; gap: var(--e4); max-width: 800px; }
.canaux-vide-tete { display: flex; gap: var(--e4); align-items: flex-start; padding: var(--e5) var(--e6); border-radius: var(--r-carte); background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte); }
.canaux-vide-tete .etat-vide-picto { flex: none; margin: 0; border: 0; border-radius: 50%; background: var(--muted); }
.canaux-vide-tete h2 { margin: 0; font-size: 16px; line-height: 24px; }
.canaux-vide-tete p { margin: 2px 0 0; font-size: 14px; color: var(--muted-foreground); max-width: 62ch; }
.canaux-offres { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: var(--e4); }
.canal-offre {
  display: flex; flex-direction: column; gap: var(--e3); min-width: 0; padding: var(--e6); border-radius: var(--r-carte);
  background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte);
}
.canal-offre.vedette { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--primary) 55%, transparent), var(--ombre-carte); }
/* Sans canal, l'offre mise en avant porte le seul bouton cobalt de la zone : celui de la section passe en blanc */
#v-canaux:has(.canaux-vide) #btn-ajout-canal { background: var(--card); border-color: transparent; color: var(--foreground); box-shadow: var(--anneau-doux); }
#v-canaux:has(.canaux-vide) #btn-ajout-canal:hover:not(:disabled) { background: var(--accent); color: var(--foreground); }
#v-canaux:has(.canaux-vide) #btn-ajout-canal:focus-visible { box-shadow: var(--anneau); }
.canal-offre-tete { display: flex; align-items: center; justify-content: space-between; gap: var(--e3); }
.canal-offre-tete .canal-picto { width: 44px; height: 44px; }
.canal-offre-tete .canal-picto svg { width: 20px; height: 20px; }
.canal-offre h3 { margin: var(--e1) 0 0; font-size: 18px; line-height: 26px; letter-spacing: -.015em; }
.canal-offre > p { margin: 0; font-size: 14px; color: var(--muted-foreground); }
.canal-atouts { list-style: none; display: grid; gap: var(--e2); margin: 0 0 var(--e2); padding: 0; font-size: 14px; }
.canal-atouts li { display: flex; gap: var(--e2); align-items: flex-start; }
.canal-atouts svg { width: 18px; height: 18px; flex: none; margin-top: 1px; padding: 3px; box-sizing: border-box; border-radius: 50%; background: var(--teinte-vert); fill: none; stroke: var(--succes); stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.canal-offre .btn { margin-top: auto; align-self: flex-start; }
.canaux-vide > .choix-sep { margin: var(--e2) var(--e1) 0; }
.choix-canal { grid-template-columns: 40px minmax(0, 1fr) 16px; padding: var(--e3) var(--e4) var(--e3) var(--e3); border-radius: 18px; border-color: transparent; background: var(--card); box-shadow: var(--anneau-doux); }
.choix-canal:hover { background: var(--muted); border-color: transparent; }
.choix-canal.risque { background: transparent; border: 1px dashed var(--border-strong); box-shadow: none; }
.choix-canal.risque:hover { background: color-mix(in srgb, var(--muted) 60%, transparent); }
.choix-canal.risque .canal-picto { background: color-mix(in srgb, var(--muted) 70%, transparent); }
.dlg .choix-canal:not(.risque):first-child { box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--primary) 45%, transparent); }
.tag.t-reco { background: var(--ciel-doux); color: var(--primary); font-weight: 600; }

/* Équipe et Facturation : une colonne de cartes blanches */
.compte-centre { max-width: none; gap: var(--e4); grid-template-columns: minmax(0, 1fr); }
.invite, .invite-sq { padding: var(--e6); border: 0; border-radius: var(--r-carte); background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte); }
.invite-tete h2 { font-size: 17px; letter-spacing: -.01em; }
.invite-places { align-items: center; }
.invite-places .mono { padding: 2px 10px; border-radius: 999px; background: var(--muted); }
.invite-places a { margin-left: var(--e2); }
.invite-ligne { grid-template-columns: minmax(0, 1fr) 180px auto; }
.invite-ligne .btn.pri { min-height: 40px; }
.invite-ligne .inp { min-height: 40px; }
.lien-unique { padding: var(--e5) var(--e6); border: 0; border-radius: var(--r-carte); background: var(--card); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--succes) 40%, transparent), var(--ombre-carte); }
.lien-unique-picto { width: 32px; height: 32px; }
.lien-unique-tete { grid-template-columns: 32px minmax(0, 1fr) auto; }
.lien-unique .copie { padding: 4px 4px 4px 14px; border-radius: 999px; background: var(--muted); }
.lien-unique .copie code { background: transparent; padding: 0; border: 0; }
.lien-unique .copie .btn:not(.pri):not(.discret):not(.lien):not(.danger) { background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); }
.lien-unique .copie .btn:not(.pri):not(.discret):not(.lien):not(.danger):hover:not(:disabled) { background: color-mix(in srgb, var(--sidebar-primary) 86%, var(--card)); }
#equipe-corps > .onglets {
  width: max-content; max-width: 100%; gap: 2px; padding: 4px; margin-top: var(--e2); border: 0; border-radius: 999px;
  background: var(--card); box-shadow: var(--anneau-doux); overflow-x: auto; scrollbar-width: none;
}
#equipe-corps > .onglets .onglet { min-height: 34px; padding: 0 14px; margin: 0; border: 0; border-radius: 999px; font-size: 13px; color: var(--foreground); }
#equipe-corps > .onglets .onglet:hover { background: var(--accent); }
#equipe-corps > .onglets .onglet[aria-selected="true"] { background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); box-shadow: 0 6px 14px -10px oklch(0.2 0.04 264 / 0.8); }
#equipe-corps > .onglets .onglet[aria-selected="true"] .compte-pastille { background: oklch(1 0 0 / 18%); color: inherit; }
#equipe-corps > .onglets .onglet .compte-pastille { border-radius: 999px; background: var(--muted); color: var(--foreground); }
#equipe-corps > .onglets .onglet:focus-visible { outline: none; box-shadow: var(--anneau); }
/* La pilule qui glisse vide le fond et l'ombre du choix actif : son anneau de focus revient ici */
#equipe-corps > .onglets.glisse-pret > .onglet[aria-selected="true"]:focus-visible { box-shadow: var(--anneau) !important; }
.cadre-tableau { border: 0; border-radius: var(--r-carte); background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte); padding: var(--e3); }
.cadre-tableau .tableau th { height: 40px; background: var(--muted); border: 0; font-size: 12px; font-weight: 600; color: var(--muted-foreground); }
.cadre-tableau .tableau th:first-child { border-radius: 12px 0 0 12px; }
.cadre-tableau .tableau th:last-child { border-radius: 0 12px 12px 0; }
.cadre-tableau .tableau td { height: 60px; border-bottom-color: var(--border-soft); }
.cadre-tableau .tableau tbody tr { transition: background-color .12s var(--courbe); }
@media (hover: hover) { .cadre-tableau .tableau tbody tr:hover { background: color-mix(in srgb, var(--muted) 55%, transparent); } }
.cadre-tableau .qui-cell .av { width: 36px; height: 36px; font-size: 13px; }
.cadre-tableau .role-choix { border-radius: 999px; background-color: var(--muted); border-color: transparent; }
.tag.role-tag { height: 24px; padding: 0 10px; line-height: 24px; }
.tag.moi-tag { border-radius: 999px; }
.av-attente { background: var(--muted); }
.equipe-panneau > .etat-vide-cadre, .canaux-vide .etat-vide-cadre { border: 0; border-radius: var(--r-carte); background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte); }
.etat-vide-cadre .etat-vide-picto { border: 0; border-radius: 50%; background: var(--muted); }
.journal-outils { padding: 0 var(--e1); }
.journal-filtre { border-radius: 999px; background-color: var(--card); border-color: transparent; box-shadow: var(--anneau-doux); }
.journal { border: 0; border-radius: var(--r-carte); background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte); padding: var(--e2) var(--e3); }
.journal-ligne { grid-template-columns: 32px minmax(0, 1fr) auto; min-height: 52px; padding: var(--e2); }
.journal-ligne .av { width: 32px; height: 32px; font-size: 12px; }
.equipe-note { padding: 0 var(--e1); }
.membre-sq { padding: var(--e3) var(--e4); }
.onglets-sq { border-bottom: 0; padding: var(--e2) 0; }

.bandeau { padding: var(--e4) var(--e5); border: 0; border-radius: var(--r-carte); background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte); grid-template-columns: 36px minmax(0, 1fr) auto; align-items: center; }
.bandeau > svg { width: 36px; height: 36px; padding: 8px; box-sizing: border-box; border-radius: 50%; background: var(--teinte-ambre); stroke: var(--avert); }
.bandeau-erreur { background: var(--card); box-shadow: 0 0 0 1.5px color-mix(in srgb, var(--destructive) 40%, transparent), var(--ombre-carte); }
.bandeau-erreur > svg { background: var(--teinte-rouge); stroke: var(--destructive); }
#facturation-corps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
#facturation-corps > * { grid-column: 1 / -1; }
#facturation-corps > .jauge, #facturation-corps > .bloc-factu:nth-of-type(2) { grid-column: auto; }
.jauge, .bloc-factu {
  align-content: start; padding: var(--e6); border: 0; border-radius: var(--r-carte); background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte);
}
.bloc-factu { padding-top: var(--e6); }
.jauge-tete h2, .bloc-factu-tete h2 { font-size: 17px; letter-spacing: -.01em; }
.jauge-chiffre { margin-top: var(--e2); }
.jauge-chiffre b { font-size: 40px; line-height: 44px; letter-spacing: -.03em; }
.jauge-barre { height: 14px; max-width: none; padding: 0; border-radius: 999px; background: var(--hachure); box-shadow: none; }
.jauge-rempli { box-shadow: 0 0 0 2px var(--card); }
.jauge-legende { display: flex; gap: var(--e4); margin: 0; font-size: 13px; color: var(--muted-foreground); }
.jauge-legende .pl { display: inline-flex; align-items: center; gap: 6px; font-variant-numeric: proportional-nums; }
.jauge-legende i { width: 10px; height: 10px; border-radius: 3px; background: var(--primary); }
.jauge-legende i.libre-c { background: var(--hachure); }
.jauge:has(.jauge-rempli.plein) .jauge-legende i.plein-c { background: var(--avert); }
.defs dt, .defs dd { border-bottom-color: var(--border-soft); }
.defs { grid-template-columns: minmax(0, 140px) minmax(0, 1fr); }
.places-champ { border-radius: 999px; min-height: 40px; }
.factu-souscrire .btn.pri { min-height: 40px; }
.factu-sq { padding: var(--e6); border-radius: var(--r-carte); background: var(--card); box-shadow: var(--anneau-doux); }

/* Fenêtres, menus, palette : grands rayons, pictogrammes dans des pastilles rondes grises */
dialog { border: 0; border-radius: 24px; box-shadow: var(--anneau-doux), 0 30px 60px -24px oklch(0.2 0.04 262 / 0.45); }
.dlg { gap: var(--e4); padding: var(--e6); }
.dlg h2 { font-size: 18px; line-height: 26px; letter-spacing: -.015em; }
.dlg .pied { padding-top: var(--e3); }
.dlg .pied .btn { min-height: 40px; }
.menu-liste { gap: 4px; margin: 0 calc(-1 * var(--e2)); }
.menu-lien { min-height: 56px; padding: var(--e2) var(--e3) var(--e2) var(--e2); border-radius: 16px; }
.menu-lien > svg { box-sizing: content-box; width: 18px; height: 18px; padding: 9px; flex: none; border-radius: 50%; background: var(--muted); color: var(--foreground); }
@media (hover: hover) { .menu-lien:hover { background: var(--muted); } .menu-lien:hover > svg { background: var(--card); } }
.menu-lien .n { min-width: 24px; height: 24px; line-height: 24px; border-radius: 999px; background: var(--primary); color: var(--primary-foreground); font-weight: 600; }
#menu-creer { min-width: 248px; padding: 8px; border: 0; border-radius: 20px; box-shadow: var(--anneau-doux), var(--ombre-flotte); }
#menu-creer .menu-titre { padding: 6px var(--e2) var(--e2); }
#menu-creer .menu-item { min-height: 44px; gap: var(--e3); padding: 6px var(--e2); border-radius: 14px; font-weight: 600; }
#menu-creer .menu-item svg { box-sizing: content-box; width: 16px; height: 16px; padding: 8px; flex: none; border-radius: 50%; background: var(--muted); stroke: var(--foreground); }
#menu-creer .menu-item:hover svg, #menu-creer .menu-item:focus-visible svg { background: var(--card); }
#menu-creer .menu-item:hover, #menu-creer .menu-item:focus-visible { background: var(--muted); }
#menu-creer .menu-sep { margin: 6px var(--e2); background: var(--border-soft); }
.menu.flottant, .menu-compte, .menu-outils { border: 0; border-radius: 18px; box-shadow: var(--anneau-doux), var(--ombre-flotte); }
dialog.palette { border-radius: 24px; }
.palette-champ { gap: var(--e3); padding: 0 var(--e5); border-bottom-color: var(--border-soft); }
.palette-champ input { height: 60px; font-size: 17px; }
.palette-champ kbd, .palette-pied kbd { border: 0; border-radius: 999px; padding: 1px 8px; background: var(--muted); }
.palette-res { padding: var(--e2) var(--e3) var(--e3); }
.palette-groupe { padding: var(--e3) var(--e2) var(--e1); font-weight: 600; }
.palette-item { min-height: 48px; gap: var(--e3); padding: 6px var(--e3) 6px var(--e2); border-radius: 14px; }
.palette-item[aria-selected="true"] { background: var(--muted); }
.palette-item > svg { box-sizing: content-box; width: 16px; height: 16px; padding: 8px; margin: 0; border-radius: 50%; background: var(--muted); stroke: var(--foreground); }
.palette-item[aria-selected="true"] > svg { background: var(--card); }
.palette-item .av { width: 32px; height: 32px; font-size: 12px; }
.palette-txt b { font-weight: 600; }
.palette-indice { padding: 2px 8px; border-radius: 999px; background: var(--muted); }
.palette-item[aria-selected="true"] .palette-indice { background: var(--card); }
.palette-pied { padding: var(--e3) var(--e5); border-top-color: var(--border-soft); }
.toast { border: 0; border-radius: 18px; box-shadow: var(--anneau-doux), var(--ombre-flotte); }

/* Connexion et invitation : centrées sur le gris perle, une carte blanche arrondie, le logo en pilule */
.auth { background: var(--fond); padding-top: var(--e10); }
.auth-boite {
  max-width: 440px; gap: var(--e6); padding: var(--e10) var(--e10) var(--e8); border-radius: var(--r-panneau);
  background: var(--card); box-shadow: var(--anneau-doux), 0 30px 60px -36px oklch(0.3 0.05 262 / 0.35);
}
.auth-marque { justify-self: center; gap: 10px; padding: 8px 14px 8px 12px; border-radius: 999px; background: var(--sidebar); box-shadow: var(--anneau-doux); }
.auth-marque .logo { height: 18px; }
.auth-marque .produit { border-radius: 999px; }
.auth-tete h1, .auth-etat h1 { font-size: 24px; line-height: 32px; letter-spacing: -.025em; }
.auth .chapo { font-size: 14px; line-height: 22px; }
.auth form { gap: var(--e4); }
.auth .inp { min-height: 44px; }
.auth .btn.pri { min-height: 46px; font-size: 15px; }
.auth-bascule { padding-top: var(--e4); border-top-color: var(--border-soft); }
.auth-lien { min-height: 36px; padding: 0 14px; border-radius: 999px; }
.auth-lien:hover { background: var(--muted); }
.auth-lien:hover b { text-decoration: none; }
.auth-pied { max-width: 440px; margin-top: var(--e6); }
.auth-etat .etat-vide-picto { width: 48px; height: 48px; border: 0; border-radius: 50%; background: var(--teinte-ambre); color: var(--avert); }

@media (max-width: 820px) {
  main:has(#v-reglages.on, #v-canaux.on, #v-equipe.on, #v-facturation.on) .surface { background: transparent; }
  .reglages-nav { margin: 0 var(--gouttiere) var(--e6); padding: var(--e2) var(--e4) var(--e3); border-radius: 20px; background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte); }
  .reglages-recherche { margin: var(--e2) 0 0; }
  .reglages-recherche .inp { min-height: 44px; font-size: 16px; }
  .groupe-titre { padding: var(--e5) 0 var(--e1); }
  .rnav, .rnav[aria-current="page"], .rnav[aria-current="page"]:hover { background: none; color: var(--foreground); box-shadow: none; }
  .rnav:last-child { border-bottom: 0; }
  .reglages-centre { padding: 0 var(--gouttiere) var(--e6); }
  .section-tete { padding: 0 var(--e1) var(--e3); }
  .reglages-carte { padding: 0 var(--e4); margin-bottom: var(--e3); border-radius: 18px; }
  .reglages-carte-tete { padding-top: var(--e4); }
  .reglages-carte .reglage { padding: var(--e4) 0; }
  .reglages-pied { bottom: calc(var(--e2) + 0px); padding: var(--e3); border-radius: 22px; }
  .reglages-apercu { margin: 0 var(--gouttiere) var(--e8); padding: var(--e5) var(--e4); border-radius: 18px; background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte); }
  #v-canaux .reglages-centre .section-tete { padding-top: 0; }
  .canaux { padding: 0 var(--e1); border-radius: 18px; }
  .canal-ligne { grid-template-columns: 40px minmax(0, 1fr) auto; }
  .canal-details { padding: 0 var(--e3) var(--e3); }
  .canaux-offres { grid-template-columns: minmax(0, 1fr); gap: var(--e3); }
  .canaux-vide-tete, .canal-offre { padding: var(--e5) var(--e4); border-radius: 18px; }
  .canal-offre .btn { align-self: stretch; }
  .page-compte { padding: 0 var(--gouttiere) var(--e8); }
  .invite, .invite-sq, .lien-unique, .jauge, .bloc-factu, .journal, .cadre-tableau, .bandeau, .factu-sq { border-radius: 18px; }
  .invite, .jauge, .bloc-factu { padding: var(--e5) var(--e4); }
  .invite-ligne { grid-template-columns: minmax(0, 1fr) auto; }
  .cadre-tableau { padding: var(--e2); }
  .lien-unique { padding: var(--e4); }
  #facturation-corps { grid-template-columns: minmax(0, 1fr); }
  #facturation-corps > .jauge, #facturation-corps > .bloc-factu:nth-of-type(2) { grid-column: 1 / -1; }
  .jauge-chiffre b { font-size: 32px; line-height: 38px; }
  .bandeau { grid-template-columns: 36px minmax(0, 1fr); padding: var(--e4); }
  dialog.feuille { border-radius: 24px 24px 0 0; }
  dialog.palette { border-radius: 20px; }
  #menu-creer { min-width: 264px; }
  .defs { grid-template-columns: minmax(0, 1fr); }
  .auth { padding: var(--e6) var(--e3) calc(var(--e5) + env(safe-area-inset-bottom, 0px)); }
  .auth-boite { padding: var(--e8) var(--e5) var(--e6); border-radius: 24px; }
}


/* Mouvement (façon Linear, Vercel) : sobre et précis. Sortie exponentielle (--courbe), 120 à 260 ms,
   seulement transform et opacity (clip-path pour la pilule qui glisse). Une entrée se fait par
   transition (@starting-style), donc elle s'interrompt et repart d'où elle en est ; la sortie est
   plus courte que l'entrée. Rien sur la palette Ctrl K, la frappe, les survols de rangée. */

/* Appui : tout ce qui se presse s'enfonce d'un rien */
.segment, .rail .nav, .ic, .barre-icones .nav.ic, .equipe, .compte, .puce-cat, .chip, .opt, .onglet, .choix-canal,
.frise-rangee, .note-saisie .btn, .creer > .btn {
  transition-property: background-color, border-color, color, box-shadow, transform;
  transition-duration: .15s; transition-timing-function: var(--courbe);
}
.btn { transition-duration: .15s, .15s, .15s, .14s; }
.btn:active:not(:disabled), .segment:active, .chip:active, .opt:active, .onglet:active, .puce-cat:active,
.equipe:active, .compte:active, .creer > .btn:active:not(:disabled) { transform: scale(.97); }
.btn.lien:active:not(:disabled) { transform: none; opacity: .7; }
@media (min-width: 821px) { .rail .nav:active, .rail .nav.rond:active { transform: scale(.96); } }

/* Interrupteur : la pastille s'étire sous le doigt, puis file de l'autre côté */
.sw::after, .interrupteur input::after { transition: transform .2s var(--courbe); transform-origin: left center; }
.sw:active::after, .interrupteur input:active::after { transform: scaleX(1.18); }
.sw[aria-checked="true"]:active::after, .sw:checked:active::after, .interrupteur input:checked:active::after { transform: translateX(12px) scaleX(1.18); transform-origin: right center; }

/* Cases à cocher : la coche se trace depuis un peu plus petit */
.td-coche::after, .menu-case .coche::after, .case input::after, .dlg input[type="checkbox"]:not([role="switch"])::after,
.form-reglages input[type="checkbox"]:not([role="switch"]):not(.sw)::after {
  transform: translateY(-1px) rotate(-45deg) scale(.5); transition: opacity .14s var(--courbe), transform .18s var(--courbe);
}
.td-coche:checked::after, .menu-case[aria-checked="true"] .coche::after, .case input:checked::after,
.dlg input[type="checkbox"]:not([role="switch"]):checked::after, .form-reglages input[type="checkbox"]:not([role="switch"]):not(.sw):checked::after {
  transform: translateY(-1px) rotate(-45deg) scale(1);
}
.td-coche:indeterminate::after { transform: none; }

/* Pilule active qui glisse : un calque d'encre derrière les choix, découpé à la place du choix actif.
   Tant qu'il n'est pas prêt (premier affichage, écran caché), le choix garde son propre fond. */
.glisseur { display: none; }
.a-glisseur { position: relative; isolation: isolate; }
.glisse-pret > .glisseur {
  display: block; position: absolute; left: 0; top: 0; z-index: 0; pointer-events: none; opacity: 0;
  filter: drop-shadow(0 4px 6px oklch(0.2 0.04 264 / 0.22));
  transition: opacity .16s var(--courbe);
}
.glisse-pret > .glisseur::before {
  content: ""; position: absolute; inset: 0; background: var(--sidebar-primary); clip-path: var(--forme);
  transition: clip-path .26s var(--courbe);
}
.glisse-pret > .glisseur.vu { opacity: 1; }
.glisseur.sans-trans, .glisseur.sans-trans::before { transition: none !important; }
.a-glisseur > :not(.glisseur) {
  position: relative; z-index: 1;
  transition: background-color .15s var(--courbe), color .26s var(--courbe), transform .15s var(--courbe);
}
.glisse-pret > [aria-current="page"], .glisse-pret > [aria-checked="true"], .glisse-pret > [aria-selected="true"] {
  background: transparent !important; box-shadow: none !important;
}
.tdb-tableau .onglets > .glisseur, .pn-onglets > .glisseur { filter: drop-shadow(0 0 .5px oklch(0.3 0.04 262 / 0.35)) drop-shadow(0 1px 1px oklch(0.3 0.04 262 / 0.1)); }
.tdb-tableau .onglets > .glisseur::before, .pn-onglets > .glisseur::before { background: var(--card); }
@media (max-width: 820px) { .nav-liste > .glisseur { filter: none; } }

/* Menus : ils naissent de leur bouton et s'y résorbent, plus vite qu'ils ne sont venus */
.menu {
  animation: none; transform-origin: var(--origine, top right);
  transition: opacity .16s var(--courbe), transform .16s var(--courbe), display .16s allow-discrete;
}
.menu.vers-haut { transform-origin: var(--origine, bottom left); }
.menu.flottant { transform-origin: var(--origine, top left); }
@starting-style { .menu:not([hidden]) { opacity: 0; transform: scale(.96); } }
.menu[hidden], .menu.sortie { opacity: 0; transform: scale(.97); transition-duration: .12s; pointer-events: none; }
@media (max-width: 820px) { #menu-creer { transform-origin: var(--origine, top right); } }

/* Fenêtres : fondu et léger grossissement depuis le centre ; la feuille du téléphone monte du bas */
dialog { animation: none; }
dialog:not(.palette) {
  transition: opacity .2s var(--courbe), transform .2s var(--courbe), display .2s allow-discrete, overlay .2s allow-discrete;
}
dialog:not(.palette):not([open]) { opacity: 0; transform: scale(.97); transition-duration: .14s; pointer-events: none; }
@starting-style { dialog[open]:not(.palette) { opacity: 0; transform: scale(.97); } }
dialog:not(.palette)::backdrop { transition: opacity .2s var(--courbe), display .2s allow-discrete, overlay .2s allow-discrete; }
dialog:not(.palette):not([open])::backdrop { opacity: 0; pointer-events: none; }
@starting-style { dialog[open]:not(.palette)::backdrop { opacity: 0; } }
dialog[open].palette { animation: none; transition: none; }
@media (max-width: 820px) {
  dialog.feuille { transition-duration: .28s; transition-timing-function: var(--courbe-tiroir); }
  dialog.feuille:not([open]) { transform: translateY(100%); transition-duration: .18s; }
  @starting-style { dialog.feuille[open] { opacity: 1; transform: translateY(100%); } }
}

/* Fiche en panneau : elle glisse depuis la droite (du bas sur téléphone) et repart par le même chemin */
.panneau, .panneau:not([hidden]) {
  animation: none;
  transition: opacity .24s var(--courbe), transform .24s var(--courbe), display .24s allow-discrete;
}
.panneau[hidden] { opacity: 0; transform: translateX(24px); transition-duration: .16s; pointer-events: none; }
@starting-style { .panneau:not([hidden]) { opacity: 0; transform: translateX(24px); } }
@media (max-width: 820px) {
  .panneau[hidden] { transform: translateY(24px); }
  @starting-style { .panneau:not([hidden]) { opacity: 0; transform: translateY(32px); } }
}

/* Toast : il monte et s'efface ; un nouveau pousse le précédent derrière lui */
.toast, .toast:not([hidden]) {
  animation: none; transform-origin: bottom right;
  transition: opacity .22s var(--courbe), transform .22s var(--courbe), display .22s allow-discrete;
}
.toast[hidden] { opacity: 0; transform: translateY(8px) scale(.98); transition-duration: .16s; }
@starting-style { .toast:not([hidden]) { opacity: 0; transform: translateY(12px) scale(.98); } }
.toast.toast-pile { z-index: 69; pointer-events: none; transition: none; }
@media (max-width: 820px) {
  .toast, .toast:not([hidden]) { transform-origin: top center; }
  .toast[hidden] { transform: translateY(-8px) scale(.98); }
  @starting-style { .toast:not([hidden]) { opacity: 0; transform: translateY(-12px) scale(.98); } }
}

/* Squelettes : ils n'apparaissent que si le chargement dure, puis respirent à peine */
.squelette { animation: sq-entre .24s .14s var(--courbe) backwards, sq-pouls 1.8s .38s ease-in-out infinite; }
@keyframes sq-entre { from { opacity: 0; } }
@keyframes sq-pouls { 50% { opacity: .6; } }

/* Graphique de l'Aperçu : les barres montent une fois, de gauche à droite */
@media (prefers-reduced-motion: no-preference) {
  .barres-cols.monte .bb { transform-origin: bottom center; animation: bb-monte .34s var(--courbe) backwards; animation-delay: var(--delai, 0ms); }
}
@keyframes bb-monte { from { transform: translateX(-50%) scaleY(0); opacity: .4; } }

/* Chiffres : largeur fixe des chiffres, rien ne bouge autour quand ils changent */
.kpi .val, .hero-val b, .nav .n, .rail .nav .n, .jauge-chiffre b, .notes-groupe .c { font-variant-numeric: proportional-nums; }
.nav .n, .rail .nav .n { transform-origin: center; }

/* Jauge de Facturation : la part utilisée se remplit à l'arrivée */
.jauge-rempli { transition: none; transform-origin: left center; }
@media (prefers-reduced-motion: no-preference) { .jauge-rempli { animation: jauge-entre .34s .08s var(--courbe) backwards; } }
@keyframes jauge-entre { from { transform: scaleX(0); } }

/* Messages : le message envoyé entre par le bas à droite, depuis la zone de réponse */
.b.me { transform-origin: bottom right; }
.b:not(.me) { transform-origin: bottom left; }

/* Agenda : le bloc saisi se soulève, le fantôme suit le pointeur sans s'animer (il est redessiné à
   chaque mouvement), et le bloc lâché se pose avec un léger rebond (app.js, poserLocal) */
.ev { transition: background-color .12s var(--courbe), opacity .15s var(--courbe); }
.ev-fantome.principal { box-shadow: 0 10px 24px -10px oklch(0.25 0.05 262 / 0.45), 0 0 0 1px var(--card); }
.widget.glisse { transform: translate(var(--gx, 0), var(--gy, 0)) scale(1.015); }

/* Panneau de la fiche contact par dessus le fil (écrans moyens) : même glissé que la fiche */
#v-messages.fiche-dessus .side { animation-duration: .22s; animation-timing-function: var(--courbe); }

@media (prefers-reduced-motion: reduce) {
  .btn:active:not(:disabled), .segment:active, .chip:active, .opt:active, .onglet:active, .puce-cat:active,
  .equipe:active, .compte:active, .creer > .btn:active:not(:disabled), .rail .nav:active, .nav:active, .ic:active,
  .barre-icones .nav.ic:active, .choix-canal:active, .frise-rangee:active, .notes-outils .onglet:active { transform: none !important; }
  .sw:active::after, .interrupteur input:active::after { transform: none; }
  .sw[aria-checked="true"]:active::after, .sw:checked:active::after, .interrupteur input:checked:active::after { transform: translateX(12px); }
  .menu[hidden], .menu.sortie, dialog:not(.palette):not([open]), .panneau[hidden], .toast[hidden], dialog.feuille:not([open]) { transform: none; }
  @starting-style {
    .menu:not([hidden]) { opacity: 0; transform: none; }
    dialog[open]:not(.palette) { opacity: 0; transform: none; }
    .panneau:not([hidden]) { opacity: 0; transform: none; }
    .toast:not([hidden]) { opacity: 0; transform: none; }
  }
  .widget.glisse { transform: translate(var(--gx, 0), var(--gy, 0)); }
}

/* Canaux n'a pas de colonne d'aperçu : la liste et les offres prennent toute la largeur, comme les autres écrans */
@media (min-width: 821px) {
  #v-canaux .liste-canaux, #v-canaux .canaux-vide, #v-canaux .section-tete { max-width: none; }
}
/* Sur téléphone, le nom entier de la fiche reste lisible dans son en tête : il passe à la ligne autant qu'il faut */
@media (max-width: 820px) {
  .pn-titres h2 { display: block; -webkit-line-clamp: unset; }
  .pn-tete { align-items: flex-start; }
}

/* Demande d'un client pas encore validée : bord en pointillés, fond rayé, étiquette « À valider » */
.ev.attente {
  border-left-style: dashed;
  background-image: repeating-linear-gradient(135deg, transparent 0 6px, color-mix(in srgb, var(--teinte-ev, var(--chart-1)) 9%, transparent) 6px 12px);
}
.ev.attente.g-tampon { opacity: .7; }
.ev-attente {
  display: inline-block; align-self: flex-start; margin-bottom: 2px; padding: 0 6px; border-radius: 999px;
  font-style: normal; font-size: 10.5px; font-weight: 600; line-height: 16px; letter-spacing: .01em;
  color: color-mix(in srgb, var(--teinte-ev, var(--chart-1)) 85%, var(--foreground));
  background: color-mix(in srgb, var(--teinte-ev, var(--chart-1)) 16%, var(--card));
}

/* Fichiers : puces sous les messages, grille des fiches, envois, visionneuse (DESIGN.md, « Fichiers ») */
.pj-vig {
  display: grid; place-items: center; flex: none; width: 36px; height: 36px; border-radius: 50%; overflow: hidden;
  background: var(--muted); color: var(--muted-foreground);
}
.pj-vig svg, .pj-carte-vig svg, .visio-grande-ico svg { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pj-vig svg { width: 18px; height: 18px; }
.pj-vig img, .pj-carte-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.g-pdf { background: var(--teinte-rouge); color: var(--destructive); }
.g-tableur { background: var(--teinte-vert); color: var(--succes); }
.g-document { background: var(--teinte-bleu); color: var(--primary); }
.g-presentation { background: var(--teinte-ambre); color: var(--avert); }
.g-image, .g-audio, .g-video { background: var(--ciel-doux); color: var(--primary); }
.g-texte, .g-mail, .g-archive, .g-autre { background: var(--muted); color: var(--muted-foreground); }

/* Puces de fichier : sous le texte d'un message, pilules blanches à anneau, miniature ronde */
.pj-puces { display: flex; flex-wrap: wrap; gap: var(--e2); margin-top: var(--e2); white-space: normal; }
.pj-puce {
  display: inline-flex; align-items: center; gap: 10px; max-width: min(300px, 100%); min-height: 48px; padding: 6px 16px 6px 6px;
  border-radius: 999px; background: var(--card); color: var(--card-foreground); box-shadow: var(--anneau-doux); text-align: left;
  transition: background-color .15s var(--courbe), box-shadow .15s var(--courbe), transform .14s var(--courbe);
}
@media (hover: hover) { .pj-puce:hover { background: var(--accent); } }
.pj-puce:active { transform: scale(.97); }
.pj-puce:focus-visible { outline: none; box-shadow: var(--anneau-doux), var(--anneau); }
.pj-puce-t { display: grid; min-width: 0; line-height: 18px; }
.pj-puce .pj-nom { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-puce small { font-size: 12px; line-height: 16px; color: var(--muted-foreground); white-space: nowrap; }
.b.me .pj-puce { box-shadow: none; }

/* Grille de fichiers d'une fiche : filtres en pilules, tri, cartes à miniature ou pictogramme */
.pj-zone { position: relative; display: grid; gap: var(--e3); min-width: 0; }
.pj-outils { display: flex; align-items: center; justify-content: space-between; gap: var(--e2); flex-wrap: wrap; }
.pj-outils:empty { display: none; }
.pj-filtres { display: flex; gap: 6px; flex-wrap: wrap; min-width: 0; }
.pj-filtre {
  display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 12px; border-radius: 999px;
  background: var(--card); color: var(--foreground); box-shadow: var(--anneau-doux); font-size: 13px; font-weight: 600;
  transition: background-color .15s var(--courbe), color .15s var(--courbe), transform .14s var(--courbe);
}
.pj-filtre-n { font-weight: 400; color: var(--muted-foreground); }
@media (hover: hover) { .pj-filtre:hover { background: var(--accent); } }
.pj-filtre:active { transform: scale(.97); }
.pj-filtre[aria-pressed="true"] { background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); box-shadow: none; }
.pj-filtre[aria-pressed="true"] .pj-filtre-n { color: inherit; opacity: .75; }
.pj-filtre:focus-visible { outline: none; box-shadow: var(--anneau); }
.pj-outils-d { display: flex; align-items: center; gap: var(--e2); margin-left: auto; }
.pj-outils-d svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; }
select.inp.pj-tri { width: auto; min-height: 32px; padding: 4px 30px 4px 12px; font-size: 13px; border-radius: 999px; }
.pj-grille { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); gap: var(--e3); }
.pj-carte { position: relative; min-width: 0; border-radius: 16px; background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte); overflow: hidden; }
.pj-carte-ouvrir {
  display: grid; width: 100%; padding: 0; text-align: left; color: inherit; border-radius: inherit;
  transition: background-color .15s var(--courbe), transform .14s var(--courbe);
}
@media (hover: hover) { .pj-carte-ouvrir:hover { background: var(--accent); } .pj-carte-ouvrir:hover .pj-carte-vig.a-image img { opacity: .92; } }
.pj-carte-ouvrir:active { transform: scale(.98); }
.pj-carte-ouvrir:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--ring); }
.pj-carte-vig { position: relative; display: grid; place-items: center; aspect-ratio: 4 / 3; border-radius: 12px; margin: 6px 6px 0; overflow: hidden; }
.pj-carte-vig svg { width: 34px; height: 34px; }
.pj-carte-vig.a-image { background: var(--muted); }
.pj-carte-img { position: absolute; inset: 0; display: block; }
.pj-type {
  position: absolute; left: 8px; bottom: 8px; padding: 0 7px; border-radius: 999px; background: var(--card); color: var(--foreground);
  font-size: 11px; line-height: 18px; font-weight: 600; letter-spacing: .02em;
}
.pj-carte-t { display: grid; gap: 2px; min-width: 0; padding: var(--e2) var(--e3) var(--e3); }
.pj-carte .pj-nom { font-size: 13px; line-height: 18px; font-weight: 600; overflow: hidden; overflow-wrap: anywhere; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.pj-carte small { font-size: 12px; line-height: 16px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-menu.btn.icone {
  position: absolute; top: 10px; right: 10px; width: 28px; min-width: 28px; height: 28px; min-height: 28px; padding: 0;
  background: var(--card); box-shadow: var(--anneau-doux); opacity: 1;
}
.pj-menu svg { width: 16px; height: 16px; }
@media (hover: hover) and (pointer: fine) {
  .pj-menu.btn.icone { opacity: 0; transition: opacity .15s var(--courbe), background-color .15s var(--courbe); }
  .pj-carte:hover .pj-menu.btn.icone, .pj-menu.btn.icone:focus-visible, .pj-menu.btn.icone[aria-expanded="true"] { opacity: 1; }
}
.pj-sq { display: grid; gap: var(--e2); padding: 6px 6px var(--e3); box-shadow: var(--anneau-doux); }
.pj-sq .squelette.bloc { height: auto; aspect-ratio: 4 / 3; border-radius: 12px; }
.pj-sq .squelette:not(.bloc) { margin-left: 6px; }
.pj-vide {
  display: grid; justify-items: center; gap: var(--e2); padding: var(--e6) var(--e4); text-align: center;
  border: 1px dashed var(--border-strong); border-radius: 16px;
}
.pj-vide p { margin: 0; max-width: 360px; font-size: 13px; color: var(--muted-foreground); }
.pj-vide p:first-of-type { color: var(--foreground); font-size: 14px; }
.pj-vide-ico { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--muted); color: var(--muted-foreground); }
.pj-vide-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.pj-depot-voile {
  position: absolute; inset: -6px; z-index: 4; display: grid; place-content: center; justify-items: center; gap: var(--e2);
  border: 2px dashed var(--primary); border-radius: 18px; background: color-mix(in srgb, var(--primary) 7%, var(--card));
  color: var(--primary); font-size: 14px; font-weight: 600; pointer-events: none; opacity: 0;
  transition: opacity .15s var(--courbe);
}
.pj-depot-voile svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; }
.pj-zone.depot .pj-depot-voile { opacity: 1; }

/* Envois : une rangée par fichier, barre de progression cobalt, erreur en teinte rouge */
.pj-envois { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--e2); }
.pj-envois:empty { display: none; }
.pj-envoi { display: flex; align-items: center; gap: var(--e3); min-height: 52px; padding: var(--e2) var(--e2) var(--e2) var(--e2); border-radius: 14px; background: var(--muted); }
.pj-envoi .pj-vig { width: 32px; height: 32px; background: var(--card); }
.pj-envoi-t { flex: 1; min-width: 0; display: grid; gap: 4px; }
.pj-envoi .pj-nom { font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pj-piste { display: block; height: 6px; border-radius: 999px; background: var(--card); overflow: hidden; }
.pj-barre { display: block; height: 100%; border-radius: inherit; background: var(--primary); transform-origin: left center; transform: scaleX(var(--p, 0)); transition: transform .2s var(--courbe); }
.pj-envoi-etat { font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.pj-envoi.echec { background: var(--teinte-rouge); }
.pj-envoi.echec .pj-piste { display: none; }
.pj-envoi.echec .pj-envoi-etat { color: var(--destructive); font-size: 13px; line-height: 18px; }
.pj-envoi svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; }

/* Visionneuse : grand panneau aux coins du panneau principal sur ordinateur, plein écran sur téléphone */
dialog.visio {
  width: min(1240px, calc(100vw - 48px)); height: calc(100dvh - 48px); max-width: none; max-height: none; padding: 0; overflow: hidden;
  border-radius: var(--r-panneau); background: var(--sidebar); color: var(--foreground);
}
dialog.visio[open] { display: flex; flex-direction: column; }
dialog.visio::backdrop { background: oklch(0.16 0.03 262 / 0.6); }
.visio-tete { display: flex; align-items: center; gap: var(--e3); min-height: 68px; padding: var(--e3) var(--e3) var(--e3) var(--e5); flex: none; }
.visio-ico .pj-vig { width: 40px; height: 40px; }
.visio-titres { flex: 1; min-width: 0; }
.visio-titres h2 { margin: 0; font-size: 16px; line-height: 24px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.visio-meta { margin: 0; font-size: 13px; line-height: 18px; color: var(--muted-foreground); }
.visio-nav { display: inline-flex; align-items: center; gap: 2px; padding: 2px; border-radius: 999px; background: var(--card); box-shadow: var(--anneau-doux); flex: none; }
.visio-nav[hidden] { display: none; }
.visio-nav .btn.icone { border-radius: 50%; }
.visio-nav .btn.icone:disabled { opacity: .35; }
.visio-position { min-width: 56px; padding: 0 4px; text-align: center; font-size: 13px; color: var(--muted-foreground); font-variant-numeric: proportional-nums; }
.visio-actions { display: flex; align-items: center; gap: var(--e2); flex: none; }
.visio-actions a[hidden] { display: none; }
.visio-tete svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.visio-actions .btn { text-decoration: none; }
.visio-fermer.btn.icone { width: 40px; min-width: 40px; height: 40px; border-radius: 50%; background: var(--card); box-shadow: var(--anneau-doux); }
.visio-scene { position: relative; flex: 1; min-height: 0; margin: 0 var(--e3) var(--e3); border-radius: var(--r-carte); background: var(--muted); overflow: hidden; }
.visio-corps { position: absolute; inset: 0; display: grid; overflow: auto; overscroll-behavior: contain; }
.visio-corps:focus-visible { outline: none; }
.visio-attente { display: grid; place-items: center; padding: var(--e6); }
.visio-attente > .squelette.bloc { width: min(560px, 80%); height: min(420px, 60%); }
.squelette.grand { height: 22px; margin-bottom: var(--e3); }
.doc-sq { display: grid; gap: var(--e3); align-content: start; width: min(794px, 100%); }
.v-pdf .visio-attente { position: absolute; inset: 0; }
.visio-pdf { position: relative; display: block; width: 100%; height: 100%; border: 0; background: var(--muted); }
.visio-note { margin: 0 auto var(--e3); max-width: 794px; padding: var(--e2) var(--e4); border-radius: 999px; background: var(--teinte-ambre); color: var(--foreground); font-size: 13px; text-align: center; }

/* Message (type sans rendu, erreur) : grande pastille, nom, taille, Télécharger */
.visio-message { place-self: center; display: grid; justify-items: center; gap: var(--e2); max-width: 440px; padding: var(--e8) var(--e6); text-align: center; }
.visio-message h3 { margin: var(--e2) 0 0; font-size: 17px; line-height: 24px; overflow-wrap: anywhere; }
.visio-message p { margin: 0; font-size: 14px; color: var(--muted-foreground); }
.visio-message-actions { display: flex; gap: var(--e2); flex-wrap: wrap; justify-content: center; margin-top: var(--e3); }
.visio-message-actions .btn { min-height: 40px; text-decoration: none; }
.visio-message-actions svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.visio-grande-ico { display: grid; place-items: center; gap: 2px; width: 104px; height: 104px; padding-top: 10px; border-radius: 28px; }
.visio-grande-ico svg { width: 40px; height: 40px; }
.visio-grande-ico span { font-size: 12px; font-weight: 600; letter-spacing: .03em; }
.visio-message-ico { display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; background: var(--teinte-ambre); color: var(--avert); }
.visio-message-ico svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

/* Image : ajustée à la scène, zoom autour du point visé, déplacement en la tirant */
.visio-image { position: relative; min-height: 0; }
.visio-img-scene { position: absolute; inset: 0; display: grid; place-items: center; overflow: hidden; touch-action: none; cursor: zoom-in; user-select: none; -webkit-user-select: none; }
.visio-img-scene.zoomee { cursor: grab; }
.visio-img-scene.zoomee:active { cursor: grabbing; }
.visio-img-scene:focus-visible { outline: none; box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--ring) 40%, transparent); }
.visio-img {
  max-width: calc(100% - 48px); max-height: calc(100% - 88px); border-radius: 10px; box-shadow: 0 12px 32px -16px oklch(0.2 0.04 262 / 0.45);
  transform: translate(var(--tx, 0), var(--ty, 0)) scale(var(--zoom, 1)); transform-origin: center; will-change: transform; pointer-events: none;
  background: var(--card);
}
.visio-img.anime { transition: transform .22s var(--courbe); }
.visio-zoom {
  position: absolute; left: 50%; bottom: var(--e4); transform: translateX(-50%); z-index: 2; display: flex; align-items: center; gap: 2px; padding: 3px;
  border-radius: 999px; background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-flotte);
}
.visio-zoom .btn.icone { border-radius: 50%; }
.visio-zoom svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.visio-zoom-val { min-width: 52px; text-align: center; font-size: 13px; color: var(--muted-foreground); font-variant-numeric: proportional-nums; }

/* Son et vidéo : lecteurs natifs */
.visio-son { place-self: center; display: grid; justify-items: center; gap: var(--e2); width: min(460px, calc(100% - 32px)); padding: var(--e8) var(--e6); border-radius: var(--r-carte); background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte); text-align: center; }
.visio-son h3 { margin: var(--e2) 0 0; font-size: 16px; line-height: 24px; overflow-wrap: anywhere; }
.visio-son p { margin: 0; font-size: 13px; }
.visio-son audio { width: 100%; margin-top: var(--e3); }
.v-video { background: oklch(0.14 0.02 262); }
.v-video video { width: 100%; height: 100%; object-fit: contain; display: block; }

/* Texte brut : bloc à police mono dans une carte */
.visio-texte-cadre { padding: var(--e6); min-width: 0; }
.visio-texte {
  margin: 0 auto; max-width: 960px; padding: var(--e6); border-radius: var(--r-carte); background: var(--card); box-shadow: var(--anneau-doux), var(--ombre-carte);
  font-family: var(--mono); font-size: 13px; line-height: 20px; white-space: pre-wrap; overflow-wrap: anywhere; tab-size: 4;
}
.visio-texte:focus-visible { outline: none; box-shadow: var(--anneau-doux), var(--anneau); }

/* Document (Word, OpenDocument, RTF) : une page blanche façon document, titres, listes, tableaux */
.doc-fond { padding: var(--e8) var(--e6); min-width: 0; }
.doc-page {
  width: 100%; max-width: 794px; margin: 0 auto; padding: 64px 72px; border-radius: 10px; background: var(--card); color: var(--card-foreground);
  box-shadow: var(--anneau-doux), 0 18px 40px -28px oklch(0.2 0.04 262 / 0.4); font-size: 15px; line-height: 24px; overflow-wrap: anywhere;
}
.doc-page > :first-child { margin-top: 0; }
.doc-page p { margin: 0 0 var(--e3); }
.doc-page .doc-vide { height: var(--e3); margin: 0; }
.doc-t { margin: var(--e6) 0 var(--e3); line-height: 1.3; letter-spacing: -.015em; font-weight: 600; }
.doc-t1 { font-size: 24px; }
.doc-t2 { font-size: 19px; }
.doc-t3 { font-size: 16px; }
.doc-t4 { font-size: 15px; color: var(--muted-foreground); }
.doc-page ul, .doc-page ol { margin: 0 0 var(--e4); padding-left: var(--e6); }
.doc-page li + li { margin-top: var(--e1); }
.doc-page li::marker { color: var(--muted-foreground); }
.doc-tableau-cadre { margin: 0 0 var(--e4); overflow-x: auto; border-radius: 10px; box-shadow: var(--anneau-doux); }
.doc-tableau-cadre:focus-visible { outline: none; box-shadow: var(--anneau-doux), var(--anneau); }
.doc-tableau { width: 100%; border-collapse: collapse; font-size: 14px; line-height: 20px; }
.doc-tableau td { padding: var(--e2) var(--e3); border-bottom: 1px solid var(--border); border-right: 1px solid var(--border-soft); vertical-align: top; min-width: 96px; overflow-wrap: normal; word-break: normal; }
.doc-tableau td:last-child { border-right: 0; }
.doc-tableau tr:last-child td { border-bottom: 0; }
.doc-tableau tr:first-child td { background: var(--muted); }

/* Tableur (Excel, OpenDocument, CSV) : onglets de feuilles en pilules, grille qui défile dans son cadre */
.tab-vue { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.tab-feuilles { display: flex; gap: 6px; padding: var(--e3) var(--e3) 0; overflow-x: auto; scrollbar-width: none; flex: none; }
.tab-feuilles::-webkit-scrollbar { display: none; }
.tab-feuille {
  flex: none; min-height: 32px; padding: 0 14px; border-radius: 999px; background: var(--card); box-shadow: var(--anneau-doux);
  font-size: 13px; font-weight: 600; color: var(--foreground); transition: background-color .15s var(--courbe), color .15s var(--courbe), transform .14s var(--courbe);
}
.tab-feuille:active { transform: scale(.97); }
.tab-feuille[aria-selected="true"] { background: var(--sidebar-primary); color: var(--sidebar-primary-foreground); box-shadow: none; }
.tab-feuille:focus-visible { outline: none; box-shadow: var(--anneau); }
.tab-notes:empty { display: none; }
.tab-notes { padding: var(--e3) var(--e3) 0; }
.tab-notes .visio-note { margin-bottom: 0; }
.tab-cadre { flex: 1; min-height: 0; margin: var(--e3); overflow: auto; border-radius: 14px; background: var(--card); box-shadow: var(--anneau-doux); overscroll-behavior: contain; }
.tab-cadre:focus-visible { outline: none; box-shadow: var(--anneau-doux), var(--anneau); }
.tab-grille { border-collapse: separate; border-spacing: 0; font-size: 13px; line-height: 18px; font-variant-numeric: proportional-nums; }
.tab-grille th, .tab-grille td { height: 32px; padding: 6px 10px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); white-space: nowrap; }
.tab-grille td { min-width: 88px; max-width: 320px; overflow: hidden; text-overflow: ellipsis; background: var(--card); }
.tab-grille td.num { text-align: right; }
.tab-grille td.formule { font-family: var(--mono); font-size: 12px; color: var(--muted-foreground); }
.tab-grille thead th { position: sticky; top: 0; z-index: 2; background: var(--muted); color: var(--muted-foreground); font-size: 12px; font-weight: 600; text-align: center; }
.tab-grille tbody th { position: sticky; left: 0; z-index: 1; min-width: 44px; background: var(--muted); color: var(--muted-foreground); font-size: 12px; font-weight: 400; text-align: right; }
.tab-grille thead th.tab-coin { left: 0; z-index: 3; min-width: 44px; }
.tab-grille tbody tr:first-child td { font-weight: 600; }
.tab-vide { margin: 0; padding: var(--e6); }
.tab-sq { display: grid; grid-template-columns: 44px repeat(5, minmax(0, 1fr)); gap: 6px; width: min(720px, 100%); }
.tab-sq .squelette { height: 24px; }

/* Présentation (PowerPoint, OpenDocument) : diapositives 16:9 en cartes, miniatures à gauche */
.diapo-vue { display: grid; grid-template-columns: 176px minmax(0, 1fr); min-height: 0; min-width: 0; }
.diapo-rail { display: grid; align-content: start; gap: var(--e3); padding: var(--e4) var(--e3) var(--e4) var(--e4); overflow-y: auto; border-right: 1px solid var(--border); }
.diapo-mini { display: grid; grid-template-columns: 16px minmax(0, 1fr); align-items: start; gap: 6px; padding: 0; text-align: left; border-radius: 10px; transition: transform .14s var(--courbe); }
.diapo-mini:active { transform: scale(.97); }
.diapo-mini-num { grid-column: 1; grid-row: 1; font-size: 12px; line-height: 16px; color: var(--muted-foreground); text-align: right; }
.diapo-mini-carte {
  grid-column: 2; grid-row: 1; display: grid; align-content: start; gap: 3px; aspect-ratio: 16 / 9; padding: 8px 9px; overflow: hidden;
  border-radius: 8px; background: var(--card); box-shadow: var(--anneau-doux); transition: box-shadow .15s var(--courbe);
}
.diapo-mini-carte b { font-size: 8px; line-height: 10px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.diapo-mini-carte i { display: block; height: 3px; width: 80%; border-radius: 2px; background: var(--muted); font-size: 0; }
.diapo-mini[aria-current="true"] .diapo-mini-carte { box-shadow: 0 0 0 2px var(--primary); }
.diapo-mini[aria-current="true"] .diapo-mini-num { color: var(--foreground); font-weight: 600; }
.diapo-mini:focus-visible { outline: none; }
.diapo-mini:focus-visible .diapo-mini-carte { box-shadow: 0 0 0 2px var(--primary), var(--anneau); }
.diapo-col { display: flex; flex-direction: column; min-height: 0; min-width: 0; }
.diapo-col > .visio-note { margin: var(--e4) auto 0; }
.diapo-liste { flex: 1; min-height: 0; overflow-y: auto; display: flex; flex-direction: column; gap: var(--e6); padding: var(--e6); overscroll-behavior: contain; }
.diapo-liste:focus-visible { outline: none; box-shadow: inset 0 0 0 3px color-mix(in srgb, var(--ring) 40%, transparent); }
.diapo {
  position: relative; flex: none; width: 100%; max-width: 960px; margin: 0 auto; aspect-ratio: 16 / 9; container-type: inline-size; overflow: hidden;
  display: grid; align-content: center; gap: 3cqi; padding: 6cqi 8cqi; border-radius: 16px; background: var(--card); color: var(--card-foreground);
  box-shadow: var(--anneau-doux), 0 18px 40px -28px oklch(0.2 0.04 262 / 0.4); scroll-margin: var(--e6);
}
.diapo-titre { margin: 0; font-size: 4.6cqi; line-height: 1.2; letter-spacing: -.02em; font-weight: 600; }
.diapo-textes { margin: 0; padding-left: 1.2em; font-size: 2.7cqi; line-height: 1.45; color: var(--muted-foreground); }
p.diapo-textes { padding-left: 0; }
.diapo-textes li + li { margin-top: .5em; }
.diapo-num { position: absolute; right: 3cqi; bottom: 2.4cqi; font-size: 1.7cqi; color: var(--muted-foreground); }

/* Mail joint : en têtes en définitions, texte, pièces du mail */
.mail-page { padding: var(--e10) var(--e10) var(--e8); display: grid; gap: var(--e5); }
.mail-sujet { margin: 0; font-size: 20px; line-height: 28px; letter-spacing: -.015em; }
.mail-texte { padding-top: var(--e5); border-top: 1px solid var(--border); white-space: pre-wrap; font-size: 14px; line-height: 22px; }
.mail-pieces { display: grid; gap: var(--e2); padding-top: var(--e4); border-top: 1px solid var(--border); }
.mail-pieces h4 { margin: 0; font-size: 13px; color: var(--muted-foreground); font-weight: 600; }
.mail-pieces ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.mail-pieces li { display: flex; align-items: center; gap: var(--e3); font-size: 14px; }
.mail-pieces .pj-vig { width: 28px; height: 28px; }
.mail-pieces .pj-vig svg { width: 14px; height: 14px; }

/* Fiche réservation : la section Documents garde la grille sans bac gris */
.pn-documents .pj-grille { grid-template-columns: repeat(auto-fill, minmax(124px, 1fr)); }

@media (max-width: 820px) {
  dialog.visio {
    width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; border-radius: 0;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) env(safe-area-inset-bottom, 0px) env(safe-area-inset-left, 0px);
  }
  .visio-tete {
    display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "ico titres fermer" "nav nav actions";
    gap: var(--e2) var(--e3); padding: var(--e2) var(--e2) var(--e2) var(--e4); min-height: 0;
  }
  .visio-tete.seul { grid-template-columns: auto minmax(0, 1fr) auto auto; grid-template-areas: "ico titres actions fermer"; }
  .visio-ico { grid-area: ico; }
  .visio-ico .pj-vig { width: 36px; height: 36px; }
  .visio-titres { grid-area: titres; }
  .visio-fermer { grid-area: fermer; }
  .visio-fermer.btn.icone { width: 44px; min-width: 44px; height: 44px; }
  .visio-nav { grid-area: nav; justify-self: start; }
  .visio-nav .btn.icone { min-width: 40px; min-height: 40px; }
  .visio-actions { grid-area: actions; justify-self: end; }
  .visio-actions .btn { min-height: 40px; }
  .visio-actions .lib-btn { display: none; }
  .visio-actions .btn.petit { min-width: 40px; padding: 0; justify-content: center; }
  .visio-scene { margin: 0; border-radius: 0; }
  .doc-fond { padding: var(--e3); }
  .doc-page { padding: var(--e6) var(--e5); font-size: 15px; }
  .doc-t1 { font-size: 21px; }
  .mail-page { padding: var(--e6) var(--e5); }
  .visio-texte-cadre { padding: var(--e3); }
  .visio-texte { padding: var(--e4); }
  .diapo-vue { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .diapo-rail { grid-row: 2; display: flex; gap: var(--e2); padding: var(--e3); overflow-x: auto; overflow-y: hidden; border-right: 0; border-top: 1px solid var(--border); }
  .diapo-mini { flex: none; width: 116px; }
  .diapo-liste { padding: var(--e4); gap: var(--e4); }
  .diapo { border-radius: 12px; }
  .visio-img { max-width: calc(100% - 24px); max-height: calc(100% - 96px); }
  .pj-puce { max-width: 100%; }
  .pj-grille { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }
  .pj-filtre { min-height: 36px; }
  select.inp.pj-tri { min-height: 36px; font-size: 16px; }
  .pj-outils-d .btn { min-height: 40px; }
}
@media (prefers-reduced-motion: reduce) {
  .pj-puce:active, .pj-filtre:active, .pj-carte-ouvrir:active, .tab-feuille:active, .diapo-mini:active { transform: none; }
  .visio-img.anime, .pj-barre { transition: none; }
}
.tab-grille thead th.tab-pad, .tab-grille tr.tab-pad th { color: color-mix(in srgb, var(--muted-foreground) 70%, transparent); }
.tab-grille td.tab-pad { min-width: 88px; }

/* Corrections de la relecture des fichiers */
/* La barre d'onglets d'une fiche ne s'écrase jamais quand l'onglet Fichiers dépasse le panneau */
.pn-corps > .pn-onglets { flex: none; min-height: max-content; }
/* La vidéo tient dans la scène, contrôles compris */
.visio-corps.v-video { grid-template-rows: minmax(0, 1fr); grid-template-columns: minmax(0, 1fr); place-items: center; overflow: hidden; }
.v-video video { width: auto; height: auto; max-width: 100%; max-height: 100%; }
/* PDF : le lecteur prend la place, une ligne d'aide dessous */
.visio-corps.v-pdf { grid-template-rows: minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); }
.v-pdf .visio-pdf { height: 100%; }
.visio-aide { margin: 0; padding: 6px var(--e4); font-size: 12px; line-height: 16px; color: var(--muted-foreground); text-align: center; background: var(--muted); }
dialog.visio:focus { outline: none; }
/* Diapositives : un plancher de taille pour que le texte reste lisible sur téléphone */
.diapo-titre { font-size: max(15px, 4.6cqi); }
.diapo-textes { font-size: max(12px, 2.7cqi); }
.diapo-num { font-size: max(10px, 1.7cqi); }
@media (max-width: 820px) {
  /* La croix reste collée au bord droit, quel que soit le nombre d'actions */
  .visio-fermer.btn.icone { justify-self: end; }
  /* Une diapositive chargée s'allonge au lieu d'être coupée */
  .diapo { overflow: visible; }
  .visio-aide { display: none; }
}
@media (pointer: coarse) {
  .visio-zoom .btn.icone { width: 40px; min-width: 40px; height: 40px; min-height: 40px; }
  .pj-menu.btn.icone { top: 6px; right: 6px; width: 40px; min-width: 40px; height: 40px; min-height: 40px; }
}

/* Documents intégrés : écran Documents, sections des fiches, coquille d'éditeur.
   L'intérieur de chaque éditeur vit dans editeur-<genre>.css (contrat : EDITEURS.md). */
.docs-ecran:not([hidden]) { display: grid; gap: var(--e6); align-content: start; min-width: 0; }
.docs-creer { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: var(--e4); }
.docs-tuile {
  display: flex; align-items: center; gap: var(--e3); min-height: 72px; padding: var(--e4); text-align: left;
  font-weight: 600; font-size: 14px; color: var(--card-foreground); background: var(--card);
  border: 0; border-radius: var(--r-carte); box-shadow: var(--anneau-doux), var(--ombre-carte); cursor: pointer;
  transition: background-color .15s var(--courbe), transform .12s var(--courbe);
}
@media (hover: hover) { .docs-tuile:hover { background: var(--accent); } }
.docs-tuile:active { transform: scale(.98); }
.docs-tuile:focus-visible { outline: none; box-shadow: var(--anneau-doux), var(--anneau); }
.docs-tuile-ico, .docs-ico, .docs-vide-ico { display: grid; place-items: center; flex: none; border-radius: 50%; }
.docs-tuile-ico { width: 40px; height: 40px; }
.docs-ico { width: 36px; height: 36px; }
.docs-tuile-ico svg, .docs-ico svg, .docs-vide-ico svg, .ed-ico svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.docs-outils { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--e3); }
.docs-outils-d { display: flex; align-items: center; gap: var(--e2); flex-wrap: wrap; }
.docs-liste { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--e2); }
.docs-carte {
  position: relative; display: flex; align-items: center; gap: var(--e3); min-width: 0; padding: var(--e2) var(--e2) var(--e2) 0;
  background: var(--card); border-radius: var(--r-carte); box-shadow: var(--anneau-doux), var(--ombre-carte);
}
.docs-liste.compacte .docs-carte { box-shadow: var(--anneau-doux); border-radius: var(--r); }
.docs-ouvrir {
  display: flex; align-items: center; gap: var(--e3); flex: 1; min-width: 0; padding: var(--e1) var(--e3);
  color: inherit; text-decoration: none; border-radius: var(--r);
}
.docs-ouvrir:focus-visible { outline: none; box-shadow: var(--anneau); }
@media (hover: hover) { .docs-ouvrir:hover .docs-nom { color: var(--primary); } }
.docs-carte-t { display: grid; min-width: 0; }
.docs-nom { font-weight: 600; font-size: 14px; line-height: 20px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-carte-t small { font-size: 12px; line-height: 16px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-lie, .ed-lie a {
  display: inline-flex; align-items: center; gap: 6px; max-width: 220px; min-height: 26px; padding: 3px 10px; flex: none;
  font-size: 12px; font-weight: 600; color: var(--foreground); text-decoration: none;
  background: var(--ciel-doux); border-radius: 999px;
}
.docs-lie span, .ed-lie span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.docs-lie svg, .ed-lie svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
@media (hover: hover) { .docs-lie:hover, .ed-lie a:hover { background: color-mix(in srgb, var(--ciel) 45%, var(--card)); } }
.docs-sq { padding: var(--e3); }
.docs-vide { display: grid; justify-items: center; gap: var(--e2); padding: var(--e10) var(--e4); text-align: center; }
.docs-vide p { margin: 0; max-width: 46ch; }
.docs-vide-ico { width: 48px; height: 48px; background: var(--muted); color: var(--muted-foreground); }
.docs-zone { display: grid; gap: var(--e3); }
.docs-zone-outils { display: flex; justify-content: flex-end; }
.docs-zone-vide { margin: 0; font-size: 13px; }
@media (max-width: 820px) {
  .docs-creer { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--e3); }
  .docs-outils-d, .docs-outils-d .td-recherche { width: 100%; }
  .docs-lie { display: none; }
}

/* Coquille d'éditeur : la barre du haut, la zone de l'éditeur, le panneau d'historique */
.surface.en-editeur > .top, .surface.en-editeur > .bandeau-demo { display: none; }
.surface.en-editeur > #v-documents.vue.on { flex: 1; min-height: 0; padding: 0; gap: 0; overflow: hidden; grid-template-rows: minmax(0, 1fr); align-content: stretch; }
.editeur-hote:not([hidden]) { display: block; min-height: 0; height: 100%; }
.ed { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.ed-barre {
  display: flex; align-items: center; gap: var(--e2); flex: none; min-height: 64px; padding: var(--e2) var(--e4);
  border-bottom: 1px solid var(--border); background: var(--background);
}
.ed-ico .docs-ico { width: 32px; height: 32px; }
.ed-titres { flex: 1; min-width: 0; display: grid; gap: 2px; }
.ed-titre {
  width: 100%; min-width: 0; padding: 2px 6px; margin-left: -6px; font: inherit; font-size: 17px; font-weight: 600; line-height: 24px;
  color: var(--foreground); background: transparent; border: 1px solid transparent; border-radius: var(--r-sm);
  text-overflow: ellipsis;
}
@media (hover: hover) { .ed-titre:hover { border-color: var(--border); } }
.ed-titre:focus { outline: none; border-color: var(--ring); box-shadow: var(--anneau); background: var(--input-bg); }
.ed-sous { display: flex; align-items: center; gap: var(--e2); min-width: 0; overflow: hidden; }
.ed-etat { display: block; min-width: 0; flex: 0 1 auto; font-size: 12px; line-height: 16px; color: var(--muted-foreground); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ed-etat::before { content: ""; display: inline-block; vertical-align: 1px; margin-right: 6px; width: 6px; height: 6px; border-radius: 50%; background: var(--succes); }
.ed-etat[data-etat="attente"]::before { background: var(--muted-foreground); }
.ed-etat[data-etat="encours"]::before { background: var(--primary); }
.ed-etat[data-etat="erreur"] { color: var(--destructive); }
.ed-etat[data-etat="erreur"]::before { background: var(--destructive); }
.ed-lie { display: flex; min-width: 0; }
.ed-lie a { min-height: 22px; padding: 2px 8px; max-width: min(220px, 100%); }
.ed-actions { display: flex; align-items: center; gap: var(--e1); flex: none; }
.ed-bandeaux:empty { display: none; }
.ed-conflit {
  display: flex; flex-wrap: wrap; align-items: center; gap: var(--e3); padding: var(--e3) var(--e4);
  background: var(--teinte-ambre); border-bottom: 1px solid var(--border); font-size: 13px; line-height: 20px;
}
.ed-conflit p { margin: 0; flex: 1 1 320px; }
.ed-conflit-actions { display: flex; gap: var(--e2); flex-wrap: wrap; }
.ed-corps { flex: 1; min-height: 0; display: flex; }
.ed-zone { position: relative; flex: 1; min-width: 0; min-height: 0; overflow: auto; background: var(--sidebar); }
.ed-historique:not([hidden]) {
  display: flex; flex-direction: column; width: 300px; flex: none; overflow: auto; padding: var(--e4);
  border-left: 1px solid var(--border); background: var(--background);
}
.ed-histo-tete { display: flex; align-items: center; justify-content: space-between; gap: var(--e2); }
.ed-histo-tete h2 { margin: 0; font-size: 16px; line-height: 24px; }
.ed-histo-aide { margin: var(--e1) 0 var(--e3); font-size: 12px; line-height: 16px; }
.ed-versions { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--e1); }
.ed-version { display: flex; align-items: center; gap: var(--e2); padding: var(--e2); border-radius: var(--r); }
@media (hover: hover) { .ed-version:hover { background: var(--accent); } }
.ed-version-t { flex: 1; min-width: 0; display: grid; }
.ed-version-t b { font-size: 13px; line-height: 20px; }
.ed-version-t small { font-size: 12px; line-height: 16px; color: var(--muted-foreground); }
.ed-version-t .ed-version-apercu { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--foreground); opacity: .72; }
.ed-version.actuelle { background: var(--muted); }
@media (max-width: 820px) {
  .surface.en-editeur > #v-documents.vue.on { flex: 1; min-height: 0; overflow: hidden; }
  .ed-barre { padding: var(--e2); gap: var(--e1); }
  .ed-actions .lib-btn { display: none; }
  .ed-ico { display: none; }
  .ed-historique:not([hidden]) { position: absolute; inset: 0; width: auto; z-index: 5; border-left: 0; }
  .ed-corps { position: relative; }
}

/* PDF par l'impression du navigateur : seule la zone de l'éditeur sort sur papier. Chaque
   éditeur ajoute sa propre mise en page dans son @media print. */
@media print {
  html.impression-document, html.impression-document body { background: #fff !important; height: auto !important; overflow: visible !important; }
  html.impression-document .rail, html.impression-document .barre-icones, html.impression-document .tete-mobile,
  html.impression-document .top, html.impression-document .bandeau-demo, html.impression-document .ed-barre,
  html.impression-document .ed-bandeaux, html.impression-document .ed-historique, html.impression-document .toast,
  html.impression-document .panneau, html.impression-document #documents-liste, html.impression-document dialog { display: none !important; }
  html.impression-document .app, html.impression-document main, html.impression-document .surface,
  html.impression-document #v-documents, html.impression-document .editeur-hote, html.impression-document .ed,
  html.impression-document .ed-corps, html.impression-document .ed-zone {
    display: block !important; position: static !important; height: auto !important; min-height: 0 !important;
    overflow: visible !important; border: 0 !important; border-radius: 0 !important; padding: 0 !important;
    margin: 0 !important; box-shadow: none !important; background: none !important;
  }
}

/* Cartes des contacts et des sociétés, en tête des fiches (préfixe cc). Une teinte par nom, toujours
   la même (teinteAvatar), prise dans les jetons des graphiques : bandeau en dégradé doux et trame de
   points, avatar en initiales pâli sur la carte, texte en encre. */
.cc-teinte-0 { --cc-c: var(--chart-2); }
.cc-teinte-1 { --cc-c: var(--chart-5); }
.cc-teinte-2 { --cc-c: var(--chart-4); }
.cc-teinte-3 { --cc-c: var(--chart-1); }
.cc-teinte-4 { --cc-c: var(--chart-3); }
:root { --cc-couv-a: 38%; --cc-couv-b: 10%; --cc-trame: 22%; --cc-av: 24%; }
:root[data-theme="dark"] { --cc-couv-a: 46%; --cc-couv-b: 14%; --cc-trame: 30%; --cc-av: 30%; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --cc-couv-a: 46%; --cc-couv-b: 14%; --cc-trame: 30%; --cc-av: 30%; } }

.cc-couv {
  background:
    radial-gradient(circle at 1px 1px, color-mix(in srgb, var(--cc-c, var(--chart-3)) var(--cc-trame), transparent) 1px, transparent 1.6px) 0 0 / 12px 12px,
    radial-gradient(120% 140% at 100% 0%, color-mix(in srgb, var(--cc-c, var(--chart-3)) var(--cc-couv-a), var(--card)) 0%, transparent 62%),
    linear-gradient(135deg, color-mix(in srgb, var(--cc-c, var(--chart-3)) calc(var(--cc-couv-a) * .7), var(--card)), color-mix(in srgb, var(--cc-c, var(--chart-3)) var(--cc-couv-b), var(--card)));
}

.cc-av {
  position: relative; flex: none; display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%;
  background: color-mix(in srgb, var(--cc-c, var(--chart-3)) var(--cc-av), var(--card)); color: var(--foreground);
  box-shadow: 0 0 0 4px var(--card), 0 6px 16px -10px oklch(0.2 0.04 262 / 0.5);
  font-size: 20px; font-weight: 600; line-height: 1; letter-spacing: .01em;
}
.cc-av.carre { border-radius: 18px; }
.cc-av-canal {
  position: absolute; right: -3px; bottom: -3px; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center;
  background: var(--mail); color: var(--card); box-shadow: 0 0 0 3px var(--card);
}
.cc-av-canal.k-whatsapp { background: var(--wa); }
.cc-av-canal svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.cc-av.carre .cc-av-canal { right: -5px; bottom: -5px; }

/* Grille : 1 colonne au téléphone, 2 en tablette, 3 ou 4 sur grand écran */
.page-table .td-cadre.cc-cadre { border: 0; background: none; overflow: visible; border-radius: 0; }
.cc-grille {
  list-style: none; margin: 0; padding: 0; display: grid; gap: var(--e4);
  grid-template-columns: repeat(auto-fill, minmax(max(min(100%, 248px), calc((100% - 3 * var(--e4)) / 4)), 1fr));
}
.cc-carte {
  position: relative; display: flex; flex-direction: column; align-items: center; min-width: 0; padding: 0 var(--e4) var(--e3);
  background: var(--card); color: var(--card-foreground); border-radius: var(--r-carte, 20px); overflow: hidden; text-align: center;
  box-shadow: var(--anneau-doux), var(--ombre-carte);
}
.cc-carte > .cc-couv { align-self: stretch; height: 64px; margin: 0 calc(-1 * var(--e4)); }
.cc-carte > .cc-av { margin-top: -32px; }
.cc-nom { margin: var(--e3) 0 0; max-width: 100%; font-size: 15px; line-height: 22px; font-weight: 600; }
.cc-ouvrir { display: block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; color: var(--foreground); }
.cc-ouvrir::after { content: ""; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.cc-ouvrir:focus-visible { outline: none; }
.cc-carte:has(.cc-ouvrir:focus-visible) { box-shadow: 0 0 0 2px var(--ring), var(--ombre-carte); }
.cc-carte.ouverte { box-shadow: 0 0 0 2px color-mix(in srgb, var(--primary) 70%, transparent), var(--ombre-carte); }
.cc-sous { margin: 0; max-width: 100%; min-height: 20px; font-size: 13px; line-height: 20px; color: var(--muted-foreground); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-sep { align-self: stretch; height: 1px; margin: var(--e3) 0; background: var(--border); }
.cc-coords { list-style: none; margin: 0; padding: 0; align-self: stretch; display: grid; gap: 4px; font-size: 13px; line-height: 18px; color: var(--muted-foreground); }
.cc-coords li { display: flex; align-items: center; justify-content: center; gap: 6px; min-width: 0; }
.cc-coords li span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-coords svg { width: 14px; height: 14px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; opacity: .8; }
.cc-tags { list-style: none; margin: var(--e3) 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; max-width: 100%; }
.cc-tags-vide { height: 22px; margin-top: var(--e3); flex: none; }
.cc-tag {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; max-width: 14ch; border-radius: 999px;
  font-size: 12px; font-weight: 600; line-height: 22px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cc-tag-0 { background: var(--teinte-bleu); color: var(--bleu); }
.cc-tag-1 { background: var(--teinte-vert); color: var(--succes); }
.cc-tag-2 { background: var(--teinte-ambre); color: var(--avert); }
.cc-tag-3, .cc-tag-plus { background: var(--muted); color: var(--muted-foreground); }
.cc-pied {
  align-self: stretch; display: flex; align-items: center; justify-content: space-between; gap: var(--e2); margin-top: auto;
  padding-top: var(--e3); font-size: 12px; line-height: 16px; color: var(--muted-foreground);
}
.cc-carte > .cc-tags, .cc-carte > .cc-tags-vide { margin-bottom: var(--e3); }
.cc-pied { border-top: 1px solid var(--border-soft); }
.cc-pied-info { display: flex; align-items: center; gap: var(--e2); min-width: 0; flex-wrap: wrap; text-align: left; }
.cc-canal { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; color: var(--foreground); font-weight: 600; }
.cc-canal .dot { width: 7px; height: 7px; }
.cc-canal svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.cc-quand { white-space: nowrap; }
.cc-quand.st-act { font-size: 12px; gap: 5px; }
.cc-nonlus {
  min-width: 20px; height: 20px; padding: 0 6px; display: inline-grid; place-items: center; border-radius: 999px;
  background: var(--primary); color: var(--primary-foreground); font-size: 11px; font-weight: 600; line-height: 20px;
}
.cc-voir { display: inline-flex; align-items: center; gap: 4px; flex: none; color: var(--foreground); font-weight: 600; white-space: nowrap; }
.cc-voir svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.cc-menu {
  position: absolute; top: var(--e2); right: var(--e2); z-index: 2;
  background: color-mix(in srgb, var(--card) 72%, transparent) !important; color: var(--foreground);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.cc-carte .cc-menu.btn { color: var(--foreground); }
.cc-menu svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
@media (hover: hover) {
  .cc-carte:hover { box-shadow: var(--anneau-doux), 0 14px 32px -18px oklch(0.25 0.05 262 / 0.42); }
  .cc-carte:hover .cc-voir { color: var(--bleu); }
  .cc-menu:hover { background: var(--card) !important; }
}
@media (prefers-reduced-motion: no-preference) {
  .cc-carte { transition: translate .2s var(--courbe), box-shadow .2s var(--courbe); }
  .cc-voir svg { transition: translate .2s var(--courbe); }
  @media (hover: hover) {
    .cc-carte:hover { translate: 0 -2px; }
    .cc-carte:hover .cc-voir svg { translate: 2px 0; }
  }
  .cc-carte:active { translate: 0; transition-duration: .08s; }
}

/* Cartes squelettes pendant le chargement */
.cc-sq { gap: 0; }
.cc-sq > .cc-couv.squelette { height: 64px; border-radius: 0; background: var(--muted); }
.cc-sq > .cc-av.squelette { width: 64px; height: 64px; margin-top: -32px; border-radius: 50%; box-shadow: 0 0 0 4px var(--card); background: var(--accent); }
.cc-sq > .cc-av.squelette.carre { border-radius: 18px; }
.cc-sq > .squelette.cc-sq-nom { height: 14px; margin-top: var(--e4); }
.cc-sq > .squelette.cc-sq-sous { height: 10px; margin-top: var(--e2); }
.cc-sq > .squelette.l70, .cc-sq > .squelette.l50 { height: 10px; margin-bottom: var(--e2); }
.cc-sq > .squelette:last-child { margin-bottom: var(--e4); }

/* Bascule Cartes / Liste et tri */
.cc-vues .segment { display: inline-flex; align-items: center; gap: 6px; padding-inline: 10px; }
.cc-vues svg, .cc-trier svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.cc-tri-menu .menu-case .coche { border-radius: 50%; }
@media (max-width: 1100px) { .cc-vue-lib { display: none; } }
@media (max-width: 820px) {
  .td-droite:has(.cc-vues) { display: flex; margin-left: 0; justify-content: flex-end; }
  .td-droite:has(.cc-vues) > :not(.cc-vues):not(.cc-trier) { display: none; }
  .cc-vues .segment { min-height: 36px; min-width: 44px; justify-content: center; }
  .cc-trier { min-height: 40px; }
  .cc-grille { gap: var(--e3); }
}

/* En tête de fiche : bandeau doux, grand avatar avec la pastille du canal, nom, état, chiffres clés */
.panneau:has(.cc-heros) .pn-tete {
  position: absolute; top: 0; left: 0; right: 0; z-index: 3; min-height: 0; padding: var(--e2); border: 0; background: none; pointer-events: none;
}
.panneau:has(.cc-heros) .pn-tete > * { pointer-events: auto; }
.panneau:has(.cc-heros) .pn-titres {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}
.panneau:has(.cc-heros) .pn-actions { margin-left: auto; }
.panneau:has(.cc-heros) .pn-tete .btn.icone {
  background: color-mix(in srgb, var(--card) 72%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.panneau:has(.cc-heros) .pn-tete .btn.icone:hover { background: var(--card); }
.panneau:has(.cc-heros) .pn-corps { padding-top: 0; }
.cc-heros { display: grid; gap: var(--e2); min-width: 0; margin: 0 calc(-1 * var(--e5)); padding: 0 var(--e5) var(--e2); }
.cc-heros > .cc-couv { height: 108px; margin: 0 calc(-1 * var(--e5)); }
.cc-heros-haut { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--e3); margin-top: -44px; min-width: 0; }
.cc-av.grand { width: 88px; height: 88px; font-size: 28px; box-shadow: 0 0 0 5px var(--popover), 0 10px 24px -14px oklch(0.2 0.04 262 / 0.55); }
.cc-av.grand.carre { border-radius: 24px; }
.cc-av.grand .cc-av-canal { width: 26px; height: 26px; right: 0; bottom: 0; box-shadow: 0 0 0 3px var(--popover); }
.cc-av.grand.carre .cc-av-canal { right: -5px; bottom: -5px; }
.cc-av.grand .cc-av-canal svg { width: 14px; height: 14px; }
.cc-heros-actions { display: flex; align-items: center; gap: var(--e2); padding-bottom: var(--e1); flex: none; }
.cc-heros-actions svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.cc-heros-btn.btn:not(.pri) { background: var(--card) !important; box-shadow: var(--anneau-doux); }
.cc-heros-btn.btn:not(.pri):hover:not(:disabled) { background: var(--accent) !important; }
.cc-heros-nom { display: flex; align-items: center; flex-wrap: wrap; gap: var(--e2) var(--e3); margin-top: var(--e2); min-width: 0; }
.cc-heros-titre { margin: 0; min-width: 0; font-size: 22px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; overflow-wrap: anywhere; }
.cc-etat {
  display: inline-flex; align-items: center; gap: 6px; height: 24px; padding: 0 10px; border-radius: 999px; flex: none;
  font-size: 12px; font-weight: 600; background: var(--muted); color: var(--muted-foreground);
}
.cc-etat-point { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cc-etat.ok { background: var(--teinte-vert); color: var(--succes); }
.cc-etat.bleu { background: var(--teinte-bleu); color: var(--bleu); }
.cc-etat.ambre { background: var(--teinte-ambre); color: var(--avert); }
.cc-heros-sous { display: flex; align-items: center; flex-wrap: wrap; gap: 2px var(--e2); margin: 0; min-width: 0; font-size: 14px; line-height: 20px; color: var(--muted-foreground); }
.cc-heros-sous > span { min-width: 0; }
.cc-coupe { overflow-wrap: anywhere; }
.cc-point-sep { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .6; }
.cc-cles {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; margin: var(--e3) 0 0; padding: var(--e3) 0;
  border-block: 1px solid var(--border-soft);
}
.cc-cle { min-width: 0; padding: 0 var(--e3); }
.cc-cle + .cc-cle { border-left: 1px solid var(--border-soft); }
.cc-cle:first-child { padding-left: 0; }
.cc-cles.n5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.cc-cles.n5 .cc-cle { padding: 0 var(--e2); }
.cc-cles.n5 .cc-cle:first-child { padding-left: 0; }
.cc-cles.n3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.cc-cles dt { font-size: 12px; line-height: 16px; color: var(--muted-foreground); overflow-wrap: anywhere; hyphens: auto; }
.cc-cles dd { margin: 4px 0 0; display: grid; min-width: 0; }
.cc-cle-val { font-size: 15px; line-height: 22px; font-weight: 600; font-variant-numeric: lining-nums; overflow-wrap: anywhere; }
.cc-cles small { font-size: 12px; line-height: 16px; color: var(--muted-foreground); }

/* Champs en lignes : libellé à gauche, valeur à droite, filets fins */
.cc-lignes { display: grid; margin: 0; min-width: 0; }
.cc-ligne { display: grid; grid-template-columns: 128px minmax(0, 1fr); gap: var(--e2) var(--e4); align-items: baseline; padding: var(--e3) 0; border-bottom: 1px solid var(--border-soft); min-width: 0; }
.cc-lignes-zone { padding-top: var(--e1); }
.cc-lib { margin: 0; font-size: 13px; line-height: 20px; color: var(--muted-foreground); }
.cc-val { margin: 0; min-width: 0; font-size: 14px; line-height: 20px; overflow-wrap: anywhere; }
.cc-val a { color: var(--foreground); text-decoration: underline; text-decoration-color: var(--border-strong); }
.cc-val a:hover { text-decoration-color: currentColor; }
.cc-val .cc-tags { margin: 0; justify-content: flex-start; }
.cc-val .cc-tag { max-width: 100%; }
.cc-edition .cc-ligne { align-items: center; padding: var(--e2) 0; }
.cc-edition .cc-lib { font-weight: 600; color: var(--foreground); }
.cc-edition .cc-val { display: grid; gap: 4px; }
.cc-edition .cc-val small { font-size: 12px; line-height: 16px; }
.cc-edition textarea.inp { min-height: 64px; resize: vertical; }
.cc-lignes-pied { display: flex; justify-content: flex-end; gap: var(--e2); padding-top: var(--e4); }
@media (max-width: 520px) {
  .cc-ligne { grid-template-columns: minmax(0, 1fr); gap: 2px; }
  .cc-edition .cc-ligne { gap: 6px; padding: var(--e2) 0; }
  .cc-lignes-pied .btn { flex: 1; min-height: 44px; }
  .cc-heros-titre { font-size: 20px; line-height: 26px; }
  .cc-cles, .cc-cles.n5, .cc-cles.n3 { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: var(--e3); }
  .cc-cle:nth-child(2n + 1) { border-left: 0; padding-left: 0; }
}
@media (max-width: 820px) {
  .cc-heros { margin: 0 calc(-1 * var(--e4)); padding: 0 var(--e4) var(--e2); }
  .cc-heros > .cc-couv { margin: 0 calc(-1 * var(--e4)); height: 96px; }
  .panneau:has(.cc-heros) .pn-tete { padding-top: calc(var(--e2) + env(safe-area-inset-top, 0px)); }
  .panneau:has(.cc-heros) .pn-tete .btn.icone.discret { min-width: 44px; min-height: 44px; }
}
@media (forced-colors: active) {
  .cc-carte, .cc-heros-btn { border: 1px solid CanvasText; }
  .cc-couv { forced-color-adjust: none; }
}
/* Écran Documents : sa colonne de grille ne grandit jamais avec son contenu (piste « auto » qui
   prenait la largeur minimale des tuiles et faisait déborder l'écran à droite), comme la colonne
   minmax(0, 1fr) des autres écrans. Chaque bloc peut rétrécir, les libellés passent à la ligne. */
.docs-ecran:not([hidden]) { grid-template-columns: minmax(0, 1fr); width: 100%; }
.docs-ecran > *, .docs-creer > .docs-tuile, .docs-outils > *, .docs-liste > .docs-carte { min-width: 0; }
.docs-creer > .docs-tuile > span:last-child { min-width: 0; overflow-wrap: anywhere; }
.docs-outils-d { min-width: 0; }
.docs-outils-d .td-recherche { min-width: 0; }
@media (max-width: 420px) {
  .docs-creer { gap: var(--e2); }
  .docs-tuile { gap: var(--e2); padding: var(--e3); min-height: 64px; }
  .docs-tuile-ico { width: 34px; height: 34px; }
}
.docs-outils > .segments { max-width: 100%; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain; }
.docs-outils > .segments::-webkit-scrollbar { display: none; }
.docs-outils > .segments .segment { flex: none; }
