@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

:root{
  --navy:#102a56;
  --blue:#3976f6;
  --blue-2:#2e9af5;
  --mint:#37c9a3;
  --lav:#8c79f6;
  --ice:#79b8ff;
  --bg:#f6f9fe;
  --surface:rgba(255,255,255,.88);
  --surface-solid:#fff;
  --muted:#66758c;
  --border:#dce7f3;
  --shadow:0 18px 55px rgba(36,74,119,.10);
  --shadow-soft:0 8px 24px rgba(39,74,113,.08);
  --radius-xl:28px;
  --radius-lg:20px;
  --radius-md:14px;
}

*{ box-sizing:border-box; }

html{ min-height:100%; }
body{
  margin:0 !important;
  min-height:100vh;
  padding:32px 24px 48px !important;
  overflow-x:hidden;
  color:var(--navy);
  font-family:'Manrope',Inter,ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,'Segoe UI',sans-serif !important;
  font-size:16px !important;
  background:
    radial-gradient(circle at 8% 5%, rgba(121,184,255,.28), transparent 28%),
    radial-gradient(circle at 93% 10%, rgba(55,201,163,.22), transparent 31%),
    radial-gradient(circle at 82% 88%, rgba(140,121,246,.13), transparent 30%),
    linear-gradient(135deg,#eef7ff 0%,#f9fbff 52%,#effdf9 100%) !important;
}
body::before{
  content:"";
  position:fixed;
  inset:0;
  pointer-events:none;
  background-image:linear-gradient(rgba(255,255,255,.28) 1px,transparent 1px),linear-gradient(90deg,rgba(255,255,255,.22) 1px,transparent 1px);
  background-size:46px 46px;
  mask-image:linear-gradient(to bottom,rgba(0,0,0,.35),transparent 70%);
  z-index:-1;
}

/* Brand */
.header,.brand-header{
  width:min(1180px,100%);
  margin:0 auto 18px !important;
  min-height:94px;
  padding:12px 20px;
  display:flex !important;
  justify-content:flex-start !important;
  align-items:center !important;
  gap:18px;
  position:relative;
}
.header img,.brand-header img{
  width:auto !important;
  height:76px !important;
  max-width:270px;
  object-fit:contain;
  filter:drop-shadow(0 10px 20px rgba(36,92,177,.12));
}
.brand-kicker{
  padding-left:18px;
  border-left:1px solid rgba(62,102,157,.18);
  color:var(--muted);
  font-weight:600;
  font-size:13px;
  letter-spacing:.02em;
}

/* Main glass shell */
.container{
  width:min(1180px,100%) !important;
  max-width:1180px !important;
  margin:0 auto !important;
  padding:92px 28px 30px !important;
  border-radius:var(--radius-xl) !important;
  border:1px solid rgba(255,255,255,.88) !important;
  background:linear-gradient(135deg,rgba(255,255,255,.90),rgba(255,255,255,.76)) !important;
  box-shadow:var(--shadow) !important;
  backdrop-filter:blur(20px);
  -webkit-backdrop-filter:blur(20px);
  position:relative;
  overflow:hidden;
}
.container::before{
  content:"";
  position:absolute;
  inset:0 0 auto 0;
  height:72px;
  background:linear-gradient(90deg,rgba(57,118,246,.055),rgba(55,201,163,.06),rgba(140,121,246,.045));
  border-bottom:1px solid rgba(72,110,161,.09);
  pointer-events:none;
}

/* Navigation */
.menu{
  position:absolute !important;
  top:14px !important;
  right:18px !important;
  left:18px;
  min-height:44px;
  display:flex !important;
  align-items:center;
  justify-content:flex-end !important;
  gap:8px !important;
  flex-wrap:wrap !important;
  z-index:2;
}
.menu a{
  text-decoration:none !important;
  color:#4f617b !important;
  background:rgba(255,255,255,.62) !important;
  border:1px solid rgba(104,137,180,.16) !important;
  border-radius:12px !important;
  padding:10px 14px !important;
  font-size:13px;
  font-weight:700 !important;
  box-shadow:none !important;
  transition:transform .18s ease,box-shadow .18s ease,background .18s ease,color .18s ease;
  backdrop-filter:blur(12px);
}
.menu a:hover{
  transform:translateY(-1px);
  background:rgba(255,255,255,.94) !important;
  box-shadow:0 7px 18px rgba(39,82,132,.08) !important;
}
.menu a.active{
  color:#fff !important;
  background:linear-gradient(135deg,var(--blue),var(--blue-2)) !important;
  border-color:transparent !important;
  box-shadow:0 8px 20px rgba(57,118,246,.22) !important;
}
body.student-mode .menu{
  top:14px !important;
  right:18px !important;
  transform:none !important;
}

/* Typography */
label,.zone-title,#catTitle,.word-pool>strong{
  color:var(--navy);
  font-weight:750;
}
#catTitle{
  margin:0 0 16px;
  font-size:18px;
}

/* Form fields */
textarea,select{
  width:100%;
  margin:8px 0 16px !important;
  padding:14px 15px !important;
  color:var(--navy);
  background:rgba(255,255,255,.93) !important;
  border:1px solid var(--border) !important;
  border-radius:13px !important;
  outline:none;
  font:500 15px/1.5 'Manrope',sans-serif !important;
  box-shadow:inset 0 1px 0 rgba(255,255,255,.8);
  transition:border-color .18s ease,box-shadow .18s ease;
}
textarea:focus,select:focus{
  border-color:rgba(57,118,246,.62) !important;
  box-shadow:0 0 0 4px rgba(57,118,246,.09) !important;
}
textarea::placeholder{ color:#9aa9bb; }

/* Buttons */
button{
  appearance:none;
  min-height:44px;
  margin:8px 0 !important;
  padding:11px 16px !important;
  border:1px solid rgba(87,122,167,.17) !important;
  border-radius:12px !important;
  background:rgba(255,255,255,.90) !important;
  color:var(--navy) !important;
  font:700 14px/1.25 'Manrope',sans-serif !important;
  cursor:pointer;
  box-shadow:0 6px 16px rgba(42,79,122,.06);
  transition:transform .18s ease,box-shadow .18s ease,border-color .18s ease;
}
button:hover{
  transform:translateY(-1px);
  border-color:rgba(57,118,246,.36) !important;
  box-shadow:0 9px 20px rgba(42,79,122,.10);
}
button:active{ transform:translateY(0); }

/* Primary actions that already exist */
.page-sort .container>button:first-of-type,
.page-sort .button-row button:first-child,
.page-order .container>button:first-of-type,
.page-auto .container>button:first-of-type,
.page-preview button{
  color:#fff !important;
  border-color:transparent !important;
  background:linear-gradient(135deg,var(--mint),var(--blue)) !important;
  box-shadow:0 10px 24px rgba(57,118,246,.18);
}
.button-row{
  gap:10px !important;
  margin:4px 0 6px;
}
.button-row button{ min-width:150px !important; }

/* Cards / draggable words */
.word{
  position:relative;
  display:inline-flex !important;
  align-items:center;
  min-height:44px;
  width:fit-content !important;
  max-width:100%;
  margin:5px !important;
  padding:10px 15px 10px 31px !important;
  border:1px solid rgba(87,122,167,.15) !important;
  border-radius:11px !important;
  background:#fff !important;
  color:#17345f !important;
  font:700 16px/1.2 'Manrope',sans-serif !important;
  box-shadow:0 5px 13px rgba(28,61,100,.08) !important;
  cursor:grab !important;
  user-select:none;
  transition:box-shadow .18s ease,transform .18s ease,border-color .18s ease;
}
.word::before{
  content:"";
  position:absolute;
  left:13px;
  width:7px;
  height:17px;
  opacity:.48;
  background:radial-gradient(circle,#6e88a8 1.3px,transparent 1.5px) 0 0/5px 5px;
}
.word:hover{
  border-color:rgba(57,118,246,.30) !important;
  box-shadow:0 10px 23px rgba(28,61,100,.13) !important;
}
.word:active{ cursor:grabbing !important; }

/* Work areas */
.columns-wrapper{
  gap:14px !important;
  margin-top:18px !important;
  align-items:stretch;
}
.word-pool,.cloud,.order-line{
  border-radius:var(--radius-lg) !important;
  border:1px solid rgba(85,127,175,.14) !important;
  background:rgba(255,255,255,.74) !important;
  box-shadow:var(--shadow-soft);
}
.word-pool{
  padding:16px !important;
  min-height:250px !important;
}
.word-pool>strong{
  display:block;
  width:100%;
  margin-bottom:10px;
  padding-bottom:12px;
  text-align:left;
  font-size:14px;
  border-bottom:1px solid rgba(90,126,168,.12);
}
.column{
  --accent:var(--mint);
  position:relative;
  min-width:0;
  padding:0 13px 14px !important;
  border:1px solid rgba(87,122,167,.15) !important;
  border-top:4px solid var(--accent) !important;
  border-radius:17px !important;
  background:rgba(255,255,255,.80) !important;
  box-shadow:var(--shadow-soft);
  overflow:hidden;
}
#columns .column:nth-child(4n+1){--accent:var(--mint)}
#columns .column:nth-child(4n+2){--accent:var(--blue-2)}
#columns .column:nth-child(4n+3){--accent:var(--lav)}
#columns .column:nth-child(4n+4){--accent:#22b8cf}
.column h3,.col-title{
  min-height:auto !important;
  margin:0 -13px 10px !important;
  padding:13px 13px 11px !important;
  color:var(--navy) !important;
  background:linear-gradient(180deg,color-mix(in srgb,var(--accent) 9%,white),rgba(255,255,255,.15));
  font:750 14px/1.3 'Manrope',sans-serif !important;
  text-align:left !important;
  font-style:normal !important;
  border-bottom:1px solid rgba(87,122,167,.08);
  outline:none;
}
.dropzone{
  min-height:210px !important;
  padding:8px !important;
  border:1.5px dashed rgba(77,127,184,.30) !important;
  border-radius:13px;
  background:rgba(246,250,255,.52);
  transition:border-color .18s ease,background .18s ease,box-shadow .18s ease;
}
.dropzone:empty::after{
  content:"Déposez ici";
  display:flex;
  align-items:center;
  justify-content:center;
  height:100%;
  min-height:125px;
  color:#9aabc0;
  font-size:12px;
  font-weight:650;
}
.dropzone:hover,.dropping{
  border-color:rgba(57,118,246,.62) !important;
  background:rgba(57,118,246,.045) !important;
  box-shadow:inset 0 0 0 3px rgba(57,118,246,.035);
}

/* Order page */
.cloud{
  min-height:210px !important;
  padding:18px !important;
  gap:8px !important;
}
.order-line{
  min-height:116px !important;
  padding:18px !important;
  background:linear-gradient(135deg,rgba(55,201,163,.075),rgba(255,255,255,.82)) !important;
  border:1.5px dashed rgba(55,201,163,.43) !important;
}
.hint{
  margin:13px 0 20px !important;
  padding:13px 15px;
  color:#62748d !important;
  background:rgba(57,118,246,.05);
  border:1px solid rgba(57,118,246,.10);
  border-radius:13px;
  font-size:13px !important;
}
.zone-title{
  margin:0 0 9px !important;
  font-size:14px;
}
.result{
  padding:14px 16px !important;
  border:1px solid rgba(55,201,163,.20) !important;
  border-radius:13px !important;
  background:rgba(55,201,163,.07) !important;
  color:var(--navy);
  font-family:'Manrope',sans-serif !important;
}

/* Automatic-list category selector */
.categories{
  display:grid !important;
  grid-template-columns:repeat(auto-fit,minmax(200px,1fr)) !important;
  gap:9px !important;
  margin:0 0 14px !important;
}
.categories label{
  position:relative;
  min-height:46px;
  padding:11px 12px;
  gap:10px !important;
  color:#415774;
  background:rgba(255,255,255,.75);
  border:1px solid rgba(91,127,169,.13);
  border-radius:12px;
  font-size:13px;
  font-weight:650;
  cursor:pointer;
  transition:border-color .16s ease,background .16s ease,transform .16s ease;
}
.categories label:hover{
  transform:translateY(-1px);
  border-color:rgba(57,118,246,.26);
  background:#fff;
}
.categories input[type="checkbox"]{
  width:16px;
  height:16px;
  margin:0;
  accent-color:var(--blue);
}
#pool{ flex-basis:235px !important; }

/* Preview */
.page-preview{
  padding-top:28px !important;
}
.page-preview .header{
  margin-bottom:18px !important;
}
.page-preview .columns{
  width:min(1100px,100%);
  margin:0 auto;
  gap:14px !important;
  padding:22px;
  border:1px solid rgba(255,255,255,.85);
  border-radius:24px;
  background:rgba(255,255,255,.82);
  box-shadow:var(--shadow);
  backdrop-filter:blur(14px);
}
.page-preview .column{
  min-height:260px !important;
}
.page-preview .button-container{ margin-top:18px !important; }
.page-preview .button-container button{
  width:auto !important;
  min-width:180px;
}

/* Paper preview: modern chrome, unchanged printable sheet */
.page-paper .toolbar{
  width:min(900px,100%);
  padding:10px;
  margin-bottom:18px !important;
  border:1px solid rgba(255,255,255,.84);
  border-radius:16px;
  background:rgba(255,255,255,.76);
  box-shadow:var(--shadow-soft);
  backdrop-filter:blur(14px);
}
.page-paper .toolbar button{ width:auto !important; margin:0 !important; }
.page-paper .paper-area{
  border-radius:14px !important;
  box-shadow:0 22px 60px rgba(20,49,83,.16) !important;
}

/* Focus accessibility */
a:focus-visible,button:focus-visible,textarea:focus-visible,select:focus-visible,[contenteditable="true"]:focus-visible{
  outline:3px solid rgba(57,118,246,.20) !important;
  outline-offset:2px;
}

@media (max-width:900px){
  body{ padding:18px 12px 32px !important; }
  .header,.brand-header{ min-height:78px;padding:8px 10px;margin-bottom:10px !important; }
  .header img,.brand-header img{ height:60px !important;max-width:210px; }
  .brand-kicker{ display:none; }
  .container{ padding:116px 16px 20px !important;border-radius:22px !important; }
  .container::before{ height:98px; }
  .menu{ justify-content:flex-start !important;top:12px !important;right:12px !important;left:12px !important; }
  .menu a{ padding:9px 11px !important;font-size:12px; }
  .columns-wrapper{ flex-direction:column !important; }
  #pool{ flex:none !important;width:100% !important; }
  #columns{ width:100% !important;overflow-x:auto;padding-bottom:6px; }
  #columns .column{ min-width:230px !important; }
  .word-pool{ min-height:160px !important; }
  .button-row button{ min-width:120px !important; }
}

@media (max-width:620px){
  body{ padding:12px 8px 24px !important; }
  .header,.brand-header{ justify-content:center !important; }
  .header img,.brand-header img{ height:56px !important; }
  .container{ padding-top:154px !important; }
  .container::before{ height:136px; }
  .menu{ display:grid !important;grid-template-columns:1fr !important; }
  .menu a{ text-align:center; }
  textarea,select{ font-size:16px !important; }
  .button-row{ flex-direction:column; }
  .button-row button{ width:100% !important; }
  .categories{ grid-template-columns:1fr !important; }
  #columns{ flex-direction:column !important;overflow:visible; }
  #columns .column{ min-width:0 !important;width:100%; }
  .word{ font-size:15px !important; }
  .page-paper{ overflow:auto !important; }
}

@media print{
  body.page-paper{ background:#fff !important;padding:0 !important; }
  body.page-paper::before,.page-paper .toolbar{ display:none !important; }
  .page-paper .paper-area{ box-shadow:none !important;border-radius:0 !important; }
}

/* ===== Accueil Triye'l ===== */
.page-home{
  min-height:100vh;
  padding:34px 18px !important;
  display:flex;
  align-items:center;
  justify-content:center;
}
.home-shell{
  width:min(1120px,100%);
  padding:34px;
  border:1px solid rgba(255,255,255,.90);
  border-radius:30px;
  background:linear-gradient(135deg,rgba(255,255,255,.90),rgba(255,255,255,.72));
  box-shadow:0 28px 72px rgba(30,73,124,.14);
  backdrop-filter:blur(22px);
  -webkit-backdrop-filter:blur(22px);
}
.home-brand{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:20px;
  padding-bottom:28px;
  border-bottom:1px solid rgba(74,112,160,.10);
}
.home-brand img{
  width:auto;
  height:86px;
  max-width:290px;
  object-fit:contain;
  filter:drop-shadow(0 10px 20px rgba(36,92,177,.12));
}
.home-brand p{margin:0;color:var(--muted);font-size:13px;font-weight:650;}
.home-intro{max-width:690px;margin:44px auto 30px;text-align:center;}
.home-eyebrow{
  display:inline-flex;
  padding:7px 11px;
  border:1px solid rgba(57,118,246,.13);
  border-radius:999px;
  background:rgba(57,118,246,.055);
  color:var(--blue);
  font-size:11px;
  font-weight:800;
  text-transform:uppercase;
  letter-spacing:.08em;
}
.home-intro h1{margin:14px 0 12px;color:var(--navy);font-size:clamp(28px,4vw,44px);line-height:1.08;letter-spacing:-.035em;}
.home-intro p{margin:0;color:var(--muted);font-size:15px;line-height:1.7;}
.home-cards{display:grid;grid-template-columns:repeat(3,1fr);gap:16px;margin-top:30px;}
.home-card{
  --card-accent:var(--blue);
  min-height:220px;
  padding:22px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  gap:18px;
  text-decoration:none;
  color:inherit;
  border:1px solid rgba(85,127,175,.14);
  border-radius:22px;
  background:rgba(255,255,255,.78);
  box-shadow:0 12px 30px rgba(28,61,100,.075);
  transition:transform .2s ease,box-shadow .2s ease,border-color .2s ease;
  position:relative;
  overflow:hidden;
}
.home-card::before{content:"";position:absolute;inset:0 0 auto;height:4px;background:var(--card-accent);}
.home-card:hover{transform:translateY(-4px);box-shadow:0 20px 42px rgba(28,61,100,.12);border-color:color-mix(in srgb,var(--card-accent) 34%,white);}
.home-card-sort{--card-accent:var(--mint)}
.home-card-order{--card-accent:var(--blue-2)}
.home-card-auto{--card-accent:var(--lav)}
.home-card-icon{
  width:50px;height:50px;display:grid;place-items:center;border-radius:16px;
  background:color-mix(in srgb,var(--card-accent) 10%,white);
  color:var(--card-accent);font-size:25px;font-weight:800;
  border:1px solid color-mix(in srgb,var(--card-accent) 16%,white);
}
.home-card-copy{display:flex;flex-direction:column;gap:9px;}
.home-card-copy strong{color:var(--navy);font-size:19px;line-height:1.2;}
.home-card-copy span{color:var(--muted);font-size:13px;line-height:1.55;}
.home-card-arrow{margin-top:auto;align-self:flex-end;width:38px;height:38px;display:grid;place-items:center;border-radius:50%;color:var(--card-accent);background:color-mix(in srgb,var(--card-accent) 8%,white);font-size:20px;transition:transform .2s ease;}
.home-card:hover .home-card-arrow{transform:translateX(3px);}
.home-footer{margin-top:30px;text-align:center;color:#95a2b4;font-size:11px;font-weight:650;letter-spacing:.04em;}

/* ===== Drag & drop tactile ===== */
.word{
  touch-action:none;
  -webkit-user-drag:element;
}
.word.is-dragging{
  opacity:.24 !important;
  transform:scale(.98);
}
.touch-drag-ghost{
  position:fixed !important;
  left:0 !important;
  top:0 !important;
  z-index:99999 !important;
  margin:0 !important;
  pointer-events:none !important;
  opacity:.96;
  box-shadow:0 18px 42px rgba(22,55,96,.24) !important;
  border-color:rgba(57,118,246,.38) !important;
  transition:none !important;
  will-change:transform;
}
.touch-drop-target,
#wordPool.touch-drop-target,
#pool.touch-drop-target,
.cloud.touch-drop-target,
.order-line.touch-drop-target{
  border-color:rgba(57,118,246,.68) !important;
  background:rgba(57,118,246,.055) !important;
  box-shadow:inset 0 0 0 3px rgba(57,118,246,.045),0 8px 22px rgba(57,118,246,.08) !important;
}
.word.just-dropped{animation:triyel-drop .22s ease-out;}
@keyframes triyel-drop{0%{transform:scale(1.04)}55%{transform:scale(.98)}100%{transform:scale(1)}}

@media (max-width:820px){
  .home-shell{padding:24px 18px;border-radius:24px;}
  .home-brand{justify-content:center;padding-bottom:20px;}
  .home-brand img{height:72px;}
  .home-brand p{display:none;}
  .home-intro{margin:30px auto 24px;}
  .home-cards{grid-template-columns:1fr;}
  .home-card{min-height:150px;}
}

/* Navigation mobile à 4 entrées */
@media (max-width:620px){
  .container{padding-top:136px !important;}
  .container::before{height:118px !important;}
  .menu{grid-template-columns:repeat(2,minmax(0,1fr)) !important;}
  .menu a{display:flex;align-items:center;justify-content:center;min-height:42px;padding:8px 7px !important;line-height:1.2;}
}

/* ===== Activités portables + mode élève ===== */
.portable-actions{
  display:flex;
  flex-wrap:wrap;
  gap:10px;
  margin:10px 0 18px;
}
.portable-actions button{
  margin:0 !important;
}
#studentModeBtn{
  color:#fff !important;
  border-color:transparent !important;
  background:linear-gradient(135deg,var(--blue),var(--lav)) !important;
  box-shadow:0 10px 24px rgba(77,101,220,.17);
}
#copyActivityLinkBtn::before{
  content:"↗";
  display:inline-block;
  margin-right:7px;
  font-size:13px;
}
.student-exit{
  display:none !important;
  position:fixed;
  top:14px;
  right:14px;
  z-index:100000;
  min-height:40px !important;
  margin:0 !important;
  padding:9px 13px !important;
  color:#fff !important;
  border-color:rgba(255,255,255,.28) !important;
  background:rgba(16,42,86,.88) !important;
  box-shadow:0 10px 28px rgba(16,42,86,.20) !important;
  backdrop-filter:blur(14px);
}
body.student-view{
  padding:14px !important;
  background:
    radial-gradient(circle at 8% 5%,rgba(121,184,255,.20),transparent 28%),
    radial-gradient(circle at 93% 10%,rgba(55,201,163,.17),transparent 31%),
    linear-gradient(135deg,#f2f8ff 0%,#fbfdff 54%,#f1fdf9 100%) !important;
}
body.student-view .brand-header,
body.student-view .menu,
body.student-view .teacher-only,
body.student-view .portable-actions,
body.student-view .correction-panel{
  display:none !important;
}
body.student-view .student-exit{
  display:inline-flex !important;
  align-items:center;
  justify-content:center;
}
body.student-view .container{
  width:100% !important;
  max-width:1500px !important;
  min-height:calc(100vh - 28px);
  padding:72px 28px 30px !important;
  border-radius:24px !important;
  overflow:visible;
}
body.student-view .container::before{ display:none; }
body.student-view .columns-wrapper{
  margin-top:0 !important;
}
body.student-view .word-pool,
body.student-view .cloud,
body.student-view .order-line{
  min-height:260px !important;
}
body.student-view .dropzone{
  min-height:260px !important;
}
body.student-view .word{
  min-height:50px;
  padding-top:12px !important;
  padding-bottom:12px !important;
  font-size:18px !important;
}
body.student-view .column h3,
body.student-view .col-title{
  font-size:16px !important;
  cursor:default !important;
  user-select:none;
}
body.student-view.page-order .activity-actions{
  display:flex !important;
  justify-content:center;
  margin:0 0 16px;
}
body.student-view.page-order .hint{
  margin-top:0 !important;
  font-size:15px !important;
}

@media (max-width:620px){
  .portable-actions{ flex-direction:column; }
  .portable-actions button{ width:100% !important; }
  body.student-view{ padding:6px !important; }
  body.student-view .container{
    min-height:calc(100vh - 12px);
    padding:68px 12px 18px !important;
    border-radius:18px !important;
  }
  body.student-view .student-exit{ top:10px; right:10px; }
  body.student-view .word{ font-size:17px !important; }
}

/* ===== Choix de hauteur du mode élève (TNI) ===== */
.student-height-chooser{
  position:fixed;
  inset:0;
  z-index:200000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px;
  background:rgba(12,33,70,.28);
  backdrop-filter:blur(12px);
  -webkit-backdrop-filter:blur(12px);
}
.student-height-card{
  width:min(680px,calc(100vw - 32px));
  padding:28px;
  border:1px solid rgba(255,255,255,.82);
  border-radius:26px;
  background:rgba(250,253,255,.96);
  box-shadow:0 24px 70px rgba(16,42,86,.22);
  color:var(--navy);
}
.student-height-kicker{
  display:inline-flex;
  margin-bottom:8px;
  padding:6px 10px;
  border-radius:999px;
  color:var(--blue);
  background:rgba(57,118,246,.09);
  font-size:12px;
  font-weight:800;
  letter-spacing:.05em;
  text-transform:uppercase;
}
.student-height-card h2{
  margin:0 0 7px;
  font-size:24px;
  line-height:1.2;
}
.student-height-card>p{
  margin:0 0 20px;
  color:var(--muted);
}
.student-height-options{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:14px;
}
.student-height-option{
  position:relative;
  width:100% !important;
  min-height:132px !important;
  display:grid !important;
  grid-template-columns:48px 1fr !important;
  align-items:center !important;
  gap:13px !important;
  margin:0 !important;
  padding:18px !important;
  text-align:left !important;
  color:var(--navy) !important;
  border:1px solid var(--line) !important;
  border-radius:18px !important;
  background:#fff !important;
  box-shadow:0 8px 24px rgba(16,42,86,.07) !important;
}
.student-height-option:hover,
.student-height-option:focus-visible{
  transform:translateY(-2px);
  border-color:rgba(57,118,246,.45) !important;
  box-shadow:0 13px 30px rgba(16,42,86,.12) !important;
}
.student-height-option.is-preferred{
  border-color:rgba(55,201,163,.52) !important;
  background:linear-gradient(145deg,#fff,rgba(55,201,163,.055)) !important;
}
.student-height-option strong{
  display:block;
  margin-bottom:5px;
  font-size:17px;
}
.student-height-option small{
  display:block;
  color:var(--muted);
  font-size:13px;
  line-height:1.4;
}
.student-height-option em{
  position:absolute;
  top:10px;
  right:11px;
  padding:4px 7px;
  border-radius:999px;
  color:#168467;
  background:rgba(55,201,163,.12);
  font-size:10px;
  font-style:normal;
  font-weight:800;
}
.student-height-icon{
  width:46px;
  height:46px;
  display:grid;
  place-items:center;
  border-radius:14px;
  color:#fff;
  background:linear-gradient(135deg,var(--blue),var(--lav));
  font-size:24px;
  box-shadow:0 8px 18px rgba(57,118,246,.18);
}

/* Le bouton de sortie doit rester petit même sur les pages dont les boutons sont à 100 %. */
body.student-view .student-exit{
  width:auto !important;
  max-width:max-content !important;
  left:auto !important;
  right:14px !important;
}

/* Hauteur enfant : le contenu pousse depuis le bas et ne monte que si nécessaire. */
body.student-view.student-height-child{
  min-height:100vh !important;
  height:100vh !important;
  display:flex !important;
  align-items:flex-end !important;
  justify-content:center !important;
  overflow:hidden !important;
  padding:10px 14px 0 !important;
}
body.student-view.student-height-child .container{
  width:100% !important;
  max-width:1500px !important;
  min-height:0 !important;
  height:auto !important;
  max-height:calc(100vh - 10px) !important;
  margin:0 auto !important;
  padding:58px 28px 18px !important;
  overflow:auto !important;
  overscroll-behavior:contain;
  border-radius:24px 24px 0 0 !important;
}
body.student-view.student-height-child .columns-wrapper{
  margin-top:0 !important;
  align-items:stretch;
}
body.student-view.student-height-child .word-pool,
body.student-view.student-height-child .cloud,
body.student-view.student-height-child .order-line,
body.student-view.student-height-child .dropzone{
  min-height:220px !important;
}

/* Hauteur adulte : conserve le comportement plein écran actuel. */
body.student-view.student-height-adult .container{
  min-height:calc(100vh - 28px);
}

@media (max-width:620px){
  .student-height-chooser{ padding:14px; }
  .student-height-card{ padding:20px; border-radius:20px; }
  .student-height-card h2{ font-size:20px; }
  .student-height-options{ grid-template-columns:1fr; }
  .student-height-option{ min-height:104px !important; }
  body.student-view.student-height-child{
    padding:6px 6px 0 !important;
  }
  body.student-view.student-height-child .container{
    max-height:calc(100vh - 6px) !important;
    padding:56px 12px 14px !important;
    border-radius:18px 18px 0 0 !important;
  }
}

/* ===== Partage par QR code ===== */
#qrActivityBtn::before{
  content:"▦";
  display:inline-block;
  margin-right:7px;
  font-size:15px;
}
.triyel-qr-overlay{
  position:fixed;
  inset:0;
  z-index:300000;
  display:flex;
  align-items:center;
  justify-content:center;
  padding:18px;
  background:rgba(10,26,55,.58);
  backdrop-filter:blur(10px);
  -webkit-backdrop-filter:blur(10px);
}
.triyel-qr-card{
  position:relative;
  width:min(760px,calc(100vw - 28px));
  max-height:calc(100vh - 28px);
  overflow:auto;
  padding:24px 26px 22px;
  text-align:center;
  color:var(--navy);
  border:1px solid rgba(255,255,255,.9);
  border-radius:28px;
  background:#fff;
  box-shadow:0 28px 85px rgba(6,23,54,.30);
}
.triyel-qr-kicker{
  display:inline-flex;
  margin-bottom:6px;
  padding:6px 10px;
  border-radius:999px;
  color:#168467;
  background:rgba(55,201,163,.12);
  font-size:12px;
  font-weight:800;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.triyel-qr-card h2{
  margin:4px 44px 14px;
  font-size:clamp(21px,3vw,30px);
  line-height:1.15;
}
.triyel-qr-code{
  width:min(68vmin,620px);
  aspect-ratio:1;
  margin:0 auto 16px;
  padding:10px;
  border-radius:18px;
  background:#fff;
}
.triyel-qr-code svg{
  display:block;
  width:100%;
  height:100%;
  shape-rendering:crispEdges;
}
.triyel-qr-close{
  position:absolute !important;
  top:12px;
  right:12px;
  width:42px !important;
  min-width:42px !important;
  height:42px !important;
  min-height:42px !important;
  margin:0 !important;
  padding:0 !important;
  border-radius:999px !important;
  font-size:28px !important;
  line-height:1 !important;
}
.triyel-qr-done{
  min-width:150px;
  margin:0 !important;
}
/* Une activité ouverte depuis un QR est une vue élève verrouillée :
   aucune commande de sortie vers l'interface enseignante n'est proposée. */
body.qr-student-view .student-exit{
  display:none !important;
}
body.qr-student-view .brand-header,
body.qr-student-view .menu,
body.qr-student-view .teacher-only,
body.qr-student-view .portable-actions,
body.qr-student-view .correction-panel{
  display:none !important;
}
@media (max-width:620px){
  .triyel-qr-overlay{ padding:8px; }
  .triyel-qr-card{
    width:calc(100vw - 16px);
    max-height:calc(100vh - 16px);
    padding:18px 12px 16px;
    border-radius:20px;
  }
  .triyel-qr-card h2{ margin:8px 46px 12px; }
  .triyel-qr-code{
    width:min(84vw,72vh);
    padding:6px;
  }
}


/* ===== Barre d'actions compacte (ergonomie enseignant) =====
   Pure mise en page : aucun comportement JS n'est modifié. */
.primary-activity-action{
  width:100% !important;
}

.button-row,
.secondary-actions,
.portable-actions{
  display:grid !important;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:10px !important;
  width:100%;
  margin:10px 0 14px !important;
}

.button-row button,
.secondary-actions button,
.portable-actions button{
  width:100% !important;
  min-width:0 !important;
  margin:0 !important;
}

/* Les actions secondaires de Liste automatique sont volontairement sur 2 colonnes. */
.page-auto .secondary-actions{
  grid-template-columns:repeat(2,minmax(0,1fr));
}

/* En vue élève locale de Remettre dans l'ordre, les commandes utiles restent centrées. */
body.student-view.page-order .activity-actions{
  display:flex !important;
  flex-wrap:wrap;
  justify-content:center;
  gap:10px !important;
}
body.student-view.page-order .activity-actions button{
  width:auto !important;
  min-width:180px !important;
  flex:1 1 220px;
  max-width:360px;
}

/* Une activité ouverte depuis un QR n'a pas besoin de la commande Mélanger. */
body.qr-student-view .qr-hidden{
  display:none !important;
}

@media (max-width:760px){
  .button-row,
  .secondary-actions,
  .portable-actions{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
  .page-auto .secondary-actions{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media (max-width:520px){
  .button-row,
  .secondary-actions,
  .portable-actions,
  .page-auto .secondary-actions{
    grid-template-columns:1fr;
  }
}
