/* Projection en classe : la page élève, sans la navigation de l'application, à lire du fond de la salle.
   Le zoom agit sur la colonne de travail seulement : la barre de projection garde sa taille et ne masque jamais
   le contenu (elle se range dans la marge haute réservée). */
:root{--cp-zoom:1.3;--cp-bar-h:64px}

body.class-present .s17-wide-nav,
body.class-present .s17-appbar,
body.class-present .pki-footer,
body.class-present [data-now-demo],
body.class-present [data-now-return-host],
body.class-present .ew3-secondary,
body.class-present .path-assignment-bar{display:none!important}

/* Deux coques possibles : élève (s17) et enseignant connecté (topbar). Le zoom porte sur toute l'application ;
   la barre de projection, ajoutée hors de #app, garde sa taille. */
body.class-present .topbar{display:none!important}
body.class-present .s17{flex-direction:column}
body.class-present #app{zoom:var(--cp-zoom);padding-top:calc(var(--cp-bar-h) / var(--cp-zoom))}
body.class-present #main-content{max-width:1180px;margin-inline:auto}
/* Le zoom ne change pas la largeur vue par les media queries : la composition « bureau » (question + colonne
   d'aides de 300 px) ne tient plus. À la projection, la question occupe toute la largeur, les aides passent dessous
   (composition tablette), et la progression personnelle — sans objet pour une démonstration — s'efface. */
body.class-present #app .learning-workspace .answer-card.qcard:has(>.qcard-secondary){
 display:grid!important;grid-template-columns:minmax(0,1fr)!important;grid-template-areas:"main" "rail"!important;gap:14px!important}
body.class-present #app .learning-workspace .answer-card.qcard:has(>.qcard-secondary)>.qcard-main{grid-area:main!important;min-width:0!important}
body.class-present #app .learning-workspace .answer-card.qcard:has(>.qcard-secondary)>.qcard-secondary{
 grid-area:rail!important;position:static!important;max-height:none!important;overflow:visible!important}
body.class-present .uah-progress{display:none!important}
/* Les en-têtes collants se rangent sous la barre de projection au lieu de passer dessous. */
body.class-present .uah-top,body.class-present .s17-qhead{top:calc(var(--cp-bar-h) / var(--cp-zoom))!important}
/* La consigne et le problème sont lus par toute la classe : mesure de lecture confortable. */
body.class-present .ex-problem,body.class-present .ew2-problem{white-space:pre-line;max-width:72ch}

/* Barre de projection, posée sur un bandeau opaque : rien ne défile visiblement au-dessus des en-têtes collants. */
body.class-present::before{content:'';position:fixed;inset:0 0 auto 0;height:var(--cp-bar-h);z-index:1150;background:var(--bg,#f6f7f9);box-shadow:0 1px 0 var(--line,#e3e7ee)}
.cp-bar{position:fixed;inset:10px 12px auto auto;z-index:1200;display:flex;align-items:center;gap:6px;
 min-height:44px;padding:5px 6px 5px 14px;border-radius:var(--r-pill);background:var(--navy);color:var(--ink-inverse);
 box-shadow:0 10px 30px -8px rgba(16,32,58,.45),0 2px 6px rgba(16,32,58,.18);font:600 var(--fs-14)/1.2 var(--font-sans)}
.cp-bar-label{display:flex;align-items:center;gap:8px;margin:0 6px 0 0;white-space:nowrap;max-width:34vw;overflow:hidden;text-overflow:ellipsis;color:#d9e2f1}
.cp-bar-label strong{color:#fff;font-weight:800}
.cp-bar-label span{overflow:hidden;text-overflow:ellipsis}
.cp-bar-group{display:flex;align-items:center;gap:2px;padding:2px;border-radius:var(--r-pill);background:rgba(255,255,255,.08)}
.cp-bar-size{min-width:4.2ch;text-align:center;font-variant-numeric:tabular-nums;color:#fff}
.cp-bar-btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-width:40px;height:40px;padding:0 10px;
 border:0;border-radius:var(--r-pill);background:transparent;color:#fff;font:inherit;text-decoration:none;cursor:pointer;
 transition:background-color var(--motion-fast,.15s) cubic-bezier(.16,1,.3,1)}
.cp-bar-btn:hover{background:rgba(255,255,255,.14)}
.cp-bar-btn:disabled{opacity:.38;cursor:not-allowed;background:transparent}
.cp-bar-btn:focus-visible{outline:3px solid #9cc2ff;outline-offset:2px}
.cp-bar-btn.is-wide{padding:0 14px}
.cp-bar-btn.is-exit{background:#fff;color:var(--navy)}
.cp-bar-btn.is-exit:hover{background:#e7edf7}
.cp-bar-btn svg{flex-shrink:0}
@media(max-width:900px){.cp-bar-label span,.cp-bar-btn.is-wide span{display:none}.cp-bar-btn.is-wide{padding:0 10px}}
@media print{.cp-bar{display:none}}

/* Corrigé enseignant : TDO en tableau ; à la projection, algorithme et Python côte à côte. */
.learning-workspace .teacher-correction .tc-tdo{width:auto;min-width:min(420px,100%);border-collapse:separate;border-spacing:0;
 background:#fff;border:1px solid #b9d9c8;border-radius:9px;overflow:hidden;font:500 14px/1.45 var(--font-mono)}
.learning-workspace .teacher-correction .tc-tdo th,.learning-workspace .teacher-correction .tc-tdo td{padding:7px 14px;text-align:left;border-bottom:1px solid #d5eadf}
.learning-workspace .teacher-correction .tc-tdo tr:last-child td{border-bottom:0}
.learning-workspace .teacher-correction .tc-tdo th{background:#dff1e7;color:#155f46;font:800 13px/1.3 var(--font-sans);text-transform:uppercase;letter-spacing:.03em}
.learning-workspace .teacher-correction .tc-actions{display:flex;flex-wrap:wrap;gap:8px;margin-top:12px}
.learning-workspace .teacher-correction .tc-note{margin:6px 0 0;font-size:13px;color:#2c5a48}
body.class-present .learning-workspace .teacher-correction{padding:18px 20px}
body.class-present .learning-workspace .teacher-correction pre{font-size:15px;line-height:1.6}
@media(min-width:1100px){
 body.class-present .learning-workspace .teacher-correction .tc-grid{display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:14px 18px;align-items:start}
 body.class-present .learning-workspace .teacher-correction .tc-grid>section{margin:0}
}
body.class-present ::selection{background:#cfe0ff;color:#0f1f3a}
/* AlgoLab ouvert (atelier ou corrigé simulé) : il occupe tout l'écran avec sa propre barre ; la barre de projection s'efface. */
body.class-present:has(.algolab-focus-workspace) .cp-bar,body.class-present:has(.algolab-focus-workspace)::before{display:none}
