/* Bureau : feuille de style unique. Mobile d'abord.
   Charte : fond lin clair, cartes blanches, demi-teintes (sauge, pêche, lavande, ocre, bleu poudré, rose). */

@font-face { font-family: "DM Sans"; src: url("../fonts/DMSans.30bbfaf1881a.ttf") format("truetype"); font-weight: 100 1000; font-style: normal; font-display: swap; }
@font-face { font-family: "DM Sans"; src: url("../fonts/DMSans-Italic.01b16af808a5.ttf") format("truetype"); font-weight: 100 1000; font-style: italic; font-display: swap; }

:root {
  --fond: #f8f5f0;
  --surface: #ffffff;
  --surface-2: #f4efe8;
  --surface-verre: rgba(255, 255, 255, .78);
  --texte: #2d2b28;
  --texte-doux: #6b655d;
  --bordure: #ece6dd;
  --bordure-forte: #ddd5c9;

  /* Encre : anthracite chaud pour les actions, terracotta pour les liens et l'accent */
  --primaire: #2e2a26;
  --primaire-fonce: #171513;
  --primaire-clair: #ece7e0;
  --lien: #9a4f33;
  --accent: #c2694a;
  --accent-fonce: #a85738;
  --accent-clair: #fbe9e0;

  /* Demi-teintes : fond / encre */
  --sauge: #e6efe9;    --sauge-encre: #3f6b5a;
  --peche: #fce8dd;    --peche-encre: #9a4f33;
  --tilleul: #edf1da;  --tilleul-encre: #4f5e1b;
  --lavande: #ece9f8;  --lavande-encre: #5b52a0;   /* pédagogie uniquement */
  --ocre: #f8eed6;     --ocre-encre: #7f5f17;
  --bleu: #e3eef7;     --bleu-encre: #3a6889;
  --rose: #f9e5ea;     --rose-encre: #a14559;

  /* Régimes : artiste-auteur (prune), micro-entreprise (noyer) */
  --prune: #f4e6f0;    --prune-encre: #7a3d6b;
  --noyer: #efe7de;    --noyer-encre: #6a4f38;

  /* États : toujours avec un point ou une icône (docs/design-system.md, 2.5) */
  --ok: #2c6b45;       --ok-fond: #dcf0e2;
  --attention: #7e4d00; --attention-fond: #fde8c4;
  --danger: #a3331d;   --danger-fond: #fbe1dc;
  --info: #3d3934;     --info-fond: #efebe5;

  --barre: #a6bdb3;    /* barres passées de l'histogramme des recettes */

  /* Échelle typographique (design-system.md, 1.1) */
  --t-h1: 2rem; --t-chiffre: 1.75rem; --t-jour: 1.5rem; --t-groupe: 1.375rem; --t-h2: 1.25rem; --t-h3: 1.125rem;
  --t-corps: 1rem; --t-second: .9375rem; --t-note: .875rem; --t-etiquette: .8125rem; --t-micro: .75rem;

  /* Espacements (base 4 px) */
  --e-1: .25rem; --e-2: .5rem; --e-3: .75rem; --e-4: 1rem; --e-5: 1.25rem; --e-6: 1.5rem; --e-8: 2rem; --e-9: 2.25rem; --e-12: 3rem;

  --rayon-flottant: 24px;
  --rayon: 20px;
  --rayon-interne: 14px;
  --rayon-petit: 12px;
  --rayon-case: 8px;
  --ombre: 0 1px 2px rgba(70, 55, 40, .04), 0 6px 22px rgba(70, 55, 40, .06);
  --ombre-forte: 0 2px 6px rgba(70, 55, 40, .06), 0 16px 40px rgba(70, 55, 40, .12);
  --police: "DM Sans", "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color-scheme: light;
}

/* Thème sombre : désactivé par défaut (l'appli reste claire même si l'ordinateur est en mode sombre).
   Il ne s'applique que si on ajoute data-theme="dark" sur la page. */
@media all {
  :root[data-theme="dark"] {
    --fond: #1b1a18;
    --surface: #24221f;
    --surface-2: #2c2a26;
    --surface-verre: rgba(36, 34, 31, .85);
    --texte: #efeae3;
    --texte-doux: #a9a197;
    --bordure: #36332e;
    --bordure-forte: #46423b;
    --primaire: #8fbba8;
    --primaire-fonce: #b4d6c7;
    --primaire-clair: #26342e;
    --accent: #e0916f;
    --accent-fonce: #f0a585;
    --accent-clair: #3a2a22;
    --sauge: #26342e;   --sauge-encre: #a9d1bf;
    --peche: #3a2a22;   --peche-encre: #f1b497;
    --lavande: #2d2a40; --lavande-encre: #c3bcf0;
    --ocre: #362f1d;    --ocre-encre: #e6c97d;
    --bleu: #1f2e3a;    --bleu-encre: #a4c8e6;
    --rose: #3a242a;    --rose-encre: #eda9b8;
    --tilleul: #2b3220; --tilleul-encre: #cdd8a0;
    --prune: #352434;   --prune-encre: #e3b5d8;
    --noyer: #33291f;   --noyer-encre: #dcc3a8;
    --ok: #8fd0a9;      --ok-fond: #1f3328;
    --attention: #e6c46e; --attention-fond: #372e17;
    --danger: #f29a8b;  --danger-fond: #3d211c;
    --info: #a4c8e6;    --info-fond: #1f2e3a;
    --ombre: 0 1px 2px rgba(0, 0, 0, .25), 0 6px 22px rgba(0, 0, 0, .25);
    --ombre-forte: 0 2px 6px rgba(0, 0, 0, .3), 0 16px 40px rgba(0, 0, 0, .4);
    color-scheme: dark;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; color: var(--texte); font: 16px/1.55 var(--police);
  background:
    radial-gradient(900px 500px at -10% -10%, var(--peche), transparent 60%),
    radial-gradient(800px 500px at 110% 0%, var(--lavande), transparent 55%),
    radial-gradient(900px 700px at 50% 120%, var(--sauge), transparent 60%),
    var(--fond);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--lien); text-underline-offset: 3px; text-decoration-thickness: 1px; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .6em; letter-spacing: -.015em; }
h1 { font-size: var(--t-h1); font-weight: 750; letter-spacing: -.025em; text-wrap: balance; }
h2 { font-size: var(--t-h2); font-weight: 700; text-wrap: balance; }
h3 { font-size: var(--t-h3); font-weight: 700; }
p { margin: 0 0 .8em; }
small, .doux { color: var(--texte-doux); }
.note { font-size: var(--t-note); color: var(--texte-doux); }
.note.sans-marge { margin: 0; }
.note.a-droite { text-align: right; }
.sous-titre-bloc { margin-top: calc(var(--e-1) * -1); color: var(--texte-doux); }
.numero { white-space: nowrap; font-variant-numeric: tabular-nums; }
.sprite { display: none; }
:where(a, button, summary, [tabindex]):focus-visible { outline: 2px solid var(--primaire); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
.icone { width: 1.2em; height: 1.2em; flex: none; vertical-align: -.22em; }
code { font-size: .9em; background: var(--surface-2); padding: .1em .35em; border-radius: 6px; }
::selection { background: var(--peche); }

/* --- Mise en page ------------------------------------------------------ */

.cadre { min-height: 100vh; }
.barre-laterale { display: none; }
.entete-mobile {
  position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .6rem;
  padding: .7rem 16px; background: var(--surface-verre); backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--bordure);
}
.entete-mobile .marque { flex: 1; text-decoration: none; color: var(--texte); }
.contenu { width: 100%; padding: 18px 16px 104px; max-width: 1120px; margin: 0 auto; }

.marque { display: flex; align-items: center; gap: .65rem; text-decoration: none; color: var(--texte); }
.marque .pastille-marque {
  display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; flex: none;
  background: conic-gradient(from 200deg, #e9b8a2, #e7d39b, #b9d3c3, #b9b2e6, #e9b8a2);
  color: #2d2b28; font-weight: 700; font-size: .85rem; letter-spacing: .02em;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .5);
}
.marque .noms { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.marque .noms strong { font-size: 1.1rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.marque .noms span { font-size: .85rem; color: var(--texte-doux); }
.marque .noms span i { font-weight: 300; }

.barre-bas {
  position: fixed; bottom: 10px; left: 10px; right: 10px; z-index: 20;
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: end;
  background: var(--surface-verre); backdrop-filter: blur(16px);
  border: 1px solid var(--bordure); border-radius: 22px; box-shadow: var(--ombre-forte);
  padding: 4px 4px calc(4px + env(safe-area-inset-bottom) * .5);
}
.barre-bas a, .barre-bas button {
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: .45rem 0 .4rem;
  font-size: var(--t-micro); font-weight: 500; color: var(--texte-doux); text-decoration: none; background: none; border: 0;
  font-family: inherit; border-radius: 16px;
}
.barre-bas .actif { color: var(--primaire); background: var(--primaire-clair); }
.barre-bas .plus span.rond {
  display: grid; place-items: center; width: 50px; height: 50px; margin-top: -26px;
  border-radius: 18px; background: linear-gradient(140deg, #d98564, var(--accent)); color: #fff;
  box-shadow: 0 8px 20px rgba(194, 105, 74, .35);
}

.menu-complet { padding: 0; border: 0; background: transparent; max-width: none; max-height: none; }
.menu-complet::backdrop { background: rgba(40, 32, 25, .3); backdrop-filter: blur(2px); }
.menu-complet .panneau {
  position: fixed; inset: 8px 8px 8px auto; width: min(320px, 86vw); background: var(--surface);
  padding: 1.1rem; overflow-y: auto; border-radius: 24px; box-shadow: var(--ombre-forte);
}

nav.principale { display: grid; gap: 2px; }
nav.principale a {
  display: flex; align-items: center; gap: .8rem; padding: var(--e-1) .6rem; min-height: 44px; border-radius: 14px;
  color: var(--texte); text-decoration: none; font-weight: 550; font-size: 1.02rem;
}
nav.principale a:hover { background: var(--surface-verre); }
nav.principale a.actif { background: var(--surface); box-shadow: var(--ombre); font-weight: 650; }
nav.principale hr { border: 0; border-top: 1px solid var(--bordure); margin: .5rem 0; }
.lien.lien-deconnexion { padding: .55rem .6rem; min-height: 44px; text-align: left; }
.menu-plus { position: fixed; inset: auto 12px 96px 12px; margin: 0; max-width: none; }
.puce {
  display: grid; place-items: center; width: 36px; height: 36px; border-radius: 11px; flex: none;
  background: var(--surface-2); color: var(--texte-doux);
}
.puce .icone { width: 19px; height: 19px; }
.t-sauge .puce, .puce.t-sauge { background: var(--sauge); color: var(--sauge-encre); }
.t-peche .puce, .puce.t-peche { background: var(--peche); color: var(--peche-encre); }
.t-lavande .puce, .puce.t-lavande { background: var(--lavande); color: var(--lavande-encre); }
.t-ocre .puce, .puce.t-ocre { background: var(--ocre); color: var(--ocre-encre); }
.t-bleu .puce, .puce.t-bleu { background: var(--bleu); color: var(--bleu-encre); }
.t-rose .puce, .puce.t-rose { background: var(--rose); color: var(--rose-encre); }
.t-tilleul .puce, .puce.t-tilleul { background: var(--tilleul); color: var(--tilleul-encre); }
.t-neutre .puce, .puce.t-neutre { background: var(--surface-2); color: var(--texte-doux); }
.puce.danger { background: var(--danger-fond); color: var(--danger); }

/* Sélecteur de régime (artiste-auteur, micro-entreprise) : menu et onglets des pages */
.choix-regime { display: grid; gap: .35rem; padding: 0 .3rem; }
.choix-regime .lab {
  font-size: var(--t-etiquette); font-weight: 600;
  color: var(--texte-doux); padding-left: .35rem;
}
.choix-regime .segments, .onglets-regime { display: grid; gap: 3px; padding: 4px; background: var(--surface-2); border-radius: 15px; }
.onglets-regime { display: inline-flex; flex-wrap: wrap; margin: 0 0 1.1rem; }
.choix-regime button, .onglets-regime .onglet {
  display: flex; align-items: center; gap: .55rem; padding: .5rem .75rem; border: 0; border-radius: 11px;
  background: none; color: var(--texte-doux); font: inherit; font-size: .95rem; font-weight: 600;
  text-align: left; text-decoration: none; cursor: pointer;
}
.choix-regime button:hover, .onglets-regime .onglet:hover { color: var(--texte); }
.choix-regime button.actif, .onglets-regime .onglet.actif { background: var(--surface); color: var(--texte); box-shadow: var(--ombre); }
.choix-regime i, .onglets-regime i { width: 10px; height: 10px; border-radius: 50%; flex: none; background: var(--bordure-forte); }
.t-prune > i { background: var(--prune-encre); }
.t-noyer > i { background: var(--noyer-encre); }
/* Régime : pastille cerclée (forme réservée aux régimes) */
.pastille.regime-prune, .pastille.regime-noyer { background: var(--surface); }
.pastille.regime-prune { color: var(--prune-encre); box-shadow: inset 0 0 0 1.5px var(--prune-encre); }
.pastille.regime-noyer { color: var(--noyer-encre); box-shadow: inset 0 0 0 1.5px var(--noyer-encre); }
.menu-complet .choix-regime { margin-bottom: 1rem; padding: 0; }

@media (min-width: 900px) {
  /* minmax(0, …) : un tableau large défile dans sa carte au lieu d'élargir toute la page */
  .cadre { display: grid; grid-template-columns: 272px minmax(0, 1fr); }
  .barre-laterale {
    display: flex; flex-direction: column; gap: 1rem; position: sticky; top: 0; height: 100vh;
    padding: 1.2rem .9rem; overflow-y: auto;
  }
  .barre-laterale .marque { padding: .2rem .4rem .4rem; }
  .barre-laterale .pied { margin-top: auto; font-size: .9rem; }
  .entete-mobile, .barre-bas { display: none; }
  .contenu { padding: 30px 36px 56px; }
}

/* --- Composants -------------------------------------------------------- */

.titre-page { display: flex; flex-wrap: wrap; align-items: center; gap: .7rem 1rem; margin-bottom: 1.5rem; }
.titre-page h1 { margin: 0; flex: 1 1 auto; }
.titre-page .sous-titre { flex-basis: 100%; margin: -.4rem 0 0; color: var(--texte-doux); }
.titre-page .actions { display: flex; flex-wrap: wrap; gap: .5rem; }
@media (max-width: 699px) {
  .titre-page .actions { width: 100%; }
  .titre-page .actions > .bouton:not(.secondaire) { order: -1; flex: 1 1 100%; }
}

.carte {
  background: var(--surface); border: 1px solid var(--bordure); border-radius: var(--rayon);
  padding: var(--e-5); box-shadow: var(--ombre); margin-bottom: 1rem;
}
.carte > h2:first-child, .carte > h3:first-child { margin-top: 0; }
.carte h2 { display: flex; align-items: center; gap: .45rem; }
.carte.teintee { border-color: transparent; box-shadow: none; }
.carte.etroite { max-width: 560px; }
.carte.t-sauge { background: var(--sauge); } .carte.t-peche { background: var(--peche); }
.carte.t-lavande { background: var(--lavande); } .carte.t-ocre { background: var(--ocre); }
.carte.t-bleu { background: var(--bleu); } .carte.t-rose { background: var(--rose); }
.grille { display: grid; gap: 1rem; margin-bottom: 1rem; }
.grille .carte { margin-bottom: 0; }
.grille > div { display: grid; gap: 1rem; align-content: start; min-width: 0; }
@media (max-width: 699px) { .grille:not(.defilant) { grid-template-columns: minmax(0, 1fr); } }
@media (min-width: 700px) {
  .grille-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grille-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* Chiffres clés */
.indicateur { display: flex; flex-direction: column; gap: .2rem; padding: 1.1rem 1.2rem; border-radius: var(--rayon); }
.indicateur .entete-ind { display: flex; align-items: center; gap: .55rem; font-size: .9rem; font-weight: 500; }
.indicateur .puce { background: var(--surface-verre); color: inherit; }
.chiffre { font-size: 1.75rem; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; line-height: 1.15; }
.indicateur small { color: inherit; opacity: .78; }
.t-sauge.indicateur { background: var(--sauge); color: var(--sauge-encre); }
.t-peche.indicateur { background: var(--peche); color: var(--peche-encre); }
.t-lavande.indicateur { background: var(--lavande); color: var(--lavande-encre); }
.t-ocre.indicateur { background: var(--ocre); color: var(--ocre-encre); }
.t-bleu.indicateur { background: var(--bleu); color: var(--bleu-encre); }
.indicateur.prochaine { background: var(--surface); color: var(--texte); box-shadow: inset 0 0 0 2px var(--accent); }
.indicateur.prochaine a { color: var(--lien); }
.chiffre.date { font-size: var(--t-groupe); }
.indicateur a { color: inherit; }

/* Sur téléphone, les chiffres clés défilent horizontalement */
@media (max-width: 699px) {
  .grille.defilant { grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px 1rem; padding: 0 16px 4px; scrollbar-width: none; }
  .grille.defilant::-webkit-scrollbar { display: none; }
  .grille.defilant > * { scroll-snap-align: start; }
  .indicateur { padding: .95rem 1rem; }
  .chiffre { font-size: 1.5rem; }
}

/* Raccourcis en tuiles */
.tuiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; margin-bottom: 1.2rem; }
@media (min-width: 700px) { .tuiles { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.tuile {
  display: flex; align-items: center; gap: .65rem; padding: .75rem .85rem; border-radius: 16px;
  background: var(--surface); border: 1px solid var(--bordure); box-shadow: var(--ombre);
  color: var(--texte); text-decoration: none; font-weight: 600; font-size: .93rem;
  transition: transform .15s ease, box-shadow .15s ease;
}
.tuile:hover { transform: translateY(-2px); box-shadow: var(--ombre-forte); }

.bouton, button.bouton {
  display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .55rem 1.1rem; border-radius: 999px; border: 1px solid transparent;
  background: var(--primaire); color: #fff; font: inherit; font-weight: 600; font-size: var(--t-second); text-decoration: none;
  cursor: pointer; min-height: 44px; box-shadow: 0 4px 14px rgba(46, 42, 38, .2);
  transition: background .15s ease, transform .1s ease, box-shadow .15s ease;
}
.bouton:hover { background: var(--primaire-fonce); }
.bouton:active { transform: translateY(1px); }
.bouton.secondaire { background: var(--surface); color: var(--texte); border-color: var(--bordure-forte); box-shadow: none; }
.bouton.secondaire:hover { background: var(--surface-2); }
.bouton.danger { background: var(--danger); box-shadow: none; }
.bouton.accent { background: var(--accent-fonce); box-shadow: 0 4px 14px rgba(168, 87, 56, .25); }
.bouton.accent:hover { background: #8f4a2f; }
.bouton.petit { padding: .3rem .8rem; min-height: 34px; font-size: var(--t-note); box-shadow: none; }
.bouton.large { width: 100%; }
.bouton .puce { width: 28px; height: 28px; border-radius: 9px; }
.bouton .puce .icone { width: 16px; height: 16px; }
.bouton[disabled] { opacity: .5; cursor: not-allowed; }
.bouton-icone { background: none; border: 0; padding: .45rem; cursor: pointer; color: inherit; display: inline-flex; border-radius: 12px; }
.bouton-icone:hover { background: var(--surface-2); }
.lien { background: none; border: 0; padding: 0; color: var(--lien); text-decoration: underline; text-underline-offset: 2px; cursor: pointer; font: inherit; }

.pastille {
  display: inline-flex; align-items: center; gap: .4rem; padding: .16rem .62rem; border-radius: 999px;
  font-size: var(--t-etiquette); font-weight: 600; background: var(--surface-2); color: var(--texte-doux); white-space: nowrap;
}
/* États (design-system.md, 2.5) : danger = à traiter maintenant, attention = à surveiller, ok = réglé, info = en cours */
.pastille.payee, .pastille.accepte, .pastille.ok { background: var(--ok-fond); color: var(--ok); }
.pastille.retard, .pastille.rembourser, .pastille.danger { background: var(--danger-fond); color: var(--danger); }
.pastille.partielle, .pastille.attention { background: var(--attention-fond); color: var(--attention); }
.pastille.attente, .pastille.envoye, .pastille.avoir, .pastille.annulee, .pastille.info { background: var(--info-fond); color: var(--info); }
.pastille.refuse { background: var(--surface-2); color: var(--texte-doux); }
.pastille.brouillon { background: var(--surface-2); color: var(--texte-doux); }
.pastille:is(.payee, .accepte, .ok, .retard, .rembourser, .danger, .partielle, .attention,
  .attente, .envoye, .avoir, .annulee, .info, .refuse, .brouillon)::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex: none;
}
.pastille.brouillon::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.pastille.prochaine { background: var(--accent-fonce); color: #fff; }

.messages { list-style: none; padding: 0; margin: 0 0 1rem; }
.messages li { padding: .75rem 1rem; border-radius: 14px; margin-bottom: .5rem; background: var(--info-fond); color: var(--info); font-weight: 500; }
.messages li.success { background: var(--ok-fond); color: var(--ok); }
.messages li.error { background: var(--danger-fond); color: var(--danger); }
.messages li.warning { background: var(--attention-fond); color: var(--attention); }

/* Tableaux : en cartes sur téléphone */
.tableau { width: 100%; border-collapse: collapse; }
.carte:has(> .tableau) { overflow-x: auto; }
.tableau th { text-align: left; font-size: var(--t-etiquette); color: var(--texte-doux); font-weight: 600; }
.tableau th, .tableau td { padding: .7rem .55rem; border-bottom: 1px solid var(--bordure); vertical-align: top; }
.tableau tbody tr:last-child td { border-bottom: 0; }
.tableau tr.cliquable { cursor: pointer; }
.tableau tr.cliquable:hover td { background: var(--surface-2); }
.tableau tr.cliquable:hover td:first-child { border-radius: 12px 0 0 12px; }
.tableau tr.cliquable:hover td:last-child { border-radius: 0 12px 12px 0; }
.tableau a { font-weight: 650; text-decoration: none; color: var(--texte); }
.tableau a:hover { color: var(--lien); }
.nombre { text-align: right !important; font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 699px) {
  .tableau.adaptatif thead { display: none; }
  .tableau.adaptatif tr { display: block; padding: .7rem 0; border-bottom: 1px solid var(--bordure); }
  .tableau.adaptatif tbody tr:last-child { border-bottom: 0; }
  .tableau.adaptatif td { display: flex; justify-content: space-between; gap: 1rem; border: 0; padding: .12rem 0; }
  .tableau.adaptatif td::before { content: attr(data-label); color: var(--texte-doux); font-size: .84rem; }
  /* Une valeur longue (nom de fichier, étiquette) passe à la ligne au lieu d'élargir la page (R2). */
  .tableau.adaptatif, .tableau.adaptatif tbody { display: block; }
  .tableau.adaptatif td { flex-wrap: wrap; row-gap: .2rem; overflow-wrap: break-word; }
  .tableau.adaptatif td > * { max-width: 100%; }
  .tableau.adaptatif td::before { flex: none; }
  .tableau.adaptatif td.nombre { text-align: right; }
}

.liste-simple { list-style: none; padding: 0; margin: 0; }
.liste-simple li { display: flex; align-items: center; gap: .75rem; padding: .7rem 0; border-bottom: 1px solid var(--bordure); }
.liste-simple li:last-child { border-bottom: 0; }
.liste-simple .principal { flex: 1; min-width: 0; }
.liste-simple .principal a { text-decoration: none; color: var(--texte); font-weight: 600; }
.liste-simple .principal a:hover { color: var(--lien); }

.vide { text-align: center; padding: 1.8rem 1rem; color: var(--texte-doux); justify-content: center; }

/* --- Listes datées (frise des déclarations, échéances) -----------------
   Colonne de date de largeur fixe : tous les titres s'alignent. */
.frise-annee, .liste-dates { list-style: none; margin: 0; padding: 0; }
.etape { display: grid; grid-template-columns: 5.2rem 1.6rem minmax(0, 1fr); position: relative; }
.etape .quand, .liste-dates .quand { display: flex; flex-direction: column; align-items: flex-end; padding-top: .9rem; line-height: 1.1; }
.etape .jour, .liste-dates .jour { font-size: 1.5rem; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.etape .mois, .liste-dates .mois { font-size: .8rem; color: var(--texte-doux); text-transform: lowercase; }
.etape .repere { position: relative; }
.etape .repere::before { content: ""; position: absolute; left: 50%; top: 0; bottom: 0; width: 2px; transform: translateX(-50%); background: var(--bordure); }
.etape:first-child .repere::before { top: 1.25rem; }
.etape:last-child .repere::before { bottom: calc(100% - 1.25rem); }
.etape .repere::after { content: ""; position: absolute; left: 50%; top: 1.05rem; width: 12px; height: 12px; transform: translateX(-50%); border-radius: 50%; background: var(--surface); border: 2px solid var(--bordure-forte); }
/* Repère d'une déclaration : teinte de la famille « ce qui est encaissé » ; la lavande reste à la pédagogie. */
.etape.declaration .repere::after { border-color: var(--sauge-encre); background: var(--sauge); }
.etape.option .repere::after { border-style: dashed; border-color: var(--ocre-encre); background: var(--surface); }
.etape.prochaine .repere::after { width: 16px; height: 16px; top: .9rem; border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 5px var(--accent-clair); }
.etape .quoi { padding: .75rem 0 1.1rem .4rem; min-width: 0; }
.etape .entete-etape { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .6rem; font-size: 1.04rem; }
.etape .quoi p { margin: .25rem 0 .5rem; color: var(--texte-doux); font-size: .94rem; max-width: 62ch; }
.etape.passe .quand, .etape.passe .entete-etape strong { color: var(--texte-doux); }
.etape.passe .jour { font-weight: 600; }
/* Prochaine étape (2.7) : carte blanche cerclée d'accent, au lieu d'un fond indiscernable de la pêche. */
.etape.prochaine .quoi { background: var(--surface); box-shadow: inset 0 0 0 2px var(--accent); border-radius: var(--rayon-interne); padding: .75rem 1rem 1rem; margin: .2rem 0 .6rem .4rem; scroll-margin-top: 90px; }
.montant-etape { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem 1rem; margin: .4rem 0 .5rem; padding: .55rem .8rem; border-radius: 12px; background: var(--surface-2); width: fit-content; max-width: 100%; }
.montant-etape span { font-size: .88rem; color: var(--texte-doux); }
.montant-etape strong { font-size: 1.15rem; font-variant-numeric: tabular-nums; }
.lien-externe { font-size: .86rem; }
.jauges { margin: .4rem 0 .6rem; }
.jauges > div { display: block; }

.liste-dates li { display: grid; grid-template-columns: 6.5rem minmax(0, 1fr) auto; gap: 1.2rem; align-items: start; padding: .9rem 0; border-bottom: 1px solid var(--bordure); }
.liste-dates li:last-child { border-bottom: 0; }
.liste-dates .quand { padding-top: .1rem; }
.liste-dates .titre-ligne { font-weight: 650; font-size: 1.02rem; }
.liste-dates .titre-ligne a { color: var(--texte); text-decoration: none; }
.liste-dates .titre-ligne a:hover { color: var(--lien); }
.liste-dates p { margin: .2rem 0 .3rem; color: var(--texte-doux); font-size: .92rem; max-width: 70ch; }
.liste-dates .action { padding-top: .1rem; }
.liste-dates li.retard .jour, .liste-dates li.retard .mois { color: var(--danger); }
.liste-dates li.proche .jour { color: var(--attention); }
.liste-dates li.faite { opacity: .6; }
.liste-dates li.vide { display: block; }
@media (max-width: 699px) {
  .etape { grid-template-columns: 3.6rem 1.3rem minmax(0, 1fr); }
  .etape .jour, .liste-dates .jour { font-size: 1.25rem; }
  .liste-dates li { grid-template-columns: 4.4rem minmax(0, 1fr); gap: .8rem; }
  .liste-dates .action { grid-column: 2; }
}

/* --- Comprendre : rubriques et fiches ----------------------------------- */
.rubrique { margin-bottom: 2rem; }
.titre-rubrique { display: flex; align-items: baseline; gap: .7rem; font-size: 1.35rem; font-weight: 750; margin: 0 0 .9rem; }
.titre-rubrique span { font-size: .82rem; font-weight: 500; color: var(--texte-doux); }
.fiches { display: grid; gap: .8rem; }
@media (min-width: 800px) { .fiches { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.fiche {
  display: flex; flex-direction: column; gap: .4rem; padding: 1.05rem 1.2rem; border-radius: 18px;
  background: var(--surface); border: 1px solid var(--bordure); box-shadow: var(--ombre); color: var(--texte); text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.fiche:hover { transform: translateY(-2px); box-shadow: var(--ombre-forte); }
.fiche strong { font-size: 1.06rem; font-weight: 700; line-height: 1.3; }
.fiche .resume { font-size: .94rem; line-height: 1.55; color: var(--texte-doux); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.fiche .lire { margin-top: auto; font-size: .86rem; font-weight: 600; color: var(--lien); }
.page-aide { font-size: 1.02rem; line-height: 1.7; }
.page-aide h1 { font-size: 2rem; margin-bottom: .4rem; }
.page-aide h2 { font-size: 1.25rem; margin: 1.6em 0 .5em; }
.page-aide p, .page-aide li { max-width: 68ch; }

/* --- Formulaires ------------------------------------------------------- */

.champ { margin-bottom: 1rem; }
.champ label, .champ .libelle { display: flex; align-items: center; gap: .35rem; font-weight: 600; font-size: .9rem; margin-bottom: .3rem; }
.champ .aide-champ { font-size: .84rem; color: var(--texte-doux); margin-top: .25rem; }
.champ .erreur { color: var(--danger); font-size: .87rem; margin-top: .25rem; font-weight: 500; }
.champ.en-erreur input, .champ.en-erreur select, .champ.en-erreur textarea { border-color: var(--danger); background: var(--danger-fond); }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=datetime-local],
input[type=password], input[type=url], input[type=search], input[type=tel], input:not([type]), select, textarea {
  width: 100%; padding: .6rem .8rem; border: 1px solid var(--bordure-forte); border-radius: var(--rayon-petit);
  background: var(--surface); color: var(--texte); font: inherit; min-height: 46px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primaire); box-shadow: 0 0 0 4px var(--primaire-clair); }
input[type=color] { width: 64px; height: 46px; padding: 4px; border: 1px solid var(--bordure-forte); border-radius: var(--rayon-petit); background: var(--surface); }
input[type=file] { font: inherit; max-width: 100%; }
.case-champ { display: flex; align-items: flex-start; gap: .55rem; font-weight: 500 !important; }
.case-champ input { width: 1.2rem; height: 1.2rem; margin-top: .15rem; accent-color: var(--primaire); }
.choix-radio { display: flex; flex-wrap: wrap; gap: .5rem; }
.choix-radio label { font-weight: 500 !important; display: flex; gap: .45rem; align-items: center; padding: .45rem .85rem; border: 1px solid var(--bordure-forte); border-radius: 999px; background: var(--surface); cursor: pointer; margin: 0; }
.choix-radio label:has(input:checked) { border-color: var(--primaire); background: var(--primaire-clair); color: var(--primaire-fonce); }
.choix-radio input { accent-color: var(--primaire); }
.choix-radio ul, .choix-radio div { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: .5rem; }
.grille-champs { display: grid; gap: 0 1rem; grid-template-columns: minmax(0, 1fr); }
@media (min-width: 700px) { .grille-champs { grid-template-columns: repeat(2, minmax(0, 1fr)); } .grille-champs .large { grid-column: 1 / -1; } }
.barre-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem; margin-top: 1rem; }
.filtres { display: flex; flex-wrap: wrap; gap: .5rem; align-items: end; margin-bottom: 1rem; }
.filtres > * { flex: 1 1 150px; }
.filtres label { font-size: .84rem; color: var(--texte-doux); display: grid; gap: .2rem; }
.filtres .bouton { flex: 0 0 auto; }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; min-width: 0; }
legend { display: flex; align-items: center; gap: .4rem; font-weight: 700; font-size: 1.05rem; margin-bottom: .7rem; padding: 0; }

/* Lignes de devis/facture (docs/design-system.md, 3.18).
   Téléphone : un bloc numéroté, désignation puis détail, activité, et les chiffres sur une rangée.
   Bureau (≥ 1000 px) : une rangée alignée sur l'en-tête des colonnes ; la colonne « Montant » a une
   largeur fixe et la croix a sa propre colonne : rien ne bouge pendant la saisie. */
.lignes .aide-lignes { margin: calc(var(--e-1) * -1) 0 var(--e-3); }
.lignes .liste-lignes { counter-reset: ligne; }
.lignes .ligne {
  position: relative; display: grid; gap: 0 var(--e-3); padding: var(--e-3) var(--e-4) var(--e-2);
  border: 1px solid var(--bordure); border-radius: var(--rayon-interne); margin-bottom: var(--e-3); background: var(--surface-2);
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr) minmax(0, 1fr);
  grid-template-areas: "tete tete tete" "desig desig desig" "detail detail detail" "activite activite activite" "qte unite prix" "montant montant montant";
}
.lignes .ligne:not(.supprimee) { counter-increment: ligne; }
.lignes .ligne.supprimee { display: none; }
.lignes .ligne > .erreur { grid-column: 1 / -1; }
.lignes .tete-ligne { grid-area: tete; display: flex; align-items: center; justify-content: space-between; font-size: var(--t-etiquette); font-weight: 600; color: var(--texte-doux); margin-bottom: var(--e-1); }
.lignes .num-ligne::after { content: " " counter(ligne); }
.lignes .ligne .supprimer-ligne { margin-right: -.45rem; color: var(--texte-doux); }
.lignes .ligne .supprimer-ligne:hover { color: var(--danger); background: var(--danger-fond); }
.lignes .ligne .champ { margin: 0 0 var(--e-3); min-width: 0; }
.lignes .ligne label, .lignes .ligne .libelle { font-size: var(--t-etiquette); }
.lignes .ligne input, .lignes .ligne select, .lignes .ligne textarea { background: var(--surface); }
.lignes .ligne textarea { min-height: 46px; resize: vertical; overflow: hidden; }
.lignes .c-desig { grid-area: desig; } .lignes .c-detail { grid-area: detail; } .lignes .c-activite { grid-area: activite; }
.lignes .c-quantite { grid-area: qte; } .lignes .c-unite { grid-area: unite; } .lignes .c-prix { grid-area: prix; }
.lignes .c-quantite input, .lignes .c-prix input { text-align: right; font-variant-numeric: tabular-nums; }
.lignes .c-quantite input, .lignes .c-unite select, .lignes .c-prix input { padding-inline: .65rem; }
.lignes .l-montant { grid-area: montant; display: flex; justify-content: space-between; align-items: baseline; padding: .45rem 0 .35rem; border-top: 1px dashed var(--bordure-forte); }
.lignes .l-montant .libelle { font-weight: 600; color: var(--texte-doux); }
.lignes .montant-ligne { font-weight: 700; font-size: var(--t-corps); font-variant-numeric: tabular-nums; white-space: nowrap; }
.lignes .montant-ligne.vide { color: var(--texte-doux); font-weight: 500; }
.lignes .entete-colonnes { display: none; }
@media (min-width: 1000px) {
  .lignes .entete-colonnes, .lignes .ligne { grid-template-columns: minmax(0, 1fr) 4.5rem 7.5rem 7rem 7rem 2.75rem; }
  .lignes .entete-colonnes { display: grid; gap: 0 var(--e-3); padding: 0 var(--e-4) var(--e-2); font-size: var(--t-etiquette); font-weight: 600; color: var(--texte-doux); }
  .lignes .ligne { grid-template-areas: "desig qte unite prix montant suppr" "detail . . . . ." "activite . . . . ."; padding: var(--e-3) var(--e-4) var(--e-1); }
  .lignes .tete-ligne { display: contents; }
  .lignes .num-ligne { display: none; }
  .lignes .ligne .supprimer-ligne { grid-area: suppr; align-self: start; justify-self: end; margin: 0; width: 44px; height: 46px; }
  /* Les libellés restent lisibles par les lecteurs d'écran ; l'en-tête des colonnes les montre. */
  .lignes .ligne .champ:not(.c-activite) .libelle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .lignes .l-montant { border: 0; padding: 0; height: 46px; align-items: center; justify-content: flex-end; }
  .lignes .l-montant .libelle { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .lignes .ligne .c-activite { display: flex; align-items: center; gap: var(--e-2); margin-bottom: var(--e-2); }
  .lignes .ligne .c-activite .libelle label { margin: 0; font-size: var(--t-note); font-weight: 500; color: var(--texte-doux); }
  .lignes .c-activite select { width: auto; min-width: 16rem; min-height: 38px; padding-block: .35rem; font-size: var(--t-note); }
}
.total-piece { display: flex; justify-content: flex-end; align-items: baseline; gap: 1rem; font-size: var(--t-h2); font-weight: 700; font-variant-numeric: tabular-nums; margin: var(--e-3) 0 var(--e-1); }
.total-piece span:first-child { font-size: var(--t-note); font-weight: 600; color: var(--texte-doux); }

/* Barre d'actions collante (3.24) : au-dessus de la barre du bas sur téléphone, en bas du contenu au bureau. */
.barre-actions.collante {
  position: sticky; z-index: 15; bottom: calc(84px + env(safe-area-inset-bottom)); justify-content: flex-end; flex-wrap: nowrap;
  margin: var(--e-4) -16px 0; padding: var(--e-3) 16px; gap: var(--e-2);
  background: var(--surface-verre); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-top: 1px solid var(--bordure);
}
.barre-actions.collante .total-barre { margin-right: auto; display: grid; line-height: 1.2; }
.barre-actions.collante .total-barre span { font-size: var(--t-etiquette); color: var(--texte-doux); }
.barre-actions.collante .total-barre strong { font-size: var(--t-h3); font-variant-numeric: tabular-nums; white-space: nowrap; }
@media (max-width: 699px) { .barre-actions.collante .bouton { padding-inline: .9rem; } }
@media (min-width: 900px) {
  .barre-actions.collante { bottom: 0; margin: var(--e-4) 0 0; padding: var(--e-3) var(--e-4); border: 1px solid var(--bordure); border-bottom: 0; border-radius: var(--rayon-interne) var(--rayon-interne) 0 0; }
}
/* Libellé long au bureau, court sur téléphone, pour qu'un bouton ne passe jamais sur deux lignes (3.5). */
.court { display: none; }
@media (max-width: 699px) { .long { display: none; } .court { display: inline; } }

.tranche { display: grid; grid-template-columns: 7rem minmax(0, 1fr) 2.5rem; gap: .6rem; align-items: end; padding: .6rem .8rem 0; margin-bottom: .5rem; border-radius: 14px; background: var(--surface-2); }
.tranche .champ { margin-bottom: .6rem; }
.tranche .bouton-icone { margin-bottom: .75rem; color: var(--texte-doux); }
.echeancier { width: 100%; border-collapse: collapse; }
.echeancier td { padding: .75rem .5rem; border-bottom: 1px solid var(--bordure); vertical-align: middle; }
.echeancier tr:last-child td { border-bottom: 0; }
.echeancier .pct { width: 4.5rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.echeancier .quoi .doux { font-size: var(--t-note); }
.echeancier .mt { width: 8rem; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.echeancier .act { width: 1%; text-align: right; white-space: nowrap; }
.echeancier .act .lien-piece { display: inline-flex; flex-wrap: nowrap; align-items: center; justify-content: flex-end; gap: var(--e-2); }
.echeancier .solde td { font-weight: 600; }
.pct-tel { display: none; }
/* Téléphone (3.19) : « Acompte n°1 · à la commande · 30 % » et le montant, l'action dessous en pleine largeur. */
@media (max-width: 699px) {
  .echeancier, .echeancier tbody { display: block; }
  .echeancier tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .3rem .75rem; padding: .8rem 0; border-bottom: 1px solid var(--bordure); }
  .echeancier tr:last-child { border-bottom: 0; }
  .echeancier td { display: block; padding: 0; border: 0; width: auto; }
  .echeancier .pct { display: none; }
  .pct-tel { display: inline; }
  .echeancier .mt { text-align: right; }
  .echeancier .act { grid-column: 1 / -1; width: auto; text-align: left; white-space: normal; }
  .echeancier .act .lien-piece { flex-wrap: wrap; justify-content: flex-start; }
  .echeancier .act form .bouton { width: 100%; }
}

.titre-groupe { font-size: 1.35rem; margin: 2rem 0 .3rem; display: flex; align-items: center; gap: .5rem; }
.intro-groupe { margin: 0 0 1rem; max-width: 68ch; }
.carte-regime legend { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; }
.carte-regime legend .pastille { font-size: .85rem; }
.carte-ajout { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem 1.5rem; border-style: dashed; box-shadow: none; }
.carte-ajout p { margin: .2rem 0 0; max-width: 60ch; }
.carte-ajout .actions { display: flex; flex-wrap: wrap; gap: .5rem; }
.ligne-activite { border-top: 1px solid var(--bordure); padding-top: .8rem; }
.regime-activite { grid-column: 1 / -1; margin: -.3rem 0 .8rem; font-size: .88rem; color: var(--texte-doux); }
.carte-le-trait { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .6rem 1rem; }
.carte-le-trait p { margin: .2rem 0 0; max-width: 64ch; }
@media (max-width: 699px) { .carte-le-trait { grid-template-columns: auto minmax(0, 1fr); } .carte-le-trait .bouton { grid-column: 1 / -1; justify-self: start; } }
details.precision { margin: 0 0 1rem; }
details.precision > summary { cursor: pointer; color: var(--lien); font-size: .92rem; font-weight: 550; margin-bottom: .6rem; }
.depuis-devis h2 { margin-bottom: .3rem; }

/* --- Aide pédagogique -------------------------------------------------- */

.bulle-bouton {
  display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%;
  border: 0; color: var(--lavande-encre); background: var(--lavande);
  font: italic 700 .78rem/1 Georgia, serif; cursor: pointer; padding: 0; vertical-align: middle; flex: none;
}
.bulle-bouton:hover { background: var(--lavande-encre); color: #fff; }
.bulle-texte {
  max-width: min(370px, calc(100vw - 32px)); padding: 1.1rem 1.2rem; border: 1px solid var(--bordure);
  border-radius: 18px; background: var(--surface); color: var(--texte); box-shadow: var(--ombre-forte);
  font-size: .95rem; font-weight: 400; margin: auto; text-transform: none; letter-spacing: normal;
}
.bulle-texte strong.titre { display: block; margin-bottom: .35rem; color: var(--lavande-encre); }
.bulle-texte::backdrop { background: rgba(40, 32, 25, .18); }

.encart { border-radius: var(--rayon); background: var(--lavande); margin-bottom: 1.1rem; overflow: hidden; }
.encart > summary {
  display: flex; align-items: center; gap: .6rem; padding: .8rem 1.1rem; cursor: pointer;
  font-weight: 650; color: var(--lavande-encre); list-style: none;
}
.encart > summary::-webkit-details-marker { display: none; }
.encart > summary .puce-encart { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 10px; background: rgba(255, 255, 255, .7); flex: none; }
/* Toujours replié (3.14) : titre, « Déplier » à droite, et en mode débutante la règle en une phrase dessous. */
.encart > summary { flex-wrap: wrap; row-gap: .2rem; }
.encart > summary .titre-encart { flex: 1 1 0; min-width: 0; }
.encart > summary .deplier { margin-left: auto; display: inline-flex; align-items: center; gap: .3rem; font-size: var(--t-note); font-weight: 600; }
.encart > summary .fleche { transition: transform .2s; }
.encart[open] > summary .fleche { transform: rotate(180deg); }
.encart > summary .si-ouvert, .encart[open] > summary .si-ferme { display: none; }
.encart[open] > summary .si-ouvert { display: inline; }
.encart > summary .resume { flex: 1 1 100%; padding-left: calc(30px + .6rem); font-weight: 400; color: var(--texte); font-size: var(--t-second); line-height: 1.5; }
.encart[open] > summary .resume { display: none; }
/* Sur téléphone, la flèche suffit : le titre garde la largeur. */
@media (max-width: 699px) { .encart > summary .deplier > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; } }
.encart .corps { padding: 0 1.1rem 1rem; display: grid; gap: .7rem; }
@media (min-width: 900px) { .encart .corps.trois { grid-template-columns: repeat(3, 1fr); } }
.encart .bloc { background: var(--surface-verre); border-radius: 14px; padding: .8rem .95rem; }
.encart .bloc h4 { margin: 0 0 .35rem; font-size: var(--t-etiquette); font-weight: 650; color: var(--lavande-encre); }
.encart .bloc p:last-child, .encart .bloc ul:last-child, .encart .bloc ol:last-child { margin-bottom: 0; }
.encart .bloc ul, .encart .bloc ol { padding-left: 1.15rem; margin: 0; }
.encart .pied-encart { padding: 0 1.1rem .9rem; font-size: .85rem; color: var(--lavande-encre); }
.encart .pied-encart a { color: inherit; }

.explication {
  position: relative; padding: .9rem 1.1rem .9rem calc(1.1rem + 28px + .75rem); min-height: 3.5rem; border-radius: var(--rayon-interne);
  background: var(--info-fond); color: var(--texte); margin-bottom: 1rem; --ec: var(--info);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 11v6M12 7.2v.1'/%3E%3C/svg%3E");
}
.explication::before {
  content: ""; position: absolute; left: 1.1rem; top: .8rem; width: 28px; height: 28px; border-radius: 50%;
  background: var(--ec) var(--ico) center / 16px no-repeat;
}
.explication > strong:first-child { color: var(--ec); }
.explication.attention { background: var(--attention-fond); --ec: var(--attention);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.4' stroke-linecap='round'%3E%3Cpath d='M12 6v7.5M12 17.6v.1'/%3E%3C/svg%3E"); }
.explication.danger { background: var(--danger-fond); --ec: var(--danger);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 8.5v5M12 16.8v.1'/%3E%3Cpath d='M4.5 19.5h15L12 4.5z' stroke-width='1.6'/%3E%3C/svg%3E"); }
.explication.ok { background: var(--ok-fond); --ec: var(--ok);
  --ico: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m5 12.5 4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.explication ul { margin: .35rem 0 0; padding-left: 1.2rem; }

.page-aide { max-width: 760px; }
.page-aide h2 { margin-top: 1.4em; }
.page-aide .source { font-size: .9rem; color: var(--texte-doux); border-top: 1px solid var(--bordure); padding-top: .8rem; margin-top: 1.5rem; }
.page-aide table { border-collapse: collapse; width: 100%; margin-bottom: 1rem; font-size: .95rem; }
.page-aide th, .page-aide td { border-bottom: 1px solid var(--bordure); padding: .5rem .6rem; text-align: left; }
.page-aide th { background: var(--surface-2); }

/* Jauges */
.jauge { margin-bottom: 1rem; }
.jauge .etiquette { display: flex; justify-content: space-between; align-items: baseline; gap: .75rem; font-size: var(--t-second); margin-bottom: .35rem; }
.jauge .etiquette span { min-width: 0; }
.jauge .etiquette strong { white-space: nowrap; font-variant-numeric: tabular-nums; }
.jauge small { font-size: var(--t-note); }
.jauge .note-jauge { display: block; margin-top: .2rem; color: var(--texte-doux); font-size: .84rem; }
.jauge .piste { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.jauge .rempli { width: var(--p, 0%); height: 100%; background: linear-gradient(90deg, #d8cfc4, #7d746a); border-radius: 99px; }
.jauge.attention .rempli { background: linear-gradient(90deg, #f3cf8c, var(--attention)); }
.jauge.alerte .rempli, .jauge.depasse .rempli { background: linear-gradient(90deg, #eea898, var(--danger)); }

/* Étapes (devis → facture → paiement) */
.frise { display: flex; gap: .35rem; flex-wrap: wrap; margin: 0 0 1.1rem; padding: 0; list-style: none; font-size: .84rem; font-weight: 600; }
.frise li { padding: .3rem .8rem; border-radius: 99px; background: var(--surface); border: 1px solid var(--bordure); color: var(--texte-doux); }
.frise li.fait { background: var(--ok-fond); border-color: transparent; color: var(--ok); }
.frise li.courant { background: var(--primaire); border-color: transparent; color: #fff; }

.apercu-pdf { width: 100%; height: 72vh; border: 1px solid var(--bordure); border-radius: 16px; background: #fff; }
.vignette { width: 58px; height: 58px; object-fit: cover; border-radius: 14px; border: 1px solid var(--bordure); background: var(--surface-2); display: grid; place-items: center; font-size: .7rem; font-weight: 600; color: var(--texte-doux); flex: none; text-decoration: none; }

/* Connexion */
.page-connexion { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.page-connexion .carte { width: 100%; max-width: 430px; padding: 1.8rem; box-shadow: var(--ombre-forte); }
.page-connexion .marque { margin-bottom: 1.2rem; }

/* Agenda : mois en mini-grilles + panneau du jour */
.planning { padding: 1.2rem; }
.planning-entete { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .6rem 1rem; margin-bottom: 1rem; }
.planning-entete h2 { margin: 0; text-transform: capitalize; }
.navigation-mois { display: flex; flex-wrap: wrap; gap: .4rem; }
.planning-corps { display: grid; gap: 1.2rem; align-items: start; }
@media (min-width: 1000px) { .planning-corps { grid-template-columns: minmax(0, 1fr) 19rem; } }
.mois-grille { display: grid; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); gap: 1.4rem 1.8rem; min-width: 0; }
.mois { max-width: 17rem; }
.mois h3 { display: flex; align-items: baseline; gap: .35rem; margin: 0 0 .45rem; font-size: 1rem; text-transform: capitalize; }
.mois h3 span { font-weight: 500; color: var(--texte-doux); }
.mois h3 small { margin-left: auto; font-size: .74rem; font-weight: 600; color: var(--ocre-encre); background: var(--ocre); padding: .05rem .5rem; border-radius: 99px; text-transform: none; }
.jours { display: grid; grid-template-columns: repeat(7, 1fr); gap: 3px; }
.jours .sem { font-size: .66rem; font-weight: 600; color: var(--texte-doux); text-align: center; padding-bottom: 2px; }
.jours .j {
  position: relative; aspect-ratio: 1 / 1; border: 0; border-radius: 9px; background: transparent; padding: 0;
  display: grid; place-items: center; font: 500 .8rem/1 var(--police); font-variant-numeric: tabular-nums; color: var(--texte); cursor: pointer;
}
.jours .j.vide { visibility: hidden; }
.jours .j:hover { box-shadow: inset 0 0 0 1.5px var(--primaire); }
.jours .j.we { background: var(--surface-2); color: var(--texte-doux); }
.jours .j.passe { opacity: .55; }
.jours .j.rdv { background: var(--ocre); color: var(--ocre-encre); font-weight: 700; }
.jours .j.echeance::after { content: ""; position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--rose-encre); }
.jours .j.deux { background: var(--ocre); color: var(--ocre-encre); font-weight: 700; }
.jours .j.deux::after { content: ""; position: absolute; bottom: 4px; width: 5px; height: 5px; border-radius: 50%; background: var(--rose-encre); }
.jours .j.auj { box-shadow: inset 0 0 0 2px var(--primaire); font-weight: 750; opacity: 1; }
.jours .j.choisi { background: var(--primaire); color: #fff; opacity: 1; }
.jours .j.choisi::after { background: #fff; }
.jours .j i { position: absolute; top: 2px; right: 3px; font: 700 .58rem/1 var(--police); font-style: normal; }
.panneau-jour { background: var(--surface-2); border-radius: 18px; padding: 1rem; display: grid; gap: .6rem; position: sticky; top: 1rem; }
.panneau-titre .lab { font-size: var(--t-etiquette); font-weight: 600; color: var(--texte-doux); }
.panneau-titre h3 { margin: .1rem 0 .2rem; font-size: 1.1rem; }
.panneau-jour .barre-actions { margin-top: .3rem; }
.ev { display: grid; gap: .1rem; padding: .7rem .85rem; border-radius: 14px; background: var(--surface); color: var(--texte); text-decoration: none; border-left: 4px solid var(--ocre-encre); }
.ev:hover { box-shadow: var(--ombre); }
.ev .heure { font-size: var(--t-etiquette); font-weight: 650; color: var(--texte-doux); }
.ev strong { font-size: .98rem; }
.ev span { font-size: .88rem; }
.ev.ev-echeance { border-left-color: var(--rose-encre); }
.ev.annule strong { text-decoration: line-through; }
.ev.faite { opacity: .6; }
.prochain { display: grid; grid-template-columns: 3.4rem minmax(0, 1fr); gap: .5rem; align-items: start; }
.prochain .date-courte { font-size: .82rem; font-weight: 700; padding-top: .7rem; text-align: right; color: var(--texte-doux); }
.legende { display: flex; flex-wrap: wrap; gap: .5rem 1.2rem; margin-top: 1.1rem; font-size: .82rem; color: var(--texte-doux); }
.legende span { display: inline-flex; align-items: center; gap: .45rem; }
.legende i { width: 16px; height: 16px; border-radius: 5px; display: inline-block; position: relative; }
.legende .l-rdv { background: var(--ocre); }
.legende .l-echeance { background: var(--surface-2); }
.legende .l-echeance::after, .legende .l-deux::after { content: ""; position: absolute; left: 5.5px; bottom: 2px; width: 5px; height: 5px; border-radius: 50%; background: var(--rose-encre); }
.legende .l-deux { background: var(--ocre); }
.legende .l-auj { box-shadow: inset 0 0 0 2px var(--primaire); }

/* --- Accueil (docs/design-system.md, 3.23) ----------------------------- */
.titre-page .compte { color: var(--danger); font-weight: 600; }
.titre-page .raccourcis { display: none; }
@media (min-width: 900px) {
  .titre-page .raccourcis { display: flex; flex-wrap: wrap; gap: var(--e-2); }
  .raccourcis .bouton { padding-left: .4rem; min-height: 40px; }
}
.carte .entete-carte { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-2) var(--e-3); margin-bottom: var(--e-2); }
.carte .entete-carte h2, .carte .entete-carte h3 { margin: 0; }
.carte .entete-carte .note { margin: 0 0 0 auto; }
.compteur { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding: 0 .45rem; border-radius: 999px; font-size: var(--t-etiquette); font-weight: 700; font-variant-numeric: tabular-nums; background: var(--danger-fond); color: var(--danger); }
.compteur.neutre { background: var(--surface-2); color: var(--texte-doux); }
.seul-bureau { display: none; }
@media (min-width: 900px) { .seul-bureau { display: block; } }

.accueil { display: grid; gap: var(--e-4); grid-template-columns: minmax(0, 1fr); }
.accueil > div { display: contents; }
.accueil .carte { margin: 0; }
.accueil .ordre-tel-1 { order: 1; } .accueil .ordre-tel-2 { order: 2; } .accueil .ordre-tel-3 { order: 3; }
.accueil .ordre-tel-4 { order: 4; } .accueil .ordre-tel-6 { order: 6; } .accueil .ordre-tel-7 { order: 7; }
@media (min-width: 900px) {
  .accueil { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
  .accueil > div { display: grid; gap: var(--e-4); align-content: start; min-width: 0; }
  .accueil :is(.ordre-tel-1, .ordre-tel-2, .ordre-tel-3, .ordre-tel-4, .ordre-tel-6, .ordre-tel-7) { order: 0; }
}
.accueil .liste-simple li { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: var(--e-3); align-items: center; }
.accueil .liste-simple li:has(.date-pastille) { grid-template-columns: 44px minmax(0, 1fr); }
.accueil .liste-simple li.vide, .accueil .liste-simple li.rien { display: flex; }
.accueil .liste-simple.compacte li { padding: .55rem 0; }
.liste-simple .principal .titre-ligne { font-weight: 650; color: var(--texte); text-decoration: none; }
.liste-simple .principal a.titre-ligne:hover { color: var(--lien); }
.liste-simple .sous-ligne { display: block; font-size: var(--t-note); color: var(--texte-doux); margin-top: .1rem; }
.sous-ligne .pastille { font-size: var(--t-micro); padding: .02rem .5rem; vertical-align: 1px; }
.liste-simple .fin { display: flex; align-items: center; gap: var(--e-2); justify-content: flex-end; }
.liste-simple .fin form { margin: 0; }
.rien { align-items: center; gap: var(--e-2); color: var(--ok); font-weight: 600; }
@media (max-width: 699px) {
  .accueil .liste-simple:not(.compacte) li:has(.fin .pastille) { grid-template-columns: 36px minmax(0, 1fr); }
  .accueil .liste-simple:not(.compacte) li .fin:has(.pastille) { grid-column: 2; justify-content: flex-start; margin-top: .3rem; }
  .accueil .fin .bouton.petit .txt { display: none; }
  .accueil .fin .bouton.petit { width: 44px; min-height: 44px; padding: 0; justify-content: center; }
}
.date-pastille { display: grid; place-items: center; align-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--ocre); color: var(--ocre-encre); line-height: 1; }
.date-pastille strong { font-size: var(--t-corps); font-weight: 700; font-variant-numeric: tabular-nums; }
.date-pastille small { font-size: var(--t-micro); font-weight: 600; margin-top: 2px; color: inherit; }

.indicateurs-pile { display: grid; gap: var(--e-3); }
@media (min-width: 900px) {
  .indicateurs-pile .indicateur { padding: .85rem 1rem; }
  .indicateurs-pile .chiffre { font-size: 1.5rem; }
}
@media (max-width: 899px) {
  .indicateurs-pile { grid-auto-flow: column; grid-auto-columns: 78%; overflow-x: auto; scroll-snap-type: x mandatory; margin: 0 -16px; padding: 0 16px 4px; scrollbar-width: none; }
  .indicateurs-pile::-webkit-scrollbar { display: none; }
  .indicateurs-pile > * { scroll-snap-align: start; }
}
.jauges.grille { margin-bottom: 0; }

/* Histogramme des recettes (3.13) */
.histo { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; align-items: end; height: 120px; margin-top: var(--e-3); }
.histo i { display: block; border-radius: 6px 6px 3px 3px; background: var(--barre); height: var(--h); min-height: 3px; }
.histo i.courant { background: var(--sauge-encre); }
.histo i.futur { background: transparent; box-shadow: inset 0 0 0 1.5px var(--bordure-forte); height: 24px; }
.histo-mois { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 6px; font-size: var(--t-micro); color: var(--texte-doux); text-align: center; margin-top: .3rem; }
.histo-mois .courant { color: var(--sauge-encre); font-weight: 700; }
.histogramme.reduit .entete-carte { display: grid; gap: .1rem; }
.histogramme.reduit .entete-carte .note { margin: 0; }
.histogramme.reduit .histo { height: 72px; gap: 4px; }
.histogramme.reduit .histo-mois { gap: 4px; }

/* --- Lot 3 : Factures et Devis ------------------------------------------ */

/* Pièces en liste (3.7) : au bureau un tableau, sur téléphone une carte de deux lignes sans étiquettes. */
.tableau.pieces .c-infos { display: none; }
@media (max-width: 699px) {
  .tableau.pieces tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "client montant" "infos etat"; gap: .15rem .75rem; padding: .7rem 0; }
  .tableau.pieces tbody tr:has(> .vide) { display: block; }
  .tableau.pieces td { display: block; padding: 0; }
  .tableau.pieces td::before { content: none; }
  .tableau.pieces .c-numero, .tableau.pieces .c-objet, .tableau.pieces .c-date { display: none; }
  .tableau.pieces .c-client { grid-area: client; font-weight: 650; }
  .tableau.pieces .c-montant { grid-area: montant; font-weight: 700; }
  .tableau.pieces .c-infos { grid-area: infos; display: block; font-size: var(--t-note); color: var(--texte-doux); }
  .tableau.pieces .c-infos a { font-weight: 500; color: inherit; }
  .tableau.pieces .c-client, .tableau.pieces .c-infos { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .tableau.pieces .c-etat { grid-area: etat; justify-self: end; align-self: center; display: flex; gap: .3rem; }
  .tableau.pieces tr.cliquable:hover td { background: none; }
}

/* Lignes d'une pièce, sur les fiches (3.7). */
.tableau.lignes-piece .c-designation small { display: block; margin-top: .15rem; }
.tableau.lignes-piece .c-calcul { display: none; }
@media (max-width: 699px) {
  .tableau.lignes-piece tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: .2rem .75rem; padding: .7rem 0; }
  .tableau.lignes-piece td { display: block; padding: 0; }
  .tableau.lignes-piece td::before { content: none; }
  .tableau.lignes-piece .c-designation { grid-column: 1 / -1; }
  .tableau.lignes-piece .c-qte, .tableau.lignes-piece .c-pu { display: none; }
  .tableau.lignes-piece .c-calcul { display: block; font-size: var(--t-note); color: var(--texte-doux); }
  .tableau.lignes-piece .c-montant { font-weight: 650; }
  .tableau.lignes-piece tfoot tr { display: flex; justify-content: space-between; padding-top: .7rem; }
  .tableau.lignes-piece tfoot td { padding: 0; }
}

/* Frise de statut sur téléphone : une seule rangée, qui défile si besoin (3.11). */
@media (max-width: 699px) {
  .frise { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .frise li { white-space: nowrap; }
}

.carte.t-tilleul { background: var(--tilleul); }
.form-paiement { margin-top: var(--e-4); }
.note.fin-bloc { margin: var(--e-3) 0 0; }

/* --- Lot 4 : Justificatifs et encarts ---------------------------------- */

/* Filtres sur téléphone : deux colonnes, la recherche et le bouton sur toute la largeur. */
@media (max-width: 699px) {
  .filtres { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .filtres > input[type=search], .filtres > .bouton { grid-column: 1 / -1; }
  .filtres > :only-child, .filtres > select:only-of-type { grid-column: 1 / -1; }
  /* Onglets de régime : une seule rangée, qui défile si besoin (3.20). */
  .onglets-regime { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .onglets-regime > * { white-space: nowrap; }
}

/* Liste des justificatifs : vignette, fournisseur, date et catégorie, montant. */
.resume-justificatifs { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .3rem 1rem; margin-bottom: var(--e-2); }
.resume-justificatifs strong { font-variant-numeric: tabular-nums; }
.liste-justificatifs li { display: grid; grid-template-columns: 58px minmax(0, 1fr) auto; gap: var(--e-3); align-items: center; }
.liste-justificatifs li.vide { display: block; }
.liste-justificatifs .sous-ligne { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Nouveau justificatif : la photo d'abord. */
.prise-photo, .champ .prise-photo {
  display: grid; margin: 0; font-weight: 400; justify-items: center; gap: .4rem; padding: 1.6rem 1rem; border-radius: var(--rayon); cursor: pointer; text-align: center;
  border: 2px dashed rgba(161, 69, 89, .45); background: var(--rose); color: var(--rose-encre);
}
.prise-photo .rond { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-fonce); color: #fff; box-shadow: 0 8px 20px rgba(168, 87, 56, .3); }
.prise-photo .rond .icone { width: 28px; height: 28px; }
.prise-photo strong { font-size: var(--t-h3); color: var(--texte); }
.prise-photo span { font-size: var(--t-note); }
.prise-photo:focus-within { outline: 3px solid var(--primaire); outline-offset: 2px; }
.ou-fichier { text-align: center; margin: var(--e-3) 0 var(--e-2); }
.ou-fichier .lien, .champ .ou-fichier .lien { display: inline; margin: 0; font-size: inherit; font-weight: 500; cursor: pointer; }
.apercu-photo:not(:empty) { margin-top: var(--e-3); text-align: center; }
.apercu-photo img { max-width: 100%; max-height: 320px; border-radius: var(--rayon-interne); }

/* Barre collante à l'intérieur d'une carte (formulaire d'une seule carte). */
.carte .barre-actions.collante { margin-inline: calc(var(--e-5) * -1); padding-inline: var(--e-5); }
@media (min-width: 900px) {
  .carte .barre-actions.collante { border: 0; border-top: 1px solid var(--bordure); border-radius: 0 0 var(--rayon) var(--rayon); margin-bottom: calc(var(--e-5) * -1); }
}
.barre-actions .a-gauche { margin-right: auto; }

/* --- Lot 5 : Déclarations --------------------------------------------- */

/* Étapes passées repliées en tête de la frise (3.10). */
.etapes-passees > summary { list-style: none; cursor: pointer; display: flex; align-items: center; gap: .5rem; min-height: 44px; padding: .3rem 0 .6rem calc(5.2rem + 1.6rem + .4rem); color: var(--texte-doux); font-weight: 600; font-size: var(--t-second); }
.etapes-passees > summary::-webkit-details-marker { display: none; }
.etapes-passees > summary .icone { transition: transform .2s; }
.etapes-passees[open] > summary .icone { transform: rotate(180deg); }
.etapes-passees .etape:last-child .repere::before { bottom: 0; }
.etapes-passees + .frise-annee .etape:first-child .repere::before { top: 0; }
@media (max-width: 699px) { .etapes-passees > summary { padding-left: calc(3.6rem + 1.3rem + .4rem); } }
.etape .jour { font-size: var(--t-jour); }
.etape .mois { font-size: var(--t-etiquette); }
.etape .quoi p { font-size: var(--t-second); }
@media (max-width: 699px) { .etape .jour { font-size: 1.25rem; } .etape .quand { padding-right: .45rem; } }

/* Bouton « Copier » (3.5) : largeur fixe, rien ne bouge quand le libellé change. */
.copier { min-width: 6.4rem; justify-content: center; }
.copier .icone { width: 16px; height: 16px; }
.copier.copie { background: var(--ok-fond); color: var(--ok); border-color: rgba(44, 107, 69, .35); }
.note-copie { margin: .2rem 0 .5rem; }
.note-copie .valeur-copie { width: 8rem; min-height: 36px; padding: .3rem .6rem; font-variant-numeric: tabular-nums; }
.lecteur-seul { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.histogramme:not(.reduit) { margin-bottom: var(--e-4); }

/* --- Lot 6 : Agenda (3.21) --------------------------------------------- */

/* Jours : week-end sans fond ; rendez-vous en ocre cerclé ; échéance marquée d'un point anthracite
   (le rose est la teinte des justificatifs) ; aujourd'hui cerclé ; jour choisi plein. */
.jours .j { border-radius: var(--rayon-case); }
.jours .j.we { background: transparent; color: var(--texte-doux); }
.jours .j.rdv, .jours .j.deux { background: var(--ocre); color: var(--ocre-encre); box-shadow: inset 0 0 0 1.5px rgba(127, 95, 23, .3); }
.jours .j.echeance::after, .jours .j.deux::after { background: var(--primaire); }
.jours .j.auj { box-shadow: inset 0 0 0 2px var(--primaire); }
.jours .j.choisi { background: var(--primaire); color: #fff; box-shadow: none; }
.jours .j.choisi::after { background: #fff; }
.legende .l-rdv { background: var(--ocre); box-shadow: inset 0 0 0 1.5px rgba(127, 95, 23, .3); }
.legende .l-echeance { background: transparent; box-shadow: inset 0 0 0 1px var(--bordure-forte); }
.legende .l-echeance::after, .legende .l-deux::after { background: var(--primaire); }
.legende .l-deux { background: var(--ocre); }

/* Cartes du panneau : compactes, heure en casse de phrase. */
.ev .heure { text-transform: none; letter-spacing: 0; }
.ev .ligne-ev { font-size: var(--t-note); color: var(--texte-doux); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ev strong { line-height: 1.3; }
.ev.ev-echeance { border-left-color: var(--primaire); }

/* Téléphone et tablette : le panneau « À venir » passe avant les grilles. */
@media (max-width: 999px) {
  .planning-corps { display: flex; flex-direction: column; }
  .planning-corps .panneau-jour { order: -1; position: static; }
}

/* Lien d'abonnement : il passe à la ligne au lieu d'élargir la page. */
.code-long { word-break: break-all; }
.lien-ics { display: flex; flex-wrap: wrap; align-items: center; gap: var(--e-2); }

/* --- Lot 7 : Paramètres, connexion, double authentification ----------- */

/* Sommaire des Paramètres (3.25) : pilules collées en haut, qui défilent sur téléphone. */
.sommaire {
  position: sticky; top: 0; z-index: 12; display: flex; gap: var(--e-2); overflow-x: auto; scrollbar-width: none;
  margin: calc(var(--e-2) * -1) -16px var(--e-4); padding: var(--e-2) 16px;
  background: var(--surface-verre); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
}
.sommaire::-webkit-scrollbar { display: none; }
.sommaire a {
  flex: none; display: inline-flex; align-items: center; min-height: 40px; padding: 0 var(--e-3); border-radius: 99px;
  border: 1px solid var(--bordure); background: var(--surface); color: var(--texte); font-size: var(--t-note); font-weight: 600; text-decoration: none; white-space: nowrap;
}
.sommaire a:hover { border-color: var(--bordure-forte); }
@media (max-width: 899px) { .sommaire { top: 64px; } }
@media (min-width: 900px) { .sommaire { margin-inline: 0; padding-inline: 0; flex-wrap: wrap; background: none; backdrop-filter: none; -webkit-backdrop-filter: none; position: static; } }
#affichage, #vos-regimes, #reglages-communs, #activites, .carte[id] { scroll-margin-top: 130px; }

/* Champ fichier (3.17) : le bouton natif prend l'allure d'un bouton secondaire. */
input[type=file] { font: inherit; font-size: var(--t-note); color: var(--texte-doux); max-width: 100%; }
input[type=file]::file-selector-button {
  font: inherit; font-size: var(--t-second); font-weight: 600; color: var(--texte); background: var(--surface);
  border: 1px solid var(--bordure-forte); border-radius: 99px; min-height: 40px; padding: 0 1rem; margin-right: var(--e-3); cursor: pointer;
}
input[type=file]::file-selector-button:hover { background: var(--surface-2); }

/* Connexion, premiers pas, double authentification. */
.page-connexion h1 { font-size: var(--t-h2); }
.note-connexion { display: flex; align-items: center; gap: .4rem; margin-top: var(--e-4); }
.sous-champ { margin: calc(var(--e-3) * -1) 0 var(--e-4); font-size: var(--t-note); color: var(--texte-doux); }
.qr { background: #fff; padding: 12px; border-radius: var(--rayon-interne); width: max-content; max-width: 100%; margin: 0 auto var(--e-4); }

@media print {
  body { background: #fff; }
  .barre-laterale, .entete-mobile, .barre-bas, .encart, .barre-actions, .titre-page .actions, .filtres { display: none !important; }
  .cadre { display: block; }
  .contenu { padding: 0; }
  .carte { box-shadow: none; border: 0; }
}
