/* copié de scalefast-devis@01362b0 (public/dashboard.css) — réduit au socle BIEX.
   BIEX-32 — charte BIEX du 27/09 (docs/wiki/charte.md) : UNE marque, TROIS
   registres posés sur `html[data-register]` (kids, explorer, adult). Les blocs
   de TOKENS ci-dessous (`:root` = adulte, `kids`, `explorer`, sombre adulte)
   sont les SEULS endroits où une couleur s'écrit en hex : partout ailleurs une
   couleur est une variable (test/charte.test.js). Fredoka + Nunito
   self-hosted (aucune requête Google Fonts). Utilitaires `u-*` à la fin :
   spécificité 0-1-0, AUCUN !important. Aucun style inline nulle part (CSP
   `style-src-attr 'none'`) : le dynamique passe par `data-sfs`. */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
:root {
  --marino: #0B2A5B; --noche: #0B1F4D; --azul: #2457E6; --turquesa: #2ED3D3;
  --turquesa-oscuro: #0B8A94; --turquesa-claro: #7EE8EA; --chispa: #FFC93C;
  --cielo: #EAF5FC; --bruma: #D6ECF7; --papel: #F5F7FA; --nube: #FFFFFF;
  --tinta-suave: #3E5477; --borde: #D6DEEA;
  --bg: #FFFFFF; --bg2: #F5F7FA; --bg3: #F5F7FA;
  --text: #0B2A5B; --text2: #3E5477; --text3: #3E5477;
  --border: #D6DEEA; --border2: #D6DEEA;
  --primary: #0B8A94; --on-primary: #FFFFFF; --primary-shadow: #0B2A5B;
  --primary-bg: #EAF5FC; --primary-border: #7EE8EA;
  --info-bg: #EAF5FC; --info: #2457E6; --info-border: #D6ECF7;
  --success-bg: #DDF7EA; --success: #14663E; --success-border: #2ECC85;
  --warn-bg: #FFF3CF; --warn: #6B4600; --warn-border: #FFC93C;
  --danger-bg: #FDE3E1; --danger: #8F1D17; --danger-border: #FF8A80;
  --navy: #0B2A5B; --header-bg: #0B2A5B; --on-header: #FFFFFF; --on-header-muted: rgba(255,255,255,0.72);
  --logo-suffix: #0B8A94;
  --focus: #2457E6; --focus-ring: 2px solid var(--focus);
  --scrim: rgba(11,42,91,0.55); --shadow-soft: rgba(11,42,91,0.08); --shadow-modal: rgba(11,42,91,0.3);
  --ghost-border: var(--border2);
  --font-body: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-display: 'Fredoka', 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-heading: var(--font-body);
  --text-size: 15px;
  --radius: 8px; --radius-lg: 12px; --radius-pill: 999px;
}
html[data-register="kids"] {
  --bg: #FFFFFF; --bg2: #D6ECF7; --bg3: #EAF5FC;
  --text: #0B2A5B; --text2: #3E5477; --text3: #3E5477;
  --border: #D6DEEA; --border2: #D6DEEA;
  --primary: #2ED3D3; --on-primary: #0B2A5B; --primary-shadow: #0B8A94;
  --primary-bg: #D6ECF7; --primary-border: #7EE8EA;
  --accent: #FFC93C;
  --ghost-border: #0B8A94;
  --navy: #EAF5FC; --header-bg: #EAF5FC; --on-header: #0B2A5B; --on-header-muted: #3E5477;
  --focus: #2457E6;
  --font-heading: var(--font-display);
  --text-size: 18px;
  --radius: 16px; --radius-lg: 24px;
}
html[data-register="explorer"] {
  --bg: #14295E; --bg2: #14295E; --bg3: #0B1F4D;
  --text: #FFFFFF; --text2: #C9D6EA; --text3: #C9D6EA;
  --border: rgba(201,214,234,0.18); --border2: #3B7BFF;
  --primary: #2ED3D3; --on-primary: #0B1F4D; --primary-shadow: #0B8A94;
  --primary-bg: #14295E; --primary-border: #3B7BFF;
  --info-bg: #14295E; --info: #7EE8EA; --info-border: #3B7BFF;
  --success-bg: #27500a; --success: #c0dd97; --success-border: #3b6d11;
  --warn-bg: #633806; --warn: #fac775; --warn-border: #ba7517;
  --danger-bg: #791f1f; --danger: #f09595; --danger-border: #a32d2d;
  --navy: #0B1F4D; --header-bg: #0B1F4D; --on-header: #FFFFFF; --on-header-muted: #C9D6EA;
  --logo-suffix: #7EE8EA;
  --focus: #7EE8EA;
  --scrim: rgba(0,0,0,0.6); --shadow-soft: rgba(0,0,0,0.25); --shadow-modal: rgba(0,0,0,0.5);
  --font-heading: var(--font-display);
  --text-size: 16px;
  --radius: 12px; --radius-lg: 16px;
}
/* Le sombre automatique ne vaut QUE pour le registre adulte : Kids reste clair,
   Explorer reste nuit, quoi que dise le système. */
@media (prefers-color-scheme: dark) {
  html:not([data-register="kids"]):not([data-register="explorer"]) {
    --bg: #14295E; --bg2: #0B1F4D; --bg3: #0B1F4D;
    --text: #FFFFFF; --text2: #C9D6EA; --text3: #C9D6EA;
    --border: rgba(201,214,234,0.14); --border2: rgba(201,214,234,0.28);
    --primary: #0B8A94; --on-primary: #FFFFFF; --primary-shadow: #0B1F4D;
    --primary-bg: #14295E; --primary-border: #0B8A94;
    --info-bg: #14295E; --info: #7EE8EA; --info-border: #3B7BFF;
    --success-bg: #27500a; --success: #c0dd97; --success-border: #3b6d11;
    --warn-bg: #633806; --warn: #fac775; --warn-border: #ba7517;
    --danger-bg: #791f1f; --danger: #f09595; --danger-border: #a32d2d;
    --navy: #0B1F4D; --header-bg: #0B1F4D; --on-header: #FFFFFF; --on-header-muted: #C9D6EA;
    --logo-suffix: #7EE8EA;
    --focus: #7EE8EA;
    --scrim: rgba(0,0,0,0.6); --shadow-soft: rgba(0,0,0,0.25); --shadow-modal: rgba(0,0,0,0.5);
  }
}
@font-face {
  font-family: 'Nunito';
  src: url('/fonts/nunito-latin.woff2') format('woff2');
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'Fredoka';
  src: url('/fonts/fredoka-latin.woff2') format('woff2');
  font-weight: 500 600;
  font-style: normal;
  font-display: swap;
}
body { font-family: var(--font-body); background: var(--bg3); color: var(--text); font-size: var(--text-size); line-height: 1.5; min-height: 100vh; }
h1, h2, h3, h4 { letter-spacing: -0.01em; font-weight: 700; }
h1, h2 { font-family: var(--font-heading); font-weight: 600; }
td, th { font-variant-numeric: tabular-nums; }
:focus-visible { outline: var(--focus-ring); outline-offset: 2px; }

/* LAYOUT */
.main { max-width: 1100px; margin: 0 auto; padding: 2rem 1.5rem; }
.page[hidden] { display: none; }
.page-title { font-size: 24px; margin-bottom: 0.5rem; }
.page-lead { color: var(--text2); margin-bottom: 1.5rem; }
/* Le thème enfant (age_band E1/E2) élargit le rythme : posé par la page élève. */
body[data-role="student"] .main { max-width: 760px; }
body[data-role="student"] { font-size: 17px; }

/* === BIEX-34 adult === */
/* Registre adulte (docente, colegio, admin — planche « Docentes y familias · Consola ») : les blocs
   partagés du shell, sur les tokens de BIEX-32 SEULS (le sombre adulte vient de ses tokens sombres,
   rien de nouveau). Sans mascotte, Fredoka dans le seul logotype (test/adult-front.test.js). Les
   retouches propres à l'adulte portent le sélecteur du registre adulte, comme le bloc sombre :
   Kids et Explorer ne les voient pas. */
/* HEADER — le logotype est TEXTE (Fredoka 600), le symbole suit le fond du registre. */
.header { background: var(--header-bg); position: sticky; top: 0; z-index: 100; color: var(--on-header); }
.header-top { display: flex; align-items: center; justify-content: space-between; padding: 0 1.5rem; gap: 1rem; }
.header-left { display: flex; align-items: center; gap: 1.5rem; min-width: 0; }
.logo { display: flex; align-items: center; gap: 10px; padding: 0.7rem 0; flex-shrink: 0; }
.logo img { height: 28px; width: auto; }
.logo-mark-light { display: none; }
html[data-register="kids"] .logo-mark-dark { display: none; }
html[data-register="kids"] .logo-mark-light { display: block; }
.logo-text { font-family: var(--font-display); font-size: 20px; font-weight: 600; letter-spacing: -0.02em; color: var(--on-header); }
.logo-suffix { font-family: var(--font-display); font-weight: 500; color: var(--logo-suffix); }
.nav { display: flex; gap: 0; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav-item { font: inherit; font-size: 13px; padding: 0.8rem 1rem; color: var(--on-header-muted); cursor: pointer; border: 0; border-bottom: 2px solid transparent; background: none; white-space: nowrap; }
.nav-item:hover { color: var(--on-header); }
.nav-item.on { color: var(--on-header); border-bottom-color: var(--primary); font-weight: 600; }
.header-right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.user-name { font-size: 13px; color: var(--on-header-muted); }
.row-g8 { display: flex; align-items: center; gap: 8px; }
@media (max-width: 600px) {
  .header-top { padding: 0 1rem; }
  .user-name { display: none; }
  .nav-item { font-size: 12px; padding: 0.6rem 0.75rem; }
}

/* CARDS, SECTIONS */
.card { background: var(--bg); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 1rem 1.25rem; margin-bottom: 1rem; }
.sec { font-size: 11px; font-weight: 500; color: var(--text3); text-transform: uppercase; letter-spacing: .06em; margin: 1.75rem 0 .75rem; }
.g2 { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin-bottom: 12px; }
.g3 { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 12px; margin-bottom: 12px; }
@media (max-width: 800px) { .g3 { grid-template-columns: repeat(2, minmax(0,1fr)); } }
@media (max-width: 500px) { .g2, .g3 { grid-template-columns: 1fr; } }

/* BUTTONS */
.btn { font: inherit; font-size: 14px; padding: 8px 16px; min-height: 36px; border: 1px solid var(--border2); border-radius: var(--radius); cursor: pointer; background: var(--bg); color: var(--text); transition: background .15s; white-space: nowrap; }
.btn:hover { background: var(--bg2); }
.btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); }
.btn.primary:hover { opacity: .88; }
.btn.danger { color: var(--danger); border-color: var(--danger-border); }
.btn.danger:hover { background: var(--danger-bg); }
.btn.ghost { background: transparent; color: inherit; border-color: var(--ghost-border); }
.btn.sm { font-size: 12px; padding: 4px 10px; min-height: 28px; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .6; cursor: default; }

/* FORMS */
.field { display: block; margin-bottom: 12px; }
.field > span { display: block; font-size: 13px; color: var(--text2); margin-bottom: 4px; }
.field input, .field select, .field textarea { width: 100%; padding: 9px 11px; border: 1px solid var(--border2); border-radius: var(--radius); background: var(--bg); color: var(--text); font: inherit; font-size: 14px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--primary); }
.field textarea { resize: vertical; min-height: 72px; }
input::placeholder, textarea::placeholder { color: var(--text3); }

/* TABLES */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-weight: 500; color: var(--text3); padding: 8px 10px; border-bottom: 1px solid var(--border2); }
td { padding: 8px 10px; border-bottom: 1px solid var(--border); }

/* ÉTATS */
.badge { display: inline-block; font-size: 11px; padding: 2px 8px; border-radius: 999px; border: 1px solid var(--border2); background: var(--bg2); }
.badge.ok { background: var(--success-bg); color: var(--success); border-color: var(--success-border); }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: var(--warn-border); }
.badge.ko { background: var(--danger-bg); color: var(--danger); border-color: var(--danger-border); }
.empty { color: var(--text3); font-size: 13px; padding: 1rem; text-align: center; }

/* TOASTS (00-ui.js) */
#sf-toasts { position: fixed; bottom: 20px; right: 20px; z-index: 1000; display: flex; flex-direction: column; gap: 8px; max-width: min(420px, calc(100vw - 40px)); }
.sf-toast { display: flex; align-items: flex-start; gap: 10px; background: var(--bg); color: var(--text); border: 1px solid var(--border2); border-left: 3px solid var(--primary); border-radius: var(--radius); padding: 10px 14px; font-size: 13px; line-height: 1.45; box-shadow: 0 8px 24px var(--shadow-modal); white-space: pre-line; animation: sf-toast-in .18s ease-out; }
.sf-toast.success { border-left-color: var(--success); }
.sf-toast.error { border-left-color: var(--danger); }
.sf-toast.warn { border-left-color: var(--warn); }
.sf-toast .sf-toast-x { margin-left: auto; cursor: pointer; color: var(--text3); background: none; border: none; font-size: 14px; line-height: 1; padding: 0 0 0 6px; }
@keyframes sf-toast-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* BANDEAU DE PANNE (04-api.js) */
.sf-databanner { display: flex; align-items: center; justify-content: center; gap: 12px; flex-wrap: wrap; padding: 10px 16px; background: var(--bg); color: var(--text); border-bottom: 2px solid var(--danger); font-size: 13px; }

/* MODALES (00-ui.js) */
.sf-modal-scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 12000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.sf-modal { background: var(--bg); color: var(--text); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px 22px; max-width: 440px; width: 100%; box-shadow: 0 20px 60px var(--shadow-modal); }
.sf-modal-msg { font-size: 14px; line-height: 1.55; white-space: pre-line; margin-bottom: 18px; }
.sf-modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.sf-prompt-input { width: 100%; padding: 8px 10px; border: 1px solid var(--border2); border-radius: var(--radius); background: var(--bg); color: var(--text); font: inherit; font-size: 13px; margin-bottom: 16px; }
.sf-choice-list { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; text-align: left; }
.sf-choice-item { display: flex; align-items: baseline; gap: 8px; padding: 7px 8px; border-radius: var(--radius); font-size: 13px; cursor: pointer; }
.sf-choice-item:hover { background: var(--bg2); }
.sf-choice-radio { margin: 0; flex: none; }
.sf-choice-hint { color: var(--text3); font-size: 12px; }
.sf-choice-sub { font-size: 12px; color: var(--text2); margin-bottom: 6px; text-align: left; }
.sf-choice-err { color: var(--danger); font-size: 12px; margin-bottom: 10px; text-align: left; }
.skel-stack { display: flex; flex-direction: column; gap: 8px; }
.skeleton { border-radius: var(--radius); background: linear-gradient(90deg, var(--bg2) 25%, var(--bg3) 50%, var(--bg2) 75%); background-size: 200% 100%; animation: sf-shimmer 1.2s infinite linear; min-height: 14px; }
@keyframes sf-shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* ADULTE — planche « Consola » : titre Nunito 800, sections 17/700, boutons 14/700, en-têtes de
   tableau en petites capitales sur papel, états en píldoras. Densité inchangée (15 px, tableaux). */
html:not([data-register="kids"]):not([data-register="explorer"]) .page-title { font-weight: 800; letter-spacing: -0.01em; }
html:not([data-register="kids"]):not([data-register="explorer"]) .card h2:not(.sec) { font-size: 17px; font-weight: 700; margin-bottom: 0.5rem; }
html:not([data-register="kids"]):not([data-register="explorer"]) .card h3:not(.sec) { font-size: 15px; font-weight: 700; margin-bottom: 0.4rem; }
html:not([data-register="kids"]):not([data-register="explorer"]) .btn { font-weight: 700; }
/* Onglets (boutons role=tab) : ils passent à la ligne à 390 px au lieu de pousser la page. */
html:not([data-register="kids"]):not([data-register="explorer"]) [role="tablist"] { flex-wrap: wrap; }
html:not([data-register="kids"]):not([data-register="explorer"]) .sec { font-size: 12px; font-weight: 800; letter-spacing: .04em; color: var(--text2); }
html:not([data-register="kids"]):not([data-register="explorer"]) .card > .sec:first-child { margin-top: 0; }
/* Un tableau large (admin, rapports) défile DANS sa carte à 390 px : la page, elle, ne défile jamais en largeur. */
html:not([data-register="kids"]):not([data-register="explorer"]) .card { overflow-x: auto; }
html:not([data-register="kids"]):not([data-register="explorer"]) .nav-item { font-weight: 600; }
html:not([data-register="kids"]):not([data-register="explorer"]) .nav-item.on { font-weight: 700; }
html:not([data-register="kids"]):not([data-register="explorer"]) th { font-size: 12px; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; color: var(--text2); background: var(--bg2); }
html:not([data-register="kids"]):not([data-register="explorer"]) .field > span { font-weight: 700; }
html:not([data-register="kids"]):not([data-register="explorer"]) .badge { font-size: 12px; font-weight: 800; padding: 2px 10px; border-radius: var(--radius-pill); }
/* Un message d'état en paragraphe (institution : contrat manquant, rapport d'import) n'est pas une píldora. */
html:not([data-register="kids"]):not([data-register="explorer"]) p.badge { display: block; border-radius: var(--radius); padding: 8px 12px; font-size: 13px; font-weight: 700; margin: 8px 0; }
.dropzone { border: 2px dashed var(--border2); border-radius: var(--radius-lg); background: var(--bg2); color: var(--text2); }
/* === /BIEX-34 === */

/* === BIEX-33 student === */
/* Écrans élève Kids / Explorer (planches du canvas, docs/wiki/boucle-eleve.md). Couleurs = tokens seuls ; les
   icônes sont des masques (la forme vient du SVG, la couleur d'une variable). Kids par défaut quand une règle est
   partagée ; `html[data-register="explorer"]` redonne la dose Explorer. Aucun !important. */
.student-chat { font-size: var(--text-size); color: var(--text); display: flex; flex-direction: column; gap: 16px; }
.student-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.student-head { display: flex; align-items: center; gap: 10px; min-width: 0; max-width: 100%; overflow: hidden; justify-self: center; }
/* BIEX-64 — la barre du haut : ← | titre de l'étape (ellipse) | Cerrar sesión ; 48 px, cibles ≥ 44 px, jamais de défilement horizontal. */
.student-topbar { position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; align-items: center; gap: 8px; min-height: 48px; padding: 2px 0 1px; background: var(--bg3); border-bottom: 1px solid var(--border); }
.student-top-slot { width: 44px; }
.student-top-title { min-width: 0; text-align: center; font-family: var(--font-display); font-weight: 600; font-size: 18px; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.student-chat .btn.student-top-back { width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; background: var(--nube); display: flex; align-items: center; justify-content: center; box-shadow: none; }
.student-top-arrow { display: block; width: 24px; height: 24px; background: var(--text); mask-repeat: no-repeat; mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-size: contain; mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M12 19l-7-7 7-7'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M19 12H5M12 19l-7-7 7-7'/%3E%3C/svg%3E"); }
.student-chat .btn.student-top-back:disabled { opacity: 0.5; }
.student-chat .btn.student-top-out { min-height: 44px; padding: 0 12px; font-size: 15px; white-space: nowrap; border-width: 2px; }
.student-head-mark { width: 26px; height: 32px; flex-shrink: 0; }
.student-logo { font-family: var(--font-display); font-weight: 600; font-size: 24px; letter-spacing: -0.02em; }
.student-logo-suffix { color: var(--turquesa-oscuro); font-weight: 500; }
.student-hello { font-family: var(--font-display); font-weight: 600; font-size: 30px; line-height: 1.1; margin: 0; }
.student-card { background: var(--bg); border: 0; border-radius: 28px; padding: 20px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 6px 18px var(--shadow-soft); }
.student-say { font-weight: 700; }
.student-hint, .student-label { font-size: 15px; color: var(--text2); font-weight: 700; display: block; }
.student-eyebrow { font-size: 13px; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--turquesa-oscuro); }
.student-note { font-size: 13px; line-height: 1.45; color: var(--text2); }
.soffia-hero { display: flex; align-items: flex-end; gap: 6px; }
.soffia-face { width: 104px; height: 140px; flex-shrink: 0; }
.soffia-say { padding: 12px 14px; background: var(--bruma); border-radius: 20px 20px 20px 4px; font-family: var(--font-display); font-weight: 600; font-size: 20px; line-height: 1.2; margin-bottom: 56px; }
.soffia-line { display: flex; align-items: center; gap: 10px; }
.soffia-line-text { font-size: 16px; line-height: 1.45; }
.soffia-avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--nube); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.soffia-avatar-img { width: 16px; height: 20px; }

/* Boutons de la page élève : píldora 56–60 px en Kids, marino sur turquesa avec relief ; 48 px radio 12 en Explorer. */
/* :where() garde ces deux règles à 0-1-0 : la touche maths (BIEX-29, plus bas) garde sa taille. */
:where(.student-chat) .btn { font-family: inherit; font-weight: 800; font-size: 17px; min-height: 48px; padding: 0 20px; border: 3px solid var(--ghost-border); border-radius: var(--radius-pill); background: var(--nube); color: var(--text); white-space: normal; }
.student-chat .btn.primary { background: var(--primary); color: var(--on-primary); border-color: var(--primary); box-shadow: 0 4px 0 var(--primary-shadow); }
.student-chat .btn.ghost { background: transparent; border-color: var(--ghost-border); color: var(--text2); }
.student-chat .btn.student-cta { min-height: 60px; font-size: 20px; width: 100%; box-shadow: 0 5px 0 var(--primary-shadow); }
.student-chat .btn.student-chip, .student-chat .btn.sm { min-height: 44px; font-size: 15px; padding: 0 16px; }
.student-chat .btn.student-option { min-height: 52px; border-radius: 16px; border-color: var(--ghost-border); text-align: left; }
.student-chat .btn.student-option.on { background: var(--bruma); border-color: var(--turquesa-oscuro); }
.student-options { display: flex; flex-direction: column; gap: 10px; }
.student-question { font-weight: 800; font-size: 20px; line-height: 1.3; }

/* Tuiles Kids (deux câblées, jamais une tuile morte) et liste Explorer. */
.student-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.student-chat .btn.student-tile { height: 96px; border: 0; border-radius: 22px; background: var(--nube); display: flex; flex-direction: column; align-items: flex-start; justify-content: space-between; padding: 14px 16px; text-align: left; box-shadow: 0 6px 18px var(--shadow-soft); }
.student-more { display: flex; flex-direction: column; gap: 10px; }
.student-chat .btn.student-entry { min-height: 64px; border: 0; border-radius: 16px; background: var(--bg3); display: grid; grid-template-columns: 24px 1fr; column-gap: 14px; align-items: center; padding: 10px 16px; text-align: left; }
.student-entry-title { font-weight: 800; font-size: 17px; line-height: 1.2; }
.student-entry-hint { grid-column: 2; font-size: 13px; font-weight: 400; color: var(--text2); }
.student-tile::before, .student-entry::before, .student-mic::before { content: ''; display: block; width: 28px; height: 28px; background: var(--turquesa-oscuro); mask-repeat: no-repeat; mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-size: contain; }
.student-entry::before { width: 24px; height: 24px; grid-row: 1 / span 2; }
.student-icon-homework::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19V5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v14M4 19a2 2 0 0 0 2 2h14M8 7h8M8 11h6'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M4 19V5a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v14M4 19a2 2 0 0 0 2 2h14M8 7h8M8 11h6'/%3E%3C/svg%3E"); }
.student-icon-exam::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 11l3 3L22 4M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 11l3 3L22 4M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11'/%3E%3C/svg%3E"); }

/* Progression : píldoras (Kids), ligne + pas nommé (Explorer) ; jamais un pourcentage. */
.student-progress { display: flex; flex-direction: column; gap: 6px; }
.student-pills, .student-line { display: flex; gap: 6px; }
.student-pill { flex-grow: 1; height: 10px; border-radius: var(--radius-pill); background: var(--nube); border: 2px solid var(--borde); }
.student-pill.done { background: var(--primary); border-color: var(--primary); }
.student-pill.now { background: var(--chispa); border-color: var(--chispa); }
.student-step { font-size: 12px; font-weight: 700; color: var(--text2); }

/* Conversation : SOFFIA à gauche avec avatar, l'élève à droite en azul. */
.student-thread { display: flex; flex-direction: column; gap: 12px; }
.student-row { display: flex; gap: 8px; align-items: flex-end; }
.student-row-me { justify-content: flex-end; }
.student-bubble { padding: 12px 16px; font-size: 18px; line-height: 1.45; max-width: 85%; overflow-wrap: anywhere; }
.student-bubble-soffia { background: var(--nube); border-radius: 20px 20px 20px 4px; }
.student-bubble-me { background: var(--azul); color: var(--nube); border-radius: 20px 20px 4px 20px; }
.student-form { display: flex; flex-direction: column; gap: 12px; }
.student-tools { display: flex; flex-wrap: wrap; gap: 8px; }
.student-chat .student-textarea, .student-chat .student-field { font-size: 18px; color: var(--text); background: var(--nube); border: 3px solid var(--borde); border-radius: 22px; padding: 14px 16px; line-height: 1.35; margin: 0; resize: none; width: 100%; }
.student-chat .student-field { border-radius: 16px; min-height: 56px; }
/* BIEX-65 — le composer : un cadre, le champ en haut, la barre (micro, photo, ➤) à droite dessous ; cibles ≥ 44 px. */
.student-composer { display: grid; grid-template-columns: minmax(0, 1fr) auto auto auto; align-items: center; gap: 6px 8px; padding: 6px 8px 8px; background: var(--nube); border: 3px solid var(--borde); border-radius: 22px; }
.student-composer:focus-within { border-color: var(--turquesa-oscuro); }
.student-chat .student-composer > .student-textarea.sf-prompt-input { grid-column: 1 / -1; border: 0; background: transparent; border-radius: 16px; padding: 8px 8px 4px; margin: 0; outline: none; overflow-y: auto; }
.student-composer > .student-mic { grid-row: 2; grid-column: 2; }
.student-composer > .student-photo { grid-row: 2; grid-column: 3; }
.student-composer > .student-send { grid-row: 2; grid-column: 4; }
.student-composer > .student-voice-status, .student-composer > .student-photo.student-photo-open, .student-composer > .student-ocr { grid-column: 1 / -1; grid-row: auto; }
.student-composer.is-reading { display: block; padding: 0; border: 0; background: transparent; }
.student-chat .student-composer .btn.student-mic, .student-chat .btn.student-send, .student-chat .btn.student-photo-take { width: 48px; height: 48px; min-height: 48px; padding: 0; border: 0; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 0; color: transparent; overflow: hidden; flex-shrink: 0; }
.student-chat .student-composer .btn.student-mic { box-shadow: 0 3px 0 var(--primary-shadow); }
.student-chat .btn.student-send { background: var(--primary); box-shadow: 0 3px 0 var(--primary-shadow); }
.student-chat .btn.student-photo-take { background: var(--bruma); box-shadow: none; }
.student-send::before, .student-photo-take::before { content: ''; display: block; width: 24px; height: 24px; mask-repeat: no-repeat; mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-size: contain; }
.student-send::before { background: var(--on-primary); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M4 4.5l17 7.5-17 7.5 2.5-7.5z'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='black'%3E%3Cpath d='M4 4.5l17 7.5-17 7.5 2.5-7.5z'/%3E%3C/svg%3E"); }
.student-photo-take::before { background: var(--turquesa-oscuro); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8a2 2 0 0 1 2-2h2.5l1.5-2h6l1.5 2H19a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 8a2 2 0 0 1 2-2h2.5l1.5-2h6l1.5 2H19a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z'/%3E%3Ccircle cx='12' cy='13' r='3.5'/%3E%3C/svg%3E"); }
.student-composer .student-mic::before { width: 24px; height: 24px; }
.student-chat .btn.student-mic { width: 72px; height: 72px; min-height: 72px; padding: 0; border: 0; border-radius: 50%; background: var(--primary); box-shadow: 0 5px 0 var(--primary-shadow); font-size: 0; color: transparent; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.student-mic::before { width: 32px; height: 32px; background: var(--on-primary); mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='9' y='3' width='6' height='11' rx='3'/%3E%3Cpath d='M5 11a7 7 0 0 0 14 0M12 18v3'/%3E%3C/svg%3E"); }
.student-chat .btn.student-mic[aria-pressed="true"] { background: var(--chispa); }
.student-mic[aria-pressed="true"]::before { mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='6' y='6' width='12' height='12' rx='2.5' fill='black'/%3E%3C/svg%3E"); -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Crect x='6' y='6' width='12' height='12' rx='2.5' fill='black'/%3E%3C/svg%3E"); }
.student-voice-status { font-size: var(--text-size); font-weight: 700; line-height: 1.35; color: var(--text); align-self: center; flex: 1 1 140px; }
.student-math { display: flex; flex-direction: column; gap: 12px; }
.student-procedure { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; background: var(--nube); border-radius: 20px; }
.student-formula-preview { font-family: var(--font-display); font-size: 22px; min-height: 1.3em; }
.student-table input { margin: 0; }
.student-net { padding: 12px 14px; border-radius: 16px; background: var(--warn-bg); color: var(--warn); font-weight: 700; display: flex; flex-direction: column; gap: 6px; }
.student-net[hidden] { display: none; }
.student-unavailable .student-cta { margin-top: 8px; }

/* Explorer : même composant, autre dose — radio 12–20, sans relieve, la chispa en vez de la cara. */
html[data-register="explorer"] .student-head-mark { width: 24px; height: 30px; }
html[data-register="explorer"] .student-logo { font-size: 22px; }
html[data-register="explorer"] .student-hello { font-size: 28px; }
html[data-register="explorer"] .student-card { border-radius: 20px; box-shadow: none; }
html[data-register="explorer"] .student-eyebrow { font-size: 12px; color: var(--turquesa-claro); }
html[data-register="explorer"] .student-more .student-eyebrow { color: var(--text2); }
html[data-register="explorer"] .soffia-avatar { width: 32px; height: 32px; background: var(--bg3); }
html[data-register="explorer"] .soffia-avatar-img { width: 14px; height: 18px; }
html[data-register="explorer"] .student-thread .soffia-avatar { width: 30px; height: 30px; background: var(--bg); }
html[data-register="explorer"] .student-thread .soffia-avatar-img { width: 13px; height: 16px; }
:where(html[data-register="explorer"] .student-chat) .btn { font-size: 16px; border-width: 2px; border-color: var(--border2); border-radius: 12px; background: transparent; }
html[data-register="explorer"] .student-chat .btn.primary { background: var(--primary); border-color: var(--primary); box-shadow: none; }
html[data-register="explorer"] .student-chat .btn.ghost { border-color: var(--ghost-border); }
html[data-register="explorer"] .student-chat .btn.student-cta { min-height: 52px; font-size: 17px; box-shadow: none; }
html[data-register="explorer"] .student-chat .btn.student-chip { min-height: 44px; font-size: 14px; border-radius: 10px; }
html[data-register="explorer"] .student-chat .btn.student-option { min-height: 44px; border-radius: 10px; border-color: var(--border2); font-weight: 700; font-size: 15px; }
html[data-register="explorer"] .student-chat .btn.student-option.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
html[data-register="explorer"] .student-chat .btn.student-entry { background: var(--bg3); border: 0; }
html[data-register="explorer"] .student-entry::before { background: var(--turquesa-claro); }
html[data-register="explorer"] .student-question { font-size: 18px; }
html[data-register="explorer"] .student-pill { height: 6px; background: var(--bg); border: 0; }
html[data-register="explorer"] .student-line { gap: 2px; }
html[data-register="explorer"] .student-pill.done, html[data-register="explorer"] .student-pill.now { background: var(--primary); }
html[data-register="explorer"] .student-thread { gap: 10px; }
html[data-register="explorer"] .student-bubble { font-size: 16px; line-height: 1.5; padding: 12px 14px; }
html[data-register="explorer"] .student-bubble-soffia { background: var(--bg); border-radius: 16px 16px 16px 4px; }
html[data-register="explorer"] .student-bubble-me { border-radius: 16px 16px 4px 16px; }
html[data-register="explorer"] .student-chat .student-textarea, html[data-register="explorer"] .student-chat .student-field { font-size: 16px; color: var(--text); background: var(--bg); border: 2px solid var(--border2); border-radius: 14px; padding: 12px 14px; }
html[data-register="explorer"] .student-chat .student-field { border-radius: 12px; min-height: 48px; }
html[data-register="explorer"] .student-composer { border-width: 2px; border-color: var(--border2); border-radius: 14px; background: var(--bg); }
html[data-register="explorer"] .student-composer:focus-within { border-color: var(--primary); }
html[data-register="explorer"] .student-chat .btn.student-send, html[data-register="explorer"] .student-chat .btn.student-photo-take { border-radius: 12px; box-shadow: none; }
html[data-register="explorer"] .student-chat .btn.student-mic { width: 48px; height: 48px; min-height: 48px; border-radius: 12px; box-shadow: none; }
html[data-register="explorer"] .student-mic::before { width: 24px; height: 24px; }
html[data-register="explorer"] .student-procedure { background: var(--bg); border: 1px solid var(--border2); border-radius: 12px; }
html[data-register="explorer"] .student-net { border-radius: 12px; }
html[data-register="explorer"] .student-chat .btn.student-top-back { border-radius: 12px; background: var(--bg); }
/* === /BIEX-33 === */
/* BIEX-64 — l'élève n'a plus d'en-tête global : sa barre (.student-topbar) porte le logotype et « Cerrar sesión ». */
body[data-role="student"] .header { display: none; }
/* BIEX-64 (relecture) : sous 375 px la piste centrale (~90 px à 320) ne tient pas « BIEX Kids » ; le logotype garde « BIEX », la barre ne chevauche jamais « Cerrar sesión ». */
@media (max-width: 374.98px) { .student-logo-suffix { display: none; } }

/* BIEX-29 — palette de touches maths de l'élève : touches larges pour un doigt d'enfant (≥ 44 px) */
.student-keys { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0; }
.student-key { min-width: 48px; min-height: 48px; padding: 8px 12px; font-size: 20px; line-height: 1; }

/* BIEX-63 — Versiones de la biblioteca : une ligne = une hauteur de badge (un badge ne se casse jamais) ; à 960 px et
   moins (tablette, téléphone), chaque version devient un bloc : Módulo en tête (Versión / Vigente desde / Informe dessous, .inst-narrow),
   puis Estado et Acciones côte à côte — trois cellules, aucun défilement horizontal de la carte. */
.inst-versions td { vertical-align: middle; }
/* Relecture : « Vigente desde » sans nowrap — une date INSTANT passe sur deux lignes ; 6 px de marge latérale gardent ces deux lignes (et pas trois) dès 961 px. */
.inst-versions th, .inst-versions td { padding-left: 6px; padding-right: 6px; }
.inst-versions .badge { white-space: nowrap; }
.inst-module { white-space: nowrap; }
.inst-actions { display: flex; gap: 8px; flex-wrap: nowrap; }
.inst-actions .btn { white-space: nowrap; }
.inst-narrow { display: none; }
@media (max-width: 960px) {
  /* Relecture : l'en-tête masqué VISUELLEMENT, jamais retiré (display: none l'ôtait aussi des lecteurs d'écran) ; les rôles sont posés par le JS. */
  .inst-versions thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap; }
  .inst-versions tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); }
  .inst-versions td { padding: 2px 0; border-bottom: 0; }
  .inst-versions td:first-child { grid-column: 1 / -1; }
  .inst-versions .inst-wide { display: none; }
  .inst-versions .inst-narrow { display: block; }
  .inst-narrow .warn { color: var(--warn); }
  .inst-narrow .ko { color: var(--danger); }
  .inst-versions .inst-module { white-space: normal; overflow-wrap: anywhere; }
  .inst-actions { flex-wrap: wrap; justify-content: flex-end; }
  .inst-versions .badge { white-space: normal; }
}
/* Relecture BIEX-63 : sous 480 px, les boutons prennent leur propre ligne — le badge d'état ne les recouvre plus (mesuré 320–390 px). */
@media (max-width: 480px) {
  .inst-versions td:last-child { grid-column: 1 / -1; }
  .inst-actions { justify-content: flex-start; }
}

/* UTILITAIRES — sans !important, spécificité 0-1-0 */
.u-display-none { display: none; }
.u-hidden { visibility: hidden; }
.u-flex { display: flex; }
.u-flex-col { display: flex; flex-direction: column; }
.u-items-center { align-items: center; }
.u-nowrap { white-space: nowrap; }
.u-link { cursor: pointer; color: var(--primary); }
.u-justify-between { justify-content: space-between; }
.u-gap-8 { gap: 8px; }
.u-gap-12 { gap: 12px; }
/* BIEX-50 : un groupe de cases sans le cadre du navigateur ; AVANT .u-mt-* / .u-mb-* (à spécificité égale, l'espacement l'emporte). */
.u-fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
.u-fieldset > legend { padding: 0; }
.u-mt-8 { margin-top: 8px; }
.u-mt-16 { margin-top: 16px; }
.u-mb-8 { margin-bottom: 8px; }
.u-mb-16 { margin-bottom: 16px; }
.u-text-2 { color: var(--text2); }
.u-text-3 { color: var(--text3); }
.u-text-sm { font-size: 13px; }
.u-text-center { text-align: center; }
.u-w-full { width: 100%; }
/* BIEX-53 : la colonne « Acceso » (Cuentas, Admin → Colegios) — « Enlace pendiente, caduca el … » sur deux lignes, jamais quatre. */
.u-minw-12 { min-width: 12rem; }
