/* =====================================================================================================
   Kobi web (PWA iPhone) — feuille de style unique
   « Vois où part ton salaire. »

   Source de vérité : docs/design/charte.md, docs/design/passe-soft.md, Kobi/Resources/Styles/Colors.xaml et
   Styles.xaml (valeurs reprises À L'IDENTIQUE : couleurs, rayons, ombres, tailles). Fiche d'adaptation :
   docs/design/web/adaptation-web.md. Auteur : ux-ui-designer, 2026-11-27.

   Intégration (senior-dotnet-architect) : copier ce fichier en Kobi.Web/wwwroot/css/kobi-web.css et le lier dans
   index.html (<link rel="stylesheet" href="css/kobi-web.css">). Un seul fichier, aucune ressource externe.

   Règles :
   1. CSP « style-src 'self' » : AUCUN attribut style="…" dans les composants Razor ni dans index.html (bloqué).
      Les largeurs variables (barres) passent par un <svg> dont le <rect> reçoit un ATTRIBUT width="42%" (pas du CSS),
      voir « Barres » plus bas. Tout le reste = classes de ce fichier.
   2. 1 px CSS = 1 point iPhone (iPhone 11 : 414 × 896). Les valeurs « dp » d'Android sont reprises telles quelles en px.
   3. Cibles tactiles ≥ 48 px (au-dessus des 44 points d'Apple). Champs de texte ≥ 16 px (sinon Safari zoome).
   4. Pas de :hover (pas de survol sur iPhone) : l'état appuyé passe par :active. Safari iOS n'applique :active que
      si un écouteur « touchstart » existe : kobi.js doit poser
      document.addEventListener("touchstart", function () {}, { passive: true });
   5. Thème clair seulement (comme Android) : color-scheme: light, même si l'iPhone est en mode sombre.
   6. Pas d'animation décorative ; transitions ≤ 120 ms sur la couleur seulement, coupées si
      « Réduire les animations » est activé.
   ===================================================================================================== */

/* ------------------------------------------------------------------
   Polices
   Police SYSTÈME tant que Space Grotesk / Inter ne sont pas fournies (comme Android, charte § 3.1) :
   iPhone = San Francisco (-apple-system), Android/Chrome = Roboto, Windows (essais) = Segoe UI.

   BASCULE (quand l'utilisateur fournit les fichiers ; fichiers LOCAUX uniquement, jamais Google Fonts en ligne) :
   1. Déposer dans Kobi.Web/wwwroot/polices/ les mêmes 6 fichiers que Kobi/Resources/Fonts/ (de préférence convertis
      en .woff2 ; le .ttf marche aussi, CSP « font-src 'self' ») + OFL-SpaceGrotesk.txt et OFL-Inter.txt.
   2. Décommenter le bloc @font-face ci-dessous.
   3. Remplacer les 2 variables --police-titre / --police-texte par les lignes commentées « BASCULE ».

@font-face { font-family: "Space Grotesk"; font-weight: 700; font-style: normal; font-display: swap;
             src: url("../polices/SpaceGrotesk-Bold.woff2") format("woff2"), url("../polices/SpaceGrotesk-Bold.ttf") format("truetype"); }
@font-face { font-family: "Space Grotesk"; font-weight: 600; font-style: normal; font-display: swap;
             src: url("../polices/SpaceGrotesk-SemiBold.woff2") format("woff2"), url("../polices/SpaceGrotesk-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Space Grotesk"; font-weight: 500; font-style: normal; font-display: swap;
             src: url("../polices/SpaceGrotesk-Medium.woff2") format("woff2"), url("../polices/SpaceGrotesk-Medium.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 400; font-style: normal; font-display: swap;
             src: url("../polices/Inter-Regular.woff2") format("woff2"), url("../polices/Inter-Regular.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 500; font-style: normal; font-display: swap;
             src: url("../polices/Inter-Medium.woff2") format("woff2"), url("../polices/Inter-Medium.ttf") format("truetype"); }
@font-face { font-family: "Inter"; font-weight: 600; font-style: normal; font-display: swap;
             src: url("../polices/Inter-SemiBold.woff2") format("woff2"), url("../polices/Inter-SemiBold.ttf") format("truetype"); }
   ------------------------------------------------------------------ */

/* ==================================================================
   1. Variables (= Colors.xaml + Styles.xaml)
   ================================================================== */
:root {
    color-scheme: light;

    /* --- Marque --- */
    --primaire: #0F5F4A;              /* carte verte, onglet actif ; blanc dessus 7,62:1 */
    --primaire-fonce: #0B4D3C;        /* texte vert sur clair 9,81:1 (Surface) / 8,96:1 (Fond) ; tuiles de la carte verte */
    --primaire-clair: #E3F1EA;        /* tuile choisie, pastille Cash, succès, état appuyé */
    --accent: #F2A83B;                /* ambre : bouton principal, « + Cash » ; texte foncé dessus 8,34:1 */
    --accent-presse: #D98E22;         /* ambre appuyé, texte foncé 6,26:1 (transitoire) */
    --accent-clair: #FDF0D5;          /* bandeau d'alerte, pastille Mixx */

    /* --- Fonds --- */
    --fond: #F3F5F4;
    --surface: #FFFFFF;

    /* --- Textes --- */
    --texte: #14201B;                 /* 16,77:1 Surface, 15,32:1 Fond */
    --texte-secondaire: #3E4A45;      /* 9,25:1 Surface, 8,45:1 Fond */
    --texte-doux: #55615C;            /* passe soft : 6,46:1 Surface, 5,90:1 Fond (libellés 14 px) */
    --texte-indice: #5C6963;          /* placeholder SEULEMENT, 5,74:1 */
    --texte-sur-primaire: #FFFFFF;
    --texte-sur-accent: #14201B;

    /* --- Montants (la couleur double toujours le signe − / +) --- */
    --depense: #9B1C1C;               /* 8,15:1 Surface, 7,44:1 Fond */
    --revenu: #1B5E20;                /* 7,87:1 Surface, 7,19:1 Fond */

    /* --- États --- */
    --alerte-fond: #FDF0D5;           /* Texte dessus 14,86:1 */
    --alerte-icone: #5E3900;          /* 9,02:1 sur alerte-fond, 10,2:1 sur Surface */
    --erreur-fond: #FBE9E9;
    --erreur-icone: #9B1C1C;
    --succes-fond: #E3F1EA;

    /* --- Traits, pistes, désactivé --- */
    --bordure: #DCE3E0;
    --bordure-champ: #7B8782;         /* 3,73:1 sur Surface (seuil 3:1 des composants) */
    --piste-barre: #DCE3E0;
    --desactive: #DCE3E0;
    --texte-desactive: #3E4A45;       /* 7,09:1 sur desactive */
    --separateur: #DCE3E0;
    --separateur-doux: #E8EDEA;       /* traits dans une carte blanche (décoratif) */
    --squelette: #E3E8E5;

    /* --- Sources --- */
    --source-mixx-fond: #FDF0D5;      --source-mixx-texte: #5E3900;     /* 9,02:1 */
    --source-flooz-fond: #E3EDFB;     --source-flooz-texte: #0D3B7A;    /* 9,24:1 */
    --source-cash-fond: #E3F1EA;      --source-cash-texte: #0B4D3C;     /* 8,42:1 */
    --source-orabank-fond: #EFE6F5;   --source-orabank-texte: #4A1D6B;  /* 10,3:1 */

    /* --- Carte verte, danger, voile --- */
    --piste-barre-sur-primaire: #0B4D3C;
    --resume-depasse: #9B1C1C;        /* blanc 8,15:1 */
    --resume-depasse-fonce: #7A1515;  /* blanc 10,8:1 */
    --danger: #9B1C1C;
    --danger-presse: #7A1515;
    --texte-sur-danger: #FFFFFF;
    --voile: rgba(20, 32, 27, 0.5);   /* #8014201B */

    /* --- Paie et plafonds --- */
    --repartition-charges: #5F907B;   /* décoratif, 3,64:1 */
    --budget-alerte: #B26B00;         /* barre d'un plafond 80-100 % : 4,20:1 Surface, 3,23:1 piste */

    /* --- Ombres (passe soft : MAUI Shadow → box-shadow) --- */
    --ombre-carte: 0 2px 12px rgba(20, 32, 27, 0.08);     /* OmbreCarte */
    --ombre-resume: 0 6px 16px rgba(15, 95, 74, 0.25);    /* OmbreResume (teinte Primaire) */
    --ombre-flottant: 0 4px 12px rgba(20, 32, 27, 0.20);  /* OmbreFlottant */
    --ombre-resume-depasse: 0 6px 16px rgba(155, 28, 28, 0.25); /* même ombre, teinte de la carte dépassée */
    --primaire-tres-fonce: #093F31;   /* web seulement : tuile de la carte verte appuyée (blanc dessus ≈ 11,9:1) */

    /* --- Polices --- */
    --police-texte: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --police-titre: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    /* BASCULE : --police-texte: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
                 --police-titre: "Space Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; */
    --graisse-normale: 400;
    --graisse-moyenne: 500;          /* TexteFontMoyen */
    --graisse-forte: 600;            /* TexteFontFort, TitreFontMoyen */
    --graisse-titre: 700;            /* TitreFont + Bold */

    /* --- Tailles de texte (px = sp) --- */
    --taille-montant-saisie: 48px;
    --taille-montant-grand: 36px;
    --taille-montant-cle: 28px;
    --taille-montant-moyen: 22px;
    --taille-montant-liste: 18px;
    --taille-montant-ligne: 16px;
    --taille-montant-jour: 14px;
    --taille-titre-marque: 36px;
    --taille-titre-ecran: 22px;
    --taille-titre-etat-vide: 20px;
    --taille-titre-section: 18px;
    --taille-texte: 16px;
    --taille-libelle: 14px;
    --taille-unite: 20px;
    --taille-touche: 24px;
    --taille-icone-tuile: 20px;
    --taille-icone-fermer: 28px;
    --taille-champ-min: 16px;        /* jamais moins dans un champ : Safari zoomerait */

    /* --- Espacements (grille 8) --- */
    --e1: 4px;  --e2: 8px;  --e3: 12px;  --e4: 16px;  --e6: 24px;  --e8: 32px;
    --espace-sections: 24px;

    /* --- Rayons --- */
    --rayon-champ: 12px;             /* champs, touches, ligne de choix */
    --rayon-tuile: 14px;             /* tuiles de catégorie, tuiles de la carte verte, bandeaux */
    --rayon-carte: 16px;             /* cartes, boutons */
    --rayon-resume: 20px;            /* carte verte */
    --rayon-pilule: 24px;            /* filtres, boutons discrets, bouton sur primaire */
    --rayon-flottant: 28px;          /* « + Cash » */

    /* --- Dimensions --- */
    --cible-min: 48px;
    --hauteur-bouton: 56px;
    --hauteur-ligne-liste: 64px;
    --hauteur-ligne-reglage: 56px;
    --taille-pastille: 40px;
    --taille-illustration: 96px;
    --hauteur-touche: 56px;          /* web : 56 au lieu de 48 (l'iPhone 11 a la place, voir adaptation-web.md § 5) */
    --hauteur-onglets: 60px;         /* sans la zone de la barre d'accueil de l'iPhone */
    --hauteur-barre: 8px;
    --hauteur-barre-fine: 6px;
    --hauteur-barre-repartition: 12px;

    /* --- Zones sûres de l'iPhone (encoche, barre d'accueil) : index.html doit avoir viewport-fit=cover --- */
    --sur-haut: env(safe-area-inset-top, 0px);
    --sur-bas: env(safe-area-inset-bottom, 0px);
    --sur-gauche: env(safe-area-inset-left, 0px);
    --sur-droite: env(safe-area-inset-right, 0px);

    /* Hauteur totale de la barre d'onglets, zone de la barre d'accueil comprise (34 px sur iPhone 11). */
    --bas-onglets: calc(var(--hauteur-onglets) + var(--sur-bas));
}

/* ==================================================================
   2. Base
   ================================================================== */
*, *::before, *::after { box-sizing: border-box; }

html {
    -webkit-text-size-adjust: 100%;          /* pas de grossissement automatique à la rotation */
    text-size-adjust: 100%;
    font-size: 100%;                         /* 1rem = 16px */
    background: var(--fond);
}

/* Option « texte agrandi de l'iPhone » (US-W.13.5, Souhaitable) : ajouter la classe sur <html> pour suivre le
   réglage Taille du texte d'iOS (17 px à la taille standard). À valider sur l'iPhone avant de l'activer. */
html.texte-iphone { font: -apple-system-body; }

body {
    margin: 0;
    min-height: 100vh;
    min-height: 100dvh;
    background: var(--fond);
    color: var(--texte);
    font-family: var(--police-texte);
    font-size: var(--taille-texte);
    font-weight: var(--graisse-normale);
    line-height: 1.4;
    -webkit-tap-highlight-color: transparent; /* l'état appuyé est dessiné par :active */
    overscroll-behavior-y: none;              /* pas de « rebond » qui montre le blanc sous la barre d'onglets */
    -webkit-font-smoothing: antialiased;
}

h1, h2, h3, p { margin: 0; }
img, svg { display: block; }
ul, ol { margin: 0; padding: 0; list-style: none; }

button {
    font: inherit;
    color: inherit;
    margin: 0;
    border: 0;
    background: none;
    cursor: pointer;                          /* iOS : rend l'élément « cliquable » au premier tap */
    touch-action: manipulation;               /* pas de délai ni de zoom au double tap (pavé !) */
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;              /* pas de loupe ni de menu à l'appui long */
}

a { color: var(--primaire-fonce); touch-action: manipulation; }

/* Numéros, dates, adresses : jamais cliquables (US-W.7.4). Compléter par
   <meta name="format-detection" content="telephone=no, date=no, address=no, email=no"> dans index.html. */
a[x-apple-data-detectors] { color: inherit !important; text-decoration: none !important; pointer-events: none !important; }

/* Champs : 16 px minimum, sinon Safari zoome sur la page au toucher. */
input, textarea, select {
    font-family: var(--police-texte);
    font-size: max(var(--taille-champ-min), 1rem);
    color: var(--texte);
}

/* Focus visible (VoiceOver, clavier Bluetooth) : anneau vert foncé, jamais retiré. */
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--primaire-fonce); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* Masqué à l'écran, lu par VoiceOver (ex. « francs CFA »). */
.visuellement-cache {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
/* Zone d'annonces VoiceOver (ILecteurEcran web) : <div class="zone-annonces" aria-live="polite"></div>. */
.zone-annonces { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ==================================================================
   3. Squelette de l'appli : contenu + barre d'onglets en bas
   ================================================================== */
.appli {
    min-height: 100vh;
    min-height: 100dvh;
    padding-left: var(--sur-gauche);
    padding-right: var(--sur-droite);
}

/* Page d'onglet (Accueil, Opérations, Paie, Réglages) : laisse la place de la barre d'onglets. */
.page {
    padding: calc(var(--sur-haut) + var(--e6)) var(--e4) calc(var(--bas-onglets) + var(--e6));
    display: flex;
    flex-direction: column;
    gap: var(--espace-sections);
}
.page--serree { gap: var(--e4); }

/* Page qui porte les boutons flottants (« Coller un SMS » + « + Cash ») : 88 px de plus en bas. */
.page--sous-flottants { padding-bottom: calc(var(--bas-onglets) + 88px); }

/* Page poussée par-dessus les onglets (fiche, saisie, collage, sous-page de réglage) : pas de barre d'onglets. */
.page-poussee {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    background: var(--fond);
}
.page-poussee__contenu {
    flex: 1 1 auto;
    padding: var(--e4) var(--e4) var(--e6);
    display: flex;
    flex-direction: column;
    gap: var(--espace-sections);
}

/* Barre du haut d'une page poussée : « × » ou « ‹ Retour » toujours visible (l'iPhone n'a pas de bouton Retour). */
.barre-haut {
    position: sticky;
    top: 0;
    z-index: 5;
    display: grid;
    grid-template-columns: 56px 1fr 56px;
    align-items: center;
    min-height: calc(56px + var(--sur-haut));
    padding: var(--sur-haut) var(--e1) 0;
    background: var(--fond);
}
.barre-haut--surface { background: var(--surface); }
.barre-haut__titre {
    grid-column: 2;
    text-align: center;
    font-family: var(--police-titre);
    font-weight: var(--graisse-forte);
    font-size: var(--taille-titre-section);
    line-height: 1.2;
}
.barre-haut__sous-titre { display: block; font-family: var(--police-texte); font-weight: var(--graisse-normale); font-size: var(--taille-libelle); color: var(--texte-doux); }

/* Zone fixe en bas d'une page poussée (bouton principal, pavé) : au-dessus de la barre d'accueil de l'iPhone. */
.zone-fixe {
    position: sticky;
    bottom: 0;
    z-index: 5;
    padding: var(--e2) var(--e4) calc(var(--e4) + var(--sur-bas));
    background: var(--fond);
    display: flex;
    gap: var(--e2);
}
.zone-fixe > * { flex: 1 1 0; }
/* Zone fixe sur un ONGLET (Paie non réglée : « Régler ma paie ») : posée juste au-dessus de la barre d'onglets. */
.zone-fixe--sur-onglets { position: fixed; left: var(--sur-gauche); right: var(--sur-droite); bottom: var(--bas-onglets); padding-bottom: var(--e4); }
.page--sous-zone-fixe { padding-bottom: calc(var(--bas-onglets) + 88px); }
.zone-fixe--colonne { flex-direction: column; }

/* En-tête d'onglet : sur-titre puis titre (« Bonjour » / « Novembre »). */
.en-tete { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--e2); }
.en-tete__textes { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* Titre de section + lien à droite (« Où part ton argent » … « Tout voir »). */
.tete-section { display: flex; align-items: center; justify-content: space-between; gap: var(--e2); min-height: var(--cible-min); }

/* ==================================================================
   4. Textes (= styles Label)
   ================================================================== */
.texte-courant { font-size: var(--taille-texte); color: var(--texte); }
.texte-fort { font-size: var(--taille-texte); font-weight: var(--graisse-forte); color: var(--texte); }
.texte-secondaire { font-size: var(--taille-texte); color: var(--texte-doux); }
.sur-titre, .libelle-doux { font-size: var(--taille-libelle); color: var(--texte-doux); }
.legende { font-size: var(--taille-libelle); font-weight: var(--graisse-forte); color: var(--texte); }
.libelle-ligne { font-size: var(--taille-libelle); color: var(--texte); }
.libelle-sur-primaire { font-size: var(--taille-libelle); color: var(--texte-sur-primaire); }
.texte-sur-primaire { color: var(--texte-sur-primaire); }
.texte-fort-sur-primaire { font-weight: var(--graisse-forte); color: var(--texte-sur-primaire); }
.texte-alerte { font-size: var(--taille-texte); color: var(--texte); }
.texte-danger { font-weight: var(--graisse-forte); color: var(--danger); }

.titre-ecran {
    font-family: var(--police-titre);
    font-weight: var(--graisse-titre);
    font-size: var(--taille-titre-ecran);
    line-height: 1.2;
    color: var(--texte);
}
.titre-section {
    font-family: var(--police-titre);
    font-weight: var(--graisse-forte);
    font-size: var(--taille-titre-section);
    line-height: 1.25;
    color: var(--texte);
}
.titre-marque {
    font-family: var(--police-titre);
    font-weight: var(--graisse-titre);
    font-size: var(--taille-titre-marque);
    line-height: 1.1;
    color: var(--primaire-fonce);                  /* 8,96:1 sur Fond */
}
.titre-groupe {                                    /* « Mes SMS », « Mes données » */
    margin: var(--e6) var(--e1) var(--e2);
    font-size: var(--taille-libelle);
    font-weight: var(--graisse-forte);
    color: var(--texte-doux);
}
.lien-section {                                    /* « Tout voir », « + Ajouter » : 14 px vert foncé, sans soulignement */
    font-size: var(--taille-libelle);
    font-weight: var(--graisse-forte);
    color: var(--primaire-fonce);
    text-decoration: none;
}
.lien { font-weight: var(--graisse-forte); color: var(--primaire-fonce); text-decoration: underline; }

/* ==================================================================
   5. Montants — toujours en chiffres à chasse fixe, jamais coupés
   Texte : FormatFcfa du Core (U+00A0 entre les groupes, « − » U+2212). « FCFA » séparé par une espace NORMALE
   pour que seul « FCFA » passe à la ligne si la place manque.
   ================================================================== */
.montant {
    font-family: var(--police-titre);
    font-weight: var(--graisse-titre);
    font-variant-numeric: tabular-nums;
    color: var(--texte);
    white-space: nowrap;
    line-height: 1.15;
}
.montant--saisie { font-size: var(--taille-montant-saisie); }
.montant--saisie-reduit { font-size: var(--taille-montant-grand); }      /* 8 à 10 chiffres */
.montant--saisie-tres-long { font-size: var(--taille-montant-cle); }     /* 11 ou 12 chiffres */
.montant--grand { font-size: var(--taille-montant-grand); }
.montant--resume { font-size: var(--taille-montant-grand); color: var(--texte-sur-primaire); white-space: normal; }
.montant--resume-reduit { font-size: var(--taille-montant-cle); color: var(--texte-sur-primaire); white-space: normal; }
.montant--cle { font-size: var(--taille-montant-cle); }
.montant--fiche { font-size: var(--taille-montant-cle); white-space: normal; }
.montant--salaire { font-size: var(--taille-montant-cle); text-align: right; }
.montant--moyen { font-size: var(--taille-montant-moyen); }
.montant--moyen-reduit { font-size: var(--taille-montant-liste); }
.montant--ligne { font-size: var(--taille-montant-ligne); text-align: right; }
.montant--jour { font-size: var(--taille-montant-jour); text-align: right; }
.montant--petit { font-size: var(--taille-libelle); font-weight: var(--graisse-forte); text-align: right; }
.montant--plafond { font-family: var(--police-texte); font-size: var(--taille-libelle); font-weight: var(--graisse-normale); color: var(--texte); }

/* Couleurs (modificateurs) : la couleur double toujours le signe écrit. */
.montant--depense { color: var(--depense); }
.montant--revenu { color: var(--revenu); }
.montant--sur-primaire { color: var(--texte-sur-primaire); }

/* « FCFA » à côté du montant tapé. */
.unite {
    font-family: var(--police-titre);
    font-weight: var(--graisse-titre);
    font-size: var(--taille-unite);
    color: var(--texte-secondaire);                 /* 9,25:1 Surface */
    white-space: nowrap;
}
/* Montant + unité alignés sur la ligne de base, « FCFA » passe dessous si la place manque. */
.montant-unite { display: flex; flex-wrap: wrap; justify-content: center; align-items: baseline; column-gap: var(--e2); }

/* ==================================================================
   6. Cartes
   ================================================================== */
.carte {
    background: var(--surface);
    border-radius: var(--rayon-carte);
    padding: var(--e4);
    box-shadow: var(--ombre-carte);
}
.carte--compacte { padding: var(--e3); }
/* Repli si l'ombre gêne (même valeur qu'Android CarteContour). */
.carte--contour { box-shadow: none; border: 1px solid var(--bordure); }

/* Carte de lignes, SANS ombre : listes longues (Opérations, SMS à vérifier, catégories, règles). */
.carte-groupe {
    background: var(--surface);
    border-radius: var(--rayon-carte);
    overflow: hidden;
}
/* Carte de lignes AVEC ombre (Réglages, Dernières opérations de l'accueil : listes courtes). */
.carte-liste {
    background: var(--surface);
    border-radius: var(--rayon-carte);
    box-shadow: var(--ombre-carte);
    overflow: hidden;
}
/* Trait entre deux lignes de réglage d'une carte (les lignes d'opération ont leur propre trait, aligné sur le texte). */
.carte-groupe > .ligne-reglage + .ligne-reglage, .carte-liste > .ligne-reglage + .ligne-reglage { border-top: 1px solid var(--separateur-doux); }

/* ------------------------------------------------------------------
   Carte verte (« Reste jusqu'à la paie », « Dépensé en novembre », « Budget par semaine »)
   ------------------------------------------------------------------ */
.carte-verte {
    background: var(--primaire);
    color: var(--texte-sur-primaire);
    border-radius: var(--rayon-resume);
    padding: 20px;
    box-shadow: var(--ombre-resume);
    display: flex;
    flex-direction: column;
    gap: var(--e3);
}
.carte-verte--compacte { padding: var(--e4) 20px; }
.carte-verte--depassee { background: var(--resume-depasse); box-shadow: var(--ombre-resume-depasse); }
.carte-verte__tete { display: flex; justify-content: space-between; align-items: baseline; gap: var(--e2); }

.tuiles-resume { display: grid; grid-template-columns: 1fr 1fr; gap: var(--e2); }
.tuile-resume {
    background: var(--primaire-fonce);              /* blanc dessus 9,81:1 */
    border-radius: var(--rayon-tuile);
    padding: var(--e3);
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-height: var(--cible-min);
    text-align: left;
    color: var(--texte-sur-primaire);
}
.carte-verte--depassee .tuile-resume { background: var(--resume-depasse-fonce); }
button.tuile-resume:active { background: var(--primaire-tres-fonce); }

/* Pilule blanche dans la carte verte (« Régler ma paie › »). */
.bouton-sur-primaire {
    align-self: flex-start;
    min-height: var(--cible-min);
    padding: 0 20px;
    border-radius: var(--rayon-pilule);
    background: var(--surface);
    color: var(--primaire-fonce);                   /* 9,81:1 */
    font-weight: var(--graisse-forte);
    font-size: var(--taille-texte);
}
.bouton-sur-primaire:active { background: var(--primaire-clair); }

/* ==================================================================
   7. Bandeaux (alerte ambre, erreur, succès) et pilules
   ================================================================== */
.bandeau {
    display: flex;
    align-items: center;
    gap: var(--e3);
    min-height: var(--hauteur-bouton);
    padding: var(--e1) var(--e4);
    border-radius: var(--rayon-tuile);
    background: var(--alerte-fond);                 /* ambre par défaut : texte 14,86:1 */
    color: var(--texte);
}
.bandeau--alerte { background: var(--alerte-fond); }
.bandeau--erreur { background: var(--erreur-fond); }
.bandeau--succes { background: var(--succes-fond); }
.bandeau--colonne { flex-direction: column; align-items: stretch; padding: var(--e3) var(--e4); }
.bandeau__texte { flex: 1 1 auto; min-width: 0; }
.bandeau__actions { display: flex; justify-content: flex-end; gap: var(--e2); flex-wrap: wrap; }
/* Glyphe d'état (« ! », « ✓ ») : décoratif (aria-hidden="true"), toujours à côté d'un texte qui dit la même chose. */
.bandeau__icone { flex: 0 0 auto; min-width: 16px; text-align: center; font-weight: var(--graisse-forte); }
.bandeau--alerte .bandeau__icone, .bandeau:not(.bandeau--erreur):not(.bandeau--succes) .bandeau__icone { color: var(--alerte-icone); }
.bandeau--erreur .bandeau__icone { color: var(--erreur-icone); }
.bandeau--succes .bandeau__icone { color: var(--primaire-fonce); }
/* Bandeau tactile en entier (« SMS à vérifier (3) ›»). */
button.bandeau { width: 100%; text-align: left; }
button.bandeau:active { filter: brightness(0.96); }

/* Message flottant d'une saisie (« Dépense enregistrée · Annuler », 5 s) : au-dessus des onglets et de la barre d'accueil. */
.message-flottant {
    position: fixed;
    left: calc(var(--e4) + var(--sur-gauche));
    right: calc(var(--e4) + var(--sur-droite));
    bottom: calc(var(--bas-onglets) + var(--e4));
    z-index: 30;
    box-shadow: var(--ombre-flottant);
}
.page-poussee .message-flottant { bottom: calc(var(--sur-bas) + var(--e4)); }

/* Icônes d'état dans une liste à puces (alignées sur la 1re ligne). */
.icone-etat { flex: 0 0 auto; min-width: 16px; font-weight: var(--graisse-forte); text-align: center; }
.icone-etat--succes { color: var(--primaire-fonce); }
.icone-etat--non { color: var(--depense); }
.icone-etat--alerte { color: var(--alerte-icone); }
.icone-etat--erreur { color: var(--erreur-icone); }
.puce { display: flex; gap: var(--e3); align-items: flex-start; }

/* Badge (« Aperçu », « Activée ») : pilule vert très clair, 14 px vert foncé 8,42:1. Pas tactile. */
.badge {
    display: inline-flex;
    align-items: center;
    align-self: flex-start;
    padding: 2px 10px;
    border-radius: var(--rayon-champ);
    background: var(--primaire-clair);
    color: var(--primaire-fonce);
    font-size: var(--taille-libelle);
    font-weight: var(--graisse-forte);
}

/* Pilule discrète tactile (« Coller un SMS » en en-tête) : blanche sans contour, 14 px vert foncé, 48 px. */
.pilule {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--e2);
    min-height: var(--cible-min);
    min-width: var(--cible-min);
    padding: 0 var(--e4);
    border-radius: var(--rayon-pilule);
    background: var(--surface);
    color: var(--primaire-fonce);
    font-size: var(--taille-libelle);
    font-weight: var(--graisse-forte);
    white-space: nowrap;
}
.pilule:active { background: var(--primaire-clair); }
.pilule--ombre { box-shadow: var(--ombre-flottant); }   /* version flottante, à côté de « + Cash » */

/* Filtres (Tout / Mixx / Flooz / Orabank / Cash) : rangée qui défile sur le côté, sans barre. */
.filtres {
    display: flex;
    gap: var(--e2);
    overflow-x: auto;
    margin: 0 calc(-1 * var(--e4));
    padding: 0 var(--e4);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}
.filtres::-webkit-scrollbar { display: none; }
.filtre {
    flex: 0 0 auto;
    min-height: var(--cible-min);
    min-width: var(--cible-min);
    padding: 0 var(--e4);
    border-radius: var(--rayon-pilule);
    background: var(--surface);
    border: 1px solid var(--bordure);
    color: var(--texte);
    font-size: var(--taille-libelle);
    font-weight: var(--graisse-forte);
}
.filtre:active { background: var(--primaire-clair); }
.filtre[aria-pressed="true"] { background: var(--primaire); border-color: var(--primaire); color: var(--texte-sur-primaire); }
.filtre[aria-pressed="true"]:active { background: var(--primaire-fonce); }

/* ==================================================================
   8. Boutons
   ================================================================== */
.bouton {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--e2);
    min-height: var(--cible-min);
    min-width: var(--cible-min);
    padding: 0 var(--e6);
    border-radius: var(--rayon-carte);
    font-size: var(--taille-texte);
    font-weight: var(--graisse-forte);
    line-height: 1.2;
    text-align: center;
    transition: background-color 120ms ease-out;
}

/* Action principale : ambre, texte foncé 8,34:1, 56 px, une seule par écran, dans le tiers inférieur. */
.bouton-principal { min-height: var(--hauteur-bouton); background: var(--accent); color: var(--texte-sur-accent); width: 100%; }
.bouton-principal:active { background: var(--accent-presse); }
/* Grisé mais TACTILE (le tap explique ce qui manque) : aria-disabled="true", jamais disabled. */
.bouton-principal[aria-disabled="true"], .bouton-principal--inactif { background: var(--desactive); color: var(--texte-desactive); }
.bouton-principal:disabled { background: var(--desactive); color: var(--texte-desactive); }

/* Secondaire : blanc, contour 1,5 px vert foncé. */
.bouton-secondaire { min-height: var(--hauteur-bouton); background: var(--surface); color: var(--primaire-fonce); border: 1.5px solid var(--primaire-fonce); width: 100%; }
.bouton-secondaire:active { background: var(--primaire-clair); }
.bouton-secondaire--compact { min-height: var(--cible-min); padding: 0 var(--e3); border-radius: var(--rayon-champ); width: auto; }

/* Bouton-lien (« Plus tard », « Continuer ») : sans fond, zone 48 px. */
.bouton-texte { background: transparent; color: var(--primaire-fonce); padding: 0 var(--e4); border-radius: var(--rayon-champ); }
.bouton-texte:active { background: var(--primaire-clair); }
.bouton-texte--danger { color: var(--danger); }
.bouton-texte--gauche { justify-content: flex-start; padding-left: 0; }

/* « Voir › », « Exporter » dans un bandeau : 14 px vert foncé, 48 px. */
.bouton-lien-section { background: transparent; color: var(--primaire-fonce); font-size: var(--taille-libelle); padding: 0 var(--e3); border-radius: var(--rayon-champ); }
.bouton-lien-section:active { background: var(--primaire-clair); }

/* Confirmation d'un effacement / d'une suppression : rouge foncé, texte blanc 8,15:1. */
.bouton-danger { min-height: var(--hauteur-bouton); background: var(--danger); color: var(--texte-sur-danger); width: 100%; }
.bouton-danger:active { background: var(--danger-presse); }

/* « × » (fermer) et « ‹ » (retour) : 48 × 48, en haut à gauche. aria-label="Fermer" / "Retour" dans la page. */
.bouton-fermer, .bouton-retour {
    grid-column: 1;
    width: var(--cible-min);
    height: var(--cible-min);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--texte);
    font-size: var(--taille-icone-fermer);
    line-height: 1;
}
/* « ‹ Retour » écrit : plus clair pour qui ne connaît pas l'iPhone. */
.bouton-retour--texte { width: auto; border-radius: var(--rayon-champ); padding: 0 var(--e3) 0 var(--e1); font-size: var(--taille-texte); font-weight: var(--graisse-forte); color: var(--primaire-fonce); gap: 2px; }
.bouton-fermer:active, .bouton-retour:active { background: var(--primaire-clair); }

/* Boutons flottants en bas à droite (« Coller un SMS » + « + Cash »), au-dessus des onglets et de la barre d'accueil. */
.actions-flottantes {
    position: fixed;
    right: calc(var(--e4) + var(--sur-droite));
    bottom: calc(var(--bas-onglets) + var(--e4));
    z-index: 20;
    display: flex;
    align-items: center;
    gap: var(--e2);
}
.bouton-flottant {
    min-height: var(--hauteur-bouton);
    min-width: 112px;
    padding: 0 20px;
    border-radius: var(--rayon-flottant);
    background: var(--accent);
    color: var(--texte-sur-accent);
    font-size: var(--taille-texte);
    font-weight: var(--graisse-forte);
    box-shadow: var(--ombre-flottant);
}
.bouton-flottant:active { background: var(--accent-presse); }
.actions-flottantes .pilule { min-height: var(--hauteur-bouton); border-radius: var(--rayon-flottant); font-size: var(--taille-texte); padding: 0 20px; }

/* ==================================================================
   9. Barre d'onglets (Accueil, Opérations, Paie, Réglages)
   Icônes : SVG en ligne copiés de docs/design/icones/onglet_*.svg avec stroke="currentColor" (aucun fichier de plus).
   L'onglet actif = aria-current="page" : couleur + pilule derrière l'icône (la couleur n'est jamais seule).
   ================================================================== */
.barre-onglets {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: var(--bas-onglets);
    padding: 0 var(--sur-droite) var(--sur-bas) var(--sur-gauche);
    background: var(--surface);
    border-top: 1px solid var(--separateur);       /* séparation au soleil, sans ombre */
}
.onglet {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: var(--cible-min);
    color: var(--texte-secondaire);                 /* 9,25:1 */
    font-size: var(--taille-libelle);
    font-weight: var(--graisse-forte);
    text-decoration: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    touch-action: manipulation;
}
.onglet__icone {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 28px;
    border-radius: 14px;
}
.onglet__icone svg { width: 24px; height: 24px; }
.onglet[aria-current="page"] { color: var(--primaire); }                       /* 7,62:1 */
.onglet[aria-current="page"] .onglet__icone { background: var(--primaire-clair); color: var(--primaire-fonce); }
.onglet:active .onglet__icone { background: var(--primaire-clair); }

/* Quand le clavier de l'iPhone est ouvert (note, nom de catégorie), la barre d'onglets et les boutons flottants se
   cachent : sinon Safari les fait « flotter » au-dessus du clavier. */
.appli:has(input:focus, textarea:focus) .barre-onglets,
.appli:has(input:focus, textarea:focus) .actions-flottantes { display: none; }

/* ==================================================================
   10. Lignes d'opération (pastille de source | textes | montant)
   ================================================================== */
.ligne-operation {
    display: grid;
    grid-template-columns: var(--taille-pastille) minmax(0, 1fr) auto;
    align-items: center;
    column-gap: var(--e3);
    min-height: var(--hauteur-ligne-liste);
    padding: var(--e3) var(--e4);
    background: var(--surface);
    width: 100%;
    text-align: left;
}
button.ligne-operation:active, a.ligne-operation:active { background: var(--primaire-clair); }
a.ligne-operation { text-decoration: none; color: inherit; }
/* Trait entre deux lignes, aligné sur le texte (68 px = 16 + 40 + 12). */
.ligne-operation + .ligne-operation { border-top: 0; position: relative; }
.ligne-operation + .ligne-operation::before {
    content: "";
    position: absolute;
    top: 0;
    left: 68px;
    right: 0;
    height: 1px;
    background: var(--separateur-doux);
}
.ligne-operation__textes { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.titre-ligne {
    font-weight: var(--graisse-forte);
    font-size: var(--taille-texte);
    color: var(--texte);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: anywhere;
}
.sous-titre-ligne {
    font-size: var(--taille-libelle);
    color: var(--texte-doux);                       /* 6,46:1 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Pastille de source 40 px, initiales 14 px gras ; le nom de la source est toujours écrit dans la ligne. */
.pastille {
    width: var(--taille-pastille);
    height: var(--taille-pastille);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--police-titre);
    font-weight: var(--graisse-titre);
    font-size: var(--taille-libelle);
    line-height: 1;
    white-space: nowrap;
    background: var(--source-cash-fond);
    color: var(--source-cash-texte);
}
.pastille--mixx { background: var(--source-mixx-fond); color: var(--source-mixx-texte); }
.pastille--flooz { background: var(--source-flooz-fond); color: var(--source-flooz-texte); }
.pastille--orabank { background: var(--source-orabank-fond); color: var(--source-orabank-texte); }
.pastille--cash { background: var(--source-cash-fond); color: var(--source-cash-texte); }

/* Groupe du jour (Opérations) : en-tête sur Fond + carte-groupe arrondie. */
.en-tete-jour {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--e2);
    min-height: var(--cible-min);
    padding: 20px var(--e1) var(--e2);
    font-size: var(--taille-libelle);
    font-weight: var(--graisse-forte);
    color: var(--texte-doux);                       /* 5,90:1 sur Fond */
}

/* ==================================================================
   11. Lignes de réglage, lignes de choix, interrupteur, champs
   ================================================================== */
.ligne-reglage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    column-gap: var(--e3);
    min-height: var(--hauteur-ligne-reglage);
    padding: var(--e2) var(--e4);
    background: var(--surface);
    width: 100%;
    text-align: left;
    color: var(--texte);
    text-decoration: none;
}
button.ligne-reglage:active, a.ligne-reglage:active { background: var(--primaire-clair); }
.ligne-reglage__textes { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.chevron { color: var(--texte-doux); font-size: var(--taille-titre-section); font-weight: var(--graisse-forte); line-height: 1; }

/* Choix à un tap (Dépense / Revenu, source d'un SMS collé, délai) : jamais de bouton radio natif. */
.ligne-choix {
    display: flex;
    align-items: center;
    gap: var(--e3);
    width: 100%;
    min-height: var(--cible-min);
    padding: var(--e2) var(--e4);
    border-radius: var(--rayon-champ);
    background: var(--surface);
    border: 1px solid var(--bordure-champ);
    text-align: left;
    color: var(--texte);
}
.ligne-choix:active { background: var(--primaire-clair); }
.ligne-choix[aria-pressed="true"], .ligne-choix[aria-checked="true"], .ligne-choix--choisie {
    background: var(--primaire-clair);
    border: 2px solid var(--primaire);
    padding: 7px 15px;                              /* compense le contour de 2 px */
}
/* Champ montant de la paie rempli par le pavé (même dessin) ; aria-current="true" = celui que remplit le pavé. */
.champ-montant {
    display: flex; align-items: center; justify-content: space-between; gap: var(--e3);
    width: 100%; min-height: var(--cible-min); padding: var(--e2) var(--e4);
    border-radius: var(--rayon-champ); background: var(--surface); border: 1px solid var(--bordure-champ); text-align: left;
}
.champ-montant[aria-current="true"] { background: var(--primaire-clair); border: 2px solid var(--primaire); padding: 7px 15px; }

/* Interrupteur (« Toujours classer {nom} ici ») : <button role="switch" aria-checked="…" class="interrupteur">.
   La ligne entière est tactile ; le texte voisin dit ce que fait l'interrupteur. */
.interrupteur {
    flex: 0 0 auto;
    position: relative;
    width: 52px;
    height: 32px;
    border-radius: 16px;
    background: var(--bordure-champ);               /* 3,73:1 sur blanc : la piste se voit éteinte */
    transition: background-color 120ms ease-out;
}
.interrupteur::after {
    content: "";
    position: absolute;
    top: 4px;
    left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--surface);
    transition: transform 120ms ease-out;
}
.interrupteur[aria-checked="true"] { background: var(--primaire); }
.interrupteur[aria-checked="true"]::after { transform: translateX(20px); }
/* L'interrupteur seul fait 52 × 32 : la ligne qui le porte fait ≥ 48 px et reçoit le tap. */
.ligne-interrupteur { display: flex; align-items: center; justify-content: space-between; gap: var(--e3); min-height: var(--cible-min); width: 100%; text-align: left; }

/* Champ de texte (nom d'une catégorie à moi : seul champ tapé au clavier de l'iPhone, avec la note du cash). */
.champ {
    width: 100%;
    min-height: var(--hauteur-bouton);
    padding: 0 var(--e3);
    border-radius: var(--rayon-champ);
    border: 1px solid var(--bordure-champ);         /* 3,73:1 */
    background: var(--surface);
    font-size: max(var(--taille-champ-min), 1rem); /* ≥ 16 px : pas de zoom Safari */
    color: var(--texte);
    -webkit-appearance: none;
    appearance: none;
}
.champ::placeholder { color: var(--texte-indice); opacity: 1; }
.champ:focus { border: 2px solid var(--primaire); padding: 0 11px; outline: none; }

/* Zone de collage (si l'iPhone refuse la lecture du presse-papiers, US-W.4.7) : « Appuie longuement ici, puis touche
   Coller. » Le texte collé est traité aussitôt (événement paste) ; la frappe est refusée (beforeinput ≠ insertFromPaste).
   Le texte n'est jamais affiché ni gardé dans la zone. */
.zone-coller {
    width: 100%;
    min-height: 160px;
    padding: var(--e4);
    border-radius: var(--rayon-carte);
    border: 2px dashed var(--bordure-champ);
    background: var(--surface);
    font-size: max(var(--taille-champ-min), 1rem);
    color: var(--texte);
    caret-color: transparent;
    resize: none;
    -webkit-appearance: none;
    appearance: none;
}
.zone-coller::placeholder { color: var(--texte); opacity: 1; text-align: center; }  /* consigne lisible 16,77:1, pas un indice gris */
.zone-coller:focus { border-color: var(--primaire); outline: none; }

/* Texte brut d'un SMS (SMS à vérifier) : sélectionnable, jamais cliquable, coupé proprement. */
.texte-sms {
    font-size: var(--taille-texte);
    color: var(--texte);
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    -webkit-user-select: text;
    user-select: text;
}

/* ==================================================================
   12. Pavé numérique de Kobi (le clavier de l'iPhone ne s'ouvre jamais pour un montant)
   <div class="zone-pave" role="group" aria-label="Pavé numérique"> + 12 <button type="button" class="touche">.
   Montant affiché dans un <output aria-live="polite">, jamais dans un <input> (sinon le clavier s'ouvre).
   ================================================================== */
.zone-pave {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--e2);                                  /* web : 8 px aussi entre les rangées (place suffisante) */
    padding: var(--e2) var(--e4) calc(var(--e2) + var(--sur-bas));
    background: var(--fond);
    border-top: 1px solid var(--separateur);
    -webkit-user-select: none;
    user-select: none;
}
.touche {
    min-height: var(--hauteur-touche);
    border-radius: var(--rayon-champ);
    background: var(--surface);
    color: var(--texte);
    font-family: var(--police-titre);
    font-weight: var(--graisse-forte);
    font-size: var(--taille-touche);
    font-variant-numeric: tabular-nums;
    display: flex;
    align-items: center;
    justify-content: center;
}
.touche:active { background: var(--primaire-clair); }
.touche:disabled { background: var(--desactive); color: var(--texte-desactive); }
.touche svg { width: 24px; height: 24px; }        /* « ⌫ » = icone_effacer.svg en ligne, stroke="currentColor" */

/* Haut de la saisie cash sur blanc, pavé sur gris (passe soft § 2.5). */
.saisie-haut { background: var(--surface); }
.saisie-montant { padding: var(--e2) var(--e4); min-height: 72px; display: flex; align-items: center; justify-content: center; }

/* Grille des jours de paie (1 à 31) : 6 colonnes, mêmes touches, 18 px. */
.grille-jours { display: grid; grid-template-columns: repeat(6, 1fr); gap: var(--e2); }
.touche-jour {
    min-height: var(--cible-min);
    border-radius: var(--rayon-champ);
    background: var(--surface);
    color: var(--texte);
    font-family: var(--police-titre);
    font-weight: var(--graisse-forte);
    font-size: var(--taille-montant-liste);
}
.touche-jour:active { background: var(--primaire-clair); }
.touche-jour[aria-pressed="true"] { background: var(--primaire); color: var(--texte-sur-primaire); }

/* ==================================================================
   13. Grille de catégories (saisie cash, fiche, plafond) : 1 tap = choix
   ================================================================== */
.aide-grille { padding: var(--e2) var(--e4); font-size: var(--taille-libelle); font-weight: var(--graisse-forte); color: var(--texte); }
.grille-categories {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: var(--e2);
    padding: var(--e2);                              /* à 8 px des bords (charte § 5) */
}
.tuile-categorie {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    min-height: 64px;                                /* 64 partout sur le web : rangées égales, la place le permet */
    min-width: var(--cible-min);
    padding: var(--e1) 2px;
    border-radius: var(--rayon-tuile);
    border: 1.5px solid var(--bordure);
    background: var(--surface);
    color: var(--texte);
    text-align: center;
}
.tuile-categorie:active { background: var(--primaire-clair); }
.tuile-categorie[aria-pressed="true"], .tuile-categorie--choisie { background: var(--primaire-clair); border-color: var(--primaire); }
/* Montant à 0 : grisée mais TACTILE (« Tape d'abord le montant. ») → aria-disabled, jamais disabled. */
.tuile-categorie[aria-disabled="true"], .tuile-categorie--inactive { background: var(--desactive); border-color: transparent; }
.tuile-categorie__icone { font-size: var(--taille-icone-tuile); line-height: 1.2; }   /* emoji du Core, police emoji d'Apple */
.tuile-categorie__nom {
    font-size: var(--taille-libelle);
    font-weight: var(--graisse-normale);
    line-height: 1.2;
    color: var(--texte);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    overflow-wrap: break-word;
    hyphens: manual;
}
/* « Note (facultatif) » dans 2 cases de la grille. */
.champ-note {
    grid-column: span 2;
    min-height: 64px;
    padding: 0 var(--e3);
    border-radius: var(--rayon-champ);
    border: 1px solid var(--bordure-champ);
    background: var(--surface);
    font-size: max(var(--taille-champ-min), 1rem);
    color: var(--texte);
    -webkit-appearance: none;
    appearance: none;
}
.champ-note::placeholder { color: var(--texte-indice); opacity: 1; }
.champ-note:focus { border: 2px solid var(--primaire); padding: 0 11px; outline: none; }

/* ==================================================================
   14. Barres (sans bibliothèque, sans style en ligne)
   Une barre = <svg class="barre barre--fine" aria-hidden="true" preserveAspectRatio="none">
                 <rect class="barre__piste" width="100%" height="100%" rx="3" />
                 <rect class="barre__remplie" width="42%" height="100%" rx="3" />  ← width = ATTRIBUT (CSP ok)
               </svg>
   La valeur est toujours écrite à côté (montant, « Reste … ») : la barre est décorative.
   ================================================================== */
.barre { width: 100%; height: var(--hauteur-barre); overflow: visible; }
.barre--fine { height: var(--hauteur-barre-fine); }
.barre__piste { fill: var(--piste-barre); }
.barre__remplie { fill: var(--primaire-fonce); }                 /* catégorie < 80 % du plafond, ou sans plafond */

/* Plafonds par catégorie (phase 5 bis) : vert < 80 %, ambre foncé 80-100 %, rouge > 100 % (pleine). */
.barre--alerte .barre__remplie { fill: var(--budget-alerte); }   /* #B26B00, 4,20:1 sur blanc */
.barre--depassee .barre__remplie { fill: var(--depense); }       /* #9B1C1C, 8,15:1 */
.texte-budget-alerte { font-size: var(--taille-libelle); font-weight: var(--graisse-forte); color: var(--alerte-icone); }  /* « ! Reste 12 000 » 10,2:1 */
.texte-budget-depasse { font-size: var(--taille-libelle); font-weight: var(--graisse-forte); color: var(--depense); }      /* « ! Dépassé de 3 000 » */

/* Barre de la carte verte : piste vert foncé, partie dépensée ambre (4,8:1 entre les deux). */
.barre--sur-primaire .barre__piste { fill: var(--piste-barre-sur-primaire); }
.barre--sur-primaire .barre__remplie { fill: var(--accent); }

/* Barre de répartition de la paie (12 px) : 3 <rect> posés bout à bout (x et width en % calculés par le C#),
   séparés par 2 px de blanc grâce au contour. */
.barre--repartition { height: var(--hauteur-barre-repartition); }
.barre--repartition rect { stroke: var(--surface); stroke-width: 2px; }
.barre__epargne { fill: var(--accent); }
.barre__charges { fill: var(--repartition-charges); }
.barre__libre { fill: var(--primaire); }
.barre--squelette rect { opacity: 0.45; }                        /* aperçu de la paie non réglée */

/* Ligne de « Où part ton argent » : nom | montant (/ plafond), barre dessous, alerte éventuelle. */
.ligne-graphique {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: var(--e1);
    column-gap: var(--e2);
    align-items: center;
    min-height: var(--cible-min);
    padding: 6px 0;
    width: 100%;
    text-align: left;
    color: var(--texte);
}
.ligne-graphique > .barre, .ligne-graphique > .texte-budget-alerte, .ligne-graphique > .texte-budget-depasse { grid-column: 1 / -1; }
button.ligne-graphique:active { background: var(--primaire-clair); border-radius: var(--e2); }

/* Carrés de légende de la répartition (16 px, décoratifs). */
.carre-legende { width: 16px; height: 16px; border-radius: 4px; flex: 0 0 auto; background: var(--primaire); }
.carre-legende--epargne { background: var(--accent); }
.carre-legende--charges { background: var(--repartition-charges); }
.carre-legende--libre { background: var(--primaire); }
.ligne-legende { display: flex; align-items: center; gap: var(--e2); min-height: 32px; }
.ligne-legende > :nth-child(2) { flex: 1 1 auto; }

/* ==================================================================
   15. États vides, aperçu, chargement
   ================================================================== */
.etat-vide { display: flex; flex-direction: column; align-items: center; gap: var(--e3); text-align: center; padding: var(--e6) var(--e2); }
.cercle-illustration {
    width: var(--taille-illustration);
    height: var(--taille-illustration);
    border-radius: 50%;
    background: var(--primaire-clair);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primaire-fonce);
}
.cercle-illustration svg, .cercle-illustration img { width: 40px; height: 40px; }
.titre-etat-vide { font-family: var(--police-titre); font-weight: var(--graisse-forte); font-size: var(--taille-titre-etat-vide); color: var(--texte); }
.texte-etat-vide { font-size: var(--taille-texte); color: var(--texte-doux); max-width: 34ch; }

.carte-apercu {
    background: var(--surface);
    border: 1.5px dashed var(--bordure);
    border-radius: var(--rayon-carte);
    padding: var(--e4);
    display: flex;
    flex-direction: column;
    gap: var(--e2);
}
.squelette-montant { width: 56px; height: 10px; border-radius: 5px; background: var(--squelette); }

/* Chargement de l'appli (index.html, avant que Blazor démarre) : logo + phrase, sans animation lourde. */
.chargement-appli {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: var(--e4);
    padding: var(--e6);
    background: var(--fond);
    text-align: center;
}
.chargement-appli img { width: var(--taille-illustration); height: var(--taille-illustration); }
.chargement-appli__texte { font-size: var(--taille-texte); color: var(--texte-secondaire); }
.indicateur {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid var(--piste-barre);
    border-top-color: var(--primaire);
    animation: kobi-tourne 900ms linear infinite;    /* seule animation : indicateur d'attente système */
}
@keyframes kobi-tourne { to { transform: rotate(360deg); } }

/* ==================================================================
   16. Confirmation (Tout effacer, supprimer) : voile + panneau en bas, au pouce
   ================================================================== */
.voile {
    position: fixed;
    inset: 0;
    z-index: 40;
    background: var(--voile);
    display: flex;
    align-items: flex-end;
}
.panneau-confirmation {
    width: 100%;
    margin: var(--e4);
    margin-bottom: calc(var(--e4) + var(--sur-bas));
    background: var(--surface);
    border-radius: var(--rayon-carte);
    padding: var(--e4);
    box-shadow: var(--ombre-carte);
    display: flex;
    flex-direction: column;
    gap: var(--e3);
}

/* ==================================================================
   17. Installation sur l'écran d'accueil (Safari, Kobi pas installé — US-W.1)
   Doit tenir sans défiler dans la partie visible de Safari sur iPhone 11 (≈ 414 × 700).
   ================================================================== */
.installation {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    gap: var(--e4);
    padding: calc(var(--sur-haut) + var(--e6)) var(--e4) calc(var(--sur-bas) + var(--e4));
    background: var(--fond);
}
.installation__tete { display: flex; align-items: center; gap: var(--e3); }
.installation__tete img { width: 56px; height: 56px; border-radius: 13px; }
.etapes { display: flex; flex-direction: column; gap: var(--e2); counter-reset: etape; }
.etape {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) 40px;
    align-items: center;
    gap: var(--e3);
    min-height: 56px;
    padding: var(--e2) var(--e3);
    background: var(--surface);
    border-radius: var(--rayon-carte);
    box-shadow: var(--ombre-carte);
}
.etape::before {
    counter-increment: etape;
    content: counter(etape);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--primaire);
    color: var(--texte-sur-primaire);               /* 7,62:1 */
    font-family: var(--police-titre);
    font-weight: var(--graisse-titre);
    display: flex;
    align-items: center;
    justify-content: center;
}
.etape__picto { width: 40px; height: 40px; color: var(--primaire-fonce); }
.etape__picto svg, .etape__picto img { width: 40px; height: 40px; }
/* Flèche vers le bas de Safari : décorative, montre où est le bouton Partager. */
.installation__fleche { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: var(--e1); color: var(--primaire-fonce); font-size: var(--taille-libelle); font-weight: var(--graisse-forte); }
.installation__fleche svg { width: 32px; height: 32px; }

/* ==================================================================
   18. Petits utilitaires de mise en page (pas de valeur en dur dans les composants)
   ================================================================== */
.pile { display: flex; flex-direction: column; gap: var(--e2); }
.pile--4 { gap: var(--e4); }
.pile--6 { gap: var(--e6); }
.rangee { display: flex; align-items: center; gap: var(--e2); }
.rangee--entre { justify-content: space-between; }
.centre { text-align: center; align-items: center; }
.pousse-bas { margin-top: auto; }
