/* ==========================================================================
   grimont.css — Socle commun des webapps grimont.net
   --------------------------------------------------------------------------
   Chargé par toutes les apps de /app/, APRÈS la feuille propre à l'app.
   Contenu :
     1. Polices auto-hébergées (Inter) + alias des anciennes familles
     2. Design tokens (thème clair par défaut, thème sombre)
     3. Accessibilité (focus, lien d'évitement, mouvement réduit)
     4. En-tête commun (.g-header)
     5. Section « À propos de l'outil » : méthode, FAQ, sources (.g-about)
     6. Pied de page commun (.g-footer)
     7. Bloc « Apps utiles » (.g-useful)
     8. Harmonisation sobre des apps Tailwind
     9. Impression
   Aucune ressource externe : tout est servi depuis /app/_shared/.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Polices
   Inter variable (100–900), sous-ensembles latin + latin étendu.
   Les familles historiques (Outfit, Space Grotesk, Plus Jakarta Sans) sont
   redirigées vers Inter : les apps gardent leur CSS mais l'identité
   typographique devient homogène, sans aucun appel à Google Fonts.
   -------------------------------------------------------------------------- */
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('fonts/inter-latin-ext-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0100-02AF, U+0304, U+0308, U+0329, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Inter';
    font-style: normal;
    font-display: swap;
    font-weight: 100 900;
    src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face { font-family: 'Outfit'; font-display: swap; font-weight: 100 900; src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations'); }
@font-face { font-family: 'Space Grotesk'; font-display: swap; font-weight: 100 900; src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations'); }
@font-face { font-family: 'Plus Jakarta Sans'; font-display: swap; font-weight: 100 900; src: url('fonts/inter-latin-wght-normal.woff2') format('woff2-variations'); }

/* --------------------------------------------------------------------------
   2. Design tokens
   Contrastes vérifiés (WCAG 2.2 AA) :
     texte principal / fond        ≥ 15:1
     texte secondaire / surface    ≥ 7:1
     texte atténué / surface       ≥ 4.5:1
     accent (liens, boutons) / fond ≥ 4.5:1
   -------------------------------------------------------------------------- */
:root {
    --g-font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    --g-font-mono: ui-monospace, 'Cascadia Code', 'SFMono-Regular', Consolas, monospace;

    --g-bg: #f8fafc;
    --g-surface: #ffffff;
    --g-surface-2: #f1f5f9;
    --g-border: #e2e8f0;
    --g-border-strong: #cbd5e1;
    --g-text: #0f172a;
    --g-text-2: #475569;
    --g-text-3: #5b6b82;
    --g-accent: #4f46e5;
    --g-accent-hover: #4338ca;
    --g-accent-soft: #eef2ff;
    --g-accent-text: #3730a3;
    --g-on-accent: #ffffff;
    --g-success: #15803d;
    --g-warning: #92400e;
    --g-danger: #b91c1c;
    --g-focus: #4f46e5;

    --g-radius: 12px;
    --g-radius-sm: 8px;
    --g-shadow: 0 1px 2px rgba(15, 23, 42, .06), 0 1px 3px rgba(15, 23, 42, .08);
    --g-shadow-lg: 0 10px 25px -8px rgba(15, 23, 42, .15);
    --g-header-h: 64px;
    --g-max: 1200px;

    color-scheme: light;
}

html.dark,
html[data-theme="dark"] {
    --g-bg: #0f172a;
    --g-surface: #1e293b;
    --g-surface-2: #172033;
    --g-border: #334155;
    --g-border-strong: #475569;
    --g-text: #f1f5f9;
    --g-text-2: #cbd5e1;
    --g-text-3: #a3b1c6;
    --g-accent: #818cf8;
    --g-accent-hover: #a5b4fc;
    --g-accent-soft: rgba(129, 140, 248, .14);
    --g-accent-text: #c7d2fe;
    --g-on-accent: #0f172a;
    --g-success: #4ade80;
    --g-warning: #fbbf24;
    --g-danger: #f87171;
    --g-focus: #a5b4fc;
    --g-shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --g-shadow-lg: 0 10px 25px -8px rgba(0, 0, 0, .5);

    color-scheme: dark;
}

/* --------------------------------------------------------------------------
   3. Accessibilité
   -------------------------------------------------------------------------- */

/* Focus clavier visible partout, sans gêner les clics souris */
:focus-visible {
    outline: 3px solid var(--g-focus) !important;
    outline-offset: 2px !important;
}
:focus:not(:focus-visible) { outline: none; }

/* Lien d'évitement : invisible jusqu'à la prise de focus clavier */
.g-skip-link {
    position: absolute;
    left: 1rem;
    top: -100px;
    z-index: 10000;
    padding: .75rem 1.25rem;
    border-radius: var(--g-radius-sm);
    background: var(--g-accent);
    color: var(--g-on-accent) !important;
    font: 600 .95rem/1 var(--g-font);
    text-decoration: none;
    transition: top .15s ease;
}
.g-skip-link:focus { top: .75rem; }

/* Texte réservé aux lecteurs d'écran */
.g-sr-only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

/* Respect de la préférence « réduire les animations » */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        /* 0s (et non .01ms) : une durée non nulle ferait « transitionner » la
           visibilité héritée et empêcherait de donner le focus aux fenêtres. */
        transition-duration: 0s !important;
        transition-delay: 0s !important;
        scroll-behavior: auto !important;
    }
}

/* Anti-débordement horizontal sur mobile (tableaux, canevas, graphiques) */
html, body { max-width: 100%; overflow-x: clip; }
img, svg, video, canvas { max-width: 100%; }
.g-scroll-x { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
select, input, textarea { max-width: 100%; }
@media (max-width: 640px) {
    /* Tableaux larges : défilement horizontal dans leur propre zone plutôt que page coupée */
    main table { display: block; overflow-x: auto; max-width: 100%; -webkit-overflow-scrolling: touch; }
}

/* --------------------------------------------------------------------------
   4. En-tête commun
   -------------------------------------------------------------------------- */
.g-header {
    position: sticky;
    top: 0;
    z-index: 900;
    width: 100%;
    background: var(--g-surface);
    border-bottom: 1px solid var(--g-border);
    font-family: var(--g-font);
    color: var(--g-text);
}
.g-header *, .g-header *::before, .g-header *::after { box-sizing: border-box; }
.g-header__inner {
    max-width: var(--g-max);
    min-height: var(--g-header-h);
    margin: 0 auto;
    padding: .5rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.g-brand {
    display: inline-flex;
    align-items: center;
    gap: .6rem;
    flex-shrink: 0;
    color: var(--g-text) !important;
    text-decoration: none !important;
    font-weight: 700;
    font-size: 1.05rem;
    letter-spacing: -.01em;
}
.g-brand__logo {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    background: var(--g-accent);
    color: var(--g-on-accent);
    font-weight: 800;
    font-size: 1.1rem;
}
.g-brand__name span { color: var(--g-accent); }

.g-breadcrumb { min-width: 0; flex: 1; }
.g-breadcrumb ol {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
    gap: .35rem;
    margin: 0;
    padding: 0 0 0 1rem;
    list-style: none;
    border-left: 1px solid var(--g-border);
    font-size: .9rem;
    color: var(--g-text-2);
    white-space: nowrap;
    overflow: hidden;
}
.g-breadcrumb li { display: inline-flex; align-items: center; gap: .35rem; min-width: 0; }
.g-breadcrumb li + li::before { content: '/'; color: var(--g-border-strong); }
.g-breadcrumb a { color: var(--g-text-2) !important; text-decoration: none; }
.g-breadcrumb a:hover { color: var(--g-accent) !important; text-decoration: underline; }
.g-breadcrumb [aria-current="page"] {
    color: var(--g-text);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
}
/* Sur petit écran, seule la page courante reste affichée */
@media (max-width: 640px) {
    .g-brand__name { display: none; }
    .g-breadcrumb li:not([aria-current]) { display: none; }
    .g-breadcrumb li + li::before { display: none; }
}

.g-theme-toggle {
    margin-left: auto;
    display: inline-grid;
    place-items: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    padding: 0;
    border-radius: 999px;
    border: 1px solid var(--g-border);
    background: var(--g-surface);
    color: var(--g-text-2);
    cursor: pointer;
    transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.g-theme-toggle:hover { background: var(--g-surface-2); color: var(--g-text); border-color: var(--g-border-strong); }
.g-theme-toggle svg { width: 18px; height: 18px; }

/* Introduction de page : H1 + phrase d'accroche (apps sans en-tête de page propre) */
.g-intro { width: 100%; min-width: 0; max-width: 760px; margin: 0 auto 2rem; text-align: center; font-family: var(--g-font); }
.g-intro h1 {
    margin: 0 0 .75rem;
    font-size: clamp(1.75rem, 4vw, 2.25rem);
    font-weight: 800;
    line-height: 1.2;
    letter-spacing: -.02em;
    color: var(--g-text);
}
.g-intro p { margin: 0; font-size: 1.05rem; line-height: 1.6; color: var(--g-text-2); }

/* --------------------------------------------------------------------------
   5. « À propos de l'outil » : méthode, FAQ, sources
   Contenu éditorial statique (SEO/GEO) placé sous l'outil.
   -------------------------------------------------------------------------- */
.g-about {
    max-width: var(--g-max);
    margin: 3rem auto 0;
    padding: 0 1rem;
    font-family: var(--g-font);
    color: var(--g-text);
    line-height: 1.65;
    font-size: 1rem;
}
.g-about *, .g-about *::before, .g-about *::after { box-sizing: border-box; }
.g-about__card {
    background: var(--g-surface);
    border: 1px solid var(--g-border);
    border-radius: var(--g-radius);
    padding: clamp(1.25rem, 3vw, 2rem);
    box-shadow: var(--g-shadow);
}
.g-about h2 {
    margin: 0 0 1rem;
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.3;
    color: var(--g-text);
}
.g-about h3 {
    margin: 2rem 0 .75rem;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--g-text);
}
.g-about p, .g-about li { color: var(--g-text-2); }
.g-about p { margin: 0 0 .9rem; }
.g-about ul, .g-about ol { margin: 0 0 1rem; padding-left: 1.25rem; }
.g-about ul { list-style: disc; }      /* rétabli : la base Tailwind retire les puces */
.g-about ol { list-style: decimal; }
.g-about li { margin: .3rem 0; }
.g-about strong { color: var(--g-text); }
.g-about a { color: var(--g-accent); text-decoration: underline; text-underline-offset: 2px; }
.g-about a:hover { color: var(--g-accent-hover); }
.g-about__grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.g-about__note {
    margin: 1rem 0 0;
    padding: .85rem 1rem;
    border-left: 4px solid var(--g-accent);
    border-radius: 0 var(--g-radius-sm) var(--g-radius-sm) 0;
    background: var(--g-accent-soft);
    color: var(--g-text) !important;
    font-size: .95rem;
}
.g-about__meta { margin-top: 1.5rem; font-size: .85rem; color: var(--g-text-3) !important; }

/* FAQ en accordéons natifs (accessibles au clavier sans JS) */
.g-faq { border-top: 1px solid var(--g-border); }
.g-faq details { border-bottom: 1px solid var(--g-border); }
.g-faq summary {
    list-style: none;
    cursor: pointer;
    padding: 1rem 2rem 1rem 0;
    position: relative;
    font-weight: 600;
    color: var(--g-text);
}
.g-faq summary::-webkit-details-marker { display: none; }
.g-faq summary::after {
    content: '+';
    position: absolute;
    right: .25rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.35rem;
    font-weight: 400;
    color: var(--g-text-3);
}
.g-faq details[open] summary::after { content: '−'; }
.g-faq details > div { padding: 0 0 1rem; }
.g-faq details > div p:last-child { margin-bottom: 0; }

/* --------------------------------------------------------------------------
   6. Pied de page commun
   -------------------------------------------------------------------------- */
.g-footer {
    margin-top: 3rem;
    border-top: 1px solid var(--g-border);
    background: var(--g-surface);
    font-family: var(--g-font);
    font-size: .9rem;
    color: var(--g-text-2);
}
.g-footer__inner {
    max-width: var(--g-max);
    margin: 0 auto;
    padding: 1.5rem 1rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: .75rem 1.5rem;
}
.g-footer p { margin: 0; color: var(--g-text-2); }
.g-footer nav { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; }
.g-footer a { color: var(--g-text-2) !important; text-decoration: underline; text-underline-offset: 2px; }
.g-footer a:hover { color: var(--g-accent) !important; }

/* --------------------------------------------------------------------------
   7. Bloc « Apps utiles » (injecté par grimont.js sous les résultats)
   -------------------------------------------------------------------------- */
.g-useful {
    clear: both;
    width: 100%;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--g-border);
    font-family: var(--g-font);
    text-align: left;
    box-sizing: border-box;
}
.g-useful *, .g-useful *::before, .g-useful *::after { box-sizing: border-box; }
.g-useful__title {
    margin: 0 0 1.25rem;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--g-text);
}
.g-about .g-useful__grid, .g-useful__grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    margin: 0;
    padding: 0;
    list-style: none;
}
.g-about .g-useful__grid > li { margin: 0; list-style: none; }   /* la liste de cartes ne doit pas hériter des puces de .g-about */
.g-useful__card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 1.25rem;
    border: 1px solid var(--g-border);
    border-radius: var(--g-radius);
    background: var(--g-surface);
    color: inherit !important;
    text-decoration: none !important;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.g-useful__card:hover { border-color: var(--g-accent); box-shadow: var(--g-shadow-lg); }
.g-useful__name {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0 0 .5rem;
    font-size: 1rem;
    font-weight: 700;
    color: var(--g-text);
}
.g-useful__icon {
    display: grid;
    place-items: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border-radius: 9px;
    background: var(--g-accent-soft);
    color: var(--g-accent);
}
.g-useful__desc { flex: 1; margin: 0 0 1rem; font-size: .9rem; line-height: 1.5; color: var(--g-text-2); }
.g-useful__cta { font-size: .875rem; font-weight: 600; color: var(--g-accent); }

/* --------------------------------------------------------------------------
   7 bis. Badges de fiabilité des données (communs à toutes les apps)
   « Sourcé » : valeur publiée par la source citée
   « Estimation » : valeur déduite ou extrapolée (méthode expliquée à côté)
   « Exemple » : valeur illustrative, à remplacer par la vôtre
   -------------------------------------------------------------------------- */
.g-badge {
    display: inline-flex;
    align-items: center;
    gap: .25rem;
    padding: .05rem .45rem;
    border: 1px solid currentColor;
    border-radius: 999px;
    font-family: var(--g-font);
    font-size: .7rem;
    font-weight: 600;
    line-height: 1.5;
    letter-spacing: .01em;
    white-space: nowrap;
    vertical-align: middle;
    background: transparent;
}
.g-badge--source   { color: var(--g-success); }
.g-badge--estimate { color: var(--g-warning); }
.g-badge--example  { color: var(--g-text-2); }

/* --------------------------------------------------------------------------
   8. Harmonisation sobre (apps compilées avec Tailwind)
   Les titres en dégradé « néon » deviennent une couleur d'accent unie :
   plus lisible, meilleur contraste, identité commune.
   -------------------------------------------------------------------------- */
.bg-clip-text.text-transparent {
    background-image: none !important;
    color: var(--g-accent) !important;
    -webkit-text-fill-color: currentColor !important;
}

/* Filet de sécurité « contraste » (WCAG AA) pour les classes Tailwind.
   Thème clair : les teintes 400/500 sont trop pâles sur fond blanc ->
   on utilise la teinte 700 (≥ 4.5:1). Thème sombre : les gris 500–700
   sans variante « dark: » sont éclaircis. */
html:not(.dark) :is(.text-slate-500, .text-gray-500, .text-slate-400, .text-gray-400, .text-zinc-400, .text-neutral-400, .text-slate-300, .text-gray-300) { color: #5b6b82; }
html:not(.dark) :is(.text-red-400, .text-red-500) { color: #b91c1c; }
html:not(.dark) :is(.text-rose-400, .text-rose-500, .text-pink-400, .text-pink-500, .text-rose-600) { color: #be123c; }
html:not(.dark) :is(.text-orange-400, .text-orange-500, .text-orange-600) { color: #c2410c; }
html:not(.dark) :is(.text-amber-400, .text-amber-500, .text-yellow-400, .text-yellow-500, .text-yellow-600, .text-amber-600, .text-amber-700) { color: #92400e; }
html:not(.dark) :is(.text-green-400, .text-green-500, .text-green-600, .text-emerald-400, .text-emerald-500, .text-emerald-600, .text-lime-500, .text-lime-600) { color: #15803d; }
html:not(.dark) :is(.text-teal-400, .text-teal-500, .text-teal-600, .text-cyan-400, .text-cyan-500, .text-cyan-600, .text-sky-400, .text-sky-500) { color: #0e7490; }
html:not(.dark) :is(.text-indigo-400, .text-indigo-500, .text-blue-400, .text-blue-500, .text-violet-400, .text-violet-500, .text-purple-400, .text-purple-500) { color: #4338ca; }
html.dark :is(.text-slate-500, .text-gray-500, .text-slate-600, .text-gray-600, .text-slate-700, .text-gray-700, .text-slate-800, .text-gray-800, .text-slate-900, .text-gray-900):not([class*="dark:text-"]):not(.g-keep-light, .g-keep-light *) { color: #a3b1c6; }
/* Thème sombre : teintes saturées 600/700 sans variante « dark: » -> teinte 300 (≥ 4.5:1 sur fond sombre).
   Exclus : éléments portant leur propre fond (pastilles claires) et zones gardées claires. */
html.dark :is(.text-green-600, .text-green-700, .text-emerald-600, .text-emerald-700, .text-teal-600, .text-teal-700):not([class*="dark:text-"], [class*="bg-"]):not(.g-keep-light, .g-keep-light *) { color: #6ee7b7; }
html.dark :is(.text-red-600, .text-red-700, .text-rose-600, .text-rose-700, .text-pink-600, .text-pink-700):not([class*="dark:text-"], [class*="bg-"]):not(.g-keep-light, .g-keep-light *) { color: #fda4af; }
html.dark :is(.text-orange-600, .text-orange-700, .text-amber-600, .text-amber-700, .text-yellow-600, .text-yellow-700):not([class*="dark:text-"], [class*="bg-"]):not(.g-keep-light, .g-keep-light *) { color: #fcd34d; }
html.dark :is(.text-blue-600, .text-blue-700, .text-indigo-600, .text-indigo-700, .text-violet-600, .text-violet-700, .text-purple-600, .text-purple-700, .text-sky-600, .text-sky-700, .text-cyan-600, .text-cyan-700):not([class*="dark:text-"], [class*="bg-"]):not(.g-keep-light, .g-keep-light *) { color: #a5b4fc; }
/* Boutons colorés à texte blanc : teinte 700 pour atteindre 4.5:1 (hors survol) */
:is(.bg-emerald-500, .bg-emerald-600, .bg-green-500, .bg-green-600, .bg-teal-500, .bg-teal-600).text-white:not(:hover) { background-color: #047857; }
:is(.bg-orange-500, .bg-orange-600, .bg-amber-500, .bg-amber-600, .bg-yellow-500).text-white:not(:hover) { background-color: #c2410c; }
:is(.bg-red-500, .bg-rose-500).text-white:not(:hover) { background-color: #dc2626; }
:is(.bg-sky-500, .bg-sky-600, .bg-cyan-500, .bg-cyan-600).text-white:not(:hover) { background-color: #0e7490; }
:is(.bg-indigo-500, .bg-blue-500, .bg-violet-500, .bg-purple-500).text-white:not(:hover) { background-color: #4f46e5; }
/* Boutons d'export : style neutre commun à toutes les apps (repérés par leur
   identifiant « export » ou par leur icône de fichier). Seule l'icône garde
   la couleur du format : PDF, Word, PowerPoint, Excel… */
/* « :not(#g-priorite) » ajoute le poids d'un identifiant : cette règle prime sur les
   classes utilitaires (ex. bg-emerald-600) et sur le filet de contraste ci-dessus. */
html body :is(:is(button, a)[id*="export" i], :is(button, a):has(> :is(.fa-file-pdf, .fa-file-word, .fa-file-powerpoint, .fa-file-excel, .fa-file-csv))):not([data-g-primary]):not(#g-priorite) {
    background: var(--g-surface);
    background-image: none;
    color: var(--g-text);
    border: 1px solid var(--g-border-strong);
    box-shadow: none;
    text-shadow: none;
}
html body :is(:is(button, a)[id*="export" i], :is(button, a):has(> :is(.fa-file-pdf, .fa-file-word, .fa-file-powerpoint, .fa-file-excel, .fa-file-csv))):not([data-g-primary]):not(#g-priorite):hover {
    background: var(--g-surface-2);
    border-color: var(--g-accent);
    color: var(--g-text);
}
:is(button, a) > .fa-file-pdf { color: #dc2626; }
:is(button, a) > .fa-file-word { color: #2b579a; }
:is(button, a) > .fa-file-powerpoint { color: #c43e1c; }
:is(button, a) > :is(.fa-file-excel, .fa-file-csv) { color: #15803d; }
html.dark :is(button, a) > :is(.fa-file-pdf, .fa-file-powerpoint) { color: #f87171; }
html.dark :is(button, a) > .fa-file-word { color: #93b4e8; }
html.dark :is(button, a) > :is(.fa-file-excel, .fa-file-csv) { color: #4ade80; }
/* …sauf sur un bouton plein (fond d'accent) où l'icône reste de la couleur du texte */
[data-g-primary] > :is(.fa-file-pdf, .fa-file-word, .fa-file-powerpoint, .fa-file-excel, .fa-file-csv) { color: inherit; }

/* Zones d'aperçu volontairement claires (ex. simulation d'un réseau social) :
   ajouter la classe .g-keep-light pour qu'elles ne passent pas en sombre */
html.dark .g-keep-light { color-scheme: light; }
html.dark :is(.dark\:text-slate-500, .dark\:text-gray-500, .dark\:text-slate-600, .dark\:text-gray-600, .dark\:text-zinc-500) { color: #a3b1c6; }
html.dark :is(.dark\:text-indigo-400, .dark\:text-blue-400, .dark\:text-violet-400, .dark\:text-purple-400) { color: #a5b4fc; }
html:not(.dark) ::placeholder { color: #64748b; opacity: 1; }
html.dark ::placeholder { color: #94a3b8; opacity: 1; }

/* --------------------------------------------------------------------------
   9. Impression : on n'imprime que l'outil et ses résultats
   -------------------------------------------------------------------------- */
@media print {
    .g-header, .g-footer, .g-about, .g-skip-link, .g-theme-toggle { display: none !important; }
    .g-useful { break-inside: avoid; }
}

/* Note « valeurs d'exemple » placée sous un sélecteur de modèle */
.g-template-note {
    margin: 0 0 1.25rem;
    padding: .75rem 1rem;
    border: 1px solid var(--g-border);
    border-radius: 10px;
    background: var(--g-surface-2);
    color: var(--g-text-2);
    font-size: .875rem;
    line-height: 1.55;
}
.g-template-note .g-badge { margin-right: .35rem; }

/* --------------------------------------------------------------------------
   10. Menu « Projet » (enregistrer / ouvrir / nouveau) et bandeau de reprise
   -------------------------------------------------------------------------- */
.g-projet { position: relative; flex-shrink: 0; }
.g-projet > summary {
    display: inline-flex; align-items: center; gap: .4rem;
    min-height: 40px; padding: 0 .8rem;
    border: 1px solid var(--g-border-strong); border-radius: var(--g-radius-sm);
    background: var(--g-surface); color: var(--g-text);
    font: 600 .9rem/1 var(--g-font); cursor: pointer; list-style: none;
}
.g-projet > summary::-webkit-details-marker { display: none; }
.g-projet > summary:hover { background: var(--g-surface-2); }
.g-projet__menu {
    position: absolute; right: 0; top: calc(100% + 6px); z-index: 950;
    width: min(290px, calc(100vw - 32px)); padding: .5rem;
    border: 1px solid var(--g-border-strong); border-radius: var(--g-radius);
    background: var(--g-surface); box-shadow: var(--g-shadow-lg);
}
.g-projet__menu button {
    display: block; width: 100%; min-height: 40px; padding: .5rem .75rem;
    border: 0; border-radius: var(--g-radius-sm); background: transparent;
    color: var(--g-text); font: 500 .9rem/1.3 var(--g-font); text-align: left; cursor: pointer;
}
.g-projet__menu button:hover, .g-projet__menu button:focus-visible { background: var(--g-surface-2); }
.g-projet__menu button.g-projet__danger { color: var(--g-danger); font-weight: 700; }
.g-projet__status { margin: .35rem .75rem .25rem; font: .8rem/1.4 var(--g-font); color: var(--g-text-2); }
@media (max-width: 560px) { .g-projet__label { display: none; } .g-projet > summary { padding: 0 .6rem; } }
.g-projet-banner {
    display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem;
    margin: 0 auto 1.25rem; max-width: var(--g-max); padding: .75rem 1rem;
    border: 1px solid var(--g-border-strong); border-left: 4px solid var(--g-accent);
    border-radius: var(--g-radius); background: var(--g-surface); color: var(--g-text);
    font: .95rem/1.5 var(--g-font);
}
.g-projet-banner p { margin: 0; }
.g-projet-banner div { display: flex; gap: .5rem; }
.g-projet-banner button {
    min-height: 40px; padding: .4rem 1rem; border-radius: var(--g-radius-sm); cursor: pointer;
    font: 600 .9rem/1 var(--g-font); border: 1px solid var(--g-accent);
}
.g-projet-banner [data-resume="yes"] { background: var(--g-accent); color: var(--g-on-accent); }
.g-projet-banner [data-resume="no"] { background: transparent; color: var(--g-accent-text); }
@media print { .g-projet, .g-projet-banner { display: none !important; } }

/* --------------------------------------------------------------------------
   11. Icônes converties (Lucide / Boxicons -> Font Awesome, voir icones.js)
   La taille suit les classes de largeur Tailwind déjà présentes (w-4 = 1rem…)
   -------------------------------------------------------------------------- */
.g-icon { display: inline-flex; align-items: center; justify-content: center; line-height: 1; font-size: 1em; }
.g-icon.w-3 { font-size: .75rem; } .g-icon.w-3\.5 { font-size: .875rem; } .g-icon.w-4 { font-size: 1rem; }
.g-icon.w-5 { font-size: 1.25rem; } .g-icon.w-6 { font-size: 1.5rem; } .g-icon.w-7 { font-size: 1.75rem; }
.g-icon.w-8 { font-size: 2rem; } .g-icon.w-10 { font-size: 2.5rem; } .g-icon.w-12 { font-size: 3rem; } .g-icon.w-16 { font-size: 4rem; }

/* --------------------------------------------------------------------------
   12. Messages non bloquants (Grimont.notify, remplace alert())
   -------------------------------------------------------------------------- */
.g-notify-zone {
    position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 10000;
    display: flex; flex-direction: column; gap: 8px; width: min(520px, calc(100vw - 32px));
    pointer-events: none;
}
.g-notify {
    display: flex; align-items: flex-start; gap: .75rem; pointer-events: auto;
    padding: .75rem .75rem .75rem 1rem; border-radius: var(--g-radius);
    border: 1px solid var(--g-border-strong); border-left: 4px solid var(--g-accent);
    background: var(--g-surface); color: var(--g-text); box-shadow: var(--g-shadow-lg);
    font: .95rem/1.5 var(--g-font);
}
.g-notify--error { border-left-color: var(--g-danger); }
.g-notify p { margin: 0; flex: 1; }
.g-notify__close {
    flex-shrink: 0; width: 32px; height: 32px; border: 0; border-radius: var(--g-radius-sm);
    background: transparent; color: var(--g-text-2); font-size: 1.3rem; line-height: 1; cursor: pointer;
}
.g-notify__close:hover { background: var(--g-surface-2); color: var(--g-text); }
@media print { .g-notify-zone { display: none; } }

/* Taille minimale des cibles cliquables (WCAG 2.2, critère 2.5.8 : 24 × 24 px) */
main button, main [role="button"], main input[type="checkbox"], main input[type="radio"] { min-width: 24px; min-height: 24px; }
