/* =========================================================
   EduVirtuelle — Feuille de style principale
   Palette : nuances de bleu & blanc + couleurs complémentaires
   ========================================================= */

:root {
  --blue-900: #0b1f4d;
  --blue-800: #12306e;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --blue-400: #60a5fa;
  --blue-200: #bfdbfe;
  --blue-100: #dbeafe;
  --blue-50: #eff6ff;
  --sky: #0ea5e9;

  --green: #16a34a;
  --green-bg: #dcfce7;
  --orange: #ea580c;
  --orange-bg: #ffedd5;
  --amber: #f59e0b;
  --red: #dc2626;
  --red-bg: #fee2e2;
  --violet: #7c3aed;
  --violet-bg: #ede9fe;
  --gray-bg: #f1f5f9;

  --bg: #f5f8ff;
  --surface: #ffffff;
  --surface-2: #f8fafc;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-soft: #475569;
  --text-muted: #64748b;
  --primary: var(--blue-600);
  --primary-strong: var(--blue-700);
  --primary-soft: var(--blue-50);
  --heading: var(--blue-900);

  --radius-sm: 8px;
  --radius: 14px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .06);
  --shadow: 0 6px 24px rgba(29, 78, 216, .08);
  --shadow-lg: 0 18px 50px rgba(29, 78, 216, .16);
  --sidebar-w: 260px;
  --font: "Plus Jakarta Sans", "Segoe UI", system-ui, -apple-system, Roboto, sans-serif;
  color-scheme: light;
}

[data-theme="dark"] {
  --bg: #0a1224;
  --surface: #111c34;
  --surface-2: #0e1830;
  --border: #22335a;
  --text: #e6edf9;
  --text-soft: #b6c3dc;
  --text-muted: #8a9ab8;
  --primary: #4f8cff;
  --primary-strong: #6ea0ff;
  --primary-soft: #16264a;
  --heading: #f1f5ff;
  --green-bg: #0f2e1d;
  --orange-bg: #3a2210;
  --red-bg: #3a1417;
  --violet-bg: #251a45;
  --gray-bg: #1a2744;
  --blue-50: #13223f;
  --blue-100: #1a2d52;
  --shadow: 0 6px 24px rgba(0, 0, 0, .35);
  --shadow-lg: 0 18px 50px rgba(0, 0, 0, .45);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  transition: background .25s, color .25s;
}
img { max-width: 100%; display: block; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { color: var(--heading); line-height: 1.25; margin: 0 0 .5em; }
h1 { font-size: clamp(1.8rem, 4vw, 3rem); font-weight: 800; }
h2 { font-size: clamp(1.4rem, 3vw, 2.1rem); font-weight: 800; }
h3 { font-size: 1.15rem; font-weight: 700; }
p { margin: 0 0 1em; }
.muted { color: var(--text-muted); }
.small { font-size: .85rem; }
.center { text-align: center; }
.hidden { display: none !important; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
.container { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 20px; }
.flex { display: flex; gap: 12px; align-items: center; }
.flex-between { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.flex-wrap { flex-wrap: wrap; }
.mt-0 { margin-top: 0; } .mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; } .mt-4 { margin-top: 36px; }
.mb-0 { margin-bottom: 0; } .mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.grid-wide { grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); }
.grid-side { grid-template-columns: 300px minmax(0, 1fr); }
:focus-visible { outline: 3px solid var(--blue-400); outline-offset: 2px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 20px; border-radius: 12px; border: 1.5px solid transparent;
  font: inherit; font-weight: 700; font-size: .95rem; cursor: pointer;
  text-decoration: none !important; white-space: nowrap;
  transition: transform .15s, box-shadow .2s, background .2s, color .2s, border-color .2s;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--blue-600), var(--blue-700)); color: #fff; box-shadow: 0 6px 18px rgba(37, 99, 235, .3); }
.btn-primary:hover { box-shadow: 0 10px 26px rgba(37, 99, 235, .42); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary-soft); }
.btn-light { background: #fff; color: var(--blue-700); }
.btn-light:hover { box-shadow: 0 8px 22px rgba(0, 0, 0, .15); }
.btn-ghost { background: var(--primary-soft); color: var(--primary); }
.btn-ghost:hover { background: var(--blue-100); }
.btn-success { background: var(--green); color: #fff; }
.btn-danger { background: var(--red); color: #fff; }
.btn-danger-ghost { background: var(--red-bg); color: var(--red); }
.btn-sm { padding: 7px 13px; font-size: .84rem; border-radius: 9px; }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; border-radius: 14px; }
.btn-block { width: 100%; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 11px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); display: inline-grid; place-items: center;
  cursor: pointer; font-size: 1.1rem; position: relative; transition: background .2s;
}
.icon-btn:hover { background: var(--primary-soft); }
.icon-btn .dot {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 4px;
  border-radius: 9px; background: var(--red); color: #fff; font-size: .7rem; font-weight: 700;
  display: grid; place-items: center;
}

/* ---------- Cartes ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow-sm); transition: transform .2s, box-shadow .2s;
}
.card-hover:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.card-title { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 14px; }
.card-title h3 { margin: 0; }

/* ---------- Badges ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
  font-size: .78rem; font-weight: 700; white-space: nowrap;
}
.badge-green { background: var(--green-bg); color: var(--green); }
.badge-orange { background: var(--orange-bg); color: var(--orange); }
.badge-red { background: var(--red-bg); color: var(--red); }
.badge-gray { background: var(--gray-bg); color: var(--text-muted); }
.badge-blue { background: var(--blue-100); color: var(--primary); }
.badge-violet { background: var(--violet-bg); color: var(--violet); }

/* ---------- Barre de progression ---------- */
.progress { height: 10px; background: var(--blue-100); border-radius: 99px; overflow: hidden; }
.progress-bar {
  height: 100%; border-radius: 99px; width: 0;
  background: linear-gradient(90deg, var(--sky), var(--blue-600));
  transition: width .8s cubic-bezier(.2, .8, .2, 1);
}
.progress-sm { height: 6px; }
.progress-label { display: flex; justify-content: space-between; font-size: .85rem; font-weight: 600; margin-bottom: 6px; }

/* ---------- Alertes ---------- */
.alert { padding: 14px 16px; border-radius: 12px; border: 1px solid; display: flex; gap: 12px; align-items: flex-start; margin-bottom: 18px; }
.alert-info { background: var(--blue-50); border-color: var(--blue-200); color: var(--primary-strong); }
.alert-success { background: var(--green-bg); border-color: #86efac; color: var(--green); }
.alert-warning { background: var(--orange-bg); border-color: #fdba74; color: var(--orange); }
.alert-danger { background: var(--red-bg); border-color: #fca5a5; color: var(--red); }
[data-theme="dark"] .alert { border-color: transparent; }
.alert .btn { margin-left: auto; }

/* ---------- Formulaires ---------- */
.form-group { margin-bottom: 16px; }
.form-group label, .label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 6px; color: var(--text-soft); }
.input, select.input, textarea.input {
  width: 100%; padding: 11px 14px; border-radius: 11px; border: 1.5px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; transition: border-color .2s, box-shadow .2s;
}
textarea.input { min-height: 110px; resize: vertical; }
.input:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 4px rgba(37, 99, 235, .15); }
.input.invalid { border-color: var(--red); }
.field-error { color: var(--red); font-size: .8rem; margin-top: 5px; min-height: 1em; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input-icon { position: relative; }
.input-icon .toggle-pass { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); background: none; border: 0; cursor: pointer; font-size: 1rem; color: var(--text-muted); }
.checkbox { display: flex; gap: 8px; align-items: center; font-size: .9rem; cursor: pointer; }
.password-meter { height: 5px; background: var(--border); border-radius: 5px; margin-top: 8px; overflow: hidden; }
.password-meter span { display: block; height: 100%; width: 0; transition: width .3s, background .3s; }

/* ---------- Navigation publique ---------- */
.navbar {
  position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .88);
  backdrop-filter: blur(12px); border-bottom: 1px solid var(--border);
}
[data-theme="dark"] .navbar { background: rgba(10, 18, 36, .88); }
.navbar .container { display: flex; align-items: center; justify-content: space-between; height: 72px; gap: 16px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; color: var(--heading); text-decoration: none !important; }
.brand img { width: 42px; height: 42px; flex-shrink: 0; background: #fff; border-radius: 12px; padding: 3px; box-shadow: 0 2px 8px rgba(15, 23, 42, .12); }
.brand small { white-space: nowrap; }
.brand small { display: block; font-size: .7rem; font-weight: 600; color: var(--text-muted); letter-spacing: .02em; }
.nav-links { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.nav-links a { padding: 8px 12px; border-radius: 9px; color: var(--text-soft); font-weight: 600; font-size: .93rem; }
.nav-links a:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.nav-actions { display: flex; gap: 10px; align-items: center; }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff;
  background: radial-gradient(1000px 500px at 85% -10%, rgba(14, 165, 233, .55), transparent 60%),
              linear-gradient(135deg, var(--blue-900) 0%, var(--blue-700) 60%, var(--blue-500) 100%);
  padding: 90px 0 110px;
}
.hero::after {
  content: ""; position: absolute; inset: auto 0 -1px 0; height: 70px; background: var(--bg);
  clip-path: ellipse(75% 100% at 50% 100%);
}
.hero .container { display: grid; grid-template-columns: 1.1fr .9fr; gap: 50px; align-items: center; position: relative; z-index: 1; }
.hero h1 { color: #fff; }
.hero h1 span { background: linear-gradient(90deg, #7dd3fc, #fff); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero p.lead { font-size: 1.15rem; color: rgba(255, 255, 255, .85); max-width: 560px; }
.hero-tag { display: inline-flex; gap: 8px; align-items: center; padding: 6px 14px; border-radius: 99px; background: rgba(255, 255, 255, .14); font-weight: 600; font-size: .85rem; margin-bottom: 18px; }
.hero-actions { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.hero-stats { display: flex; gap: 34px; margin-top: 40px; flex-wrap: wrap; }
.hero-stats strong { display: block; font-size: 1.7rem; font-weight: 800; }
.hero-stats span { color: rgba(255, 255, 255, .75); font-size: .9rem; }
.hero-visual { position: relative; }
.mock {
  background: #fff; color: var(--text); border-radius: 20px; padding: 20px; box-shadow: 0 30px 70px rgba(0, 0, 0, .3);
  animation: float 6s ease-in-out infinite;
}
[data-theme="dark"] .mock { background: var(--surface); }
.mock-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.mock-row { display: flex; align-items: center; gap: 12px; padding: 10px; border-radius: 12px; background: var(--surface-2); margin-bottom: 10px; }
.mock-row .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; }
.mock-row .grow { flex: 1; }
.floating-chip {
  position: absolute; background: #fff; color: var(--text); padding: 10px 14px; border-radius: 14px;
  box-shadow: var(--shadow-lg); font-weight: 700; font-size: .85rem; display: flex; gap: 8px; align-items: center;
  animation: float 5s ease-in-out infinite;
}
[data-theme="dark"] .floating-chip { background: var(--surface); }
.chip-1 { top: -18px; right: -10px; animation-delay: -2s; }
.chip-2 { bottom: -20px; left: -20px; animation-delay: -1s; }
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }

/* ---------- Sections ---------- */
.section { padding: 80px 0; }
.section-alt { background: var(--surface); }
.section-head { text-align: center; max-width: 720px; margin: 0 auto 46px; }
.eyebrow { display: inline-block; font-weight: 800; font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--primary); margin-bottom: 10px; }
.feature-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.6rem; margin-bottom: 14px; background: var(--primary-soft); }
.subject-card { text-align: center; padding: 26px 16px; }
.subject-card .feature-icon { margin: 0 auto 12px; }
.about-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 50px; align-items: center; }
.about-visual { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.about-visual .card { text-align: center; }
.about-visual .card strong { display: block; font-size: 1.8rem; color: var(--primary); font-weight: 800; }
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li { padding: 6px 0 6px 30px; position: relative; }
.check-list li::before { content: "✓"; position: absolute; left: 0; top: 6px; width: 20px; height: 20px; border-radius: 50%; background: var(--green-bg); color: var(--green); font-size: .75rem; font-weight: 800; display: grid; place-items: center; }

/* Formules */
.plan-card { position: relative; display: flex; flex-direction: column; padding: 30px 26px; border-width: 2px; }
.plan-card.featured { border-color: var(--primary); box-shadow: var(--shadow-lg); transform: scale(1.03); }
.plan-card.featured:hover { transform: scale(1.03) translateY(-4px); }
.plan-card .ribbon { position: absolute; top: -14px; left: 50%; transform: translateX(-50%); background: linear-gradient(135deg, var(--blue-600), var(--sky)); color: #fff; padding: 4px 14px; border-radius: 99px; font-size: .78rem; font-weight: 800; }
.plan-card .plan-name { font-weight: 800; font-size: 1.2rem; display: flex; align-items: center; gap: 8px; }
.plan-price { font-size: 2.2rem; font-weight: 800; color: var(--heading); margin: 12px 0 4px; }
.plan-price small { font-size: .95rem; font-weight: 600; color: var(--text-muted); }
.plan-card .check-list { margin: 18px 0 24px; flex: 1; }
.plan-card.current { border-color: var(--green); }

/* Étapes */
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; counter-reset: step; }
.step { text-align: center; position: relative; }
.step .num { width: 60px; height: 60px; border-radius: 50%; margin: 0 auto 14px; background: linear-gradient(135deg, var(--blue-600), var(--sky)); color: #fff; font-size: 1.4rem; font-weight: 800; display: grid; place-items: center; box-shadow: 0 10px 24px rgba(37, 99, 235, .3); }
.flow { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 36px; }
.flow span { background: var(--primary-soft); color: var(--primary); padding: 6px 12px; border-radius: 99px; font-weight: 700; font-size: .82rem; }
.flow i { color: var(--text-muted); font-style: normal; align-self: center; }

/* Témoignages */
.testimonial p { font-style: italic; color: var(--text-soft); }
.testimonial .who { display: flex; gap: 12px; align-items: center; margin-top: 14px; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: linear-gradient(135deg, var(--blue-600), var(--sky)); flex-shrink: 0; }
.avatar-lg { width: 84px; height: 84px; font-size: 1.8rem; }
.stars { color: var(--amber); letter-spacing: 2px; }

.cta-band { background: linear-gradient(135deg, var(--blue-700), var(--sky)); color: #fff; border-radius: var(--radius-lg); padding: 50px; text-align: center; box-shadow: var(--shadow-lg); }
.cta-band h2 { color: #fff; }
.cta-band p { color: rgba(255, 255, 255, .88); }

/* Pied de page */
.footer { background: var(--blue-900); color: rgba(255, 255, 255, .78); padding: 60px 0 24px; }
[data-theme="dark"] .footer { background: #060d1c; }
.footer h4 { color: #fff; font-size: 1rem; }
.footer a { color: rgba(255, 255, 255, .78); }
.footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.2fr; gap: 30px; }
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer li { padding: 4px 0; }
.footer .brand { color: #fff; }
.footer-bottom { border-top: 1px solid rgba(255, 255, 255, .12); margin-top: 40px; padding-top: 20px; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .85rem; }
.pay-logos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.pay-logos span { background: rgba(255, 255, 255, .1); padding: 4px 10px; border-radius: 8px; font-size: .78rem; font-weight: 700; }

/* ---------- Pages d'authentification ---------- */
.auth-page { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side {
  background: radial-gradient(700px 400px at 100% 0, rgba(14, 165, 233, .5), transparent 60%), linear-gradient(135deg, var(--blue-900), var(--blue-700));
  color: #fff; padding: 50px; display: flex; flex-direction: column; justify-content: space-between;
}
.auth-side h2 { color: #fff; }
.auth-side .brand { color: #fff; }
.auth-side .check-list li::before { background: rgba(255, 255, 255, .2); color: #fff; }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.auth-card { width: 100%; max-width: 480px; }
.auth-card h1 { font-size: 1.9rem; }
.demo-box { font-size: .82rem; background: var(--primary-soft); border: 1px dashed var(--blue-400); border-radius: 12px; padding: 12px 14px; margin-top: 20px; }
.demo-box code { font-weight: 700; }

/* ---------- Espace application (élève & admin) ---------- */
.app { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border);
  position: fixed; inset: 0 auto 0 0; display: flex; flex-direction: column; z-index: 60; transition: transform .3s;
}
.sidebar .brand { padding: 20px 22px; border-bottom: 1px solid var(--border); }
.sidebar-nav { flex: 1; overflow-y: auto; padding: 14px 12px; }
.sidebar-nav a, .sidebar-nav button {
  display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 11px; width: 100%;
  color: var(--text-soft); font-weight: 600; font-size: .93rem; border: 0; background: none; font-family: inherit;
  cursor: pointer; text-align: left; margin-bottom: 2px; transition: background .2s, color .2s;
}
.sidebar-nav a:hover, .sidebar-nav button:hover { background: var(--primary-soft); color: var(--primary); text-decoration: none; }
.sidebar-nav a.active { background: linear-gradient(135deg, var(--blue-600), var(--blue-700)); color: #fff; box-shadow: 0 6px 16px rgba(37, 99, 235, .3); }
.sidebar-nav .ico { width: 22px; text-align: center; }
.sidebar-nav .count { margin-left: auto; background: var(--red); color: #fff; font-size: .72rem; padding: 1px 7px; border-radius: 99px; }
.sidebar-nav .sep { height: 1px; background: var(--border); margin: 10px 8px; }
.sidebar-foot { padding: 14px; border-top: 1px solid var(--border); }
.sub-mini { font-size: .82rem; padding: 12px; border-radius: 12px; background: var(--primary-soft); }
.main { flex: 1; margin-left: var(--sidebar-w); min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 0; z-index: 40; background: rgba(245, 248, 255, .9); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border); padding: 12px 28px; display: flex; align-items: center; gap: 14px;
}
[data-theme="dark"] .topbar { background: rgba(10, 18, 36, .9); }
.topbar .title { font-weight: 800; font-size: 1.1rem; color: var(--heading); }
.topbar .spacer { flex: 1; }
.topbar .user-chip { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: .9rem; color: var(--text); text-decoration: none !important; }
.topbar .user-chip .avatar { width: 38px; height: 38px; font-size: .9rem; }
.menu-toggle { display: none; }
.content { padding: 28px; flex: 1; animation: fadeIn .35s ease; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; gap: 14px; flex-wrap: wrap; margin-bottom: 24px; }
.page-header h1 { font-size: 1.7rem; margin: 0; }
.page-header p { margin: 4px 0 0; color: var(--text-muted); }
.overlay { position: fixed; inset: 0; background: rgba(2, 6, 23, .5); z-index: 55; display: none; }
.overlay.show { display: block; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* Statistiques */
.stat-card { display: flex; gap: 16px; align-items: center; }
.stat-card .ic { width: 52px; height: 52px; border-radius: 15px; display: grid; place-items: center; font-size: 1.5rem; flex-shrink: 0; }
.stat-card .val { font-size: 1.6rem; font-weight: 800; color: var(--heading); line-height: 1.1; }
.stat-card .lbl { font-size: .85rem; color: var(--text-muted); font-weight: 600; }
.ic-blue { background: var(--blue-100); } .ic-green { background: var(--green-bg); } .ic-orange { background: var(--orange-bg); }
.ic-violet { background: var(--violet-bg); } .ic-red { background: var(--red-bg); } .ic-gray { background: var(--gray-bg); }

.welcome {
  background: radial-gradient(600px 300px at 100% 0, rgba(14, 165, 233, .45), transparent 60%), linear-gradient(135deg, var(--blue-700), var(--blue-600));
  color: #fff; border: 0; padding: 28px; display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
}
.welcome h1 { color: #fff; font-size: 1.8rem; margin-bottom: 4px; }
.welcome p { color: rgba(255, 255, 255, .85); margin: 0; }
.ring { --p: 0; width: 110px; height: 110px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(#fff calc(var(--p) * 1%), rgba(255, 255, 255, .22) 0); }
.ring span { width: 84px; height: 84px; border-radius: 50%; background: var(--blue-700); display: grid; place-items: center; font-weight: 800; font-size: 1.3rem; color: #fff; }

/* Listes */
.list { list-style: none; margin: 0; padding: 0; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.list-item:last-child { border-bottom: 0; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .t { font-weight: 700; color: var(--text); }
.list-item .s { font-size: .82rem; color: var(--text-muted); }
.thumb { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; font-size: 1.3rem; flex-shrink: 0; }
.sicon {
  --c: #1f6fe0; display: inline-grid; place-items: center; flex-shrink: 0; border-radius: 30%; color: var(--c);
  background: color-mix(in srgb, var(--c) 12%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--c) 20%, transparent);
}
.sicon svg { width: 56%; height: 56%; }
.sicon-emoji { font-size: 1.2em; line-height: 1; }
.sicon-xs { width: 1.3em; height: 1.3em; background: none; box-shadow: none; vertical-align: -.3em; margin-right: 1px; }
.sicon-xs svg { width: 100%; height: 100%; }
.sicon-sm { width: 32px; height: 32px; border-radius: 10px; }
.sicon-md { width: 44px; height: 44px; border-radius: 13px; font-size: 1.3rem; }
.sicon-lg { width: 58px; height: 58px; border-radius: 17px; font-size: 1.6rem; }
.sicon-xl { width: 80px; height: 80px; border-radius: 24px; font-size: 2.3rem; }
.sicon-solid {
  color: #fff; background: linear-gradient(145deg, color-mix(in srgb, var(--c) 72%, #fff), var(--c) 55%, color-mix(in srgb, var(--c) 80%, #000));
  box-shadow: 0 12px 26px color-mix(in srgb, var(--c) 35%, transparent), inset 0 1px 0 rgba(255, 255, 255, .35);
}
[data-theme="dark"] .sicon:not(.sicon-solid) { color: color-mix(in srgb, var(--c) 65%, #fff); background: color-mix(in srgb, var(--c) 22%, transparent); }
.empty-state { text-align: center; padding: 40px 20px; color: var(--text-muted); }
.empty-state .big { font-size: 2.6rem; margin-bottom: 8px; }

/* Cours */
.course-card { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.course-cover { height: 120px; display: grid; place-items: center; font-size: 3rem; position: relative; }
.course-cover .badge { position: absolute; top: 12px; right: 12px; }
.course-cover .lock { position: absolute; inset: 0; background: rgba(11, 31, 77, .55); display: grid; place-items: center; font-size: 2rem; }
.course-body { padding: 18px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.course-body h3 { margin: 0; font-size: 1.05rem; }
.course-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.filters { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.filters .input { width: auto; min-width: 170px; flex: 1; }
.filters .search { flex: 2; min-width: 220px; }

.course-layout { display: grid; grid-template-columns: 320px 1fr; gap: 22px; align-items: start; }
.chapter { border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; overflow: hidden; }
.chapter-head { padding: 12px 14px; background: var(--surface-2); font-weight: 700; cursor: pointer; display: flex; justify-content: space-between; gap: 10px; }
.chapter-body { padding: 6px; }
.chapter.collapsed .chapter-body { display: none; }
.lesson-link { display: flex; gap: 10px; align-items: center; padding: 9px 10px; border-radius: 9px; color: var(--text-soft); font-size: .9rem; cursor: pointer; border: 0; background: none; width: 100%; text-align: left; font-family: inherit; }
.lesson-link:hover { background: var(--primary-soft); }
.lesson-link.active { background: var(--primary-soft); color: var(--primary); font-weight: 700; }
.lesson-link .st { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; font-size: .7rem; flex-shrink: 0; }
.lesson-link.done .st { background: var(--green); border-color: var(--green); color: #fff; }
.lesson-content { font-size: 1rem; }
.lesson-content p { color: var(--text-soft); }
.video-wrap { position: relative; padding-top: 56.25%; border-radius: 14px; overflow: hidden; background: #000; margin-bottom: 18px; }
.video-wrap iframe, .video-wrap video { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.doc-link { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px; margin-bottom: 10px; color: var(--text); }
.doc-link:hover { background: var(--primary-soft); text-decoration: none; }

/* Onglets */
.tabs { display: flex; gap: 6px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tab { padding: 10px 16px; border: 0; background: none; font: inherit; font-weight: 700; color: var(--text-muted); cursor: pointer; border-bottom: 3px solid transparent; white-space: nowrap; }
.tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* Tableaux */
.table-wrap { overflow-x: auto; border-radius: var(--radius); border: 1px solid var(--border); background: var(--surface); }
.table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.table th { text-align: left; padding: 12px 14px; background: var(--surface-2); color: var(--text-muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .04em; white-space: nowrap; border-bottom: 1px solid var(--border); }
.table td { padding: 12px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table tbody tr:hover { background: var(--surface-2); }
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }
.mono { font-family: ui-monospace, Consolas, monospace; font-size: .82rem; }

/* Quiz / examens */
.quiz-shell { max-width: 820px; margin: 0 auto; }
.quiz-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.timer { font-weight: 800; font-variant-numeric: tabular-nums; padding: 8px 14px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.timer.warn { background: var(--red-bg); color: var(--red); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.question-text { font-size: 1.2rem; font-weight: 700; color: var(--heading); margin-bottom: 18px; }
.options { display: grid; gap: 10px; }
.option {
  display: flex; gap: 12px; align-items: center; padding: 14px 16px; border: 2px solid var(--border); border-radius: 13px;
  cursor: pointer; background: var(--surface); font: inherit; color: var(--text); text-align: left; width: 100%; transition: border-color .15s, background .15s;
}
.option:hover { border-color: var(--blue-400); }
.option .letter { width: 30px; height: 30px; border-radius: 9px; background: var(--primary-soft); color: var(--primary); font-weight: 800; display: grid; place-items: center; flex-shrink: 0; }
.option.selected { border-color: var(--primary); background: var(--primary-soft); }
.option.selected .letter { background: var(--primary); color: #fff; }
.option.correct { border-color: var(--green); background: var(--green-bg); }
.option.correct .letter { background: var(--green); color: #fff; }
.option.wrong { border-color: var(--red); background: var(--red-bg); }
.option.wrong .letter { background: var(--red); color: #fff; }
.option:disabled { cursor: default; }
.explain { margin-top: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border-left: 4px solid var(--primary); font-size: .92rem; }
.q-dots { display: flex; gap: 6px; flex-wrap: wrap; }
.q-dot { width: 30px; height: 30px; border-radius: 8px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 700; font-size: .8rem; cursor: pointer; color: var(--text-soft); }
.q-dot.answered { background: var(--primary-soft); border-color: var(--primary); color: var(--primary); }
.q-dot.current { background: var(--primary); color: #fff; border-color: var(--primary); }
.score-hero { text-align: center; padding: 30px; }
.score-circle { width: 150px; height: 150px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: conic-gradient(var(--c, var(--primary)) calc(var(--p) * 1%), var(--blue-100) 0); }
.score-circle span { width: 118px; height: 118px; border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-size: 1.8rem; font-weight: 800; color: var(--heading); }
.review-item { border: 1px solid var(--border); border-radius: 14px; padding: 16px; margin-bottom: 14px; }
.review-item.ok { border-left: 5px solid var(--green); }
.review-item.ko { border-left: 5px solid var(--red); }

/* Paiement */
.pay-layout { display: grid; grid-template-columns: 1.3fr 1fr; gap: 22px; align-items: start; }
.method {
  display: flex; gap: 14px; align-items: center; padding: 14px 16px; border: 2px solid var(--border); border-radius: 14px;
  cursor: pointer; margin-bottom: 10px; background: var(--surface); transition: border-color .15s, background .15s;
}
.method:hover { border-color: var(--blue-400); }
.method input { accent-color: var(--primary); width: 18px; height: 18px; }
.method.selected { border-color: var(--primary); background: var(--primary-soft); }
.method .logo { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; font-weight: 800; color: #fff; font-size: .8rem; flex-shrink: 0; }
.summary-line { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px dashed var(--border); font-size: .93rem; }
.summary-total { display: flex; justify-content: space-between; padding-top: 14px; font-weight: 800; font-size: 1.25rem; color: var(--heading); }
.secure-note { display: flex; gap: 10px; font-size: .82rem; color: var(--text-muted); margin-top: 16px; }
.btn-wave { background: #1dc4ff; color: #04243a; box-shadow: 0 6px 18px rgba(29, 196, 255, .35); }
.btn-wave:hover { background: #14b4ec; box-shadow: 0 10px 26px rgba(29, 196, 255, .45); }
.btn-wave img { border-radius: 6px; }
.wave-logo { width: 28px; height: 28px; border-radius: 7px; vertical-align: middle; }
.wave-steps { padding-left: 20px; margin: 8px 0 0; }
.wave-steps li { margin-bottom: 8px; line-height: 1.5; }
.success-screen { text-align: center; max-width: 560px; margin: 30px auto; }
.success-icon { width: 96px; height: 96px; border-radius: 50%; background: var(--green-bg); color: var(--green); font-size: 3rem; display: grid; place-items: center; margin: 0 auto 18px; animation: pop .5s cubic-bezier(.2, 1.6, .4, 1); }
@keyframes pop { from { transform: scale(0); } to { transform: scale(1); } }
.flow-mini { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; margin: 16px 0; }
.flow-mini span { font-size: .8rem; font-weight: 700; padding: 5px 10px; border-radius: 99px; background: var(--green-bg); color: var(--green); }

/* Abonnement */
.sub-status { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.sub-status .k { font-size: .78rem; color: var(--text-muted); font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.sub-status .v { font-weight: 800; color: var(--heading); font-size: 1.05rem; }

/* Notifications */
.notif { display: flex; gap: 14px; padding: 14px; border-radius: 12px; border: 1px solid var(--border); margin-bottom: 10px; background: var(--surface); }
.notif.unread { border-color: var(--blue-400); background: var(--primary-soft); }
.notif .ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; font-size: 1.2rem; flex-shrink: 0; background: var(--blue-100); }
.notif .grow { flex: 1; }
.notif-panel {
  position: absolute; right: 0; top: 50px; width: 360px; max-width: calc(100vw - 32px); max-height: 440px; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow-lg); padding: 12px; z-index: 70;
}
.notif-panel .notif { padding: 10px; font-size: .88rem; }

/* Modales */
.modal-backdrop { position: fixed; inset: 0; background: rgba(2, 6, 23, .55); z-index: 100; display: grid; place-items: center; padding: 20px; animation: fadeIn .2s; }
.modal { background: var(--surface); border-radius: 20px; width: 100%; max-width: 620px; max-height: calc(100vh - 40px); overflow-y: auto; box-shadow: var(--shadow-lg); }
.modal-lg { max-width: 920px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 22px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 1; }
.modal-head h3 { margin: 0; }
.modal-body { padding: 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 16px 22px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }

/* Toasts */
.toast-container { position: fixed; bottom: 20px; right: 20px; z-index: 200; display: flex; flex-direction: column; gap: 10px; }
.toast { background: var(--surface); color: var(--text); border-left: 5px solid var(--primary); padding: 14px 18px; border-radius: 12px; box-shadow: var(--shadow-lg); min-width: 260px; max-width: 380px; font-weight: 600; font-size: .9rem; animation: slideIn .3s ease; }
.toast.success { border-color: var(--green); } .toast.error { border-color: var(--red); } .toast.warning { border-color: var(--amber); }
@keyframes slideIn { from { transform: translateX(120%); } to { transform: none; } }

/* Graphiques */
.chart { width: 100%; }
.chart svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart .axis { stroke: var(--border); }
.chart text { fill: var(--text-muted); font-size: 11px; font-family: var(--font); }
.chart .val-label { fill: var(--text); font-weight: 700; }
.legend { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 10px; font-size: .82rem; }
.legend span { display: inline-flex; gap: 6px; align-items: center; }
.legend i { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }

/* Éditeur de questions (admin) */
.q-editor { border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 12px; background: var(--surface-2); }
.q-editor .opt-row { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.q-editor .opt-row input[type=radio] { accent-color: var(--green); width: 18px; height: 18px; flex-shrink: 0; }
.inline-list { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; margin-bottom: 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .course-layout { grid-template-columns: 1fr; }
  .steps { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 900px) {
  .nav-links, .nav-actions .btn-outline { display: none; }
  .nav-toggle { display: inline-grid; }
  .navbar.open .nav-links {
    display: flex; flex-direction: column; position: absolute; top: 72px; left: 0; right: 0;
    background: var(--surface); border-bottom: 1px solid var(--border); padding: 12px 20px; box-shadow: var(--shadow);
  }
  .navbar.open .nav-actions .btn-outline { display: inline-flex; }
  .hero .container, .about-grid, .pay-layout, .grid-wide, .grid-side { grid-template-columns: 1fr; }
  .hero-visual { max-width: 460px; margin: 0 auto; width: 100%; }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .plan-card.featured { transform: none; }
  .auth-page { grid-template-columns: 1fr; }
  .auth-side { display: none; }
  .sidebar { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
  .sidebar.open { transform: none; }
  .main { margin-left: 0; }
  .menu-toggle { display: inline-grid; }
  .topbar { padding: 12px 16px; }
  .content { padding: 20px 16px; }
}
@media (max-width: 600px) {
  body { font-size: 14.5px; }
  .grid-2, .grid-3, .grid-4, .form-row, .steps, .footer-grid { grid-template-columns: 1fr; }
  .section { padding: 56px 0; }
  .hero { padding: 60px 0 90px; }
  .hero-stats { gap: 20px; }
  .cta-band { padding: 34px 20px; }
  .topbar .user-chip .name { display: none; }
  .topbar .title { font-size: 1rem; }
  .nav-actions .btn-primary { padding: 9px 14px; font-size: .85rem; }
  .brand small { display: none; }
  .modal-body { padding: 16px; }
  .floating-chip { display: none; }
  .card { padding: 18px; }
  .table-stack thead { display: none; }
  .table-stack tr { display: block; border-bottom: 1px solid var(--border); padding: 8px 0; }
  .table-stack td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 6px 14px; }
  .table-stack td::before { content: attr(data-label); font-weight: 700; color: var(--text-muted); font-size: .78rem; text-transform: uppercase; }
  .table-stack .actions { justify-content: flex-end; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- Téléversement des fichiers de leçon ---------- */
.media-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 6px; }
.media-box { border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; display: flex; flex-direction: column; gap: 8px; background: var(--surface-2); min-width: 0; }
.media-box-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: 30px; }
.media-state { display: flex; align-items: center; gap: 4px; }
.dropzone {
  display: flex; align-items: center; gap: 12px; padding: 16px; border: 2px dashed var(--blue-200); border-radius: 12px; cursor: pointer;
  background: var(--surface); transition: border-color .2s, background .2s;
}
.dropzone:hover, .dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.dz-ic { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); font-size: 1.3rem; font-weight: 800; flex-shrink: 0; }
.dz-text { display: flex; flex-direction: column; line-height: 1.35; }
.dz-text strong { color: var(--primary); }
.dz-text small { font-size: .78rem; color: var(--text-soft); }
.dz-progress { display: flex; flex-direction: column; gap: 4px; }
.dz-bar { width: 0; transition: width .6s ease; }
.media-preview video { width: 100%; max-height: 190px; border-radius: 10px; background: #000; margin-top: 6px; }
.media-file { display: flex; align-items: center; gap: 8px; font-size: .88rem; font-weight: 600; min-width: 0; }
.media-file .grow { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 700px) { .media-grid { grid-template-columns: 1fr; } }

/* ---------- Copies à rendre ---------- */
.sub-files { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0; }
.sub-file { display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 6px; border: 1px solid var(--border); border-radius: 12px; background: var(--surface); color: var(--text); font-size: .85rem; font-weight: 600; max-width: 260px; text-decoration: none !important; }
.sub-file:hover { border-color: var(--primary); }
.sub-file span:last-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sub-file img { width: 44px; height: 44px; object-fit: cover; border-radius: 8px; background: var(--gray-bg); }
.sub-file-ic { width: 44px; height: 44px; border-radius: 8px; display: grid; place-items: center; background: var(--red-bg); font-size: 1.2rem; }
.sub-result { border: 1px solid var(--border); border-left: 4px solid var(--green); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; background: var(--surface-2); }
.sub-grade { font-weight: 800; font-size: 1.2rem; color: var(--green); background: var(--green-bg); padding: 4px 12px; border-radius: 99px; }
.sub-feedback { margin-top: 10px; padding: 10px 14px; border-radius: 10px; background: var(--surface); border: 1px dashed var(--border); }
.sub-feedback p:last-child { margin-bottom: 0; }
.sub-comment { padding: 10px 14px; border-radius: 10px; background: var(--primary-soft); margin: 8px 0; }
.sub-picked { list-style: none; padding: 0; margin: 8px 0 0; display: grid; gap: 6px; }
.sub-picked li { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border: 1px solid var(--border); border-radius: 10px; font-size: .88rem; }

/* ---------- Correction sur la copie (js/annotation.js) ---------- */
.annot-overlay { position: fixed; inset: 0; z-index: 1000; display: flex; flex-direction: column; background: #4b5563; touch-action: pan-x pan-y; }
.annot-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 8px 12px; background: var(--surface); border-bottom: 1px solid var(--border); box-shadow: 0 2px 8px rgba(0,0,0,.15); }
.annot-title { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.annot-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: 1; }
.annot-tools .btn { min-width: 40px; }
.annot-actions { display: flex; gap: 6px; margin-left: auto; }
.annot-sep { width: 1px; height: 26px; background: var(--border); margin: 0 4px; }
.annot-color { width: 28px; height: 28px; border-radius: 50%; border: 3px solid transparent; cursor: pointer; box-shadow: 0 0 0 1px var(--border); }
.annot-color.active { border-color: var(--surface); box-shadow: 0 0 0 2px var(--text); }
.annot-tools select.annot-size { width: auto; flex: 0 0 auto; padding: 6px 28px 6px 10px; }
.annot-pages { flex: 1; overflow: auto; padding: 16px; -webkit-overflow-scrolling: touch; }
.annot-pages .empty-state { color: #fff; }
.annot-page { width: calc(min(900px, 100%) * var(--zoom, 1)); margin: 0 auto 20px; }
.annot-zoom { min-width: 48px; text-align: center; font-size: .85rem; font-weight: 600; }
.annot-label { color: #e5e7eb; font-size: .82rem; margin-bottom: 4px; }
.annot-stack { position: relative; background: #fff; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
.annot-base, .annot-layer { display: block; width: 100%; height: auto; }
.annot-layer { position: absolute; inset: 0; height: 100%; touch-action: none; cursor: crosshair; }
.annot-scroll .annot-layer { cursor: grab; }
.annot-pages, .annot-pages * { touch-action: none; } /* défilement et zoom gérés par js/annotation.js */
.annot-bar { touch-action: manipulation; }
@media (max-width: 640px) {
  .annot-title { display: none; } .annot-pages { padding: 8px; }
  .annot-bar { gap: 6px; padding: 6px 8px; }
  .annot-tools { gap: 4px; min-width: 0; }
  .annot-tools .btn { min-width: 36px; padding: 6px 9px; }
  .annot-sep { display: none; }
  .annot-color { width: 26px; height: 26px; }
  .annot-actions { width: 100%; min-width: 0; }
  .annot-actions .btn { flex: 1; min-width: 0; white-space: normal; line-height: 1.2; }
}
.annot-bar { max-width: 100vw; box-sizing: border-box; }

/* ---------- Mes copies corrigées (élève) ---------- */
.copy-done { border-left: 4px solid var(--green, #16a34a); }
.copy-grade { font-size: 1.9rem; font-weight: 800; line-height: 1; white-space: nowrap; }
.copy-grade small { font-size: .9rem; font-weight: 600; opacity: .7; }
.copy-grade.ok { color: #16a34a; }
.copy-grade.ko { color: #dc2626; }
.copy-open { font-size: 1rem; padding: 12px; }

/* ---------- Attribution d'élèves à un professeur (espaces.js) ---------- */
.st-list { max-height: 50vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.st-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); cursor: pointer; }
.st-row:last-child { border-bottom: 0; }
/* Sous-classes : choix « Réservé à » et répartition des élèves */
.sc-list { display: flex; flex-wrap: wrap; gap: 6px 16px; }
.sc-members { max-height: 50vh; overflow: auto; border: 1px solid var(--border); border-radius: 12px; }
.sc-member { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-bottom: 1px solid var(--border); margin: 0; }
.sc-member:last-child { border-bottom: 0; }
.st-row input { width: 18px; height: 18px; flex: 0 0 auto; }

/* =========================================================
   Prof IA (prof.html, js/prof.js)
   La discussion fait partie de la page : aucune réponse n'est coupée dans un cadre.
   --c : couleur de la matière choisie
   ========================================================= */
.pia { --c: var(--primary); max-width: 920px; margin: 0 auto; display: flex; flex-direction: column; gap: 14px; }

/* En-tête */
.pia-hero { position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px; padding: 20px 22px;
  border-radius: var(--radius-lg); color: #fff; box-shadow: var(--shadow);
  background: radial-gradient(circle at 85% -20%, rgba(255,255,255,.28), transparent 45%), linear-gradient(135deg, var(--c), var(--blue-900)); transition: background .3s; }
.pia-hero-avatar { position: relative; flex: none; width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center;
  font-size: 30px; background: rgba(255,255,255,.18); border: 2px solid rgba(255,255,255,.45); }
.pia-online { position: absolute; right: 1px; bottom: 3px; width: 13px; height: 13px; border-radius: 50%; background: #22c55e; border: 2px solid #fff; }
.pia-hero-text { flex: 1; min-width: 0; }
.pia-hero h1 { margin: 0; font-size: 1.5rem; color: #fff; letter-spacing: -.01em; }
.pia-hero p { margin: 2px 0 0; color: rgba(255,255,255,.88); font-size: .95rem; }
.pia-hero p strong { color: #fff; }
.pia-quota { flex: none; padding: 7px 13px; border-radius: 99px; background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.35);
  font-size: .85rem; white-space: nowrap; }
.pia-quota strong { font-size: 1rem; }
.pia-quota.low { background: #fff; color: var(--orange); border-color: #fff; }

/* Abonnement requis */
.pia-locked { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 16px 18px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.pia-locked > div:nth-child(2) { flex: 1; min-width: 200px; }
.pia-locked p { margin: 2px 0 0; color: var(--text-muted); font-size: .92rem; }
.pia-locked-ico { font-size: 1.8rem; }

/* Matières */
.pia-subjects { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.pia-subjects::-webkit-scrollbar { display: none; }
.pia-subject { flex: none; display: inline-flex; align-items: center; gap: 7px; min-height: 42px; padding: 8px 15px; border-radius: 99px;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .92rem;
  cursor: pointer; transition: all .18s; }
.pia-subject:hover { border-color: var(--sc); color: var(--sc); }
.pia-subject[aria-pressed="true"] { background: var(--sc); border-color: var(--sc); color: #fff; box-shadow: 0 6px 16px -6px var(--sc); }

/* Modes */
.pia-modes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); border: 1px solid var(--border); }
.pia-mode { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 40px; padding: 6px 8px; border: 0; border-radius: 10px;
  background: transparent; color: var(--text-soft); font: inherit; font-weight: 600; font-size: .88rem; cursor: pointer; transition: all .18s; }
.pia-mode:hover { color: var(--c); }
.pia-mode[aria-pressed="true"] { background: var(--surface); color: var(--c); box-shadow: var(--shadow-sm); }
.pia-mode-hint { margin: -4px 4px 0; color: var(--text-muted); font-size: .86rem; }

/* Discussion */
.pia-thread { display: flex; flex-direction: column; gap: 18px; padding: 6px 0 4px; }
.pia-msg { display: flex; gap: 10px; animation: piaIn .3s ease; }
@keyframes piaIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.pia-avatar { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 19px;
  background: linear-gradient(135deg, var(--c), var(--blue-900)); box-shadow: 0 4px 10px -4px var(--c); }
.pia-prof .pia-bubble { flex: 1; min-width: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 4px 18px 18px 18px;
  padding: 14px 18px; box-shadow: var(--shadow-sm); border-top: 3px solid var(--c); }
.pia-meta { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--c); margin-bottom: 6px; }
.pia-user { justify-content: flex-end; }
.pia-user .pia-bubble { max-width: min(560px, 85%); padding: 11px 15px; border-radius: 18px 18px 4px 18px; color: #fff;
  background: var(--c); background: linear-gradient(135deg, var(--c), color-mix(in srgb, var(--c) 70%, #000)); white-space: pre-wrap; overflow-wrap: anywhere; box-shadow: var(--shadow-sm); }
.pia-user .pia-bubble img { display: block; max-width: 100%; max-height: 260px; border-radius: 10px; margin-bottom: 6px; }

/* Contenu des réponses */
.pia-body { color: var(--text); line-height: 1.68; font-size: 1rem; overflow-wrap: anywhere; }
.pia-body > :first-child { margin-top: 0; }
.pia-body > :last-child { margin-bottom: 0; }
.pia-body p { margin: 0 0 .75em; }
.pia-body h1, .pia-body h2 { font-size: 1.22rem; line-height: 1.3; color: var(--heading); margin: 0 0 .6em; }
.pia-body h3, .pia-body h4 { font-size: 1.03rem; color: var(--heading); margin: 1.2em 0 .45em; display: flex; align-items: center; gap: 8px; }
.pia-body h3::before { content: ""; width: 4px; height: 1.05em; border-radius: 4px; background: var(--c); flex: none; }
.pia-body ul, .pia-body ol { padding-left: 1.35em; margin: 0 0 .8em; }
.pia-body li { margin: .25em 0; }
.pia-body li::marker { color: var(--c); font-weight: 700; }
.pia-body strong { color: var(--heading); }
.pia-body code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: .92em; }
.pia-body hr { border: 0; border-top: 1px dashed var(--border); margin: 1.1em 0; }
.pia-body .katex { font-size: 1.07em; }
.pia-body .katex-display { overflow-x: auto; overflow-y: hidden; margin: .7em 0; padding: 10px 6px; border-radius: 10px; background: var(--surface-2); }
.pia-table { overflow-x: auto; margin: 0 0 .9em; border: 1px solid var(--border); border-radius: 10px; }
.pia-table table { border-collapse: collapse; width: 100%; font-size: .94rem; }
.pia-table th { background: var(--surface-2); background: color-mix(in srgb, var(--c) 12%, var(--surface)); color: var(--heading); text-align: left; }
.pia-table th, .pia-table td { padding: 8px 11px; border-bottom: 1px solid var(--border); }
.pia-table tr:last-child td { border-bottom: 0; }
.pia-table th, .pia-table td { overflow-wrap: normal; word-break: normal; hyphens: auto; vertical-align: top; }
.pia-table th:first-child, .pia-table td:first-child { min-width: 5.5em; font-weight: 600; }

/* Encadrés (« > 📌 **À retenir** : … ») */
.pia-callout { --k: var(--c); margin: .9em 0; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border);
  border-left: 4px solid var(--k); background: var(--surface-2); background: color-mix(in srgb, var(--k) 9%, var(--surface)); }
.pia-callout p:last-child { margin-bottom: 0; }
.pia-callout strong:first-of-type { color: var(--k); }
.pia-callout-retenir { --k: #2563eb; }
.pia-callout-piege { --k: #ea580c; }
.pia-callout-methode { --k: #7c3aed; }
.pia-callout-exemple { --k: #16a34a; }
.pia-callout-ok { --k: #16a34a; }
.pia-callout-ko { --k: #dc2626; }
.pia-callout-defi { --k: var(--c); }
[data-theme="dark"] .pia-callout-retenir { --k: #60a5fa; }
[data-theme="dark"] .pia-callout-methode { --k: #a78bfa; }
[data-theme="dark"] .pia-callout-exemple, [data-theme="dark"] .pia-callout-ok { --k: #4ade80; }


/* Attente de la réponse */
.pia-typing { display: flex; align-items: center; gap: 10px; color: var(--text-muted); font-size: .93rem; }
.pia-dots { display: inline-flex; gap: 4px; }
.pia-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--c); animation: piaDot 1.2s infinite ease-in-out; }
.pia-dots i:nth-child(2) { animation-delay: .15s; }
.pia-dots i:nth-child(3) { animation-delay: .3s; }
@keyframes piaDot { 0%, 80%, 100% { transform: scale(.6); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
.pia-skeleton { display: grid; gap: 8px; margin-top: 12px; }
.pia-skeleton i { height: 11px; border-radius: 6px; background: linear-gradient(90deg, var(--surface-2), var(--border), var(--surface-2)); background-size: 200% 100%; animation: piaShimmer 1.4s infinite linear; }
.pia-skeleton i:nth-child(2) { width: 85%; }
.pia-skeleton i:nth-child(3) { width: 60%; }
@keyframes piaShimmer { to { background-position: -200% 0; } }
.pia-failed .pia-bubble { border-top-color: var(--red); }
.pia-failed .pia-body { color: var(--red); }

.pia-actions { display: flex; gap: 6px; margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--border); }
.pia-actions button { border: 0; background: none; color: var(--text-muted); font: inherit; font-size: .84rem; padding: 4px 8px; border-radius: 8px; cursor: pointer; }
.pia-actions button:hover { background: var(--surface-2); color: var(--c); }
.pia-actions { flex-wrap: wrap; align-items: center; }

/* Zone de saisie : toujours visible en bas de l'écran */
.pia-composer { position: sticky; bottom: 0; z-index: 30; margin: 4px -6px 0; padding: 10px 6px calc(10px + env(safe-area-inset-bottom));
  background: linear-gradient(to top, var(--bg) 75%, transparent); }
.pia-inputrow { display: flex; align-items: flex-end; gap: 8px; padding: 7px; border-radius: 22px; background: var(--surface);
  border: 1.5px solid var(--border); box-shadow: var(--shadow); transition: border-color .18s, box-shadow .18s; }
.pia-inputrow:focus-within { border-color: var(--c); }
.pia-inputrow textarea { flex: 1; min-width: 0; border: 0; outline: 0; resize: none; background: transparent; color: var(--text);
  font: inherit; font-size: 16px; line-height: 1.45; padding: 9px 4px; max-height: 180px; }
.pia-icon-btn { flex: none; width: 42px; height: 42px; border-radius: 50%; border: 0; background: var(--surface-2); font-size: 1.15rem; cursor: pointer; }
.pia-send { flex: none; width: 44px; height: 44px; border-radius: 50%; border: 0; display: grid; place-items: center; cursor: pointer;
  background: linear-gradient(135deg, var(--c), var(--blue-900)); box-shadow: 0 6px 14px -6px var(--c); transition: transform .15s; }
.pia-send svg { width: 20px; height: 20px; fill: #fff; margin-left: 2px; }
.pia-send:hover { transform: scale(1.06); }
.pia-send:disabled, .pia-icon-btn:disabled { opacity: .45; cursor: default; transform: none; }
.is-busy .pia-send { animation: piaPulse 1.2s infinite; }
@keyframes piaPulse { 50% { opacity: .5; } }
.pia-attach { display: inline-flex; align-items: center; gap: 8px; margin: 0 0 8px 6px; padding: 5px 6px 5px 5px; border-radius: 12px;
  background: var(--surface); border: 1px solid var(--border); font-size: .85rem; color: var(--text-soft); box-shadow: var(--shadow-sm); }
.pia-attach[hidden] { display: none; }
.pia-attach img { width: 40px; height: 40px; object-fit: cover; border-radius: 8px; }
.pia-attach button { border: 0; background: var(--surface-2); color: var(--text); width: 26px; height: 26px; border-radius: 50%; cursor: pointer; }
.pia-foot { text-align: center; color: var(--text-muted); font-size: .75rem; margin-top: 6px; }

@media (prefers-reduced-motion: reduce) { .pia-msg, .pia-dots i, .pia-skeleton i, .is-busy .pia-send { animation: none; } }
@media (max-width: 600px) {
  .pia { gap: 11px; }
  .pia-hero { padding: 14px; gap: 12px; border-radius: var(--radius); flex-wrap: wrap; }
  .pia-hero-avatar { width: 46px; height: 46px; font-size: 24px; }
  .pia-hero h1 { font-size: 1.25rem; }
  .pia-hero p { font-size: .86rem; }
  .pia-quota { width: 100%; text-align: center; }
  .pia-modes { grid-template-columns: repeat(2, 1fr); }
  .pia-avatar { display: none; }
  .pia-prof .pia-bubble { padding: 12px 13px; border-radius: 14px; }
  .pia-user .pia-bubble { max-width: 90%; }
  .pia-body { font-size: .98rem; line-height: 1.62; }
  .pia-body .katex-display { font-size: .86em; }
  /* Tableaux : une fiche par ligne, lisible en entier sans glisser sur le côté */
  .pia-table { overflow: visible; border: 0; }
  .pia-table table, .pia-table tbody, .pia-table tr, .pia-table td { display: block; width: 100%; }
  .pia-table thead { display: none; }
  .pia-table tr { margin-bottom: 10px; border: 1px solid var(--border); border-left: 4px solid var(--c); border-radius: 10px; background: var(--surface); overflow: hidden; }
  .pia-table td { padding: 7px 11px; border-bottom: 1px solid var(--border); font-size: .94rem; }
  .pia-table tr td:last-child { border-bottom: 0; }
  .pia-table td:first-child { background: var(--surface-2); color: var(--heading); }
  .pia-table td[data-label]::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--c); margin-bottom: 2px; }
}

/* Prof IA : barre d'outils, « Mes discussions », bouton « Demander au Prof IA » */
.pia-toolbar { display: flex; gap: 8px; flex-wrap: wrap; }
.pia-tool { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font: inherit; font-weight: 600; font-size: .9rem; cursor: pointer; transition: all .18s; }
.pia-tool:hover { border-color: var(--c); color: var(--c); }
.pia-tool:disabled { opacity: .5; cursor: default; }
.pia-photo-tag { font-size: .82rem; opacity: .85; margin-bottom: 4px; }

body.pia-noscroll { overflow: hidden; }
.pia-drawer[hidden] { display: none; }
.pia-drawer { position: fixed; inset: 0; z-index: 90; }
.pia-drawer-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 23, .5); animation: piaFade .2s ease; }
.pia-drawer-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(440px, 100%); display: flex; flex-direction: column;
  background: var(--bg); box-shadow: var(--shadow-lg); animation: piaSlide .25s ease; }
.pia-drawer-panel header { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 18px;
  padding-top: max(16px, env(safe-area-inset-top)); border-bottom: 1px solid var(--border); background: var(--surface); }
.pia-drawer-panel h2 { margin: 0; font-size: 1.15rem; }
.pia-drawer-list { flex: 1; overflow-y: auto; padding: 12px; display: flex; flex-direction: column; gap: 8px; padding-bottom: max(12px, env(safe-area-inset-bottom)); }
.pia-drawer-empty { text-align: center; color: var(--text-muted); padding: 40px 16px; line-height: 1.6; }
@keyframes piaFade { from { opacity: 0; } }
@keyframes piaSlide { from { transform: translateX(30px); opacity: 0; } }
.pia-conv { display: flex; align-items: stretch; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); border-left: 4px solid var(--sc); overflow: hidden; }
.pia-conv.current { box-shadow: 0 0 0 2px var(--sc); }
.pia-conv-open { flex: 1; min-width: 0; display: flex; align-items: center; gap: 12px; padding: 12px; border: 0; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.pia-conv-open:hover { background: var(--surface-2); }
.pia-conv-icon { flex: none; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 1.15rem; background: var(--surface-2); }
.pia-conv-text { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pia-conv-text strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--heading); font-size: .95rem; }
.pia-conv-text small { color: var(--text-muted); font-size: .8rem; }
.pia-conv-del { flex: none; width: 46px; border: 0; border-left: 1px solid var(--border); background: none; cursor: pointer; font-size: 1rem; opacity: .7; }
.pia-conv-del:hover { opacity: 1; background: var(--red-bg); }

.prof-ia-cta { display: flex; align-items: center; justify-content: space-between; gap: 10px 14px; flex-wrap: wrap; margin: 18px 0; padding: 14px 16px;
  border-radius: var(--radius); border: 1px dashed var(--blue-200); background: var(--primary-soft); text-align: left; }
.prof-ia-cta span { color: var(--text-soft); font-weight: 600; }
.btn-prof-ia { background: linear-gradient(135deg, var(--blue-600), var(--blue-900)); color: #fff; border: 0; box-shadow: 0 6px 14px -6px var(--blue-600); }
.btn-prof-ia:hover { color: #fff; text-decoration: none; filter: brightness(1.08); }
[data-theme="dark"] .prof-ia-cta { border-color: var(--border); }
@media (max-width: 600px) {
  .pia-tool { flex: 1; justify-content: center; }
  .prof-ia-cta .btn-prof-ia { width: 100%; justify-content: center; }
}

/* ---------- Cours en visio (js/visio.js) ---------- */
.vz-card.vz-live { border-left: 4px solid #dc2626; }
.vz-body { overflow: hidden; }
.vz-wait { min-height: 100vh; display: grid; place-items: center; padding: 16px; background: var(--bg); }
.vz-prejoin-bg { background: radial-gradient(1200px 600px at 20% 0%, #1e3a8a 0%, #0b1220 55%, #070b14 100%); }
.vz-prejoin { width: min(480px, 100%); text-align: center; color: #e5e7eb; background: rgba(17, 24, 39, .82); border: 1px solid rgba(255,255,255,.08); border-radius: 24px; padding: 24px; box-shadow: 0 30px 80px rgba(0,0,0,.45); backdrop-filter: blur(10px); }
.vz-prejoin h2 { color: #fff; margin: 6px 0 2px; font-size: 1.35rem; }
.vz-prejoin-brand { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; color: #93c5fd; font-weight: 600; letter-spacing: .02em; }
.vz-prejoin-brand img { width: 22px; height: 22px; border-radius: 6px; background: #fff; }
.vz-muted { color: #9ca3af; }
.vz-small { font-size: .82rem; }
.vz-preview { position: relative; margin: 16px 0 12px; border-radius: 18px; overflow: hidden; background: #000; aspect-ratio: 16 / 10; }
.vz-preview video { width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: block; }
.vz-preview-off { position: absolute; inset: 0; display: grid; place-items: center; background: #111827; color: #9ca3af; font-weight: 600; }
.vz-meter { position: absolute; left: 14px; right: 14px; bottom: 12px; height: 5px; border-radius: 4px; background: rgba(255,255,255,.18); overflow: hidden; }
.vz-meter i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #22c55e, #a3e635); transition: width .1s; }
.vz-note { background: rgba(234, 179, 8, .12); color: #fde68a; border-radius: 12px; padding: 10px 12px; font-size: .85rem; margin-bottom: 10px; }
.vz-prejoin-ctl { display: flex; justify-content: center; gap: 14px; margin: 6px 0 10px; }
.vz-round { width: 52px; height: 52px; border-radius: 50%; border: 0; font-size: 1.3rem; background: #374151; cursor: pointer; transition: background .15s, transform .1s; }
.vz-round:hover { transform: translateY(-1px); }
.vz-round.vz-off { background: #b91c1c; }
.vz-join { width: 100%; border: 0; border-radius: 14px; padding: 14px; font: inherit; font-size: 1.05rem; font-weight: 700; color: #fff; background: linear-gradient(135deg, #2563eb, #7c3aed); cursor: pointer; box-shadow: 0 10px 25px rgba(37, 99, 235, .35); margin-top: 6px; }
.vz-join:hover { filter: brightness(1.08); }
.vz-back { display: inline-block; margin-top: 12px; color: #9ca3af; font-size: .9rem; }

.vz { position: fixed; inset: 0; display: flex; flex-direction: column; background: #0b1220; color: #e5e7eb; }
.vz-top { display: flex; align-items: center; gap: 12px; padding: 10px 16px; background: linear-gradient(180deg, rgba(17,24,39,.95), rgba(11,18,32,.9)); border-bottom: 1px solid rgba(255,255,255,.06); }
.vz-brand { display: flex; align-items: center; gap: 10px; min-width: 0; flex: 1; }
.vz-brand img { width: 34px; height: 34px; border-radius: 10px; background: #fff; flex: 0 0 auto; }
.vz-title { font-weight: 700; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vz-sub { display: flex; align-items: center; gap: 8px; font-size: .8rem; color: #9ca3af; }
.vz-live { display: inline-flex; align-items: center; gap: 6px; color: #fca5a5; font-weight: 700; letter-spacing: .04em; font-size: .72rem; }
.vz-live i { width: 8px; height: 8px; border-radius: 50%; background: #ef4444; box-shadow: 0 0 0 0 rgba(239,68,68,.7); animation: vzPulse 1.6s infinite; }
@keyframes vzPulse { 0% { box-shadow: 0 0 0 0 rgba(239,68,68,.6); } 70% { box-shadow: 0 0 0 8px rgba(239,68,68,0); } 100% { box-shadow: 0 0 0 0 rgba(239,68,68,0); } }
.vz-top-right { display: flex; align-items: center; gap: 8px; }
.vz-icon { border: 1px solid rgba(255,255,255,.1); background: rgba(255,255,255,.06); color: #e5e7eb; border-radius: 12px; padding: 8px 12px; font: inherit; font-weight: 600; cursor: pointer; }
.vz-hands { border: 0; border-radius: 999px; padding: 7px 14px; font: inherit; font-weight: 800; color: #1f2937; background: #facc15; cursor: pointer; animation: vzHandBlink 1.2s ease-in-out infinite; }
@keyframes vzHandBlink { 50% { box-shadow: 0 0 0 6px rgba(250, 204, 21, .25); } }

.vz-main { flex: 1; display: flex; min-height: 0; }
.vz-stage { position: relative; flex: 1; min-width: 0; padding: 12px; display: flex; flex-direction: column; min-height: 0; }
.vz-grid { flex: 1; display: grid; gap: 12px; grid-template-columns: repeat(var(--n, 2), minmax(0, 1fr)); align-content: center; overflow: auto; }
.vz-speaker { position: relative; flex: 1; display: flex; min-height: 0; }
.vz-self { position: absolute; right: 12px; bottom: 12px; width: min(200px, 32%); }
.vz-tile { position: relative; background: #111827; border-radius: 18px; overflow: hidden; aspect-ratio: 16 / 10; box-shadow: 0 8px 24px rgba(0,0,0,.3); outline: 3px solid transparent; transition: outline-color .15s; }
.vz-tile video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vz-tile video.vz-mirror { transform: scaleX(-1); }
.vz-tile-big { flex: 1; aspect-ratio: auto; }
.vz-tile-big video { object-fit: contain; background: #000; }
.vz-tile-mini { border-radius: 14px; }
.vz-avatar { display: none; position: absolute; inset: 0; margin: auto; width: 34%; max-width: 110px; aspect-ratio: 1; border-radius: 50%; background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; font-weight: 800; font-size: clamp(.9rem, 3vw, 2rem); place-items: center; }
.vz-novideo video { visibility: hidden; }
.vz-novideo .vz-avatar { display: grid; }
.vz-tile-name { position: absolute; left: 10px; bottom: 10px; display: flex; align-items: center; gap: 6px; max-width: calc(100% - 20px); background: rgba(0,0,0,.55); backdrop-filter: blur(6px); color: #fff; font-size: .8rem; font-weight: 600; padding: 4px 10px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vz-mic-off { color: #fca5a5; }
.vz-speaking { outline-color: #22c55e; }
.vz-hand-up { outline-color: #facc15; animation: vzHandBlink 1.2s ease-in-out infinite; }
.vz-hand-badge { position: absolute; top: 10px; right: 10px; width: 38px; height: 38px; border-radius: 50%; background: #facc15; display: grid; place-items: center; font-size: 1.2rem; box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.vz-empty { display: grid; place-items: center; }
.vz-hint { color: #9ca3af; text-align: center; padding: 20px; }

.vz-shared { position: relative; flex: 1; display: flex; flex-direction: column; gap: 8px; min-height: 0; }
.vz-shared-head { position: absolute; top: 8px; left: 8px; z-index: 6; display: flex; align-items: center; gap: 10px; }
.vz-shared .vz-tools + .vz-board-box { margin-top: 0; }
.vz-shared:has(.vz-tools) .vz-shared-head { position: static; }
.vz-chip { box-shadow: 0 4px 14px rgba(0,0,0,.35); background: rgba(30, 58, 138, .92); color: #bfdbfe; border-radius: 999px; padding: 6px 14px; font-weight: 700; font-size: .85rem; }
.vz-board-box { flex: 1; min-height: 0; display: flex; align-items: center; justify-content: center; }
.vz-board { display: block; background: #fff; border-radius: 14px; touch-action: none; cursor: crosshair; box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.vz-board[data-ro="1"] { cursor: default; }
.vz-board-modal { height: 65vh; }
.vz-pip { position: absolute; right: 8px; bottom: 8px; display: flex; flex-direction: column; gap: 8px; width: clamp(110px, 16vw, 190px); max-height: 70%; overflow: auto; z-index: 5; }
.vz-pip .vz-tile { box-shadow: 0 8px 20px rgba(0,0,0,.5); }

.vz-tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 8px; padding: 8px; background: rgba(17,24,39,.92); border: 1px solid rgba(255,255,255,.08); border-radius: 16px; box-shadow: 0 8px 24px rgba(0,0,0,.35); }
.vz-tool-group { display: flex; align-items: center; gap: 4px; padding: 0 6px; border-right: 1px solid rgba(255,255,255,.08); }
.vz-tool-group:last-child { border-right: 0; }
.vz-tool-end { margin-left: auto; }
.vz-tool, .vz-size { min-width: 40px; height: 40px; border: 0; border-radius: 10px; background: transparent; color: #e5e7eb; font-size: 1.15rem; cursor: pointer; display: grid; place-items: center; }
.vz-tool:hover, .vz-size:hover { background: rgba(255,255,255,.08); }
.vz-tool.active, .vz-size.active { background: #2563eb; color: #fff; }
.vz-tool.vz-danger:hover { background: rgba(220, 38, 38, .25); }
.vz-size i { display: block; border-radius: 50%; background: currentColor; }
.vz-swatch { width: 30px; height: 30px; border-radius: 50%; border: 3px solid transparent; background: var(--c); cursor: pointer; box-shadow: 0 0 0 1px rgba(255,255,255,.25); }
.vz-swatch.active { border-color: #0b1220; box-shadow: 0 0 0 2px #fff; }
.vz-pill { border: 0; border-radius: 999px; padding: 9px 16px; font: inherit; font-weight: 700; font-size: .88rem; color: #fff; background: #2563eb; cursor: pointer; white-space: nowrap; }
.vz-pill:hover { filter: brightness(1.1); }
.vz-pill-red { background: #dc2626; }

.vz-side { width: 0; overflow: hidden; background: #0f172a; border-left: 1px solid rgba(255,255,255,.06); transition: width .2s; }
.vz-side.vz-side-open { width: 320px; overflow: auto; padding: 12px; }
.vz-side-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.vz-side-head h3 { color: #fff; font-size: 1rem; margin: 0; }
.vz-side-head h3 span { background: rgba(255,255,255,.1); border-radius: 999px; padding: 1px 8px; font-size: .78rem; margin-left: 4px; }
.vz-side-head .vz-pill { padding: 6px 10px; font-size: .76rem; background: #374151; }
.vz-thumb { background: #111827; border: 1px solid rgba(255,255,255,.06); border-radius: 16px; padding: 10px; margin-bottom: 10px; }
.vz-thumb-shared { border-color: #2563eb; box-shadow: 0 0 0 1px #2563eb; }
.vz-thumb-hand { border-color: #facc15; box-shadow: 0 0 0 2px rgba(250, 204, 21, .45); }
.vz-thumb-head { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; color: #f3f4f6; }
.vz-thumb-head strong { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-hand-tag { background: #facc15; color: #1f2937; border-radius: 999px; padding: 2px 8px; font-size: .72rem; font-weight: 800; }
.vz-thumb canvas { width: 100%; border-radius: 10px; background: #fff; cursor: zoom-in; display: block; margin-bottom: 8px; }
.vz-thumb-actions { display: flex; flex-wrap: wrap; gap: 6px; }
.vz-mini { border: 0; border-radius: 9px; padding: 6px 10px; font: inherit; font-size: .78rem; font-weight: 600; color: #f9fafb; background: #374151; cursor: pointer; }
.vz-mini:hover { background: #4b5563; }
.vz-mini-on { background: #2563eb; }
.vz-mini-warn { background: #facc15; color: #1f2937; }

.vz-controls { display: flex; justify-content: center; align-items: center; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(0deg, rgba(17,24,39,.98), rgba(11,18,32,.92)); border-top: 1px solid rgba(255,255,255,.06); }
.vz-ctl { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 70px; border: 0; border-radius: 16px; padding: 8px 10px; background: #1f2937; color: #e5e7eb; font: inherit; cursor: pointer; transition: background .15s, transform .1s; }
.vz-ctl:hover { background: #374151; transform: translateY(-1px); }
.vz-ctl:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.vz-ctl-ic { font-size: 1.3rem; line-height: 1; }
.vz-ctl-lb { font-size: .72rem; font-weight: 600; white-space: nowrap; }
.vz-ctl.vz-off { background: #7f1d1d; }
.vz-ctl.vz-on { background: #a16207; color: #fff; }
.vz-ctl-accent { background: #2563eb; color: #fff; }
.vz-ctl-accent:hover { background: #1d4ed8; }
.vz-ctl-leave { background: #dc2626; color: #fff; margin-left: 12px; }
.vz-ctl-leave:hover { background: #b91c1c; }

.vz-rotate { display: none; }
@media (max-width: 760px) and (orientation: portrait) { .vz-rotate { display: block; text-align: center; font-size: .8rem; font-weight: 600; color: #bfdbfe; background: rgba(37, 99, 235, .15); border-radius: 12px; padding: 8px 10px; } }
.vz-editor { position: fixed; inset: 0; z-index: 900; display: flex; flex-direction: column; gap: 10px; padding: 10px; background: #0b1220; }
@media (max-width: 760px) {
  .vz-top { padding: 8px 10px; }
  .vz-hide-sm { display: none; }
  .vz-stage { padding: 8px; }
  .vz-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .vz-side.vz-side-open { position: fixed; right: 0; top: 0; bottom: 0; z-index: 800; width: 88vw; box-shadow: -10px 0 30px rgba(0,0,0,.5); }
  .vz-controls { gap: 5px; padding: 8px 6px calc(8px + env(safe-area-inset-bottom)); justify-content: safe center; overflow-x: auto; scrollbar-width: none; }
  .vz-controls::-webkit-scrollbar { display: none; }
  /* téléphone : boutons étroits, libellé sur deux lignes au besoin (jamais superposés) ; la barre défile si nécessaire */
  .vz-ctl { min-width: 56px; max-width: 84px; flex: 1 0 56px; padding: 7px 3px; border-radius: 14px; }
  @media (max-width: 430px) { .vz-controls { gap: 3px; padding-left: 4px; padding-right: 4px; } .vz-ctl { min-width: 49px; flex-basis: 49px; padding: 6px 2px; border-radius: 12px; } .vz-ctl-ic { font-size: 1.15rem; } .vz-ctl-lb { font-size: .6rem; } }
  .vz-ctl-lb { font-size: .62rem; white-space: normal; text-align: center; line-height: 1.1; }
  .vz-ctl-leave { margin-left: 0; }
  .vz-tools { gap: 4px; padding: 6px; border-radius: 14px; }
  .vz-tool-group { padding: 0 3px; }
  .vz-tool, .vz-size { min-width: 36px; height: 36px; }
  .vz-swatch { width: 26px; height: 26px; }
  .vz-tool-end { margin-left: 0; }
  .vz-pip { width: 92px; }
  .vz-self { width: 34%; }
}

/* ---------- Salle de visio v3 : tableau au centre, élèves en vignettes, écran, discussion ---------- */
.vz-stage { gap: 8px; }
.vz-area { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 8px; }
.vz-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.vz-bar .vz-pill { padding: 6px 12px; font-size: .8rem; }
.vz-chip-live { background: rgba(185, 28, 28, .92); color: #fee2e2; }
.vz-pill-ghost { background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); }
.vz-area .vz-tools { justify-content: flex-start; }
.vz-area .vz-board-box { flex: 1; min-height: 0; }
.vz-screen { display: block; max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; background: #000; border-radius: 14px; box-shadow: 0 12px 40px rgba(0,0,0,.45); }
.vz-doc { width: auto; padding: 0 10px; gap: 6px; display: inline-flex; font-size: 1rem; }
.vz-doc span { font-size: .78rem; font-weight: 700; }

/* Vignettes des participants (nom seulement, très compactes) */
.vz-people { flex: 0 0 auto; display: flex; gap: 6px; overflow-x: auto; padding: 2px 2px 4px; scrollbar-width: thin; }
.vz-person { flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; max-width: 170px; padding: 3px 10px 3px 3px; border-radius: 999px; border: 1px solid rgba(255,255,255,.1); background: #111827; color: #e5e7eb; font: inherit; font-size: .76rem; font-weight: 600; cursor: default; outline: 2px solid transparent; transition: outline-color .15s; }
.vz-person[data-board] { cursor: pointer; }
.vz-person[data-board]:hover { background: #1f2937; }
.vz-person-av { width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; font-size: .66rem; font-weight: 800; }
.vz-person-host .vz-person-av { background: #f59e0b; font-size: .8rem; }
.vz-person-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vz-person-tag { background: #facc15; color: #1f2937; border-radius: 999px; padding: 0 6px; font-size: .72rem; }
.vz-person-off { color: #fca5a5; font-size: .72rem; }
.vz-person-hand { border-color: #facc15; animation: vzHandBlink 1.2s ease-in-out infinite; }
.vz-person.vz-speaking { outline-color: #22c55e; }

/* Caméra du professeur en petit (repliable) */
.vz-pip { position: absolute; right: 22px; bottom: 58px; z-index: 6; width: clamp(130px, 15vw, 230px); aspect-ratio: 16 / 10; border-radius: 14px; overflow: hidden; background: #111827; box-shadow: 0 10px 30px rgba(0,0,0,.55); outline: 3px solid transparent; transition: outline-color .15s, width .15s; }
.vz-pip video { width: 100%; height: 100%; object-fit: cover; display: block; }
.vz-mirror-pip video { transform: scaleX(-1); }
.vz-pip-av { display: none; position: absolute; inset: 0; margin: auto; width: 46%; aspect-ratio: 1; border-radius: 50%; background: linear-gradient(135deg, #f59e0b, #d97706); color: #fff; font-weight: 800; place-items: center; font-size: 1.1rem; }
.vz-pip.vz-novideo video { visibility: hidden; }
.vz-pip.vz-novideo .vz-pip-av { display: grid; }
.vz-pip-name { position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 40px); background: rgba(0,0,0,.6); color: #fff; font-size: .7rem; font-weight: 700; padding: 2px 8px; border-radius: 999px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.vz-pip-btn { position: absolute; right: 5px; top: 5px; width: 24px; height: 24px; border: 0; border-radius: 50%; background: rgba(0,0,0,.55); color: #fff; font-weight: 800; cursor: pointer; line-height: 1; }
.vz-pip.vz-speaking { outline-color: #22c55e; }
.vz-pip-small { width: 56px; aspect-ratio: 1; border-radius: 50%; }
.vz-pip-small video, .vz-pip-small .vz-pip-name { visibility: hidden; }
.vz-pip-small .vz-pip-av { display: grid; width: 100%; height: 100%; font-size: .9rem; }
.vz-pip-small .vz-pip-btn { right: -2px; top: -2px; width: 22px; height: 22px; }

/* Écran d'accueil d'un élève (pas de caméra) */
.vz-preview-student { flex-direction: column; gap: 10px; display: flex; align-items: center; justify-content: center; text-align: center; padding: 16px; font-size: .9rem; }
.vz-avatar-lg { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: linear-gradient(135deg, #2563eb, #7c3aed); color: #fff; font-size: 1.8rem; font-weight: 800; }

/* Discussion écrite */
.vz-chat { width: 330px; flex: 0 0 330px; display: flex; flex-direction: column; background: #0f172a; border-left: 1px solid rgba(255,255,255,.06); min-height: 0; }
.vz-chat.hidden { display: none; }
.vz-chat-head { display: flex; align-items: center; gap: 6px; padding: 12px; border-bottom: 1px solid rgba(255,255,255,.06); }
.vz-chat-head h3 { flex: 1; margin: 0; font-size: 1rem; color: #fff; }
.vz-chat-list { flex: 1; overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 8px; }
.vz-msg { background: #1f2937; border-radius: 12px 12px 12px 4px; padding: 7px 10px; max-width: 92%; align-self: flex-start; }
.vz-msg-me { background: #1d4ed8; border-radius: 12px 12px 4px 12px; align-self: flex-end; }
.vz-msg-host { border: 1px solid #f59e0b; }
.vz-msg-head { display: flex; align-items: center; gap: 8px; font-size: .72rem; color: #cbd5e1; margin-bottom: 2px; }
.vz-msg-head strong { color: #fff; }
.vz-msg-head span { margin-left: auto; opacity: .7; }
.vz-msg-del { border: 0; background: transparent; color: #fca5a5; cursor: pointer; padding: 0 2px; }
.vz-msg-text { white-space: pre-wrap; word-break: break-word; font-size: .88rem; color: #f8fafc; }
.vz-chat-form { display: flex; gap: 6px; padding: 10px; border-top: 1px solid rgba(255,255,255,.06); }
.vz-chat-form input { flex: 1; min-width: 0; border-radius: 12px; border: 1px solid rgba(255,255,255,.14); background: #111827; color: #fff; padding: 10px 12px; font: inherit; }
.vz-chat-form input:disabled { opacity: .5; }
.vz-ctl { position: relative; }
.vz-ctl[data-unread]:not([data-unread=""])::after { content: attr(data-unread); position: absolute; top: 2px; right: 8px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 999px; background: #dc2626; color: #fff; font-size: .68rem; font-weight: 800; display: grid; place-items: center; }
@media (max-width: 760px) {
  .vz-chat { position: fixed; inset: 0 0 64px 0; z-index: 820; width: auto; }
  .vz-pip { width: 104px; bottom: 54px; right: 12px; }
  .vz-bar .vz-chip { font-size: .74rem; padding: 4px 10px; }
  .vz-doc { padding: 0 6px; }
}

/* Salle v3 : tableau le plus grand possible — informations et vignettes dans la barre du haut,
   outils en colonne à gauche sur ordinateur, commandes compactes */
.vz-top { flex-wrap: wrap; row-gap: 6px; }
.vz-brand { flex: 0 1 auto; }
.vz-ctx { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.vz-ctx:empty { display: none; }
.vz-ctx .vz-chip { box-shadow: none; padding: 5px 12px; font-size: .78rem; }
.vz-ctx .vz-pill { padding: 5px 12px; font-size: .78rem; }
.vz-top .vz-people { flex: 1; min-width: 140px; padding: 0; }
.vz-pip { bottom: 12px; }
.vz-controls { padding-top: 6px; padding-bottom: calc(6px + env(safe-area-inset-bottom)); }
.vz-ctl { padding: 6px 10px; border-radius: 14px; }
.vz-ctl-ic { font-size: 1.15rem; }
@media (min-width: 900px) {
  .vz-area { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 10px; }
  .vz-area > .vz-board-box { grid-column: 2; grid-row: 1; }
  .vz-area > .vz-board-box:only-child { grid-column: 1 / -1; }
  .vz-area > .vz-rotate { display: none; }
  .vz-area > .vz-tools { grid-column: 1; grid-row: 1; flex-direction: column; flex-wrap: wrap; align-content: flex-start; justify-content: flex-start; align-items: stretch; max-height: 100%; padding: 6px; gap: 2px; }
  .vz-area > .vz-tools .vz-tool-group { flex-direction: column; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.08); padding: 4px 0; }
  .vz-area > .vz-tools .vz-tool-group:last-child { border-bottom: 0; }
  .vz-area > .vz-tools .vz-tool-end { margin-left: 0; }
  .vz-area > .vz-tools .vz-pill { white-space: normal; width: 76px; padding: 8px 6px; font-size: .72rem; line-height: 1.15; }
  .vz-area > .vz-tools .vz-doc span { display: none; }
  .vz-area > .vz-tools .vz-swatch { margin: 3px auto; }
}
@media (max-width: 760px) {
  .vz-top .vz-people { order: 5; flex-basis: 100%; }
  .vz-ctx { order: 4; }
}

/* ---------- Visio sur téléphone ---------- */
/* Portrait : barre du haut compacte, outils sur une ligne qui défile, tableau en haut */
@media (max-width: 760px) and (orientation: portrait) {
  .vz-top { padding: 6px 8px; gap: 6px; }
  .vz-brand { flex: 1 1 60%; }
  .vz-brand img { width: 28px; height: 28px; border-radius: 8px; }
  .vz-title { font-size: .9rem; }
  .vz-sub { font-size: .72rem; gap: 5px; }
  .vz-ctx { order: 4; max-width: 55%; flex-wrap: nowrap; }
  .vz-ctx .vz-chip, .vz-ctx .vz-pill { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; font-size: .72rem; padding: 4px 10px; }
  .vz-top .vz-people { order: 5; flex: 1 1 0; flex-basis: 0; min-width: 0; }
  .vz-person { font-size: .7rem; padding: 2px 8px 2px 2px; }
  .vz-person-av { width: 22px; height: 22px; flex-basis: 22px; }
  .vz-stage { padding: 6px; gap: 6px; }
  .vz-area { gap: 6px; }
  .vz-area > .vz-tools { flex-wrap: nowrap; overflow-x: auto; justify-content: flex-start; padding: 4px; gap: 2px; border-radius: 12px; scrollbar-width: none; }
  .vz-area > .vz-tools .vz-tool-group { padding: 0 2px; flex: 0 0 auto; }
  .vz-area > .vz-tools .vz-tool-end { margin-left: 0; }
  .vz-area > .vz-tools .vz-pill { padding: 7px 10px; font-size: .72rem; }
  .vz-area .vz-tools .vz-doc span { display: none; }
  .vz-rotate { padding: 4px 8px; font-size: .72rem; border-radius: 10px; }
  .vz-area .vz-board-box { align-items: flex-start; }
  .vz-pip { width: 96px; right: 8px; bottom: 8px; }
}
/* Paysage (téléphone tenu à l'horizontale) : tout pour le tableau — boutons en colonne à droite,
   outils en colonne à gauche, barre du haut fine, panneaux par-dessus */
@media (orientation: landscape) and (max-height: 520px) {
  .vz { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto minmax(0, 1fr); }
  .vz-top { grid-column: 1; grid-row: 1; padding: 4px 8px; gap: 8px; flex-wrap: nowrap; }
  .vz-brand img { width: 26px; height: 26px; border-radius: 7px; }
  .vz-title { font-size: .82rem; max-width: 26vw; }
  .vz-sub { font-size: .68rem; gap: 5px; }
  .vz-ctx { flex-wrap: nowrap; min-width: 0; }
  .vz-ctx .vz-chip, .vz-ctx .vz-pill { white-space: nowrap; font-size: .7rem; padding: 3px 9px; }
  .vz-top .vz-people { min-width: 60px; }
  .vz-person { font-size: .68rem; padding: 2px 8px 2px 2px; }
  .vz-person-av { width: 20px; height: 20px; flex-basis: 20px; font-size: .6rem; }
  .vz-icon { padding: 5px 9px; }
  .vz-hide-sm { display: none; }
  .vz-main { grid-column: 1; grid-row: 2; }
  .vz-controls { grid-column: 2; grid-row: 1 / span 2; flex-direction: column; justify-content: center; gap: 6px; padding: 6px calc(6px + env(safe-area-inset-right)) 6px 6px; border-top: 0; border-left: 1px solid rgba(255,255,255,.06); overflow-y: auto; }
  .vz-ctl { min-width: 0; width: 50px; flex: 0 0 auto; padding: 7px 2px; border-radius: 12px; }
  .vz-ctl-lb { display: none; }
  .vz-ctl-leave { margin-left: 0; margin-top: 4px; }
  .vz-ctl[data-unread]:not([data-unread=""])::after { top: -2px; right: -2px; }
  .vz-stage { padding: 4px 6px 6px; }
  .vz-area, .vz-editor { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); gap: 6px; }
  .vz-area > .vz-board-box, .vz-editor > .vz-board-box { grid-column: 2; grid-row: 1; }
  .vz-area > .vz-board-box:only-child { grid-column: 1 / -1; }
  .vz-rotate { display: none !important; }
  .vz-area > .vz-tools, .vz-editor > .vz-tools { grid-column: 1; grid-row: 1; flex-direction: column; flex-wrap: wrap; align-content: flex-start; justify-content: flex-start; align-items: stretch; max-height: 100%; padding: 3px; gap: 0; border-radius: 12px; }
  .vz-area > .vz-tools .vz-tool-group, .vz-editor > .vz-tools .vz-tool-group { flex-direction: column; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.08); padding: 2px 0; gap: 0; }
  .vz-area > .vz-tools .vz-tool-group:last-child, .vz-editor > .vz-tools .vz-tool-group:last-child { border-bottom: 0; }
  .vz-area > .vz-tools .vz-tool-end, .vz-editor > .vz-tools .vz-tool-end { margin-left: 0; }
  .vz-tools .vz-tool, .vz-tools .vz-size { min-width: 34px; height: 32px; font-size: 1rem; }
  .vz-tools .vz-swatch { width: 24px; height: 24px; margin: 3px auto; }
  .vz-tools .vz-pill { white-space: normal; width: 62px; padding: 6px 4px; font-size: .64rem; line-height: 1.1; }
  .vz-tools .vz-doc span { display: none; }
  .vz-editor { padding: 6px; }
  .vz-pip { width: 92px; right: 6px; bottom: 6px; }
  .vz-side.vz-side-open { position: fixed; right: 0; top: 0; bottom: 0; z-index: 800; width: min(360px, 62vw); box-shadow: -10px 0 30px rgba(0,0,0,.5); }
  .vz-chat { position: fixed; top: 0; bottom: 0; right: 64px; z-index: 820; width: min(360px, 60vw); }
}
@media (max-width: 760px) and (orientation: portrait) {
  .vz-area > .vz-tools { order: 1; }
  .vz-area > .vz-rotate { order: 2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .vz-area > .vz-board-box { order: 3; }
  .vz-area > .vz-pages { order: 4; margin-right: 64px; } /* la pastille de la caméra reste à droite */
}
.vz-pip.vz-pip-small { width: 52px; height: 52px; aspect-ratio: 1; border-radius: 50%; }
/* Dans la salle de visio, les fenêtres (présence, tableau d'un élève, confirmations) et les messages
   passent toujours au-dessus des panneaux (élèves, discussion, tableau plein écran) */
.vz-body .modal-backdrop { z-index: 1100; }
.vz-body .toast-container { z-index: 1200; }
/* « Lire en grand » : document 4K du tableau en plein écran, avec zoom */
.vz-zoom { position: fixed; inset: 0; z-index: 1050; display: flex; flex-direction: column; background: #0b1220; color: #e5e7eb; }
.vz-zoom-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px calc(8px); padding-top: calc(8px + env(safe-area-inset-top)); border-bottom: 1px solid rgba(255,255,255,.08); background: #111827; }
.vz-zoom-bar strong { flex: 1; min-width: 120px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #fff; }
.vz-zoom-bar .vz-mini { min-width: 36px; font-size: 1rem; padding: 6px 10px; }
.vz-zoom-val { min-width: 52px; text-align: center; font-weight: 700; font-size: .85rem; }
.vz-zoom-body { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; padding: 8px; }
.vz-zoom-canvas { display: block; margin: 0 auto; background: #fff; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.5); }
.vz-frames { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.vz-frame { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; cursor: pointer; font-weight: 600; }
.vz-frame:has(input:checked) { border-color: var(--primary, #2563eb); background: rgba(37, 99, 235, .08); }
/* Panneau des élèves par-dessus l'écran (téléphone / tablette) : fermeture toujours possible */
.vz-side-head { flex-wrap: wrap; }
.vz-side-actions { gap: 6px; }
.vz-side-close { display: none; padding: 6px 12px; font-size: .78rem; }
.vz-scrim { position: fixed; inset: 0; z-index: 790; background: rgba(2, 6, 23, .55); }
@media (max-width: 999px) {
  .vz-side.vz-side-open { position: fixed; right: 0; top: 0; bottom: 0; z-index: 800; width: min(380px, 88vw); box-shadow: -10px 0 30px rgba(0,0,0,.5);
    padding-top: calc(12px + env(safe-area-inset-top)); padding-bottom: calc(12px + env(safe-area-inset-bottom)); padding-right: calc(12px + env(safe-area-inset-right)); }
  .vz-side-close { display: inline-flex; margin-left: auto; }
  .vz-side-head { position: sticky; top: 0; z-index: 2; background: #0f172a; padding: 4px 0 8px; }
}
.vz-side-head .vz-side-close { background: #dc2626; color: #fff; font-weight: 800; }
.vz-zoom-hint { text-align: center; font-size: .78rem; font-weight: 600; color: #bfdbfe; background: rgba(37, 99, 235, .18); padding: 6px 10px; transition: opacity .6s; }
.vz-zoom-hint.vz-fade { opacity: 0; height: 0; padding: 0; overflow: hidden; }
.vz-zoom { touch-action: none; }
.vz-zoom-body { touch-action: pan-x pan-y; overscroll-behavior: contain; }
.vz-board[data-ro="1"] { cursor: zoom-in; }
/* Écrire sur le document en grand */
.vz-zoom-tools { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 10px; background: #0f172a; border-bottom: 1px solid rgba(255,255,255,.08); }
.vz-zoom-tools .vz-tools { padding: 4px; gap: 4px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.vz-zoom-tools .vz-tool, .vz-zoom-tools .vz-size { min-width: 36px; height: 36px; }
.vz-zoom-tools .vz-swatch { width: 26px; height: 26px; }
.vz-zoom-modes { display: flex; gap: 6px; }
.vz-zoom-modes .vz-pill { padding: 7px 12px; font-size: .8rem; }
.vz-zoom-writing .vz-zoom-canvas { touch-action: none; cursor: crosshair; }
.vz-zoom-writing .vz-zoom-body { touch-action: none; }
@media (orientation: landscape) and (max-height: 520px) {
  .vz-zoom-tools { padding: 3px 8px; }
  .vz-zoom-bar { padding: 4px 10px; }
  .vz-zoom-tools .vz-tool, .vz-zoom-tools .vz-size { min-width: 32px; height: 30px; }
}
/* Tableau en plein écran : toute la surface, zoom et déplacement à deux doigts */
.vz-zoom .vz-zoom-body { padding: 0; overflow: hidden; touch-action: none; position: relative; }
.vz-focus-canvas { display: block; touch-action: none; cursor: crosshair; }
.vz-zoom .vz-zoom-tools .vz-tools { justify-content: flex-start; }
.vz-fs { font-size: 1.2rem; }
/* Plein écran, téléphone à l'horizontale : outils en colonne à gauche, zoom / fermer en pastille,
   le tableau prend toute la hauteur */
@media (orientation: landscape) and (max-height: 520px) {
  .vz-zoom { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: minmax(0, 1fr); }
  .vz-zoom-bar { position: absolute; top: 6px; right: calc(6px + env(safe-area-inset-right)); z-index: 3; padding: 4px 6px; gap: 4px; border: 0; border-radius: 14px; background: rgba(17, 24, 39, .88); box-shadow: 0 6px 18px rgba(0,0,0,.4); flex-wrap: nowrap; }
  .vz-zoom-bar strong { display: none; }
  .vz-zoom-bar .vz-mini { min-width: 32px; padding: 5px 8px; font-size: .9rem; }
  .vz-zoom-bar .vz-pill { padding: 5px 10px; font-size: .74rem; }
  .vz-zoom-val { min-width: 42px; font-size: .74rem; }
  .vz-zoom-tools { grid-column: 1; grid-row: 1; padding: 4px calc(4px) 4px calc(4px + env(safe-area-inset-left)); border-bottom: 0; border-right: 1px solid rgba(255,255,255,.08); overflow-y: auto; }
  .vz-zoom-tools .vz-tools { flex-direction: column; flex-wrap: wrap; align-content: flex-start; max-height: 100%; padding: 2px; gap: 0; overflow: visible; }
  .vz-zoom-tools .vz-tool-group { flex-direction: column; border-right: 0; border-bottom: 1px solid rgba(255,255,255,.08); padding: 2px 0; gap: 0; }
  .vz-zoom-tools .vz-tool-group:last-child { border-bottom: 0; }
  .vz-zoom-tools .vz-tool, .vz-zoom-tools .vz-size { min-width: 34px; height: 30px; }
  .vz-zoom-tools .vz-swatch { width: 24px; height: 24px; margin: 3px auto; }
  .vz-zoom-hint { position: absolute; left: 50%; bottom: 8px; transform: translateX(-50%); z-index: 3; border-radius: 999px; white-space: nowrap; box-shadow: 0 6px 18px rgba(0,0,0,.35); }
  .vz-zoom .vz-zoom-body { grid-column: 2; grid-row: 1; }
  .vz-zoom-ro .vz-zoom-body { grid-column: 1 / -1; }
}
/* Portrait / petit écran : barre du haut plus compacte */
@media (max-width: 600px) {
  .vz-zoom-bar strong { font-size: .85rem; }
  .vz-zoom-bar { padding: 6px 8px; gap: 6px; }
}
/* Accueil sur téléphone / tablette : « Se connecter » toujours visible à côté de « S'inscrire » */
@media (max-width: 900px) {
  .nav-actions .btn-outline[data-guest] { display: inline-flex; }
}
@media (max-width: 600px) {
  .lp-nav .container { gap: 8px; }
  .lp-nav .nav-actions { gap: 6px; }
  .lp-nav .nav-actions .btn-sm { padding: 7px 11px; font-size: .8rem; white-space: nowrap; }
  .lp-nav [data-theme-toggle] { display: none; }
  .lp-nav.open [data-theme-toggle] { display: inline-grid; }
}
@media (max-width: 400px) {
  .lp-nav .brand span { display: none; }
  .lp-nav .nav-actions .btn-sm { padding: 7px 9px; font-size: .76rem; }
}
@media (max-width: 600px) { .lp-nav .brand span { font-size: .95rem; } .lp-nav .brand img { width: 34px; height: 34px; } }
@media (max-width: 520px) { .lp-nav .brand span { display: none; } }
.recovery-code { font-size: 1.6rem; font-weight: 800; letter-spacing: .12em; text-align: center; padding: 16px; margin: 12px 0; border: 2px dashed var(--primary, #2563eb); border-radius: 14px; background: rgba(37, 99, 235, .06); user-select: all; }

/* Zoom pour tous dans la salle : bouton sur le tableau, commandes sur l'écran partagé / la caméra */
.vz-board-box { position: relative; overflow: hidden; }
.vz-stage-zoom-btn { position: absolute; top: 8px; left: 8px; z-index: 3; border: 0; border-radius: 999px; padding: 8px 14px; font: 700 .85rem var(--font); color: #fff; background: rgba(15, 23, 42, .78); box-shadow: 0 6px 18px rgba(0, 0, 0, .3); cursor: pointer; backdrop-filter: blur(6px); }
.vz-stage-zoom-btn:hover { background: rgba(37, 99, 235, .9); }
.vz-stage-zoom { position: absolute; right: 10px; bottom: 10px; z-index: 3; display: flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: rgba(15, 23, 42, .78); color: #fff; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); backdrop-filter: blur(6px); }
.vz-stage-zoom button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font: 700 1.05rem var(--font); cursor: pointer; }
.vz-stage-zoom button:hover { background: rgba(37, 99, 235, .9); }
.vz-stage-zoom span { min-width: 48px; text-align: center; font-size: .8rem; font-weight: 700; }
.vz-board-box video.vz-screen { transform-origin: center center; transition: transform .05s linear; }
.vz-board-box.vz-zoomed { cursor: grab; }

/* Indicateur de connexion de la salle (réseau faible, reconnexion) */
.vz-net { margin-left: 6px; padding: 1px 8px; border-radius: 999px; font-size: .72rem; font-weight: 700; color: #fde68a; background: rgba(245, 158, 11, .18); white-space: nowrap; }

/* Visio : bande des pages d'un document (glisser pour voir les pages, toucher pour afficher) */
.vz-pages { display: flex; align-items: center; gap: 6px; padding: 6px 8px; margin-top: 6px; border-radius: 14px; background: rgba(15, 23, 42, .72); color: #e5e7eb; flex-shrink: 0; }
.vz-pages.hidden { display: none; }
.vz-pstrip { flex: 1; min-width: 0; display: flex; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity; padding: 2px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; touch-action: pan-x; }
.vz-pthumb { position: relative; flex: 0 0 auto; width: 58px; height: 74px; padding: 0; border: 2px solid transparent; border-radius: 8px; background: #fff; overflow: hidden; cursor: pointer; scroll-snap-align: center; }
.vz-pthumb canvas { width: 100%; height: 100%; object-fit: contain; display: block; }
.vz-pthumb span { position: absolute; left: 3px; bottom: 3px; min-width: 18px; padding: 0 4px; border-radius: 6px; font: 700 .7rem var(--font); color: #fff; background: rgba(15, 23, 42, .75); }
.vz-pthumb.active { border-color: #3b82f6; box-shadow: 0 0 0 2px rgba(59, 130, 246, .45); }
.vz-pthumb.inked::after { content: "✍"; position: absolute; right: 3px; top: 2px; font-size: .75rem; }
.vz-pthumb.loading { opacity: .55; }
.vz-pnav { flex: 0 0 auto; width: 36px; height: 36px; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .12); color: #fff; font-size: .95rem; cursor: pointer; }
.vz-pnav:disabled { opacity: .35; cursor: default; }
.vz-pcount { flex: 0 0 auto; font-size: .78rem; font-weight: 700; white-space: nowrap; padding: 0 4px; }
.vz-zoom-pager { display: inline-flex; align-items: center; gap: 4px; }
.vz-zoom-pager.hidden { display: none; }
.vz-zoom-page { font-weight: 700; font-size: .85rem; min-width: 46px; text-align: center; }
@media (max-width: 600px) { .vz-pthumb { width: 46px; height: 60px; } .vz-pcount { display: none; } }

/* Visio : document en préparation (reste affiché jusqu'à ce que la page apparaisse) */
.vz-doc-busy { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); z-index: 4; padding: 12px 20px; border-radius: 999px; background: rgba(15, 23, 42, .85); color: #fff; font: 700 .95rem var(--font); box-shadow: 0 10px 30px rgba(0, 0, 0, .35); animation: vzPulse 1.4s ease-in-out infinite; white-space: nowrap; }
@keyframes vzPulse { 50% { opacity: .65; } }
