/* Styles propres aux ateliers guidés (CMS, Flutter & Dart, IA) : moteurs de la zone « Moteur ». S'appuie sur atelier.css et zones.css. */
.eng-note { flex: none; padding: 5px 10px; font-size: .78rem; color: var(--n7); border-bottom: 1px solid var(--n1); background: var(--n0); }
.eng-note:empty { display: none; }
.eng-root { flex: 1 1 auto; min-height: 0; overflow: auto; position: relative; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
.eng-root.eng-fit { overflow: hidden; }
.zone[data-zone=moteur] .zone-corps { display: flex; flex-direction: column; min-height: 0; }
.cibles-liste .cible-lien { cursor: default; font: 600 .75rem var(--f-ui); }
.etiq-demo { font: 600 .68rem var(--f-mono); text-transform: uppercase; letter-spacing: .05em; background: var(--warn-soft); color: var(--warn); border-radius: 999px; padding: 3px 9px; margin-inline-start: 6px; vertical-align: middle; }
.etoiles svg { width: 22px; height: 22px; } .etoiles svg.plein { fill: var(--or); stroke: #B58500; } .etoiles svg.creux { fill: none; stroke: var(--n4); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* quiz */
.q-liste { padding: 10px 12px; display: grid; gap: 10px; }
.q-intro { margin: 0; color: var(--n7); }
.q-carte { display: flex; gap: 10px; border: 1px solid var(--n2); border-radius: 12px; padding: 10px; background: var(--surface); }
.q-num { flex: none; width: 28px; height: 28px; border-radius: 8px; background: var(--bleu-soft); color: var(--bleu-ink); display: grid; place-items: center; font-weight: 800; }
.q-corps { flex: 1; min-width: 0; } .q-bloc { border: 0; margin: 0; padding: 0; min-width: 0; } .q-bloc legend, .q-enonce { font-weight: 650; margin-bottom: 6px; padding: 0; }
.q-opt { display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 2px 8px; border-radius: 8px; cursor: pointer; } .q-opt:hover { background: var(--bleu-soft); } .q-opt input { width: 22px; height: 22px; flex: none; accent-color: var(--bleu); margin: 0; }
.q-cats { display: flex; flex-wrap: wrap; gap: 6px; } .q-cat { min-height: 44px; padding: 0 14px; border-radius: 10px; border: 1px solid var(--n3); background: var(--surface); font-weight: 650; cursor: pointer; } .q-cat[aria-checked=true] { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.q-ordre { list-style: decimal; margin: 0; padding-inline-start: 1.6em; } .q-ordre li { display: flex; align-items: center; gap: 6px; margin-bottom: 6px; } .q-lab { flex: 1; min-width: 0; }
.ia .q-bloc { margin-top: 10px; }

/* Dart */
.dt { height: 100%; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); min-height: 0; }
.dt-ed, .dt-cons { display: flex; flex-direction: column; min-height: 0; min-width: 0; } .dt-cons { border-inline-start: 1px solid var(--n2); }
.dt-bar { flex: none; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 4px 8px; background: var(--n1); border-bottom: 1px solid var(--n2); min-height: 44px; }
.dt-file { font: 600 .78rem var(--f-mono); color: var(--n7); }
.dt-code { flex: 1 1 auto; min-height: 0; width: 100%; resize: none; border: 0; outline: none; padding: 10px 12px; font: 500 16px/1.5 var(--f-mono); background: var(--surface); color: var(--ink); tab-size: 2; white-space: pre; overflow: auto; }
.dt-code:focus-visible { outline: 3px solid var(--bleu); outline-offset: -3px; }
.dt-keys { flex: none; display: none; gap: 4px; padding: 4px 6px; overflow-x: auto; background: var(--n0); border-top: 1px solid var(--n2); white-space: nowrap; }
@media (pointer: coarse) { .dt-keys { display: flex; } }
.dt-keys button { min-width: 44px; min-height: 44px; border-radius: 8px; border: 1px solid var(--n3); background: var(--surface); font: 600 1rem var(--f-mono); cursor: pointer; }
.dt-consbody { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 8px 10px; }
.dt-out { margin: 0 0 8px; padding: 10px 12px; background: #0F1B3C; color: #E4ECFF; border-radius: 10px; font: 500 .85rem/1.5 var(--f-mono); white-space: pre-wrap; word-break: break-word; }
.dt-err { background: var(--ko-soft); color: var(--ko); border-radius: 8px; padding: 8px 10px; font-weight: 600; font-size: .86rem; }
@media (max-width: 760px) { .dt { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1.4fr) minmax(0, 1fr); } .dt-cons { border-inline-start: 0; border-top: 1px solid var(--n2); } }

/* arbre de widgets */
.wd { height: 100%; display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr) minmax(0, 1fr); min-height: 0; }
.wd-tabs { display: none; grid-column: 1 / -1; gap: 4px; padding: 4px; background: var(--n1); } .wd-tabs button { flex: 1; min-height: 44px; border-radius: 8px; border: 1px solid var(--n3); background: var(--surface); font-weight: 650; cursor: pointer; } .wd-tabs button[aria-selected=true] { background: var(--bleu); border-color: var(--bleu); color: #fff; }
.wd-p { overflow: auto; min-height: 0; padding: 8px 10px; } .wd-arbre { grid-row: 2 / 4; grid-column: 1; border-inline-end: 1px solid var(--n2); } .wd-apercu { grid-column: 2; grid-row: 2; display: flex; flex-direction: column; align-items: center; } .wd-code { grid-column: 2; grid-row: 3; border-top: 1px solid var(--n2); }
.wd-ul { list-style: none; margin: 0; padding-inline-start: 14px; border-inline-start: 2px solid var(--n2); } .wd-racine { border: 0; padding: 0; }
.wd-n { margin: 4px 0; } .wd-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; min-height: 44px; } .wd-w { color: var(--bleu-ink); font-family: var(--f-mono); } .wd-lab { color: var(--n5); font: 600 .78rem var(--f-mono); }
.wd-in { min-height: 44px; flex: 1 1 140px; min-width: 0; border: 1px solid var(--n3); border-radius: 8px; padding: 0 10px; font: 16px var(--f-ui); background: var(--surface); color: var(--ink); }
.wd-sel { min-height: 44px; max-width: 100%; border: 1px dashed var(--bleu); border-radius: 8px; padding: 0 8px; font: 16px var(--f-ui); background: var(--bleu-soft); color: var(--bleu-ink); }
.wd-add { margin: 4px 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.phone { width: min(190px, 100%); aspect-ratio: 9 / 17; max-height: 100%; border: 6px solid #1B2438; border-radius: 22px; background: #fff; overflow: hidden; display: flex; flex-direction: column; color: #111; font: 500 13px/1.3 system-ui, sans-serif; flex: none; }
.ph-status { flex: none; height: 12px; background: #E9ECF3; } .ph-scaf { flex: 1; display: flex; flex-direction: column; min-height: 0; } .ph-body { flex: 1; min-height: 0; display: flex; } .ph-body > * { flex: 1; } .ph-appbar { flex: none; background: #0B5FFF; color: #fff; padding: 10px; font-weight: 700; } .ph-vide { margin: auto; color: #8A93A6; }
.ph-center { display: flex; align-items: center; justify-content: center; } .ph-pad { padding: 16px; } .ph-col { display: flex; flex-direction: column; align-items: center; gap: 6px; } .ph-row { display: flex; align-items: center; gap: 8px; justify-content: center; }
.ph-btn { display: inline-block; background: #0B5FFF; color: #fff; padding: 6px 12px; border-radius: 6px; font-weight: 700; } .ph-gap { display: inline-block; height: 16px; width: 16px; } .ph-appbar .ph-text, .ph-btn .ph-text { color: #fff; }
@media (max-width: 760px), (max-height: 560px) {
  .wd { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto minmax(0, 1fr); } .wd-tabs { display: flex; }
  .wd-p { display: none; grid-column: 1; grid-row: 2; border: 0; } .wd[data-v=arbre] .wd-arbre, .wd[data-v=code] .wd-code { display: block; } .wd[data-v=apercu] .wd-apercu { display: flex; }
}

/* IA */
.ia { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; padding: 10px 12px; height: 100%; min-height: 0; }
.ia-g, .ia-c { min-width: 0; min-height: 0; }
.ia-g { display: flex; flex-direction: column; } .ia-c { overflow: auto; padding-inline-end: 2px; }
.ia-plot { width: 100%; flex: 1 1 auto; min-height: 0; display: block; touch-action: manipulation; }
.ia-fond { fill: var(--surface); stroke: var(--n3); stroke-width: .3; } .ia-grid { stroke: var(--n2); stroke-width: .2; } .ia-ax { font: 3px var(--f-ui); fill: var(--n5); } .ia-ax2 { font: 600 3.3px var(--f-ui); fill: var(--n7); }
.ia-tr.c0 { fill: #E8801A; } .ia-tr.c1 { fill: #9A8A00; } .ia-te { fill: var(--surface); stroke-width: .8; cursor: pointer; } .ia-te.c0 { stroke: #E8801A; } .ia-te.c1 { stroke: #9A8A00; } .ia-te.err { stroke: var(--ko); stroke-width: 1.1; }
.ia-tr { stroke: var(--surface); stroke-width: .3; } .ia-x { font: 700 5px var(--f-ui); fill: var(--ko); pointer-events: none; } .ia-vois { stroke: var(--bleu); stroke-width: .5; stroke-dasharray: 1.2 1; } .ia-sel { fill: none; stroke: var(--bleu); stroke-width: .7; }
.ia-reg.r0 { fill: #E8801A; opacity: .22; } .ia-reg.r1 { fill: #9A8A00; opacity: .24; }
.ia-leg { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .78rem; margin-top: 4px; } .ia-leg svg { width: 13px; height: 13px; vertical-align: -2px; } .ia-leg-te { color: var(--n5); }
.ia-cartes { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; } .ia-carte { border: 1px solid var(--bleu-line); background: var(--bleu-soft); border-radius: 10px; padding: 8px 10px; } .ia-carte b { display: block; font-size: 1.5rem; color: var(--bleu-ink); } .ia-carte span { font-size: .76rem; color: var(--n7); } .ia-carte.alt { background: var(--n1); border-color: var(--n2); } .ia-carte.alt b { color: var(--n7); } .ia-carte.mauvais { background: var(--ko-soft); border-color: var(--ko); } .ia-carte.mauvais b { color: var(--ko); }
.ia-step { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; } .ia-val { flex: 1; min-width: 0; } .ia-val input { width: 100%; min-height: 44px; accent-color: var(--bleu); } .ia-out { min-width: 2ch; font: 700 1.1rem var(--f-mono); text-align: center; }
.ia-sel-t, .ia-cls { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 8px; } .ia-lec { margin: 6px 0; font-size: .86rem; } .ia-lec .ok { color: var(--ok); font-weight: 700; } .ia-lec .ko { color: var(--ko); font-weight: 700; }
.ia-conf { border-collapse: collapse; width: 100%; font-size: .82rem; margin-bottom: 8px; } .ia-conf th, .ia-conf td { border: 1px solid var(--n2); padding: 5px 8px; text-align: center; } .ia-conf th { background: var(--n1); font-weight: 600; } .ia-conf td.mauvais { background: var(--ko-soft); color: var(--ko); font-weight: 800; }
.sw-champ { display: flex; flex-direction: column; gap: 3px; margin-bottom: 8px; } .sw-champ > span { font-size: .8rem; font-weight: 650; color: var(--n5); }
@media (max-width: 760px), (max-height: 560px) { .ia { grid-template-columns: minmax(0, 1fr); height: auto; } .ia-plot { height: 42vh; flex: none; } .ia-c { overflow: visible; } }
@media (max-height: 560px) and (min-width: 700px) { .ia { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); height: 100%; } .ia-plot { height: auto; flex: 1 1 auto; } .ia-c { overflow: auto; } }

/* ajustements de coque pour 5 exercices et cibles tactiles */
.marque { min-width: 44px; }
@media (max-width: 760px) and (min-height: 561px) {
  .liste-ex { gap: 4px; } .ex-carte { min-height: 44px; padding: 2px 10px; gap: 8px; } .ex-carte .t span { display: none; } .ex-num { width: 32px; height: 32px; }
  .heros #heroPetit { display: none; } .heros { padding: 10px 12px; gap: 4px; } .heros .btn.prim { min-height: 44px; }
}
@media (max-width: 760px) and (max-height: 560px) {
  .liste-ex { gap: 3px; } .ex-carte { min-height: 44px; padding: 0 10px; gap: 8px; } .ex-carte .t span { display: none; } .ex-num { width: 30px; height: 30px; }
  .heros #heroPetit { display: none; } .heros { padding: 8px 12px; gap: 3px; } .heros h1 { font-size: 1.1rem; }
}
@media (max-width: 760px) and (max-height: 460px) { .heros .kicker { display: none; } .heros .badge-niveau { padding: 4px 10px; } .heros h1 { font-size: 1rem; } }

/* badge simulateur (en-tête) */
.sim-badge { position: relative; } .sim-badge summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; border-radius: 10px; border: 1px solid var(--warn); background: var(--warn-soft); color: var(--warn); font: 700 .74rem var(--f-ui); } .sim-badge summary::-webkit-details-marker { display: none; }
.sim-badge .sb-court { display: none; }
.sim-pop { position: absolute; inset-inline-start: 0; top: 48px; width: min(340px, 90vw); background: var(--surface); color: var(--ink); border: 1px solid var(--n3); border-radius: 12px; box-shadow: var(--sh); padding: 10px 12px; z-index: 60; font-size: .82rem; line-height: 1.45; }
@media (max-width: 1100px) { .sim-badge .sb-long { display: none; } .sim-badge .sb-court { display: inline; } }
@media (max-width: 760px) { .sim-pop { position: fixed; inset-inline: 8px; top: 110px; width: auto; } }
/* corrections de mise en page (accueil bas, bilan avec note, éditeur sur écran très bas) */
.bilan-droite { overflow: auto; }
.dt-code { min-height: 44px; }
@media (max-height: 560px) {
  .heros #heroPetit { display: none; } .heros #heroEssai { font-size: .72rem; line-height: 1.25; } .heros { gap: 3px; padding: 8px 12px; }
  .liste-ex { gap: 3px; } .ex-carte { min-height: 44px; padding: 0 10px; } .ex-carte .t span { display: none; }
}
@media (max-width: 760px) and (min-height: 561px) { .heros #heroEssai { font-size: .72rem; line-height: 1.25; } }
@media (max-height: 460px) { .dt-keys { display: none !important; } .dt { grid-template-rows: minmax(0, 1fr) minmax(0, .6fr); } .dt-bar { min-height: 44px; } }
@media (max-width: 760px) and (max-height: 460px) { .heros .badge-niveau { display: none; } }
@media (max-width: 760px) and (max-height: 460px) { .ex-carte .t b { font-size: .78rem; line-height: 1.1; } .ex-carte .etoiles { display: none; } .ex-carte .puce { font-size: .64rem; padding: 1px 6px; } .ex-carte { padding: 0 8px; gap: 6px; } }
@media (max-width: 760px) and (min-height: 561px) { .ex-carte .t b { font-size: .82rem; line-height: 1.12; } .ex-carte .puce { font-size: .66rem; padding: 1px 7px; } }
