/*
  Outil « Comptes de campagne » : feuille propre à l'outil.
  Chargée après tokens.css et style.css. Ne contient que des classes préfixées « .cc- » (et leurs
  descendants) et le bloc @media print de l'outil ; ne redéfinit ni jeton ni classe partagée.
  Aucun rayon au-dessus de 16 px, aucune couleur politique, aucune couleur hors jetons.
  Mouvement : seuls transform, opacity et les couleurs bougent, en moins de 300 ms, avec les courbes
  des jetons (--ease-out) ; les entrées jouées en script (comptes-registre.js) suivent la même règle
  et s'effacent quand l'utilisateur a demandé moins de mouvement.
*/

/* ---------------------------------------------------------------- coquille */
.cc-app { padding-left: 0; }                       /* pas de rail sur cette page */
.cc-app #toast-root { left: var(--s4); right: var(--s4); }
.cc-main { display: flex; flex-direction: column; gap: var(--s3); }
.cc-notes { display: flex; flex-direction: column; gap: var(--s2); }
.cc-notes:empty { display: none; }
.cc-screen { gap: var(--s3); }
.cc-actions { display: flex; flex-direction: column; gap: var(--s2); align-items: stretch; }
.cc-foot { margin-top: var(--s2); }

/* Accueil sans dossier : ce que fait l'outil, en trois temps. */
.cc-accueil { background: var(--surface); border-radius: var(--r-12); box-shadow: var(--shadow-1); padding: var(--s6) var(--s5); display: flex; flex-direction: column; gap: var(--s3); }
.cc-accueil-titre { margin: 0; font-size: var(--fs-22); font-weight: 700; letter-spacing: -.015em; line-height: 1.15; text-wrap: balance; }
.cc-accueil-texte { margin: 0; font-size: var(--fs-15); color: var(--ink-2); line-height: 1.5; max-width: 60ch; }
.cc-accueil-etapes { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 6px; font-size: var(--fs-15); color: var(--ink-2); line-height: 1.45; }
.cc-accueil-etapes li::marker { color: var(--accent); font-weight: 700; }
.cc-accueil-etapes b { color: var(--ink); font-weight: 600; }

/* ---------------------------------------------------------------- utilitaires */
.cc-danger { color: var(--danger); }
.cc-warn { color: var(--warn); }
.cc-ok { color: var(--ok); }
.cc-link { color: var(--accent); font-size: var(--fs-13); font-weight: 500; white-space: nowrap; }
.cc-req { color: var(--danger); }
.cc-badge { display: inline-block; padding: 1px 6px; border-radius: var(--r-6); background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-12); font-weight: 500; line-height: 1.5; white-space: nowrap; vertical-align: middle; margin-left: 6px; }
.cc-badge.is-warn { background: var(--warn-soft); color: var(--warn); }
.cc-badge.is-ok { background: var(--ok-soft); color: var(--ok); }
.cc-badge.is-muted { color: var(--muted); }
.cc-badge.is-danger { background: var(--danger-soft); color: var(--danger); }
.list-row-value .cc-badge { margin: 2px 0 0; }
/* Jauge miniature d'une ligne de dossier (Mes dossiers) : même lecture que la CeilingGauge. */
.cc-rowgauge { display: block; width: 72px; height: 4px; margin: 4px 0 0 auto; border-radius: 2px; background: var(--surface-2); }
.cc-rowgauge i { display: block; height: 100%; min-width: 2px; border-radius: 2px; background: var(--accent); }
.cc-rowgauge.is-unconfirmed { outline: 1px dotted var(--warn); outline-offset: 1px; }
.cc-rowgauge.is-alerte i { background: var(--warn); }
.cc-rowgauge.is-depasse i { background: var(--danger); }
.cc-two { display: grid; grid-template-columns: 1fr; gap: var(--s3); }

/* ---------------------------------------------------------------- registre : vues et repères */
/* Le contrôle segmenté colle juste sous l'en-tête : sa hauteur réelle est mesurée par comptes.js
   et posée dans --cc-header-h (l'en-tête de cette page ne se compacte pas, mais sa hauteur change
   avec la rangée de faits et la largeur). Le repli de 92 px vaut pour l'en-tête à une ligne de faits.
   « sticky » (ou « relative » à 720) doit rester une position non statique : l'indicateur glissant
   du contrôle segmenté est en position absolue et se placerait ailleurs dans la page sinon. */
.cc-views { position: sticky; top: var(--cc-header-h, 92px); z-index: 4; }
.cc-view { display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.cc-card { gap: var(--s3); }
.cc-icone { flex: none; }

/* ---------------------------------------------------------------- résumé du compte */
/* Une seule carte en tête du registre : trois chiffres, la jauge du plafond, le détail sous « + ».
   Les lignes viennent juste dessous : c'est pour elles que l'on ouvre l'outil. */
.cc-resume { background: var(--surface); border-radius: var(--r-12); box-shadow: var(--shadow-1); padding: var(--s4); display: flex; flex-direction: column; gap: var(--s3); min-width: 0; }
.cc-chiffres { container-type: inline-size; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s3); }
.cc-chiffre { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cc-chiffre-libelle { font-size: var(--fs-12); font-weight: 500; color: var(--muted); }
/* la taille suit la largeur de la carte : « 111 095,00 € » tient sur une ligne à 375 px comme à 1 300 */
.cc-chiffre-valeur { font-size: var(--fs-17); font-size: clamp(15px, 5.1cqi, 28px); font-weight: 650; letter-spacing: -.01em; white-space: nowrap; line-height: 1.15; }
.cc-resume .more { margin-top: calc(-1 * var(--s1)); }
.cc-resume .cc-total-list { margin-top: var(--s2); }

/* ---------------------------------------------------------------- CeilingGauge */
.cc-gauge { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding-top: var(--s3); border-top: 1px solid var(--line); }
.cc-gauge-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s2); flex-wrap: wrap; }
.cc-gauge-title { font-size: var(--fs-12); font-weight: 500; color: var(--muted); }
.cc-gauge-lien { padding-top: 4px; padding-bottom: 4px; }
.cc-gauge-bar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.cc-gauge.is-unconfirmed .cc-gauge-bar { outline: 1.5px dotted var(--warn); outline-offset: 2px; }
.cc-gauge-fill { position: absolute; top: 0; bottom: 0; display: block; background: var(--accent); }
.cc-gauge-fill.is-engagees { opacity: .6; }
/* prévues : hachures 45° dessinées avec deux bandes pleines (motif, pas de dégradé de couleur) */
.cc-gauge-fill.is-prevues { background: repeating-linear-gradient(45deg, var(--accent) 0 3px, transparent 3px 6px); opacity: .8; }
.cc-gauge.is-alerte .cc-gauge-fill { background-color: var(--warn); }
.cc-gauge.is-alerte .cc-gauge-fill.is-prevues { background: repeating-linear-gradient(45deg, var(--warn) 0 3px, transparent 3px 6px); }
.cc-gauge.is-depasse .cc-gauge-fill { background-color: var(--danger); }
.cc-gauge.is-depasse .cc-gauge-fill.is-prevues { background: repeating-linear-gradient(45deg, var(--danger) 0 3px, transparent 3px 6px); }
.cc-gauge-text { font-size: var(--fs-13); display: flex; flex-wrap: wrap; gap: 0 var(--s1); align-items: baseline; }
.cc-gauge-text .num { font-weight: 600; }
.cc-gauge-text.cc-danger .num { color: var(--danger); }
.cc-gauge-text.cc-warn .num { color: var(--warn); }
.cc-gauge-switch { padding-top: 8px; padding-bottom: 8px; font-size: var(--fs-13); }
/* ---------------------------------------------------------------- Lignes : barre de filtres */
.cc-filterbar { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.cc-filterbar .chip { max-width: 100%; }
.cc-search { flex: 1 1 180px; min-width: 0; }
.cc-search-input, .cc-sort select { width: 100%; min-height: 44px; padding: 0 var(--s3); border: 1px solid transparent; border-radius: var(--r-8); background: var(--surface); box-shadow: var(--shadow-1); color: var(--ink); font-size: var(--fs-15); }
.cc-search-input:focus, .cc-sort select:focus { outline: 2px solid var(--focus); outline-offset: 0; border-color: var(--focus); }
.cc-search-input::placeholder { color: var(--muted); }
.cc-sort { flex: 0 1 190px; min-width: 0; }
.cc-selection-slot:empty { display: none; }
.cc-selection { margin: 0; padding: var(--s2) var(--s3); border-radius: var(--r-8); background: var(--accent-soft); color: var(--ink); font-size: var(--fs-13); line-height: 1.45; }
/* registre vide : une invitation, pas un écran blanc */
.cc-vide { background: var(--surface); border-radius: var(--r-12); box-shadow: var(--shadow-1); padding: var(--s6) var(--s5); display: flex; flex-direction: column; gap: var(--s2); align-items: center; text-align: center; }
.cc-vide-titre { margin: 0; font-size: var(--fs-17); font-weight: 650; }
.cc-vide .meta { max-width: 44ch; }

/* ---------------------------------------------------------------- LedgerTable : lignes de liste (sous 720) */
.cc-ledger .list-row-subtitle, .cc-doss .list-row-subtitle { display: flex; flex-direction: column; gap: 1px; }
.cc-sub2 { color: var(--ink-2); }
.cc-montant { font-weight: 600; white-space: nowrap; }
.cc-row-marques { display: inline-flex; align-items: center; justify-content: flex-end; gap: 6px; min-height: 0; }
.cc-row-marques:empty { display: none; }
.cc-trombone { display: inline-flex; align-items: center; gap: 2px; color: var(--muted); font-size: var(--fs-12); font-weight: 600; vertical-align: middle; }
.cc-td-objet .cc-trombone { margin-left: 6px; }
.cc-ledger-slot { min-width: 0; }

/* ---------------------------------------------------------------- LedgerTable : table (720 et plus) */
.cc-ledger-wrap { overflow: auto; max-width: 100%; max-height: min(70dvh, 720px); border: 1px solid var(--line); border-radius: var(--r-12); background: var(--surface); box-shadow: var(--shadow-1); }
.cc-table { border-collapse: separate; border-spacing: 0; width: 100%; font-size: var(--fs-13); }
.cc-table th, .cc-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: top; }
.cc-table thead th { position: sticky; top: 0; z-index: 2; background: var(--surface-2); color: var(--ink-2); font-weight: 600; white-space: nowrap; padding: 0 4px; }
.cc-table th.num, .cc-table td.num { text-align: right; white-space: nowrap; }
.cc-table thead th.num .cc-th-btn { justify-content: flex-end; }
.cc-th-btn { display: flex; align-items: center; gap: 2px; width: 100%; padding: 10px 6px; border: 0; background: transparent; color: inherit; font: inherit; font-weight: 600; text-align: left; border-radius: var(--r-6); }
.cc-th-btn.is-active { color: var(--accent); }
.cc-th-dir { color: var(--accent); }
.cc-ledger-row { cursor: pointer; background: var(--surface); transition: background-color var(--d-fast); }
/* La colonne Montant TTC reste visible quand la table défile horizontalement : c'est le chiffre que
   l'on vient lire. « background: inherit » laisse passer l'état survolé de la rangée. */
.cc-table th.cc-col-montant, .cc-table td.cc-col-montant { position: sticky; right: 0; z-index: 1; background: inherit; border-left: 1px solid var(--line); }
.cc-table thead th.cc-col-montant { z-index: 3; background: var(--surface-2); }
.cc-ledger-row:focus-visible { outline: 2px solid var(--focus); outline-offset: -2px; }
.cc-row-btn { border: 0; background: transparent; color: var(--accent); font-size: var(--fs-12); font-weight: 600; padding: 0; padding-top: 10px; padding-bottom: 10px; }
.cc-td-objet { min-width: 140px; overflow-wrap: anywhere; }
.cc-td-objet .cc-badge { margin-left: 4px; }
/* Libellés de rubrique longs : la colonne se coupe plutôt que de pousser la colonne Montant hors du conteneur. */
.cc-td-cat { max-width: 240px; color: var(--ink-2); overflow-wrap: anywhere; }
/* Lieu et tiers : un nom long (« Imprimerie de la Fontaine-du-Roure ») rendait la table plus large
   que son conteneur à 720 px, et la colonne collante « Montant TTC » recouvrait alors une colonne
   qu'aucune position de défilement ne dégageait. La coupure à l'intérieur d'un mot laisse la table
   se réduire à la largeur disponible ; l'en-tête « Tiers ou donateur » se plie sur deux lignes. */
.cc-td-tiers { max-width: 180px; overflow-wrap: anywhere; }
.cc-table thead th.cc-col-tiers { white-space: normal; }
.cc-piece-num { color: var(--muted); }

/* ---------------------------------------------------------------- détail des totaux (sous le résumé) */
.cc-total-list { margin: 0; display: flex; flex-direction: column; gap: 4px; }
.cc-total-list > div { display: flex; justify-content: space-between; gap: var(--s3); font-size: var(--fs-13); }
.cc-total-list dt { color: var(--ink-2); min-width: 0; }
.cc-total-list dd { margin: 0; font-weight: 600; min-width: 0; text-align: right; }
/* Ligne de précision sous un total (part et son dénominateur, détail des espèces) : sous le
   montant, jamais sur la même ligne, pour que le dénominateur en toutes lettres tienne à 375 px. */
.cc-total-list dd small { display: block; font-size: var(--fs-12); font-weight: 400; color: var(--muted); line-height: 1.3; }

/* ---------------------------------------------------------------- bouton collant « Ajouter une ligne » */
.cc-add { position: sticky; bottom: 0; z-index: 5; display: flex; gap: var(--s2); margin: var(--s2) calc(-1 * var(--s4)) 0; padding: var(--s2) var(--s4) calc(var(--s2) + env(safe-area-inset-bottom)); background: var(--nav-bg); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.cc-add .btn { flex: 1 1 0; }
.cc-add .btn.primary { flex-grow: 1.6; }
.cc-line-actions { display: flex; flex-wrap: wrap; gap: var(--s2); align-items: center; }
.cc-line-actions:empty { display: none; }
.cc-confirm { display: flex; gap: var(--s2); flex-wrap: wrap; }
.cc-confirm .btn { flex: 1; }

/* ---------------------------------------------------------------- formulaires */
.cc-form { display: flex; flex-direction: column; gap: var(--s4); }
.cc-form .sheet-group { gap: var(--s3); }
.cc-form .field { color: var(--ink); }
.cc-amount { position: relative; display: flex; align-items: center; }
.cc-amount-input { padding-right: 36px !important; text-align: right; font-variant-numeric: tabular-nums; }
.cc-amount-suffix { position: absolute; right: var(--s3); color: var(--muted); font-size: var(--fs-15); pointer-events: none; }
.cc-date { font-variant-numeric: tabular-nums; }
.cc-commune { display: flex; flex-direction: column; gap: var(--s1); }
.cc-commune-row { display: flex; align-items: center; gap: var(--s2); }
.cc-commune-row input { flex: 1; min-width: 0; }
.cc-commune-code code { display: inline-block; padding: 2px 6px; border-radius: var(--r-6); background: var(--surface-2); color: var(--ink-2); font-size: var(--fs-12); }
.cc-suggest { display: flex; flex-direction: column; border: 1px solid var(--line-2); border-radius: var(--r-8); background: var(--surface); box-shadow: var(--shadow-1); max-height: 240px; overflow-y: auto; }
.cc-suggest-item { display: flex; justify-content: space-between; align-items: center; gap: var(--s2); width: 100%;  padding: var(--s2) var(--s3); border: 0; border-bottom: 1px solid var(--line); background: transparent; color: var(--ink); text-align: left; font-size: var(--fs-15); }
.cc-suggest-item:last-child { border-bottom: 0; }
.cc-suggest-item:focus-visible { background: var(--surface-2); }
.cc-suggest-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-suggest-meta { flex: none; font-size: var(--fs-12); color: var(--muted); font-variant-numeric: tabular-nums; }
.cc-amount .cc-amount-grand { min-height: 60px; font-size: var(--fs-22); font-weight: 650; letter-spacing: -.01em; }
.cc-territoire:empty { display: none; }
.cc-territoire-fixe { margin: 0; }

/* Rubrique : un champ où l'on tape, et la liste des rubriques dessous. Aucune animation à l'ouverture :
   le geste se répète à chaque ligne et part le plus souvent du clavier. */
.cc-combo { display: flex; flex-direction: column; gap: var(--s1); }
.cc-combo-row { position: relative; display: flex; align-items: center; }
.cc-combo-row .cc-combo-input { padding-right: 96px; text-overflow: ellipsis; }
.cc-combo-code { position: absolute; right: 48px; padding: 2px 6px; border-radius: var(--r-6); background: var(--surface); color: var(--ink-2); font-family: var(--mono); font-size: var(--fs-12); pointer-events: none; }
.cc-combo-toggle { position: absolute; right: 4px; display: flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 0; border-radius: var(--r-8); background: transparent; color: var(--ink-2); }
.cc-combo-list { display: flex; flex-direction: column; max-height: min(46dvh, 340px); overflow-y: auto; overscroll-behavior: contain; border-radius: var(--r-8); background: var(--surface); box-shadow: var(--shadow-1); }
.cc-combo-item { display: flex; flex-direction: column; gap: 2px; padding: 10px var(--s3); border-bottom: 1px solid var(--line); cursor: pointer; }
.cc-combo-item:last-child { border-bottom: 0; }
.cc-combo-item.is-active { background: var(--accent-soft); }
.cc-combo-item.is-current .cc-combo-libelle b { color: var(--accent); }
.cc-combo-libelle { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s2); font-size: var(--fs-15); line-height: 1.3; }
.cc-combo-libelle b { font-weight: 600; min-width: 0; }
.cc-combo-num { flex: none; font-family: var(--mono); font-size: var(--fs-12); color: var(--muted); }
.cc-combo-exemples { font-size: var(--fs-12); color: var(--muted); line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cc-combo-vide { padding: var(--s3); font-size: var(--fs-13); color: var(--muted); }

/* Pièces jointes : vignette, nom, poids, « Retirer » ; le bouton d'ajout ouvre l'appareil photo ou les fichiers. */
.cc-pieces { display: flex; flex-direction: column; gap: var(--s2); }
.cc-pieces-list { display: flex; flex-direction: column; gap: var(--s2); }
.cc-pieces-actions { display: flex; }
.cc-pieces-actions .cc-pieces-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.cc-pieces-add { flex: 1; cursor: pointer; border: 1.5px dashed var(--line-2); background: transparent; }
.cc-pieces-add.is-disabled { opacity: .4; pointer-events: none; }
.cc-pieces-file:focus-visible + .cc-pieces-add { outline: 2px solid var(--focus); outline-offset: 2px; }
.cc-pieces-etat { margin: 0; }
.cc-piece { display: flex; align-items: center; gap: var(--s3); padding: 6px; border-radius: var(--r-8); background: var(--fill); }
.cc-piece-vue { flex: none; display: flex; align-items: center; justify-content: center; width: 56px; height: 56px; padding: 0; border: 0; border-radius: var(--r-6); overflow: hidden; background: var(--surface); color: var(--ink-2); cursor: zoom-in; transition: transform 160ms var(--ease-out); }
.cc-piece-vue:active { transform: scale(.96); }
.cc-piece-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-piece-type { font-size: var(--fs-12); font-weight: 700; letter-spacing: .04em; }
.cc-piece-texte { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cc-piece-nom { font-size: var(--fs-13); font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-piece-meta { font-size: var(--fs-12); color: var(--muted); }
.cc-piece-retirer { flex: none; }

/* ---------------------------------------------------------------- sauvegarde en ligne (coffre) */
.cc-actions-liens { display: flex; flex-wrap: wrap; justify-content: center; gap: 0 var(--s3); }
.cc-form .cc-code, .field .cc-code { font-family: var(--mono); font-size: var(--fs-22); letter-spacing: .3em; text-align: center; }
.cc-coffre-fiche { display: flex; flex-direction: column; gap: var(--s2); padding: var(--s4); border-radius: var(--r-8); background: var(--fill); }
.cc-coffre-libelle { font-size: var(--fs-12); font-weight: 500; color: var(--muted); }
.cc-coffre-id { font-family: var(--mono); font-size: var(--fs-17); font-weight: 600; letter-spacing: .04em; overflow-wrap: anywhere; user-select: all; -webkit-user-select: all; }
.cc-coffre-etat { display: flex; align-items: center; justify-content: space-between; gap: var(--s3); padding-top: var(--s3); border-top: 1px solid var(--line); }
.cc-coffre-texte { display: flex; flex-direction: column; gap: 2px; min-width: 0; font-size: var(--fs-15); }

/* ---------------------------------------------------------------- import */
.cc-import-result { display: flex; flex-direction: column; gap: var(--s2); }
.cc-import-result:empty { display: none; }
.cc-import-preview { font-size: var(--fs-15); }
.cc-import-warn { margin: 0; padding-left: 20px; font-size: var(--fs-13); color: var(--warn); }
.cc-import-actions { display: contents; }

/* ---------------------------------------------------------------- synthèse : le compte par rubrique */
/* Présenté comme le formulaire : une ligne par rubrique, le montant à droite ; les colonnes « partis »
   et « en nature » n'existent que si elles servent (.is-complet). */
.cc-formulaire-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 calc(-1 * var(--s2)); padding: 0 var(--s2); }
.cc-formulaire { width: 100%; border-collapse: collapse; font-size: var(--fs-13); }
.cc-formulaire th, .cc-formulaire td { padding: 9px 6px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: baseline; }
.cc-formulaire thead th { font-size: var(--fs-12); font-weight: 600; color: var(--muted); white-space: nowrap; }
.cc-formulaire thead th small { display: block; font-weight: 400; }
.cc-formulaire th.num, .cc-formulaire td.num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.cc-formulaire tbody th { font-weight: 500; }
.cc-formulaire.is-complet tbody th { min-width: 170px; }
.cc-formulaire tr.is-zero th, .cc-formulaire tr.is-zero td { color: var(--muted); font-weight: 400; }
.cc-formulaire tr.is-hors th { font-style: italic; }
.cc-formulaire td.cc-form-total { font-weight: 650; color: var(--ink); }
.cc-formulaire tr.is-zero td.cc-form-total { font-weight: 400; color: var(--muted); }
.cc-formulaire tfoot th, .cc-formulaire tfoot td { border-bottom: 0; border-top: 2px solid var(--ink); font-weight: 700; }
.cc-form-rubrique { padding: 0; border: 0; background: transparent; color: var(--ink); font: inherit; font-weight: 500; text-align: left; cursor: pointer; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
.cc-form-code { margin-left: 8px; font-size: var(--fs-12); color: var(--muted); }
.cc-compte-solde { margin: 0; font-size: var(--fs-15); }
.cc-compte-toutes { font-size: var(--fs-13); }
.cc-chart-mois { min-height: 190px; }

/* ---------------------------------------------------------------- synthèse : recettes par origine */
/* Le <b> de la liste partagée .donut-list est en white-space: nowrap (style.css, contrat de la
   section 7.2) : « 6 000,00 € · 70,6 % du total des recettes » sur une seule ligne débordait du
   conteneur sous 720 px. Le montant garde son insécabilité, la part et son dénominateur passent
   dessous et se coupent ; l'entrée entière se replie si la largeur ne suffit plus. */
.cc-donut-list > div { flex-wrap: wrap; }
.cc-donut-list .cc-donut-label { min-width: 0; overflow-wrap: anywhere; }
.cc-donut-list .cc-donut-value { display: flex; flex-direction: column; align-items: flex-end; min-width: 0; margin-left: auto; text-align: right; }
.cc-donut-list .cc-donut-part { white-space: normal; line-height: 1.3; }
@media (max-width: 719px) {
  .cc-donut-list b { white-space: normal; }
}

/* ---------------------------------------------------------------- synthèse : contrôles (ControlsList) */
.cc-controls { display: flex; flex-direction: column; gap: var(--s1); }
.cc-controls-ok { display: flex; align-items: center; gap: var(--s2); color: var(--ok); font-size: var(--fs-15); font-weight: 500; padding: var(--s2) 0; }
.cc-control { border: 1px solid var(--line); border-radius: var(--r-8); background: var(--surface); }
.cc-control.has-issues { border-color: var(--warn); }
.cc-control-summary { list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: var(--s2); min-height: 44px; padding: var(--s2) var(--s3); font-size: var(--fs-13); }
.cc-control-summary::-webkit-details-marker { display: none; }
.cc-control-label { flex: 1; min-width: 0; }
.cc-control-body { padding: 0 var(--s3) var(--s3); display: flex; flex-direction: column; gap: var(--s2); }
.cc-control-none { margin: 0; }

/* ---------------------------------------------------------------- paramètres : plafond, estimation */
.cc-estim { display: flex; flex-direction: column; gap: var(--s2); }
.cc-estim:empty { display: none; }
.cc-estim-actions { display: contents; }
.cc-estim-table th, .cc-estim-table td { white-space: normal; }
.cc-estim-sub th, .cc-estim-sub td { color: var(--ink-2); font-weight: 500; }
.cc-estim-notes summary { cursor: pointer; font-size: var(--fs-13); color: var(--accent); min-height: 32px; display: flex; align-items: center; }
.cc-estim-notes ul { margin: var(--s1) 0 0; padding-left: 20px; }

/* ---------------------------------------------------------------- références */
.cc-refs { display: flex; flex-direction: column; gap: var(--s1); padding-bottom: var(--s2); }
.cc-refs-group { font-size: var(--fs-12); font-weight: 500; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin-top: var(--s2); }
.cc-ref { display: flex; align-items: flex-start; justify-content: space-between; gap: var(--s2); padding: 6px 0; border-bottom: 1px solid var(--line); font-size: var(--fs-13); }
.cc-ref:last-of-type { border-bottom: 0; }
.cc-ref-text { flex: 1; min-width: 0; line-height: 1.45; }
.cc-ref-label { color: var(--ink-2); }
.cc-ref-note { color: var(--muted); }
.cc-refs-foot { font-size: var(--fs-13); color: var(--muted); }

/* ---------------------------------------------------------------- 720 px et plus */
@media (min-width: 720px) {
  .cc-app { padding-left: 0; }
  .cc-app #toast-root { left: var(--s5); right: var(--s5); }
  /* plus de collage à 720 (la colonne est courte et l'en-tête reste visible) ; « relative » et non
     « static » pour garder l'indicateur du contrôle segmenté dans sa boîte. */
  .cc-views { position: relative; top: auto; }
  .cc-two { grid-template-columns: 1fr 1fr; }
  .cc-chart-mois { min-height: 220px; }
  .cc-resume { padding: var(--s5); }
  .cc-add { justify-content: flex-end; }
  .cc-add .btn, .cc-add .btn.primary { flex: 0 1 220px; }
  .cc-add { margin-left: calc(-1 * var(--s5)); margin-right: calc(-1 * var(--s5)); padding-left: var(--s5); padding-right: var(--s5); }
  .cc-search { flex-basis: 240px; }
}

/* ---------------------------------------------------------------- impression : A4, document de travail */
@media print {
  @page { size: A4; margin: 14mm; }
  .cc-app { padding: 0; }
  .cc-notes, .cc-views, .cc-resume, .cc-filterbar, .cc-add, .cc-view, .cc-actions, .cc-foot, .cc-accueil, .cc-line-actions, .cc-confirm { display: none !important; }
  .cc-print[hidden] { display: block !important; }
  .cc-print { font-size: 12px; color: #000; }
  .cc-print h2 { font-size: 18px; margin: 0 0 6px; }
  .cc-print h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .06em; color: #444; margin: 16px 0 6px; }
  .cc-print .data-table { font-size: 11px; }
  .cc-print .data-table th, .cc-print .data-table td { white-space: normal; border-bottom: 1px solid #bbb; }
  .cc-print .data-table thead th { position: static; background: #eee; color: #000; }
  .cc-print-note { margin: 8px 0 12px; padding: 8px 10px; border: 1px solid #000; font-weight: 600; break-inside: avoid; }
  .cc-print-table { break-inside: auto; }
  .cc-print-table tr { break-inside: avoid; }
  .cc-print-controls { padding-left: 18px; }
  .cc-badge { border: 1px solid #666; background: none; color: #000; }
  .cc-badge.is-warn { border-color: #000; font-weight: 600; }
  .cc-refs { break-inside: avoid; }
  .cc-ledger-wrap { max-height: none; overflow: visible; border: 0; box-shadow: none; }
  .cc-table thead th { position: static; }
  .cc-danger, .cc-warn, .cc-ok { color: #000; }
}

/* survol : seulement à la souris (un doigt qui touche ne doit pas laisser un état de survol collé) */
@media (hover: hover) and (pointer: fine) {
  .cc-th-btn:hover { background: var(--surface-3); }
  .cc-ledger-row:hover { background: var(--surface-2); }
  .cc-suggest-item:hover { background: var(--surface-2); }
  .cc-combo-item:hover { background: var(--surface-2); }
  .cc-combo-toggle:hover { background: var(--fill); }
  .cc-form-rubrique:hover { text-decoration-color: var(--accent); color: var(--accent); }
}
