/* =====================================================================
   Commium Pilot · couche visuelle « Instrument » (v1)
   ---------------------------------------------------------------------
   À charger APRÈS style.css. Ce fichier ne touche à aucune logique :
   il redessine uniquement les classes existantes.

   Principe : barre latérale posée sur un cadre gris, contenu dans un
   panneau arrondi ; un seul bandeau encre (avec un cadran d'instrument,
   clin d'œil à « Piloter » et « Le point sur votre activité ») ; une
   bande de 4 indicateurs ; des cartes pour l'analyse. Une seule couleur
   d'accent (bleu outremer), réservée aux données et à l'attention.
   ===================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Mona+Sans:wdth,wght@75..125,200..900&display=swap");

:root:root{
  /* Couleurs ------------------------------------------------------- */
  --cm-frame: #EDEEF2;        /* cadre derrière la barre latérale */
  --cm-paper: #F7F7F9;        /* fond du panneau de contenu */
  --cm-surface: #FFFFFF;      /* cartes */
  --cm-surface-2: #F3F4F7;    /* creux : pistes, puces, survols */
  --cm-ink: #14151A;          /* texte principal, marque */
  --cm-ink-2: #4A4E5A;        /* texte secondaire */
  --cm-ink-3: #676C7A;        /* texte discret (4,5:1 mini sur tous les fonds) */
  --cm-ink-4: #8B909D;        /* traits secondaires (période précédente) */
  --cm-line: #E5E7EB;         /* filets */
  --cm-line-2: #D5D8DF;       /* bordures de contrôles */
  --cm-accent: #2F47E6;       /* outremer : données, compteurs, focus */
  --cm-accent-soft: #EDF0FE;
  --cm-accent-on-ink: #8C9BFF;/* accent sur fond encre */
  --cm-good: #0B7D50;
  --cm-good-soft: #E7F4ED;
  --cm-bad: #C2412D;
  --cm-bad-soft: #FBECE9;
  --cm-warn: #A86200;

  /* Typographie ---------------------------------------------------- */
  --cm-font: "Mona Sans", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --cm-wide: 112%;            /* titres et chiffres élargis, en écho au logo */

  /* Formes et mouvement -------------------------------------------- */
  --cm-r-sm: 8px;
  --cm-r: 12px;
  --cm-r-lg: 16px;
  --cm-r-xl: 20px;
  --cm-shadow-1: 0 1px 2px rgba(20, 21, 26, .05);
  --cm-shadow-2: 0 1px 2px rgba(20, 21, 26, .05), 0 14px 34px -18px rgba(20, 21, 26, .28);
  --cm-shadow-pop: 0 2px 6px rgba(20, 21, 26, .06), 0 28px 70px -24px rgba(20, 21, 26, .38);
  --cm-ease: cubic-bezier(.2, .7, .2, 1);
  --cm-ease-out: cubic-bezier(.16, 1, .3, 1);
  --cm-sidebar-w: 256px;

  /* Icônes (remplacent les caractères ☰ ✕ ⇄ ⌄ ↗ ＋ qui changent selon l'OS) */
  --cm-i-arrow: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M7 17 17 7M8.5 7H17v8.5'/%3E%3C/svg%3E");
  --cm-i-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
  --cm-i-menu: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 7h16M4 12h16M4 17h16'/%3E%3C/svg%3E");
  --cm-i-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 6l12 12M18 6 6 18'/%3E%3C/svg%3E");
  --cm-i-swap: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 8h15m-3.5-3.5L19 8l-3.5 3.5M20 16H5m3.5-3.5L5 16l3.5 3.5'/%3E%3C/svg%3E");
  --cm-i-plus: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 5v14M5 12h14'/%3E%3C/svg%3E");
  /* Cadran du bandeau : 72 graduations, 12 repères, un index outremer */
  --cm-dial: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 360 360' fill='none'%3E%3Ccircle cx='180' cy='180' r='176' stroke='white' stroke-opacity='.13'/%3E%3Ccircle cx='180' cy='180' r='168' stroke='white' stroke-opacity='.22' stroke-width='8' stroke-dasharray='.9 13.76'/%3E%3Ccircle cx='180' cy='180' r='164' stroke='white' stroke-opacity='.48' stroke-width='16' stroke-dasharray='1.6 84.27'/%3E%3Ccircle cx='180' cy='180' r='162' stroke='%238C9BFF' stroke-width='20' stroke-dasharray='2.6 1015.28' transform='rotate(-58 180 180)'/%3E%3Ccircle cx='180' cy='180' r='128' stroke='white' stroke-opacity='.07'/%3E%3C/svg%3E");

  color-scheme: light;
}

/* ---------------------------------------------------------------------
   Base
   --------------------------------------------------------------------- */
:root *,
:root *::before,
:root *::after{ box-sizing: border-box; }

:root body{
  margin: 0;
  background: var(--cm-paper);
  color: var(--cm-ink);
  font-family: var(--cm-font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

:root body button,
:root body input,
:root body select,
:root body textarea{ font-family: inherit; }

:root ::selection{ background: var(--cm-accent-soft); color: var(--cm-ink); }

:root :where(#sidebar, .app, #dialog) :is(a, button, input, select, textarea, summary, [tabindex]):focus-visible{
  outline: 2px solid var(--cm-accent);
  outline-offset: 2px;
}

/* ---------------------------------------------------------------------
   Structure : cadre + panneau (écrans larges uniquement ; en dessous,
   le tiroir mobile existant de style.css reste maître)
   --------------------------------------------------------------------- */
@media (min-width: 901px) {
  :root body{ display: block; background: var(--cm-frame); }

  :root #sidebar{
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 30;
    width: var(--cm-sidebar-w);
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    padding: 22px 14px 16px;
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: none;
    visibility: visible;
    opacity: 1;
  }

  :root .app{
    display: flex;
    flex-direction: column;
    width: auto;
    max-width: none;
    min-height: calc(100vh - 16px);
    margin: 8px 8px 8px var(--cm-sidebar-w);
    padding: 0;
    background: var(--cm-paper);
    border: 1px solid var(--cm-line);
    border-radius: var(--cm-r-xl);
    box-shadow: var(--cm-shadow-1);
    overflow: clip; /* arrondis propres sans casser l'en-tête collant */
  }

  :root #menu{ display: none; } /* la barre latérale reste visible sur grand écran */
}

/* ---------------------------------------------------------------------
   Barre latérale
   --------------------------------------------------------------------- */
:root #sidebar{
  background: var(--cm-frame);
  color: var(--cm-ink-2);
  border: 0;
  box-shadow: none;
  font-family: var(--cm-font);
}

:root #sidebar .wordmark{ display: inline-flex; align-self: flex-start; padding: 2px 8px 0; border-radius: 6px; color: var(--cm-ink); text-decoration: none; }
:root #sidebar .wordmark img{ display: block; width: auto; height: 22px; }

:root #sidebar .brand-sub{
  margin: 8px 0 16px;
  padding: 0 8px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: .16em;
  color: var(--cm-ink-3);
}

:root #sidebar .workspace{
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  padding: 9px 10px;
  background: var(--cm-surface);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-r);
  box-shadow: var(--cm-shadow-1);
}
:root #sidebar .client-logo{
  flex: none;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: var(--cm-ink);
  color: #fff;
  font: 700 13px/1 var(--cm-font);
  font-stretch: var(--cm-wide);
  letter-spacing: -.02em;
}
:root #sidebar .workspace-copy{ display: grid; gap: 1px; min-width: 0; }
:root #sidebar .workspace-copy strong{
  overflow: hidden;
  font-size: 13.5px;
  font-weight: 650;
  color: var(--cm-ink);
  white-space: nowrap;
  text-overflow: ellipsis;
}
:root #sidebar .workspace-copy small{ font-size: 11.5px; color: var(--cm-ink-3); }

:root #nav{ display: flex; flex-direction: column; gap: 1px; }

:root #nav .nav-label{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 12px 10px 5px;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .12em;
  color: var(--cm-ink-3);
}

:root #nav > a{
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 9px;
  background: transparent;
  color: var(--cm-ink-2);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.3;
  text-decoration: none;
  opacity: 1;
  filter: none;
  transition: background-color .15s var(--cm-ease), color .15s var(--cm-ease), box-shadow .15s var(--cm-ease);
}
:root #nav > a > svg{
  flex: none;
  width: 18px;
  height: 18px;
  color: var(--cm-ink-3);
  opacity: 1;
  transition: color .15s var(--cm-ease);
}
:root #nav > a > span:not([class]){ flex: 1; min-width: 0; }
:root #nav > a:hover{ background: rgba(20, 21, 26, .05); color: var(--cm-ink); }
:root #nav > a:hover > svg{ color: var(--cm-ink-2); }
:root #nav > a.active,
:root #nav > a[aria-current="page"]{
  background: var(--cm-surface);
  color: var(--cm-ink);
  font-weight: 600;
  box-shadow: 0 0 0 1px var(--cm-line), var(--cm-shadow-1);
}
:root #nav > a.active > svg,
:root #nav > a[aria-current="page"] > svg{ color: var(--cm-ink); }

:root #nav .nav-count{
  display: inline-grid;
  place-items: center;
  flex: none;
  min-width: 20px;
  height: 20px;
  margin-left: auto;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--cm-accent-soft);
  color: var(--cm-accent);
  font-size: 11px;
  font-weight: 700;
}

:root #nav .nav-separator{
  height: 1px;
  margin: 8px 10px 2px;
  border: 0;
  background: var(--cm-line-2);
}

/* Lien « tous les services » (↗) */
:root #nav .nav-section-title > a{
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  color: var(--cm-ink-3);
  font-size: 0;
  text-decoration: none;
  transition: background-color .15s, color .15s;
}
:root #nav .nav-section-title > a::before{
  content: "";
  width: 14px;
  height: 14px;
  background: currentColor;
  -webkit-mask: var(--cm-i-arrow) center / contain no-repeat;
  mask: var(--cm-i-arrow) center / contain no-repeat;
}
:root #nav .nav-section-title > a:hover{ background: rgba(20, 21, 26, .06); color: var(--cm-ink); }

/* Services : actif = point vert ; non souscrit = opportunité, pas un élément grisé */
:root #nav .module-state{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: none;
  margin-left: auto;
  font-size: 0;
  line-height: 0;
  opacity: 1;
}
:root #nav .module-state.on::before{
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cm-good);
  box-shadow: 0 0 0 3px var(--cm-good-soft);
}
:root #nav .service-nav.unsubscribed{ color: var(--cm-ink-3); }
:root #nav .service-nav.unsubscribed > svg{ color: var(--cm-ink-4); }
:root #nav .service-nav.unsubscribed .module-state{
  height: 20px;
  min-width: 20px;
  padding: 0 4px;
  border: 1px solid var(--cm-line-2);
  border-radius: 999px;
  background: transparent;
  color: var(--cm-ink-3);
  transition: border-color .2s var(--cm-ease), color .2s var(--cm-ease), background-color .2s var(--cm-ease);
}
:root #nav .service-nav.unsubscribed .module-state::before{
  content: "";
  flex: none;
  width: 10px;
  height: 10px;
  background: currentColor;
  -webkit-mask: var(--cm-i-plus) center / contain no-repeat;
  mask: var(--cm-i-plus) center / contain no-repeat;
}
:root #nav .service-nav.unsubscribed .module-state::after{
  content: "Découvrir";
  max-width: 0;
  overflow: hidden;
  font-size: 11px;
  font-weight: 650;
  line-height: 1;
  white-space: nowrap;
  transition: max-width .3s var(--cm-ease), margin .3s var(--cm-ease);
}
:root #nav .service-nav.unsubscribed:hover,
:root #nav .service-nav.unsubscribed:focus-visible{ color: var(--cm-ink); }
:root #nav .service-nav.unsubscribed:hover .module-state,
:root #nav .service-nav.unsubscribed:focus-visible .module-state{
  border-color: transparent;
  background: var(--cm-accent-soft);
  color: var(--cm-accent);
}
:root #nav .service-nav.unsubscribed:hover .module-state::after,
:root #nav .service-nav.unsubscribed:focus-visible .module-state::after{
  max-width: 72px;
  margin: 0 3px 0 4px;
}

/* Bas de barre */
:root #sidebar .sidebar-bottom{ display: grid; gap: 8px; margin-top: auto; padding-top: 18px; }
:root #sidebar .advisor{
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px;
  background: var(--cm-surface);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-r);
}
:root #sidebar .advisor .avatar{
  flex: none;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--cm-accent);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .02em;
}
:root #sidebar .advisor strong{ display: block; font-size: 13px; font-weight: 650; color: var(--cm-ink); }
:root #sidebar .advisor small{ display: block; font-size: 11.5px; color: var(--cm-ink-3); }

:root #sidebar .text-btn{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 8px 10px;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--cm-ink-2);
  font: 500 12.5px/1.3 var(--cm-font);
  text-align: left;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
:root #sidebar .text-btn:hover{ background: rgba(20, 21, 26, .05); color: var(--cm-ink); }
:root #sidebar .text-btn > span{
  flex: none;
  width: 14px;
  height: 14px;
  font-size: 0;
  background: currentColor;
  -webkit-mask: var(--cm-i-arrow) center / contain no-repeat;
  mask: var(--cm-i-arrow) center / contain no-repeat;
}

:root #sidebar .demo-note{
  margin: 0;
  padding: 10px 10px 0;
  border-top: 1px solid var(--cm-line-2);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .14em;
  line-height: 1.7;
  color: var(--cm-ink-3);
}
:root #sidebar .demo-note span{ font-size: 11.5px; font-weight: 400; letter-spacing: 0; }

/* ---------------------------------------------------------------------
   En-tête
   --------------------------------------------------------------------- */
:root .app > header{
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: auto;
  min-height: 60px;
  margin: 0;
  padding: 10px 28px;
  background: var(--cm-paper);
  background: color-mix(in srgb, var(--cm-paper) 84%, transparent);
  -webkit-backdrop-filter: saturate(1.6) blur(14px);
  backdrop-filter: saturate(1.6) blur(14px);
  border: 0;
  border-bottom: 1px solid var(--cm-line);
  box-shadow: none;
}

:root .breadcrumb{
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  font-size: 13px;
  color: var(--cm-ink-3);
}
:root .breadcrumb b{ font-weight: 400; color: var(--cm-ink-4); }
:root .breadcrumb strong{ overflow: hidden; color: var(--cm-ink); font-weight: 600; white-space: nowrap; text-overflow: ellipsis; }

:root .icon-btn{
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--cm-ink-2);
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
:root .icon-btn:hover{ background: rgba(20, 21, 26, .06); color: var(--cm-ink); }
:root #menu::before,
:root #close::before{
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  margin: auto;
  background: currentColor;
  -webkit-mask: var(--cm-i-menu) center / contain no-repeat;
  mask: var(--cm-i-menu) center / contain no-repeat;
}
:root #close::before{
  -webkit-mask-image: var(--cm-i-close);
  mask-image: var(--cm-i-close);
}

:root .header-right{ display: flex; align-items: center; gap: 8px; }

:root .notification-btn{
  position: relative;
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--cm-ink-2);
  cursor: pointer;
  transition: background-color .15s, color .15s;
}
:root .notification-btn:hover{ background: rgba(20, 21, 26, .06); color: var(--cm-ink); }
:root .notification-btn svg{ width: 19px; height: 19px; }
:root .notification-count{
  position: absolute;
  top: 3px;
  right: 3px;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--cm-accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 0 2px var(--cm-paper);
}

:root .demo-pill{
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 28px;
  padding: 0 10px;
  border: 1px solid var(--cm-line);
  border-radius: 999px;
  background: var(--cm-surface);
  color: var(--cm-ink-2);
  font-size: 12px;
  font-weight: 550;
  white-space: nowrap;
}
:root .demo-pill i{
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cm-warn);
  box-shadow: 0 0 0 3px rgba(168, 98, 0, .14);
}

:root .role{
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--cm-line-2);
  border-radius: 999px;
  background: var(--cm-surface);
  color: var(--cm-ink);
  font: 600 12.5px/1 var(--cm-font);
  white-space: nowrap;
  box-shadow: var(--cm-shadow-1);
  cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
:root .role:hover{ border-color: #C3C7D0; }
:root .role > span{
  flex: none;
  width: 14px;
  height: 14px;
  font-size: 0;
  background: currentColor;
  -webkit-mask: var(--cm-i-swap) center / contain no-repeat;
  mask: var(--cm-i-swap) center / contain no-repeat;
}

:root .avatar{
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  line-height: 1;
}
:root .app > header .avatar{
  width: 32px;
  height: 32px;
  background: var(--cm-ink);
  color: #fff;
  font-size: 11px;
  letter-spacing: .02em;
}

/* ---------------------------------------------------------------------
   Zone principale et titre de page
   --------------------------------------------------------------------- */
:root #main{
  flex: 1 0 auto;
  width: 100%;
  max-width: 1320px;
  margin: 0 auto;
  padding: 34px 40px 20px;
}

:root .eyebrow{
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  line-height: 1.4;
  color: var(--cm-ink-3);
}

:root .page-heading{
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px 32px;
  margin: 0 0 26px;
  padding: 0;
}
:root .page-heading > div:first-child{ min-width: 0; max-width: 720px; }
:root .page-heading h1{
  margin: 10px 0 10px;
  color: var(--cm-ink);
  font-family: var(--cm-font);
  font-size: clamp(30px, 1.6vw + 18px, 42px);
  font-weight: 650;
  font-stretch: var(--cm-wide);
  letter-spacing: -.032em;
  line-height: 1.04;
  text-wrap: balance;
}
:root .page-heading p{ margin: 0; font-size: 15px; color: var(--cm-ink-2); }
:root .heading-actions{ display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------------------------------------------------------------------
   Boutons et petits éléments communs
   --------------------------------------------------------------------- */
:root .btn{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--cm-line-2);
  border-radius: 10px;
  background: var(--cm-surface);
  color: var(--cm-ink);
  font: 600 13px/1 var(--cm-font);
  letter-spacing: -.005em;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--cm-shadow-1);
  cursor: pointer;
  transition: background-color .15s var(--cm-ease), border-color .15s var(--cm-ease), box-shadow .15s var(--cm-ease), transform .12s var(--cm-ease);
}
:root .btn svg{ flex: none; width: 16px; height: 16px; }
:root .btn:hover{ border-color: #C3C7D0; background: #FBFBFC; }
:root .btn:active{ transform: scale(.98); }
:root .btn.primary{ border-color: var(--cm-ink); background: var(--cm-ink); color: #fff; }
:root .btn.primary:hover{ border-color: #2B2D35; background: #2B2D35; }
:root .btn.primary svg,
:root .recommendations-teaser .btn svg{ transition: transform .2s var(--cm-ease); }
:root .btn.primary:hover svg,
:root .recommendations-teaser .btn:hover svg{ transform: translateX(2px); }

:root .date-range-button > span:last-child{
  flex: none;
  width: 14px;
  height: 14px;
  margin-right: -2px;
  font-size: 0;
  background: var(--cm-ink-3);
  -webkit-mask: var(--cm-i-chevron) center / contain no-repeat;
  mask: var(--cm-i-chevron) center / contain no-repeat;
}

:root .tag{
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 0;
  border-radius: 6px;
  background: var(--cm-surface-2);
  color: var(--cm-ink-2);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .06em;
  white-space: nowrap;
}

:root .small-link{
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 2px;
  border: 0;
  background: none;
  color: var(--cm-ink-2);
  font: 600 12.5px/1.2 var(--cm-font);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: color .15s var(--cm-ease);
}
:root .small-link:hover{ color: var(--cm-accent); }
:root .small-link svg{ width: 14px; height: 14px; transition: transform .2s var(--cm-ease); }
:root .small-link:hover svg{ transform: translateX(2px); }

/* ---------------------------------------------------------------------
   Bandeau « Le point sur votre activité »
   --------------------------------------------------------------------- */
:root .hero{
  position: relative;
  isolation: isolate;
  overflow: hidden;
  container: cm-hero / inline-size;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 24px 40px;
  height: auto;
  min-height: 0;
  margin: 0 0 16px;
  padding: 28px 32px;
  border: 0;
  border-radius: var(--cm-r-xl);
  background: var(--cm-ink);
  color: #fff;
  box-shadow: var(--cm-shadow-2);
}
:root .hero::before,
:root .hero::after{ content: none; }
:root .hero > div:first-child{ flex: 1 1 420px; min-width: 0; max-width: 620px; }
:root .hero .eyebrow{ font-size: 10.5px; color: rgba(255, 255, 255, .6); }
:root .hero h2{
  margin: 10px 0 8px;
  color: #fff;
  font-size: clamp(22px, .9vw + 14px, 28px);
  font-weight: 620;
  font-stretch: var(--cm-wide);
  letter-spacing: -.025em;
  line-height: 1.15;
  text-wrap: balance;
}
:root .hero p{ max-width: 60ch; margin: 0; color: rgba(255, 255, 255, .72); font-size: 14.5px; line-height: 1.55; }
:root .hero-right{ position: relative; display: flex; flex: none; align-items: center; gap: 14px; }
:root .hero-icon{
  position: relative;
  display: grid;
  flex: none;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  background: rgba(255, 255, 255, .05);
  color: #fff;
}
:root .hero-icon svg{ width: 20px; height: 20px; }
:root .hero-icon::before{
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: -1;
  width: 360px;
  height: 360px;
  margin: -180px 0 0 -180px;
  background: var(--cm-dial) center / contain no-repeat;
  pointer-events: none;
  animation: cm-dial 1.8s var(--cm-ease-out) .1s both;
}
/* Bandeau replié sur deux lignes : le cadran se range contre le bord droit,
   puis disparaît quand la place manque. */
@container cm-hero (max-width: 879px) {
  :root .hero-right,
:root .hero-icon{ position: static; }
  :root .hero-icon::before{ top: 50%; right: -196px; left: auto; margin: -180px 0 0; }
}
@container cm-hero (max-width: 759px) {
  :root .hero-icon::before{ display: none; }
}
:root .hero .btn.lime{
  height: 42px;
  padding: 0 18px;
  border-color: #fff;
  background: #fff;
  color: var(--cm-ink);
  box-shadow: 0 10px 24px -10px rgba(0, 0, 0, .7);
}
:root .hero .btn.lime:hover{ border-color: #E9ECF6; background: #E9ECF6; }

/* ---------------------------------------------------------------------
   Bande d'indicateurs : un seul bloc, 4 cellules séparées par des filets
   --------------------------------------------------------------------- */
:root .metrics{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  margin: 0 0 16px;
  padding: 0;
  overflow: hidden;
  background: var(--cm-line);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-r-lg);
  box-shadow: var(--cm-shadow-1);
}
:root .metrics > .metric{
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
  margin: 0;
  padding: 20px 22px 18px;
  background: var(--cm-surface);
  border: 0;
  border-radius: 0;
  box-shadow: none;
}
:root .metric-top{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--cm-ink-2);
}
:root .metric-top svg{ flex: none; width: 17px; height: 17px; color: var(--cm-ink-4); }
:root .metric-value{
  color: var(--cm-ink);
  font-size: clamp(28px, 1vw + 20px, 38px);
  font-weight: 620;
  font-stretch: var(--cm-wide);
  letter-spacing: -.035em;
  line-height: 1;
  white-space: nowrap;
}
:root .metric-foot{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
  font-size: 12px;
  color: var(--cm-ink-3);
}
:root .metric-foot .positive,
:root .metric-foot .negative,
:root .metric-foot .neutral{
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 3px 7px;
  border-radius: 6px;
  font-size: 11.5px;
  font-weight: 650;
  line-height: 1.3;
  white-space: nowrap;
}
:root .metric-foot .neutral{ white-space: normal; }
:root .metric-foot svg{ flex: none; width: 12px; height: 12px; margin-right: 3px; }
:root .metric-foot .positive{ background: var(--cm-good-soft); color: var(--cm-good); }
:root .metric-foot .negative{ background: var(--cm-bad-soft); color: var(--cm-bad); }
:root .metric-foot .neutral{ background: var(--cm-surface-2); color: var(--cm-ink-2); font-weight: 550; }

/* ---------------------------------------------------------------------
   Cartes
   --------------------------------------------------------------------- */
:root .grid-main{
  display: grid;
  grid-template-columns: minmax(0, 1.62fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 16px;
  margin: 0 0 16px;
}
:root .card{
  position: relative;
  min-width: 0;
  margin: 0;
  padding: 22px 24px 20px;
  background: var(--cm-surface);
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-r-lg);
  box-shadow: var(--cm-shadow-1);
}
:root .card-head{
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px 16px;
  margin: 0 0 16px;
}
:root .card-head h2{
  margin: 0;
  color: var(--cm-ink);
  font-size: 18px;
  font-weight: 640;
  font-stretch: 106%;
  letter-spacing: -.02em;
  line-height: 1.25;
}
:root .card-head p{ margin: 4px 0 0; font-size: 13px; color: var(--cm-ink-3); }

:root .segmented{
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  border: 1px solid var(--cm-line);
  border-radius: 10px;
  background: var(--cm-surface-2);
}
:root .segmented button{
  height: 28px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--cm-ink-3);
  font: 600 12.5px/1 var(--cm-font);
  cursor: pointer;
  transition: color .15s var(--cm-ease), background-color .15s var(--cm-ease), box-shadow .15s var(--cm-ease);
}
:root .segmented button:hover{ color: var(--cm-ink); }
:root .segmented button.active{
  background: var(--cm-surface);
  color: var(--cm-ink);
  box-shadow: 0 1px 2px rgba(20, 21, 26, .1), 0 0 0 1px rgba(20, 21, 26, .04);
}

/* ---------------------------------------------------------------------
   Graphique (svg.chart) : traits fins, grille pleine, une seule couleur
   --------------------------------------------------------------------- */
:root .chart{
  display: block;
  width: 100%;
  height: auto;
  margin: 6px 0 4px;
  overflow: visible;
  font-family: var(--cm-font);
  touch-action: pan-y;
  border-radius: 6px;
}
:root .chart text{
  fill: var(--cm-ink-3);
  font-size: 10px;
  font-weight: 500;
}
:root .chart line{
  stroke: var(--cm-line);
  stroke-width: 1;
  stroke-dasharray: none;
  vector-effect: non-scaling-stroke;
}
:root .chart linearGradient stop:first-child{ stop-color: var(--cm-accent); stop-opacity: .15; }
:root .chart linearGradient stop:last-child{ stop-color: var(--cm-accent); stop-opacity: 0; }
:root .chart polygon{ stroke: none; }
:root .chart polyline{
  fill: none;
  stroke: var(--cm-accent);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}
:root .chart polyline[stroke-dasharray]{ stroke: var(--cm-ink-4); stroke-width: 1.5; stroke-dasharray: 4 4; }
:root .chart > circle{
  fill: var(--cm-accent);
  stroke: var(--cm-surface);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  transform-box: fill-box;
  transform-origin: center;
  animation: cm-pop .5s cubic-bezier(.34, 1.56, .64, 1) 1.05s both;
}
:root .chart polygon,
:root .chart polyline{ animation: cm-wipe 1.2s var(--cm-ease-out) .15s both; }
:root .chart polyline[stroke-dasharray]{ animation-duration: .9s; }

/* Calque de survol ajouté par commium-motion.js */
:root .chart [data-cm]{ pointer-events: none; }
:root .chart .cm-cross{ stroke: var(--cm-ink-3); stroke-width: 1; vector-effect: non-scaling-stroke; }
:root .chart .cm-dot{
  fill: var(--cm-accent);
  stroke: var(--cm-surface);
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
:root .chart .cm-dot-prev{ fill: var(--cm-ink-4); }
:root .chart:focus-visible{ outline: 2px solid var(--cm-accent); outline-offset: 6px; }

:root .cm-tip{
  position: absolute;
  z-index: 5;
  min-width: 176px;
  padding: 10px 12px 11px;
  border-radius: 12px;
  background: var(--cm-ink);
  color: #fff;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: var(--cm-shadow-pop);
  pointer-events: none;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .14s var(--cm-ease), transform .14s var(--cm-ease);
}
:root .cm-tip[data-show]{ opacity: 1; transform: none; }
:root .cm-tip-head{ margin-bottom: 7px; color: rgba(255, 255, 255, .62); font-size: 11.5px; }
:root .cm-tip-row{ display: grid; grid-template-columns: 14px auto 1fr; align-items: center; gap: 8px; }
:root .cm-tip-row + .cm-tip-row{ margin-top: 4px; }
:root .cm-tip-row b{ font-size: 13px; font-weight: 650; white-space: nowrap; }
:root .cm-tip-row span{ color: rgba(255, 255, 255, .62); font-size: 11.5px; white-space: nowrap; }
:root .cm-tip-key{ width: 14px; height: 0; border-top: 2px solid var(--cm-accent-on-ink); }
:root .cm-tip-row.is-prev .cm-tip-key{ border-top: 2px dashed rgba(255, 255, 255, .55); }

:root .comparison-caption{
  margin: 2px 0 0;
  font-size: 11.5px;
  color: var(--cm-ink-3);
}
:root .chart-caption{
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--cm-line);
}
:root .legend{ display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--cm-ink-2); }
:root .legend span{ display: inline-flex; align-items: center; gap: 8px; }
:root .legend i{
  display: inline-block;
  width: 16px;
  height: 0;
  margin: 0;
  border: 0;
  border-top: 2px solid var(--cm-accent);
  border-radius: 0;
  background: none;
}
:root .legend .previous i{ border-top: 2px dashed var(--cm-ink-4); }

/* ---------------------------------------------------------------------
   Leads reçus, gagnés, perdus
   --------------------------------------------------------------------- */
:root .funnel-row{ display: grid; gap: 8px; margin: 0 0 18px; }
:root .funnel-label{
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 13px;
  font-weight: 500;
  color: var(--cm-ink-2);
}
:root .funnel-label strong{
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  color: var(--cm-ink);
  font-size: 20px;
  font-weight: 640;
  font-stretch: var(--cm-wide);
  letter-spacing: -.02em;
  line-height: 1;
}
:root .funnel-label .outcome-percent{
  min-width: 44px;
  color: var(--cm-ink-3);
  font-size: 12px;
  font-weight: 500;
  font-stretch: 100%;
  letter-spacing: 0;
  text-align: right;
}
:root .bar-track{
  position: relative;
  height: 10px;
  overflow: hidden;
  border-radius: 3px;
  background: var(--cm-surface-2);
}
:root .bar-track .bar{
  height: 100%;
  max-width: 100%;
  border-radius: 0 3px 3px 0;
  transform-origin: left center;
  animation: cm-grow 1s var(--cm-ease-out) .25s both;
}
:root .funnel-row ~ .funnel-row .bar{ animation-delay: .35s; }
:root .funnel-row ~ .funnel-row ~ .funnel-row .bar{ animation-delay: .45s; }
/* les couleurs sont posées en ligne par app.js : on les harmonise */
:root .bar-track .bar[style*="#171717" i]{ background: var(--cm-ink) !important; }
:root .bar-track .bar[style*="#198754" i]{ background: var(--cm-good) !important; }
:root .bar-track .bar[style*="#d55b4d" i]{ background: var(--cm-bad) !important; }
:root .bar-track:has(.bar[style*="#198754" i]){ background: var(--cm-good-soft); }
:root .bar-track:has(.bar[style*="#d55b4d" i]){ background: var(--cm-bad-soft); }

:root .funnel-foot{
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--cm-line);
}
:root .funnel-foot strong{
  color: var(--cm-ink);
  font-size: 34px;
  font-weight: 640;
  font-stretch: var(--cm-wide);
  letter-spacing: -.035em;
  line-height: 1;
  white-space: nowrap;
}
:root .funnel-foot p{ margin: 0; color: var(--cm-ink-3); font-size: 12.5px; line-height: 1.5; }

/* ---------------------------------------------------------------------
   Tableau des origines
   --------------------------------------------------------------------- */
:root .table-wrap{ margin: 0 -6px; overflow-x: auto; }
:root .table-wrap table{
  width: 100%;
  min-width: 460px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13.5px;
}
:root .table-wrap th{
  padding: 0 12px 10px;
  border-bottom: 1px solid var(--cm-line);
  background: none;
  color: var(--cm-ink-3);
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .08em;
  text-align: left;
  white-space: nowrap;
}
:root .table-wrap td{
  padding: 10px 12px;
  border-bottom: 1px solid var(--cm-line);
  background: none;
  color: var(--cm-ink-2);
  vertical-align: middle;
}
:root .table-wrap tbody tr:last-child td{ border-bottom: 0; }
:root .table-wrap th:not(:first-child),
:root .table-wrap td:not(:first-child){ text-align: right; }
:root .table-wrap td.amount{ color: var(--cm-ink); font-weight: 650; white-space: nowrap; }
:root .table-wrap tbody td{ transition: background-color .15s; }
:root .table-wrap tbody tr:hover td{ background: var(--cm-paper); }

:root .source{ position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; color: var(--cm-ink); font-weight: 550; }
:root .source-icon{
  display: grid;
  flex: none;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid var(--cm-line);
  border-radius: 8px;
  background: var(--cm-surface);
  color: var(--cm-ink-2);
  font-size: 13px;
  font-weight: 650;
  line-height: 1;
}
:root .source-icon svg{ width: 15px; height: 15px; }

/* Part du CA par canal, sous le nom (largeur calculée par commium-motion.js) */
:root .cm-share-table td:first-child{ position: relative; padding-bottom: 14px; }
:root .cm-share-table td:first-child::before,
:root .cm-share-table td:first-child::after{
  content: "";
  position: absolute;
  bottom: 8px;
  left: 50px;
  height: 3px;
  border-radius: 0 2px 2px 0;
}
:root .cm-share-table td:first-child::before{ right: 12px; background: var(--cm-surface-2); }
:root .cm-share-table td:first-child::after{
  width: calc((100% - 62px) * var(--cm-share, 0));
  background: var(--cm-accent);
  transform-origin: left center;
  animation: cm-grow 1s var(--cm-ease-out) .3s both;
}

:root .insight{
  margin-top: 14px;
  padding: 12px 14px;
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-r);
  background: var(--cm-paper);
  color: var(--cm-ink-2);
  font-size: 12.5px;
  line-height: 1.55;
}
:root .insight strong{ margin-right: 2px; color: var(--cm-ink); font-weight: 650; }

/* ---------------------------------------------------------------------
   Commium à vos côtés
   --------------------------------------------------------------------- */
:root .timeline-item{
  position: relative;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 14px;
  margin: 0;
  padding: 0 0 18px;
  border: 0;
}
:root .timeline-item::before{
  content: "";
  position: absolute;
  top: 38px;
  bottom: 4px;
  left: 15.5px;
  width: 1px;
  background: var(--cm-line-2);
}
:root .timeline-item:has(+ :not(.timeline-item))::before,
:root .timeline-item::after{ content: none; }
:root .timeline-bubble{
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--cm-line-2);
  border-radius: 50%;
  background: var(--cm-surface);
  color: var(--cm-ink-2);
}
:root .timeline-bubble svg{ width: 15px; height: 15px; }
:root .card-head + .timeline-item .timeline-bubble{
  border-color: transparent;
  background: var(--cm-accent-soft);
  color: var(--cm-accent);
}
:root .timeline-text strong{ display: block; color: var(--cm-ink); font-size: 13.5px; font-weight: 650; line-height: 1.35; text-wrap: pretty; }
:root .timeline-text p{ margin: 3px 0 6px; color: var(--cm-ink-2); font-size: 12.5px; line-height: 1.5; }
:root .timeline-date{ color: var(--cm-ink-3); font-size: 11.5px; }

:root .next-step{
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  margin-top: 4px;
  padding: 12px 14px 12px 12px;
  border: 1px solid var(--cm-line);
  border-radius: 14px;
  background: var(--cm-paper);
}
:root .date-box{
  display: grid;
  width: 50px;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--cm-line-2);
  border-radius: 10px;
  background: var(--cm-surface);
  text-align: center;
  box-shadow: var(--cm-shadow-1);
}
:root .date-box small{
  display: block;
  padding: 3px 0;
  background: var(--cm-accent);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: .12em;
}
:root .date-box strong{
  display: block;
  padding: 4px 0 5px;
  color: var(--cm-ink);
  font-size: 21px;
  font-weight: 650;
  font-stretch: var(--cm-wide);
  letter-spacing: -.03em;
  line-height: 1.1;
}
:root .next-step h3{ margin: 0; color: var(--cm-ink); font-size: 13.5px; font-weight: 650; }
:root .next-step p{ margin: 2px 0 0; color: var(--cm-ink-3); font-size: 12.5px; }
:root .next-step .small-link{
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--cm-line-2);
  border-radius: 50%;
  background: var(--cm-surface);
  color: var(--cm-ink);
  font-size: 0;
  transition: background-color .15s, border-color .15s, color .15s;
}
:root .next-step .small-link::before{
  content: "";
  width: 15px;
  height: 15px;
  background: currentColor;
  -webkit-mask: var(--cm-i-arrow) center / contain no-repeat;
  mask: var(--cm-i-arrow) center / contain no-repeat;
}
:root .next-step .small-link:hover{ border-color: var(--cm-ink); background: var(--cm-ink); color: #fff; }

/* ---------------------------------------------------------------------
   Recommandations
   --------------------------------------------------------------------- */
:root .recommendations-teaser{
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  margin: 0 0 16px;
  padding: 14px 24px 14px 14px;
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-r-xl);
  background: var(--cm-surface);
  box-shadow: var(--cm-shadow-1);
}
:root .teaser-banner{ height: 112px; overflow: hidden; border-radius: var(--cm-r); background: var(--cm-ink); }
:root .teaser-banner img{ display: block; width: 100%; height: 100%; object-fit: cover; }
:root .recommendations-teaser .eyebrow{ color: var(--cm-accent); }
:root .recommendations-teaser h3{
  margin: 8px 0 6px;
  color: var(--cm-ink);
  font-size: 21px;
  font-weight: 640;
  font-stretch: var(--cm-wide);
  letter-spacing: -.025em;
  line-height: 1.2;
  text-wrap: balance;
}
:root .recommendations-teaser p{ margin: 0; color: var(--cm-ink-2); font-size: 13.5px; }

:root .status-line{ margin: 22px 0 0; color: var(--cm-ink-3); font-size: 12px; text-align: center; }
:root .app > footer{
  margin: 0;
  padding: 18px 28px 24px;
  border: 0;
  background: none;
  color: var(--cm-ink-3);
  font-size: 12px;
  text-align: center;
}

/* ---------------------------------------------------------------------
   Fenêtres (dialog) et formulaires
   --------------------------------------------------------------------- */
:root #dialog{
  width: min(560px, calc(100vw - 32px));
  max-height: calc(100dvh - 48px);
  padding: 0;
  border: 0;
  border-radius: var(--cm-r-xl);
  background: var(--cm-surface);
  color: var(--cm-ink);
  box-shadow: var(--cm-shadow-pop);
}
:root #dialog[open]{ animation: cm-pop-in .22s var(--cm-ease-out) both; }
:root #dialog::backdrop{
  background: rgba(20, 21, 26, .36);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
:root #dialog .dialog-top{
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 22px 24px 0;
}
:root #dialog .dialog-top h2{
  margin: 6px 0 0;
  color: var(--cm-ink);
  font-size: 21px;
  font-weight: 640;
  font-stretch: var(--cm-wide);
  letter-spacing: -.025em;
  line-height: 1.2;
}
:root #dialog-body{ padding: 18px 24px 24px; }
:root #dialog .two-col{ display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
:root #dialog .field{ display: grid; gap: 6px; min-width: 0; }
:root #dialog .field label{ color: var(--cm-ink-2); font-size: 12.5px; font-weight: 550; }
:root #dialog input:not([type="file"]):not([type="checkbox"]):not([type="radio"]),
:root #dialog select,
:root #dialog textarea{
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--cm-line-2);
  border-radius: 10px;
  background: var(--cm-surface);
  color: var(--cm-ink);
  font: 500 14px/1.3 var(--cm-font);
  box-shadow: var(--cm-shadow-1);
  transition: border-color .15s, box-shadow .15s;
}
:root #dialog textarea{ padding: 10px 12px; }
:root #dialog input:not([type="file"]):not([type="checkbox"]):not([type="radio"]):focus,
:root #dialog select:focus,
:root #dialog textarea:focus{
  border-color: var(--cm-accent);
  box-shadow: 0 0 0 3px var(--cm-accent-soft);
  outline: none;
}
:root #dialog .import-client{
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
  padding: 12px;
  border: 1px solid var(--cm-line);
  border-radius: var(--cm-r);
  background: var(--cm-paper);
}
:root #dialog .import-client > div{ flex: 1; min-width: 0; display: grid; }
:root #dialog .client-monogram{
  display: grid;
  flex: none;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 9px;
  background: var(--cm-ink);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}
:root #dialog .report-upload{
  position: relative;
  display: grid;
  justify-items: center;
  gap: 6px;
  margin: 4px 0 10px;
  padding: 24px 18px;
  border: 1.5px dashed var(--cm-line-2);
  border-radius: 14px;
  background: var(--cm-paper);
  color: var(--cm-ink-2);
  font-size: 12.5px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background-color .15s;
}
:root #dialog .report-upload:hover{ border-color: var(--cm-accent); background: var(--cm-accent-soft); }
:root #dialog .report-upload:focus-within{ border-color: var(--cm-accent); box-shadow: 0 0 0 3px var(--cm-accent-soft); }
:root #dialog .report-upload input[type="file"]{
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
  clip-path: inset(50%);
}
:root #dialog .report-upload svg{ width: 24px; height: 24px; color: var(--cm-accent); }
:root #dialog .report-upload strong{ color: var(--cm-ink); font-size: 14px; font-weight: 650; }
:root #dialog .micro{ margin: 6px 0; color: var(--cm-ink-3); font-size: 12px; line-height: 1.5; }
:root #dialog .error{ color: var(--cm-bad); font-size: 12.5px; }
:root #dialog .error:empty{ display: none; }
:root #dialog .form-actions{ display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

:root #toast{
  max-width: min(440px, calc(100vw - 32px));
  padding: 12px 16px;
  border: 0;
  border-radius: 12px;
  background: var(--cm-ink);
  color: #fff;
  font: 500 13px/1.45 var(--cm-font);
  box-shadow: var(--cm-shadow-pop);
}

/* ---------------------------------------------------------------------
   Mouvement
   --------------------------------------------------------------------- */
@keyframes cm-dial { from { opacity: 0; transform: rotate(-40deg) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes cm-wipe { from { clip-path: inset(-12px 100% -12px -12px); } to { clip-path: inset(-12px -12px -12px -12px); } }
@keyframes cm-pop { from { opacity: 0; transform: scale(0); } to { opacity: 1; transform: scale(1); } }
@keyframes cm-grow { from { transform: scaleX(0); } }
@keyframes cm-pop-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }

@media (prefers-reduced-motion: reduce) {
  :root #sidebar *,
:root #sidebar *::before,
:root #sidebar *::after,
:root .app *,
:root .app *::before,
:root .app *::after,
:root #dialog,
:root #dialog *{
    animation: none !important;
    transition: none !important;
  }
}

/* ---------------------------------------------------------------------
   Écrans moyens et mobiles
   --------------------------------------------------------------------- */
@media (max-width: 1180px) {
  :root .grid-main{ grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 1100px) {
  :root .metrics{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
  :root body{ background: var(--cm-paper); }
  :root .app > header{
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  :root #main{
    padding-block: 26px 20px;
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
}

@media (max-width: 760px) {
  :root .page-heading{ align-items: flex-start; }
  :root .hero{ padding: 22px 20px; border-radius: var(--cm-r-lg); }
  :root .hero-right{ width: 100%; }
  :root .hero .btn.lime{ flex: 1; }
  :root .card{ padding: 18px 16px; }
  :root .chart text{ font-size: 15px; }
  :root .recommendations-teaser{ grid-template-columns: minmax(0, 1fr); gap: 16px; padding: 12px 12px 18px; }
  :root .recommendations-teaser > :not(.teaser-banner){ padding: 0 6px; }
  :root .teaser-banner{ height: 150px; }
  :root #dialog .two-col{ grid-template-columns: minmax(0, 1fr); }
}

@media (max-width: 560px) {
  :root .breadcrumb > span,
:root .breadcrumb > b,
:root .demo-pill{ display: none; }
  :root .metrics > .metric{ gap: 10px; padding: 16px 14px; }
  :root .metric-top svg{ display: none; }
  :root .metric-value{ font-size: 25px; }
  :root .funnel-foot strong{ font-size: 28px; }
  :root .chart text{ font-size: 18px; }
}

/* Compatibility with the existing screens, navigation states and dark mode.
   Only visual tokens and selectors are adapted; all application state stays intact. */
:root:root:root {
  --cm-hover: #E6E8EE;
  --cm-on-ink: #FFFFFF;
  --cm-on-accent: #FFFFFF;
  --cm-warn-soft: #FFF4E4;
  --cm-hero: #14151A;
  --cm-hero-text: #FFFFFF;
  --cm-hero-muted: #C6C8D2;
  --cm-hero-line: #494B55;
  --cm-hero-glass: #24262E;
  --cm-hero-button: #FFFFFF;
  --cm-hero-button-hover: #E9ECF6;
  --cm-hero-button-ink: #14151A;
  --cm-tip-muted: #BEC0C8;
  --cm-overlay: rgb(20 21 26 / 40%);
  --cm-thumbnail: #F0F0F2;
  --cm-rail-w: 80px;
  --cm-header-h: 64px;
  --cm-space: 8px;
  --background: var(--cm-paper);
  --surface: var(--cm-surface);
  --surface-subtle: var(--cm-surface-2);
  --surface-hover: var(--cm-hover);
  --text: var(--cm-ink);
  --text-secondary: var(--cm-ink-2);
  --text-muted: var(--cm-ink-3);
  --text-disabled: var(--cm-ink-4);
  --border: var(--cm-line);
  --border-strong: var(--cm-line-2);
  --primary: var(--cm-ink);
  --primary-hover: var(--cm-ink-2);
  --on-primary: var(--cm-on-ink);
  --success: var(--cm-good);
  --success-bg: var(--cm-good-soft);
  --warning: var(--cm-warn);
  --warning-bg: var(--cm-warn-soft);
  --danger: var(--cm-bad);
  --danger-bg: var(--cm-bad-soft);
  --focus: var(--cm-accent);
  --overlay: var(--cm-overlay);
  --header-background: var(--cm-paper);
  --font: var(--cm-font);
  --radius-sm: var(--cm-r-sm);
  --radius-md: var(--cm-r);
  --radius-lg: var(--cm-r-lg);
  --radius-xl: var(--cm-r-xl);
  --shadow-sm: var(--cm-shadow-1);
  --shadow-md: var(--cm-shadow-2);
  --shadow-lg: var(--cm-shadow-pop);
  --sidebar-width: var(--cm-sidebar-w);
  --header-height: var(--cm-header-h);
}
:root:root[data-theme="dark"] {
  color-scheme: dark;
  --cm-frame: #101116;
  --cm-paper: #17181E;
  --cm-surface: #202127;
  --cm-surface-2: #292B33;
  --cm-hover: #343741;
  --cm-ink: #F3F4F8;
  --cm-ink-2: #CFD2DD;
  --cm-ink-3: #A4A9B9;
  --cm-ink-4: #8B91A2;
  --cm-line: #353843;
  --cm-line-2: #505565;
  --cm-accent: #A4B0FF;
  --cm-accent-soft: #2C3357;
  --cm-good: #7DDEAC;
  --cm-good-soft: #203E30;
  --cm-bad: #FFA69A;
  --cm-bad-soft: #482D2C;
  --cm-warn: #EDC17E;
  --cm-warn-soft: #423623;
  --cm-on-ink: #17181E;
  --cm-on-accent: #17181E;
  --cm-tip-muted: #4A4E5A;
  --cm-overlay: rgb(0 0 0 / 65%);
  --cm-shadow-1: 0 1px 2px rgb(0 0 0 / 15%);
  --cm-shadow-2: 0 1px 2px rgb(0 0 0 / 15%), 0 14px 34px -18px rgb(0 0 0 / 40%);
  --cm-shadow-pop: 0 2px 6px rgb(0 0 0 / 20%), 0 28px 70px -24px rgb(0 0 0 / 65%);
}

:root body { font-family: var(--cm-font); }
:root :is(h1,h2,h3,.metric-value,.native-total,.plan-total strong) { font-family: var(--cm-font); }
:root :is(button,a,input,select,textarea,summary):focus-visible { outline-color: var(--cm-accent); }
:root :is(button,input,select,textarea):disabled { opacity: .45; cursor: not-allowed; }
:root :is(.btn,.icon-btn,.notification-btn,.role):disabled { transform: none; }
:root .btn { height: auto; min-height: 40px; padding: 10px 14px; line-height: 1.35; }
:root .btn:hover { background: var(--cm-surface-2); border-color: var(--cm-line-2); }
:root .btn.primary { color: var(--cm-on-ink); }
:root .btn.primary:hover { background: var(--cm-ink-2); border-color: var(--cm-ink-2); }
:root main :is(.btn.primary,.btn.lime):not(.screen-primary) { background: var(--cm-surface); color: var(--cm-ink); border-color: var(--cm-line-2); }
:root main :is(.btn.primary,.btn.lime):not(.screen-primary):hover { background: var(--cm-surface-2); }
:root :is(.icon-btn,.notification-btn,.role):hover { background: var(--cm-hover); color: var(--cm-ink); border-color: var(--cm-line-2); }
:root #nav > a:hover, :root #sidebar .text-btn:hover, :root #nav .nav-section-title > a:hover { background: var(--cm-hover); }
:root #nav .nav-section-title > a { font-size: 0 !important; }
:root #nav .service-nav.unsubscribed .module-state::after { content: none; }
:root #nav .service-nav.unsubscribed .module-state { gap: 3px; font-size: 10px; line-height: 1.2; }
:root #sidebar .brand-row { padding: 0; }
:root #sidebar .wordmark { min-width: 0; padding-inline: var(--cm-space); }
:root #sidebar .wordmark img { max-width: 100%; }
:root #sidebar .workspace-copy { flex: 1; min-width: 0; }
:root #sidebar .workspace-copy select { max-width: 100%; }
:root #sidebar .client-logo, :root .app > header .avatar, :root #dialog .client-monogram { color: var(--cm-on-ink); }
:root #sidebar .advisor .avatar, :root .notification-count, :root .date-box small { color: var(--cm-on-accent); }
:root #menu:has(svg)::before, :root #close:has(svg)::before { content: none; }
:root .role > span { padding: 0; }
:root .hero { background: var(--cm-hero); color: var(--cm-hero-text); }
:root .hero h2 { color: var(--cm-hero-text); }
:root .hero :is(.eyebrow,p) { color: var(--cm-hero-muted); }
:root .hero-icon { background: var(--cm-hero-glass); color: var(--cm-hero-text); border-color: var(--cm-hero-line); }
:root .hero .btn.lime, :root main .hero .btn.lime:not(.screen-primary) { color: var(--cm-hero-button-ink); background: var(--cm-hero-button); border-color: var(--cm-hero-button); }
:root .hero .btn.lime:hover, :root main .hero .btn.lime:not(.screen-primary):hover { background: var(--cm-hero-button-hover); border-color: var(--cm-hero-button-hover); }
:root .metric-top { min-height: 0; margin-bottom: 0; line-height: 1.4; }
:root .metric-value { font-variant-numeric: tabular-nums; }
:root .metric-foot { margin-top: auto; }
:root .metric-value.metric-pending { white-space: normal; font-size: 18px; line-height: 1.4; padding: 4px 0; }
:root :is(.positive,.stage.won,.tag.success) { color: var(--cm-good); background: var(--cm-good-soft); }
:root :is(.negative,.stage.lost) { color: var(--cm-bad); background: var(--cm-bad-soft); }
:root :is(.tag.amber,.stage.new,.warning,.caution) { color: var(--cm-warn); background: var(--cm-warn-soft); }
:root .tag { height: auto; min-height: 22px; line-height: 1.4; }
:root .tag.gray, :root .neutral { background: var(--cm-surface-2); color: var(--cm-ink-3); }
:root .cm-tip, :root #toast { color: var(--cm-on-ink); }
:root .cm-tip-head, :root .cm-tip-row span { color: var(--cm-tip-muted); }
:root .cm-tip-row.is-prev .cm-tip-key { border-color: var(--cm-tip-muted); }
:root .cm-tip-key { border-color: var(--cm-accent); }
:root .next-step .small-link:hover { color: var(--cm-on-ink); }

/* Shared surfaces not present in the supplied dashboard-only theme. */
:root :is(.rec-card,.service-card,.client-card,.campaign-panel,.native-series-grid>article,.context-rec,.followup-banner,.connector-card,.report-source-card) {
  background: var(--cm-surface); border-color: var(--cm-line); border-radius: var(--cm-r-lg); box-shadow: var(--cm-shadow-1);
}
:root :is(.module-hero,.subscription-summary,.connection-row,.reporting-month) { background: var(--cm-surface); border-color: var(--cm-line); border-radius: var(--cm-r-lg); }
:root .module-hero h1 { font-stretch: var(--cm-wide); }
:root .module-hero-image { background: var(--cm-thumbnail); }
:root .resource-card { padding: 0; }
:root .resource-preview { background: var(--cm-thumbnail); }
:root .resource-preview-type { background: var(--cm-surface-2); }
:root .journal-panel { background: transparent; border: 0; box-shadow: none; padding: 0; }
:root :is(.journal-marker,.companion-marker) { background: var(--cm-surface); color: var(--cm-ink-2); border-color: var(--cm-line-2); }
:root .journal-body { background: var(--cm-surface-2); border-color: var(--cm-line); }
:root .collaboration-main { align-items: start; }
:root .context-rec-label { color: var(--cm-accent); }
:root :is(.context-rec-icon,.followup-icon,.section-icon,.service-icon,.campaign-symbol,.rec-symbol,.notification-symbol) { background: var(--cm-surface-2); color: var(--cm-ink-2); border-color: var(--cm-line); }
:root .goal-track > span, :root .budget-track > span { background: var(--cm-accent); }
:root .goal-track > span.achieved { background: var(--cm-good); }
:root .history-line { stroke: var(--cm-accent); }
:root .history-dot { fill: var(--cm-accent); }
:root .calendar { border-color: var(--cm-line); }
:root .day { background: var(--cm-surface); border-color: var(--cm-line); }
:root .day.blank { background: var(--cm-surface-2); }
:root .day.today .day-num { background: var(--cm-accent); color: var(--cm-on-accent); }
:root .cal-event { background: var(--cm-surface-2); color: var(--cm-ink-2); }
:root .cal-event.bat { background: var(--cm-warn-soft); color: var(--cm-warn); }
:root .cal-event:hover { background: var(--cm-hover); }
:root .segmented { flex-wrap: wrap; }
:root .segmented button { height: auto; min-height: 30px; padding: 6px 12px; line-height: 1.3; }
:root .table-wrap { max-width: 100%; }
:root .table-wrap:not(:has(.cm-share-table)) :is(th,td):not(:first-child) { text-align: left; }
:root .table-wrap :is(th,td).amount { text-align: right; }
:root #dialog { width: min(680px, calc(100vw - 32px)); overflow: auto; overscroll-behavior: contain; }
:root #dialog .dialog-top { margin-bottom: 0; padding-bottom: 8px; }
:root #dialog::backdrop, :root #command-palette::backdrop { background: var(--cm-overlay); }
:root #dialog :is(input[type="checkbox"],input[type="radio"]) { min-height: 0; padding: 0; accent-color: var(--cm-accent); box-shadow: none; }
:root #dialog .goal-visible input { width: 18px; height: 18px; flex: 0 0 18px; }
:root #dialog .review-decisions input[type="radio"] { width: 1px; height: 1px; }
:root #dialog :is(input,select,textarea) { max-width: 100%; }
:root #dialog textarea { min-height: 112px; }
:root #dialog :is(.form-actions,.banner-choices,.rec-facts,.rec-card-bottom) { flex-wrap: wrap; }
:root #dialog .form-actions .btn { white-space: normal; }
:root #command-palette { background: var(--cm-surface); color: var(--cm-ink); border-color: var(--cm-line); box-shadow: var(--cm-shadow-pop); border-radius: var(--cm-r-xl); }
:root .command-option[aria-selected="true"] { background: var(--cm-accent-soft); color: var(--cm-ink); }
:root #toast { z-index: 100; }

/* Preserve the existing icon rail and 900px mobile-menu breakpoint. */
@media (min-width: 901px) {
  :root:root[data-sidebar="collapsed"] { --cm-sidebar-w: var(--cm-rail-w); }
  :root[data-sidebar="collapsed"] #sidebar { padding: 20px 10px 16px; }
  :root[data-sidebar="collapsed"] #sidebar .wordmark img { display: none; }
  :root[data-sidebar="collapsed"] #sidebar :is(.brand-sub,.workspace-copy,.workspace-dot,.demo-note,.sidebar-bottom .text-btn,.advisor>div) { display: none; }
  :root[data-sidebar="collapsed"] #sidebar .workspace { padding: 8px; margin-block: 16px; min-height: 48px; }
  :root[data-sidebar="collapsed"] #sidebar .advisor { padding: 10px 0; border: 0; background: transparent; }
  :root[data-sidebar="collapsed"] #nav > a { padding: 12px; min-height: 44px; justify-content: center; }
  :root[data-sidebar="collapsed"] #nav > a > span:not(.nav-count) { display: none; }
  :root[data-sidebar="collapsed"] #nav .nav-label { padding: 0; margin: 0; height: 0; min-height: 0; font-size: 0; line-height: 0; overflow: hidden; }
  :root[data-sidebar="collapsed"] #nav .nav-section-title { height: 32px; overflow: visible; justify-content: center; }
  :root[data-sidebar="collapsed"] #nav .nav-section-title a { font-size: 0; }
  :root[data-sidebar="collapsed"] #nav .nav-count { position: absolute; top: 1px; right: 0; min-width: 16px; height: 16px; padding: 0 3px; font-size: 9px; }
  :root[data-sidebar="collapsed"] #nav .nav-separator { margin: 8px 6px; }
}
@media (max-width: 900px) {
  :root #sidebar { background: var(--cm-frame); z-index: 40; }
  :root #sidebar.open { box-shadow: var(--cm-shadow-pop); }
  :root .app { margin: 0; border: 0; border-radius: 0; }
  :root #menu { display: inline-flex; }
  :root .app > header { min-height: var(--cm-header-h); padding-block: 8px; }
}
@media (max-width: 640px) {
  :root .app > header { gap: 8px; padding-inline: 12px; }
  :root .header-right { gap: 4px; }
  :root .app > header .avatar { display: none; }
  :root .role { padding-inline: 8px; font-size: 11px; }
  :root .role > span { display: none; }
  :root .breadcrumb { gap: 8px; flex: 1; }
  :root .breadcrumb strong { max-width: 88px; font-size: 11px; }
  :root .page-heading h1 { font-size: 30px; line-height: 1.1; }
  :root .page-heading p { font-size: 14px; }
  :root .heading-actions { gap: 8px; }
  :root .btn { font-size: 12px; padding: 10px 12px; }
  :root .heading-actions .date-range-button { min-width: 0; }
  :root .date-range-button > span:first-of-type { white-space: normal; }
  :root .hero { flex-direction: column; align-items: stretch; }
  :root .hero > div:first-child { flex: auto; }
  :root .hero h2 { font-size: 24px; }
  :root .hero p { font-size: 14px; }
  :root .hero-right { align-self: stretch; }
  :root .metrics > .metric { padding: 16px 12px; gap: 12px; }
  :root .metric-top { font-size: 12px; line-height: 1.4; }
  :root .metric-value { font-size: clamp(20px, 5.8vw, 28px); }
  :root .metric-value.metric-pending { font-size: 16px; }
  :root .metric-foot { font-size: 11px; }
  :root .metric-foot :is(.positive,.negative,.neutral) { font-size: 11px; }
  :root .card-head h2 { font-size: 18px; }
  :root .small-link { white-space: normal; line-height: 1.4; }
  :root .segmented button { padding: 8px; min-height: 36px; font-size: 12px; }
  :root .module-hero { grid-template-columns: minmax(0,1fr) 112px; }
  :root .module-hero-copy { padding: 24px 16px; }
  :root .module-hero h1 { font-size: 25px; overflow-wrap: anywhere; }
  :root .module-hero p { font-size: 12px; }
  :root #dialog { width: calc(100vw - 24px); max-height: calc(100dvh - 24px); border-radius: var(--cm-r-lg); }
  :root #dialog .dialog-top { padding: 20px 16px 8px; gap: 8px; }
  :root #dialog .dialog-top h2 { font-size: 22px; overflow-wrap: anywhere; }
  :root #dialog-body { padding: 16px; }
  :root #dialog :is(input:not([type="checkbox"]):not([type="radio"]),select,textarea) { font-size: 16px; }
  :root #dialog .form-actions { gap: 8px; }
  :root .form-actions .btn { white-space: normal; }
  :root .cm-tip { min-width: 0; max-width: calc(100% - 16px); }
  :root .cm-tip-row { gap: 6px; }
  :root #toast { left: calc(2 * var(--cm-space)); right: calc(2 * var(--cm-space)); bottom: calc(2 * var(--cm-space)); width: auto; max-width: none; overflow-wrap: anywhere; transform: translateY(12px); }
  :root #toast.show { transform: none; }
}
