/*
 * Langage visuel des espaces Scolarix « mobile d'abord » (gx-*).
 * Copie conforme des règles écrites en ligne dans App/Views/base_groupe.php
 * (espaces Fondateur / Coordinateur / Informaticien), pour que l'Espace
 * Enseignant parle exactement le même langage. Toute évolution du langage
 * gx-* doit être reportée dans les deux endroits (ou base_groupe.php peut
 * à terme charger ce fichier à la place de son bloc <style>).
 */
:root {
    --gx-good: var(--ux-success);
    --gx-warn: var(--ux-warning);
    --gx-bad: var(--ux-danger);
    --gx-tab-h: 62px;
}
body { background: var(--ux-bg); }
.nk-content { padding-top: 20px; }
.gx-page { max-width: 1180px; margin: 0 auto; }
/* Chrome mobile fige la largeur de la page sur le premier rendu : un
   débordement transitoire (police pas encore chargée) laissait un
   défilement horizontal de quelques pixels. Le contenu ne peut plus
   élargir la page ; rien n'y dépasse une fois rendu (vérifié de
   320 à 1024 px). */
.nk-content { overflow-x: clip; }
/* ux.css stylise une barre de défilement de 8 px sur toute
   l'application : sur écran tactile elle réduisait la largeur utile
   (page plus large que l'écran de 9 px à 320 px). Inutile au doigt. */
@media (pointer: coarse) {
    ::-webkit-scrollbar { width: 0; height: 0; }
}

/* --- en-tête de page --- */
.gx-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.gx-title { font-size: 1.45rem; font-weight: 800; color: var(--ux-ink); margin: 0; letter-spacing: -.01em; }
.gx-sub { color: var(--ux-muted); font-size: .85rem; margin: 2px 0 0; }
.gx-back { display: inline-flex; align-items: center; gap: 4px; color: var(--ux-muted); font-size: .85rem; margin-bottom: 6px; }

/* --- sélecteur de contexte --- */
.gx-context { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 18px; }
.gx-context select { appearance: none; -webkit-appearance: none; min-height: 44px; padding: 0 36px 0 14px; border: 1px solid var(--ux-border);
    background: var(--ux-surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%237c8aa5' stroke-width='2.5'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
    color: var(--ux-ink); font-weight: 600; font-size: .9rem; border-radius: var(--ux-radius-sm); max-width: 100%; }
.gx-context .gx-school { flex: 1 1 220px; min-width: 0; }
.gx-context .gx-session { flex: 0 0 auto; }

/* --- cartes --- */
.gx-card { background: var(--ux-surface); border: 1px solid var(--ux-border); border-radius: var(--ux-radius); padding: 16px; margin-bottom: 14px; }
.gx-card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.gx-card-title { font-size: .95rem; font-weight: 700; color: var(--ux-ink); margin: 0; }
.gx-card-note { font-size: .78rem; color: var(--ux-muted); }
.gx-more { display: flex; align-items: center; justify-content: space-between; min-height: 44px; margin: 8px -16px -16px; padding: 0 16px;
    border-top: 1px solid var(--ux-border); color: var(--ux-primary-dark); font-weight: 600; font-size: .88rem; }
body.dark-mode .gx-more { color: var(--ux-primary-light); }
.gx-chart { position: relative; height: 210px; }
.gx-chart-sm { position: relative; height: 170px; }
.gx-section { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--ux-muted); margin: 22px 0 10px; }
.gx-grid-2 { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0 14px; }
.gx-grid-2 > *, .gx-card, .min-w-0 { min-width: 0; }
.gx-card-head { flex-wrap: wrap; row-gap: 2px; }
.gx-card-title, .gx-title, .gx-row-title { overflow-wrap: anywhere; }
@media (min-width: 992px) { .gx-grid-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }

/* --- KPI touchables --- */
.gx-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
@media (min-width: 992px) { .gx-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; } }
.gx-kpi { display: block; background: var(--ux-surface); border: 1px solid var(--ux-border); border-radius: var(--ux-radius); padding: 14px; min-height: 104px; color: inherit; position: relative; }
a.gx-kpi:active { transform: scale(.98); }
a.gx-kpi::after { content: "›"; position: absolute; right: 12px; top: 10px; color: var(--ux-muted); font-size: 1.1rem; }
.gx-kpi-label { font-size: .78rem; font-weight: 600; color: var(--ux-muted); }
.gx-kpi-value { font-size: 1.65rem; font-weight: 800; color: var(--ux-ink); line-height: 1.15; margin-top: 6px; white-space: nowrap; letter-spacing: -.02em; }
.gx-kpi-value small { font-size: .55em; font-weight: 700; color: var(--ux-muted); margin-left: 2px; }
.gx-kpi-sub { font-size: .76rem; color: var(--ux-muted); margin-top: 4px; }
.gx-kpi-bar { height: 4px; background: var(--ux-border); border-radius: 4px; margin-top: 10px; overflow: hidden; }
.gx-kpi-bar span { display: block; height: 100%; border-radius: 4px; }
@media (max-width: 359px) { .gx-kpi-value { font-size: 1.35rem; } }

/* --- états (couleur = information) --- */
.gx-good { color: var(--gx-good) !important; } .gx-warn { color: var(--gx-warn) !important; } .gx-bad { color: var(--gx-bad) !important; }
.bg-gx-good { background: var(--gx-good); } .bg-gx-warn { background: var(--gx-warn); } .bg-gx-bad { background: var(--gx-bad); } .bg-gx-neutral { background: var(--ux-primary-light); }
.gx-trend { font-weight: 700; }

/* --- listes (remplacent les tableaux) --- */
.gx-list { list-style: none; margin: 0; padding: 0; }
.gx-row { display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 10px 0; border-bottom: 1px solid var(--ux-border); color: inherit; }
.gx-list > li:last-child > .gx-row, .gx-list > .gx-row:last-child { border-bottom: 0; }
a.gx-row:active { background: var(--ux-bg); }
.gx-row-main { flex: 1; min-width: 0; }
/* Titre tronqué (…) dans une ligne flex : sans min-width 0 il impose
   sa largeur de texte et élargit la page sur petit écran. */
/* Ligne titre + valeur. (Pas de « gap-2 » : dans ce thème c'est un
   séparateur de hauteur fixe 0,75 rem, qui écrasait la ligne.) */
.gx-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.gx-line > .text-truncate { min-width: 0; flex: 1 1 auto; }
.gx-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.gx-check { display: flex; align-items: center; gap: 8px; min-height: 40px; }
.nk-wrap, .nk-content { min-width: 0; }
.gx-row-title { font-weight: 600; color: var(--ux-ink); font-size: .9rem; line-height: 1.3; }
.gx-row-sub { font-size: .78rem; color: var(--ux-muted); margin-top: 2px; }
.gx-row-value { font-weight: 700; color: var(--ux-ink); font-size: .95rem; white-space: nowrap; text-align: right; }
.gx-dot { width: 10px; height: 10px; border-radius: 50%; flex: 0 0 10px; }
.gx-chev { color: var(--ux-muted); flex: 0 0 auto; }
.gx-bar { height: 6px; background: var(--ux-border); border-radius: 6px; margin-top: 6px; overflow: hidden; }
.gx-bar span { display: block; height: 100%; border-radius: 6px; }
.gx-empty { text-align: center; color: var(--ux-muted); padding: 22px 8px; font-size: .9rem; }
.gx-ok { display: flex; align-items: center; gap: 10px; color: var(--ux-success-ink); background: var(--ux-success-bg); border-radius: var(--ux-radius-sm); padding: 12px 14px; font-weight: 600; font-size: .9rem; }

/* --- contrôle segmenté (choix de l'indicateur d'un graphique) --- */
.gx-seg { display: flex; gap: 4px; background: var(--ux-bg); border: 1px solid var(--ux-border); border-radius: var(--ux-radius-sm); padding: 3px; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
.gx-seg::-webkit-scrollbar { display: none; }
.gx-seg button { flex: 1 0 auto; min-height: 36px; border: 0; background: transparent; border-radius: calc(var(--ux-radius-sm) - 2px); padding: 0 12px; font-size: .82rem; font-weight: 600; color: var(--ux-muted); white-space: nowrap; }
.gx-seg button.active { background: var(--ux-surface); color: var(--ux-ink); box-shadow: var(--ux-shadow-sm); }

/* --- donut avec valeur centrale --- */
.gx-donut { position: relative; height: 170px; }
.gx-donut-center { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; pointer-events: none; }
.gx-donut-center strong { font-size: 1.6rem; font-weight: 800; color: var(--ux-ink); line-height: 1; }
.gx-donut-center span { font-size: .75rem; color: var(--ux-muted); margin-top: 4px; }
.gx-legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: .8rem; color: var(--ux-body); margin-top: 10px; }
.gx-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }

/* --- puces de filtre --- */
.gx-chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; margin-bottom: 12px; }
.gx-chips::-webkit-scrollbar { display: none; }
.gx-chip { display: inline-flex; align-items: center; min-height: 36px; padding: 0 14px; border: 1px solid var(--ux-border); border-radius: 999px; background: var(--ux-surface); color: var(--ux-body); font-size: .82rem; font-weight: 600; white-space: nowrap; }
.gx-chip.active { background: var(--ux-ink); border-color: var(--ux-ink); color: var(--ux-surface); }

/* --- en-tête, barre latérale --- */
.nk-header { border-bottom: 1px solid var(--ux-border); background: var(--ux-surface); }
.nk-header .user-avatar { background: var(--ux-primary-dark); color: #fff; }
.header-role-badge { background: var(--ux-primary-50); color: var(--ux-primary-dark); padding: 4px 12px; border-radius: 30px; font-size: .72rem; font-weight: 700; }
body.dark-mode .header-role-badge { color: var(--ux-primary-light); }
.nk-sidebar .nk-menu-text { font-size: 13.5px; font-weight: 500; }
.nk-sidebar .nk-menu-heading .overline-title { font-size: 11px; letter-spacing: .08em; font-weight: 700; color: var(--ux-muted); }
.nk-menu-section-divider { height: 1px; background: var(--ux-border); margin: .4rem 1rem; }
.nk-menu-item.active { background: var(--ux-primary-50); border-radius: 8px; margin: 0 4px; }
.nk-menu-item.active .nk-menu-text, .nk-menu-item.active .nk-menu-icon .icon { color: var(--ux-primary-dark); }
.nk-sidebar-content .nk-sidebar-menu[data-simplebar] { overflow-y: auto; -webkit-overflow-scrolling: touch; }

/* --- barre d'onglets mobile (PWA) --- */
.gx-tabbar { display: none; }
@media (max-width: 1199.98px) {
    .gx-tabbar { display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 1030; background: var(--ux-surface); border-top: 1px solid var(--ux-border);
        padding-bottom: env(safe-area-inset-bottom); height: calc(var(--gx-tab-h) + env(safe-area-inset-bottom)); }
    .gx-tabbar > a, .gx-tabbar > a.nk-nav-toggle { flex: 1 1 0; margin: 0; padding: 0; width: auto; height: auto; }
    .nk-header .container-fluid { padding-left: 12px; padding-right: 12px; max-width: 100%; }
    .nk-header-wrap { min-width: 0; }
    .nk-header-brand img { max-width: 140px; }
    .gx-tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--ux-muted);
        font-size: .68rem; font-weight: 600; position: relative; min-width: 0; -webkit-tap-highlight-color: transparent; }
    .gx-tabbar a .icon { font-size: 1.3rem; }
    .gx-tabbar a.active { color: var(--ux-primary-dark); }
    body.dark-mode .gx-tabbar a.active { color: var(--ux-primary-light); }
    .gx-tabbar .gx-badge { position: absolute; top: 6px; left: calc(50% + 6px); min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px;
        background: var(--gx-bad); color: #fff; font-size: .62rem; line-height: 17px; text-align: center; }
    body.has-gx-tabbar .nk-content { padding-bottom: calc(var(--gx-tab-h) + 24px + env(safe-area-inset-bottom)); }
    body.has-gx-tabbar .nk-footer { display: none; }
    .nk-content { padding-left: 16px !important; padding-right: 16px !important; }
    .nk-content .container-fluid { padding-left: 0; padding-right: 0; }
}

/* Avertissement d'inactivité de l'Espace Enseignant : reste affiché jusqu'au clic sur « Rester connecté ». */
.te-idle-banner { position: fixed; left: 12px; right: 12px; bottom: calc(var(--gx-tab-h, 64px) + 12px + env(safe-area-inset-bottom)); z-index: 2000;
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 14px 16px; background: var(--ux-ink); color: #fff;
    border-radius: 12px; border-left: 4px solid var(--ux-warning); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); }
.te-idle-banner p { margin: 0; flex: 1 1 220px; font-size: .95rem; line-height: 1.4; }
.te-idle-banner .btn { min-height: 44px; }
@media (min-width: 1200px) { .te-idle-banner { left: auto; right: 20px; bottom: 20px; max-width: 440px; } }

/* Pages-guides de l'Espace Enseignant : grandes lignes tactiles, icône + titre + phrase d'explication. */
.te-hub-row { min-height: 72px; padding: 12px 0; }
.te-hub-row .gx-row-title { font-size: 1rem; }
.te-hub-row .gx-row-sub { font-size: .875rem; line-height: 1.35; }
.te-hub-ico { width: 44px; height: 44px; flex: 0 0 44px; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px;
    background: var(--ux-primary-50); color: var(--ux-primary); font-size: 1.35rem; }
.te-hub-ico-out { background: var(--ux-danger-bg); color: var(--ux-danger-ink, #b91c1c); }

/* Accueil de l'Espace Enseignant : « Que voulez-vous faire ? » (4 grands boutons) et mode simple. */
.te-actions { margin-bottom: 16px; }
.te-actions-title { font-size: 1.05rem; font-weight: 700; margin: 0 0 10px; color: var(--ux-ink); }
.te-actions-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (min-width: 992px) { .te-actions-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.te-action { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-height: 132px; padding: 16px; background: var(--ux-surface);
    border: 1px solid var(--ux-border); border-radius: var(--ux-radius); color: var(--ux-ink); text-decoration: none; box-shadow: var(--ux-shadow); }
.te-action:hover, .te-action:focus-visible { border-color: var(--ux-primary); color: var(--ux-ink); }
.te-action:active { background: var(--ux-primary-50); }
.te-action .icon { width: 48px; height: 48px; display: inline-flex; align-items: center; justify-content: center; margin-bottom: 8px; border-radius: 14px;
    background: var(--ux-primary-50); color: var(--ux-primary); font-size: 1.6rem; }
.te-action strong { font-size: 1.05rem; line-height: 1.25; }
.te-action span { font-size: .9rem; color: var(--ux-muted); }
.te-simple-toggle { margin-top: 10px; padding: 8px 0; min-height: 44px; background: none; border: 0; color: var(--ux-primary); font-weight: 600; text-decoration: underline; }
body.te-simple .te-hide-simple { display: none !important; }

/* Aide intégrée de l'Espace Enseignant : guides numérotés, bouton « ? » et visite de bienvenue. */
.te-help-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.te-help-btns .btn { min-height: 48px; display: inline-flex; align-items: center; }
.te-help-toc { margin-bottom: 14px; }
.te-help-guide { scroll-margin-top: 80px; }
.te-help-guide .gx-card-title { display: flex; align-items: center; gap: 10px; }
.te-steps { list-style: none; counter-reset: step; margin: 12px 0 0; padding: 0; }
.te-steps li { counter-increment: step; position: relative; padding: 10px 0 10px 46px; font-size: 1rem; line-height: 1.45; border-top: 1px solid var(--ux-border); }
.te-steps li:first-child { border-top: 0; }
.te-steps li::before { content: counter(step); position: absolute; left: 0; top: 8px; width: 32px; height: 32px; border-radius: 50%; background: var(--ux-primary); color: #fff;
    font-weight: 700; display: flex; align-items: center; justify-content: center; }
.te-tip { margin: 10px 0 0; padding: 10px 12px; background: var(--ux-primary-50); border-radius: var(--ux-radius-sm); font-size: .95rem; }
.te-help-fab { position: fixed; right: 14px; bottom: calc(var(--gx-tab-h, 64px) + 14px + env(safe-area-inset-bottom)); z-index: 1025; min-width: 48px; height: 48px; padding: 0 16px;
    display: inline-flex; align-items: center; gap: 6px; border-radius: 24px; background: var(--ux-primary); color: #fff; font-weight: 700; text-decoration: none; box-shadow: 0 6px 18px rgba(0, 0, 0, .25); }
.te-help-fab:hover, .te-help-fab:focus-visible { color: #fff; filter: brightness(1.08); }
@media (min-width: 1200px) { .te-help-fab { bottom: 20px; } }
.te-welcome { position: fixed; inset: 0; z-index: 3000; display: flex; align-items: flex-end; justify-content: center; background: rgba(15, 23, 42, .55); }
@media (min-width: 576px) { .te-welcome { align-items: center; } }
.te-welcome-card { width: 100%; max-width: 440px; background: var(--ux-surface); border-radius: 20px 20px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom)); }
@media (min-width: 576px) { .te-welcome-card { border-radius: 20px; } }
.te-welcome-card .te-hub-ico { width: 56px; height: 56px; flex-basis: 56px; font-size: 1.8rem; margin-bottom: 10px; }
.te-welcome-card h2 { font-size: 1.25rem; margin: 0 0 6px; }
.te-welcome-card p { margin: 0 0 16px; font-size: 1.02rem; line-height: 1.45; color: var(--ux-ink); }
.te-welcome-dots { display: flex; gap: 6px; margin-bottom: 14px; }
.te-welcome-dots span { width: 8px; height: 8px; border-radius: 50%; background: var(--ux-border); }
.te-welcome-dots span.on { background: var(--ux-primary); }
.te-welcome-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.te-welcome-actions .btn { min-height: 48px; flex: 1 1 auto; }

/* Brouillon retrouvé (TeDraft) : bandeau au-dessus de la saisie. */
.te-draft-banner { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 0 0 14px; padding: 12px 14px; background: var(--ux-warning-bg, #fef3c7);
    border: 1px solid var(--ux-warning, #f59e0b); border-radius: var(--ux-radius-sm); }
.te-draft-banner p { margin: 0; flex: 1 1 240px; font-size: .95rem; color: var(--ux-ink); }
.te-draft-banner div { display: flex; gap: 8px; }
.te-draft-banner .btn { min-height: 44px; }

/* Font Awesome n'est plus chargé dans l'Espace Enseignant (≈ 285 Ko) : il ne servait qu'aux flèches des tableaux paginés et à un indicateur d'attente. */
.fa-angle-right::before, .fa-angle-left::before { font-family: inherit; font-weight: 700; font-size: 1.2em; line-height: 1; }
.fa-angle-right::before { content: "\203A"; }
.fa-angle-left::before { content: "\2039"; }
.fa-spinner, .fa-circle-notch { display: inline-block; width: 1em; height: 1em; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; vertical-align: -.125em; }
.fa-spin { animation: te-spin 1s linear infinite; }
@keyframes te-spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .fa-spin { animation-duration: 3s; } }
/* Le bouton « Aide » monte au-dessus de la barre « Enregistrer » pour ne jamais la cacher. */
body:has(.te-savebar) .te-help-fab { bottom: calc(var(--gx-tab-h, 64px) + 104px + env(safe-area-inset-bottom)); }
@media (min-width: 1200px) { body:has(.te-savebar) .te-help-fab { bottom: 96px; } }

/* Élèves à suivre */
.te-why { margin-bottom: 14px; }
.te-why summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.te-why ul { margin: 8px 0; padding-left: 1.1rem; }
.te-watch-row { padding: 14px 0; border-top: 1px solid var(--ux-border); }
.te-watch-row:first-child { border-top: 0; }
.te-watch-head { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 10px; }
.te-watch-name { font-weight: 700; font-size: 1.05rem; color: var(--ux-ink); text-decoration: none; }
.te-watch-reasons { margin: 8px 0 10px; padding-left: 1.1rem; font-size: .95rem; }
.te-watch-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.te-watch-actions .btn { min-height: 44px; display: inline-flex; align-items: center; }
.pf-badge-lite { display: inline-block; padding: 2px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.pf-badge-lite.critique { background: rgba(220, 38, 38, .12); color: #b91c1c; }
.pf-badge-lite.important { background: rgba(217, 119, 6, .14); color: #92400e; }
.pf-badge-lite.a_surveiller { background: rgba(37, 99, 235, .1); color: #1d4ed8; }

.te-watch-link { display: flex; align-items: center; gap: 10px; margin-top: 12px; padding: 12px 14px; min-height: 56px; background: var(--ux-warning-bg, #fef3c7); border: 1px solid var(--ux-warning, #f59e0b);
    border-radius: var(--ux-radius-sm); color: var(--ux-ink); text-decoration: none; }
.te-watch-link span { flex: 1; font-size: .95rem; }

/* Dictée vocale (te-voice.js) */
.te-voice { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; margin: 6px 0 4px; }
.te-mic { display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid var(--ux-primary); border-radius: 22px; background: var(--ux-surface); color: var(--ux-primary); font-weight: 700; }
.te-mic.is-on { background: #dc2626; border-color: #dc2626; color: #fff; animation: te-pulse 1.4s ease-in-out infinite; }
@keyframes te-pulse { 50% { box-shadow: 0 0 0 6px rgba(220, 38, 38, .2); } }
@media (prefers-reduced-motion: reduce) { .te-mic.is-on { animation: none; } }
.te-voice-live { flex: 1 1 160px; font-size: .9rem; color: var(--ux-muted); min-height: 1.2em; }
.te-voice-note { flex-basis: 100%; font-size: .78rem; color: var(--ux-muted); }

/* Ma progression */
.te-flash { margin: 0 0 14px; padding: 12px 14px; border-radius: var(--ux-radius-sm); font-weight: 600; }
.te-flash.ok { background: var(--ux-success-bg, #dcfce7); color: var(--ux-success-ink, #166534); }
.te-flash.ko { background: var(--ux-danger-bg, #fee2e2); color: var(--ux-danger-ink, #991b1b); }
.te-prog-help { margin-bottom: 14px; }
.te-prog-help summary, .te-prog-add summary { cursor: pointer; font-weight: 600; min-height: 44px; display: flex; align-items: center; }
.te-prog { scroll-margin-top: 80px; }
.te-prog-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.te-prog-pct { font-size: 1.6rem; color: var(--ux-primary); white-space: nowrap; }
.te-bar { height: 10px; background: var(--ux-border); border-radius: 10px; margin: 10px 0 12px; overflow: hidden; }
.te-bar-fill { display: block; height: 100%; background: var(--ux-primary); border-radius: 10px; }
.te-chapters { list-style: none; margin: 0 0 8px; padding: 0; }
.te-chapters li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; padding: 10px 0; border-top: 1px solid var(--ux-border); }
.te-chapters li.is-done .te-ch-title { color: var(--ux-muted); text-decoration: line-through; }
.te-ch-title { flex: 1 1 200px; font-size: 1rem; line-height: 1.35; }
.te-ch-actions { margin: 0; }
.te-ch-actions .btn { min-height: 44px; min-width: 44px; }
.te-prog-add form { display: grid; gap: 10px; padding-bottom: 6px; }
.te-prog-add .btn { min-height: 48px; }
.te-check { display: flex; align-items: flex-start; gap: 8px; font-size: .95rem; }
.te-check input { margin-top: .25rem; width: 20px; height: 20px; flex: 0 0 20px; }
.te-w0 { width: 0%; }
.te-w5 { width: 5%; }
.te-w10 { width: 10%; }
.te-w15 { width: 15%; }
.te-w20 { width: 20%; }
.te-w25 { width: 25%; }
.te-w30 { width: 30%; }
.te-w35 { width: 35%; }
.te-w40 { width: 40%; }
.te-w45 { width: 45%; }
.te-w50 { width: 50%; }
.te-w55 { width: 55%; }
.te-w60 { width: 60%; }
.te-w65 { width: 65%; }
.te-w70 { width: 70%; }
.te-w75 { width: 75%; }
.te-w80 { width: 80%; }
.te-w85 { width: 85%; }
.te-w90 { width: 90%; }
.te-w95 { width: 95%; }
.te-w100 { width: 100%; }
.te-why summary::after, .te-prog-help summary::after, .te-prog-add summary::after { content: "+"; margin-left: auto; font-size: 1.4rem; color: var(--ux-primary); }
.te-why[open] summary::after, .te-prog-help[open] summary::after, .te-prog-add[open] summary::after { content: "\2212"; }
.te-why summary, .te-prog-help summary, .te-prog-add summary { list-style: none; }
.te-why summary::-webkit-details-marker, .te-prog-help summary::-webkit-details-marker, .te-prog-add summary::-webkit-details-marker { display: none; }
