/* Compléments de l'atelier « moteurs matériels » (réseau, électronique, robotique), par-dessus atelier.css et zones.css (copiés du dossier maquette/assets). */

/* ---------- Zone Moteur : cadre du simulateur + pied avec Vérifier ---------- */
.moteur-corps { display: flex; flex-direction: column; min-height: 0; padding: 0; }
.moteur-cadre { flex: 1 1 auto; min-height: 0; position: relative; display: flex; flex-direction: column; }
.cadre-iframe { flex: 1 1 auto; min-height: 0; position: relative; }
.cadre-iframe iframe { position: absolute; top: 0; right: 0; bottom: 0; left: 0; inset: 0; width: 100%; height: 100%; border: 0; background: var(--surface); }
.pied-moteur { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-top: 1px solid var(--n2); background: var(--n0); flex-wrap: wrap; }
.pied-moteur #statut { flex: 1 1 12em; min-width: 0; }
.pied-moteur #statut:empty { display: none; }
@media (max-height: 560px) {
  .pied-moteur { padding: 3px 6px; gap: 4px; flex-wrap: nowrap; }
  .pied-moteur .lib:not(.vf) { display: none; }
  .pied-moteur #statut { position: absolute; inset-inline: 8px; bottom: 58px; padding: 6px 10px; background: var(--surface); border: 1px solid var(--n3); border-radius: 8px; box-shadow: var(--sh); z-index: 6; pointer-events: none; }
}

/* ---------- Moteur « formulaire » (calculs et choix) ---------- */
.formulaire { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 10px 12px; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 12px; align-content: start; overscroll-behavior: contain; -webkit-overflow-scrolling: touch; }
.formulaire .figure { background: var(--surface); border: 1px solid var(--n2); border-radius: 12px; padding: 8px; display: flex; align-items: center; justify-content: center; min-height: 0; }
.formulaire .figure svg { width: 100%; height: auto; max-height: 260px; }
.formulaire .intro { font-size: .9rem; color: var(--n7); margin-bottom: 8px; }
.formulaire .champ { margin-bottom: 8px; }
.formulaire label { display: block; font-weight: 600; font-size: .88rem; margin-bottom: 3px; }
.formulaire .saisie { display: flex; align-items: center; gap: 8px; }
.formulaire input, .formulaire select { flex: 1 1 auto; min-width: 0; min-height: 44px; border: 1px solid var(--n3); border-radius: 8px; padding: 0 10px; background: var(--surface); color: var(--ink); font: 500 1rem var(--f-mono); }
.formulaire select { font-family: var(--f-ui); font-weight: 500; }
.formulaire .unite { flex: none; font: 600 .95rem var(--f-mono); color: var(--bleu-ink); min-width: 2.2em; }
.formulaire code { white-space: nowrap; }
@media (max-width: 760px), (max-height: 560px) { .formulaire { grid-template-columns: minmax(0, 1fr); } .formulaire .figure svg { max-height: 150px; } }
@media (max-height: 560px) and (min-width: 700px) { .formulaire { grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); } .formulaire .figure svg { max-height: 120px; } }
.figure svg text { font-family: var(--f-ui); fill: var(--ink); }
.figure svg .fil { stroke: var(--ink); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.figure svg .fil2 { stroke: var(--bleu); fill: none; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
.figure svg .rempli { fill: var(--bleu-soft); stroke: var(--ink); stroke-width: 2.2; }
.figure svg .led { fill: #fecaca; stroke: #b91c1c; stroke-width: 2.2; }
.figure svg .doux { fill: var(--n1); }

/* ---------- Énoncé : tableaux et rappels ---------- */
.enonce-corps table, .aide-corps table { border-collapse: collapse; margin: .3em 0 .5em; font-size: .85rem; }
.enonce-corps th, .enonce-corps td, .aide-corps th, .aide-corps td { border: 1px solid var(--n2); padding: 3px 8px; text-align: start; }
.enonce-corps th, .aide-corps th { background: var(--n1); }
.fn-carte .corps-r p { margin-bottom: .3em; } .fn-carte .corps-r code { display: inline; }
.fn-carte .corps-r { font-size: .86rem; }
.retours .premier b { color: var(--ko); }
.formule-r { display: block; font: 600 .95rem var(--f-mono); background: var(--n1); border-radius: 8px; padding: 4px 10px; margin: 4px 0; text-align: center; }
.tbl-wrap { overflow-x: auto; }

.barre-question { flex: none; display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-bottom: 1px solid var(--n2); background: var(--n0); flex-wrap: wrap; }
.barre-question label { font-weight: 650; font-size: .86rem; }
.barre-question select { flex: 1 1 14em; min-width: 0; min-height: 44px; border: 1px solid var(--n3); border-radius: 8px; padding: 0 8px; background: var(--surface); color: var(--ink); font-family: inherit; font-size: .9rem; }

@media (pointer: coarse), (max-width: 760px) { .barre-question select, .formulaire input, .formulaire select { font-size: 16px; } }
/* le bouton « Avis » (ajouté par le site) peut se glisser dans la rangée des exercices : elle passe à la ligne au lieu de déborder */
.top .chips { flex-wrap: wrap; min-width: 0; max-width: 100%; }
@media (max-width: 760px) { .ex-carte { min-height: 44px; } .liste-ex { gap: 4px; } }
@media (max-width: 760px) and (max-height: 700px) { .heros .badge-niveau { padding: 6px 10px; } .heros { gap: 4px; } .heros .petit { display: none; } }
@media (max-width: 760px) and (max-height: 640px) { .liste-ex { gap: 3px; } .ex-carte { padding: 2px 10px; } .ex-num { width: 32px; height: 32px; } .accueil { gap: 6px; } .heros { padding: 8px 12px; } }
@media (max-width: 760px) and (max-height: 700px) { .heros .long, .heros #heroEssai { display: none; } }
@media (max-width: 520px) { .mode-reseau .rsx-piece span { display: none; } .mode-reseau .rsx-piece { min-width: 44px; min-height: 44px; } }
@media (max-width: 760px) and (max-height: 700px) { .heros h1 { font-size: 1.05rem; } .ex-carte .t span { display: none; } .ex-carte { min-height: 40px; } }
