/* =====================================================================
   Quiz SES — feuille de style
   ===================================================================== */

:root {
  --bg: #f5f3fb;
  --surface: #ffffff;
  --surface-2: #efecf8;
  --surface-3: #e6e1f5;
  --line: #e1dcf0;
  --ink: #1c1631;
  --ink-2: #4a4363;
  --muted: #7a7392;
  --accent: #5b2ee0;
  --accent-hover: #4a21c7;
  --accent-ink: #ffffff;
  --accent-soft: #ece6ff;
  --good: #15803d;
  --good-soft: #dcfce7;
  --bad: #dc2626;
  --bad-soft: #fee2e2;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --info: #1d4ed8;
  --info-soft: #dbeafe;
  --shadow: 0 1px 2px rgba(28, 22, 49, .06), 0 8px 24px rgba(28, 22, 49, .07);
  --shadow-lg: 0 20px 60px rgba(28, 22, 49, .25);
  --radius: 16px;
  --radius-sm: 10px;
  --t-red: #e21b3c;
  --t-blue: #1368ce;
  --t-yellow: #c98f00;
  --t-green: #26890c;
  --t-purple: #864cbf;
  --t-teal: #0a8f8f;
  --game-bg: #3a1c8c;
  --game-bg-2: #24105e;
  --font-display: ui-rounded, "SF Pro Rounded", "Nunito", "Segoe UI Variable Display", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --side-w: 244px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #110e1b;
    --surface: #1a1628;
    --surface-2: #231e35;
    --surface-3: #2c2642;
    --line: #342c4d;
    --ink: #f1eefa;
    --ink-2: #cbc4e0;
    --muted: #958dae;
    --accent: #8b6cff;
    --accent-hover: #a18aff;
    --accent-ink: #120c2a;
    --accent-soft: #2a2150;
    --good: #4ade80;
    --good-soft: #0f2e1c;
    --bad: #f87171;
    --bad-soft: #3a1518;
    --warn: #fbbf24;
    --warn-soft: #3a2a0a;
    --info: #60a5fa;
    --info-soft: #0f2340;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #110e1b;
  --surface: #1a1628;
  --surface-2: #231e35;
  --surface-3: #2c2642;
  --line: #342c4d;
  --ink: #f1eefa;
  --ink-2: #cbc4e0;
  --muted: #958dae;
  --accent: #8b6cff;
  --accent-hover: #a18aff;
  --accent-ink: #120c2a;
  --accent-soft: #2a2150;
  --good: #4ade80;
  --good-soft: #0f2e1c;
  --bad: #f87171;
  --bad-soft: #3a1518;
  --warn: #fbbf24;
  --warn-soft: #3a2a0a;
  --info: #60a5fa;
  --info-soft: #0f2340;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 8px 24px rgba(0, 0, 0, .3);
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
/* #app (point de montage de toute l'appli, cf. core.js QZ.root) manquait dans la chaîne de hauteurs :
   sans lui, le "min-height:100%" de .auth et .shell ne trouve pas de hauteur DÉFINIE à cent-pourcenter
   et retombe à la hauteur du contenu — sur un écran plus haut que le contenu (ex. connexion), le panneau
   violet s'arrête net et laisse voir le fond de la page en dessous, au lieu d'aller jusqu'en bas.
   "height" et non "min-height" : un min-height seul ne compte pas comme une hauteur définie pour la
   résolution des pourcentages des enfants (.auth/.shell min-height:100% resterait "auto"). Comme pour
   html/body juste au-dessus, ça ne bloque pas le défilement des pages longues (overflow visible par
   défaut : le contenu qui dépasse continue de pousser la hauteur réelle de la page). */
#app { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 15px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  -webkit-text-size-adjust: 100%;
}
img { max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3, h4 { font-family: var(--font-display); line-height: 1.15; margin: 0; text-wrap: balance; letter-spacing: -.01em; }
h1 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); font-weight: 800; }
h2 { font-size: 1.25rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 700; }
p { margin: 0; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.nowrap { white-space: nowrap; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grow { flex: 1 1 auto; min-width: 0; }
.icon { width: 20px; height: 20px; flex: none; display: inline-block; vertical-align: middle; }
.icon-sm { width: 16px; height: 16px; }
.icon-lg { width: 28px; height: 28px; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 42px; padding: 0 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 600 .95rem/1 var(--font); cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s, box-shadow .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover { background: var(--surface-2); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 0 color-mix(in srgb, var(--accent) 60%, #000); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-danger { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 85%, #000); }
.btn-good { background: var(--good); border-color: var(--good); color: #fff; }
.btn-warn { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 40%, transparent); color: var(--warn); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-2); }
.btn-sm { min-height: 34px; padding: 0 12px; font-size: .85rem; border-radius: 10px; }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 1.05rem; border-radius: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 38px; min-height: 38px; padding: 0; }
.btn-icon.btn-sm { width: 32px; min-height: 32px; }

/* ---------- Forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > label, .label { font-weight: 600; font-size: .88rem; color: var(--ink-2); }
.hint { font-size: .8rem; color: var(--muted); }
.input, .select, .textarea {
  width: 100%; min-height: 44px; padding: 10px 12px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  font: 1rem/1.35 var(--font);
  transition: border-color .15s, box-shadow .15s;
}
.textarea { min-height: 90px; resize: vertical; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input-code { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; letter-spacing: .25em; text-transform: uppercase; text-align: center; font-size: 1.4rem; font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 14px; }
.check { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.check input { width: 20px; height: 20px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; pointer-events: none; }
.switch .track { flex: none; width: 44px; height: 26px; border-radius: 99px; background: var(--surface-3); position: relative; transition: background .15s; margin-top: 1px; }
.switch .track::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: transform .15s; }
.switch input:checked + .track { background: var(--accent); }
.switch input:checked + .track::after { transform: translateX(18px); }
.switch input:focus-visible + .track { outline: 3px solid var(--accent-soft); }
.switch .txt { display: flex; flex-direction: column; gap: 2px; }
.switch .txt b { font-weight: 600; }
.error-box { background: var(--bad-soft); color: var(--bad); border-radius: 12px; padding: 10px 14px; font-weight: 600; font-size: .92rem; }
.info-box { background: var(--info-soft); color: var(--info); border-radius: 12px; padding: 12px 14px; font-size: .92rem; }
.warn-box { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 12px 14px; font-size: .92rem; }

/* ---------- Surfaces ---------- */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); min-width: 0; }
.card-flat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; min-width: 0; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.section-title { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; }
.divider { height: 1px; background: var(--line); margin: 4px 0; }
.empty { text-align: center; padding: 36px 16px; color: var(--muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .icon { width: 40px; height: 40px; opacity: .6; }

/* ---------- Pills / chips ---------- */
.pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; white-space: nowrap; background: var(--surface-2); color: var(--ink-2); }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.pill-good { background: var(--good-soft); color: var(--good); }
.pill-bad { background: var(--bad-soft); color: var(--bad); }
.pill-warn { background: var(--warn-soft); color: var(--warn); }
.pill-info { background: var(--info-soft); color: var(--info); }
.pill-accent { background: var(--accent-soft); color: var(--accent); }
.pill-live .dot { animation: pulse 1.4s infinite; }
@keyframes pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 99px; background: var(--bad); color: #fff; font-size: .72rem; font-weight: 800; }
.note { font-family: var(--font-display); font-weight: 800; font-variant-numeric: tabular-nums; }
.note-good { color: var(--good); }
.note-mid { color: var(--warn); }
.note-bad { color: var(--bad); }

/* ---------- Tables ---------- */
.tbl-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
table.tbl { width: 100%; border-collapse: collapse; font-size: .92rem; }
.tbl th, .tbl td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line); vertical-align: middle; }
.tbl th { font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 700; background: var(--surface-2); white-space: nowrap; }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl tbody tr.clickable { cursor: pointer; }
.tbl tbody tr.clickable:hover td { background: var(--surface-2); }
.tbl td.num, .tbl th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- Toasts & modals ---------- */
.toasts { position: fixed; z-index: 2000; left: 50%; transform: translateX(-50%); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; width: min(440px, calc(100vw - 32px)); pointer-events: none; }
.toast { pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 14px; background: var(--ink); color: var(--bg); box-shadow: var(--shadow-lg); font-weight: 600; font-size: .92rem; animation: toast-in .25s ease; }
.toast.bad { background: var(--bad); color: #fff; }
.toast.good { background: var(--good); color: #fff; }
.toast.alert { background: #7f1d1d; color: #fff; border: 2px solid #f87171; }
.toast .grow { display: flex; flex-direction: column; gap: 2px; }
.toast small { font-weight: 500; opacity: .85; }
@keyframes toast-in { from { transform: translateY(12px); opacity: 0; } }
.modal-back { position: fixed; inset: 0; z-index: 1500; background: rgba(16, 10, 36, .55); display: grid; place-items: center; padding: 16px; animation: fade .15s; overflow-y: auto; }
@keyframes fade { from { opacity: 0; } }
.modal { width: min(560px, 100%); max-height: calc(100vh - 32px); overflow: auto; background: var(--surface); color: var(--ink); border-radius: 20px; box-shadow: var(--shadow-lg); display: flex; flex-direction: column; animation: pop .18s ease; }
.modal.wide { width: min(860px, 100%); }
@keyframes pop { from { transform: scale(.96); opacity: 0; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 20px 10px; }
.modal-body { padding: 8px 20px 16px; display: flex; flex-direction: column; gap: 14px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px 18px; border-top: 1px solid var(--line); flex-wrap: wrap; position: sticky; bottom: 0; background: var(--surface); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--surface-3); border-top-color: var(--accent); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { display: grid; place-items: center; padding: 60px 16px; }

/* ---------- Auth ---------- */
.auth { min-height: 100%; display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); }
.auth-brand { position: relative; overflow: hidden; background: radial-gradient(120% 90% at 10% 0%, #5a2fd6 0%, var(--game-bg) 45%, var(--game-bg-2) 100%); color: #fff; padding: 48px clamp(24px, 5vw, 64px); display: flex; flex-direction: column; justify-content: space-between; gap: 32px; }
.auth-brand h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3.4rem); line-height: 1.02; letter-spacing: -.02em; max-width: 12ch; }
.auth-brand p { max-width: 42ch; opacity: .85; font-size: 1.05rem; }
.brand-mark { display: flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 800; font-size: 1.15rem; }
.brand-logo { width: 38px; height: 38px; border-radius: 11px; background: #fff; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; padding: 6px; }
.brand-logo i { border-radius: 3px; }
.brand-logo i:nth-child(1) { background: var(--t-red); }
.brand-logo i:nth-child(2) { background: var(--t-blue); }
.brand-logo i:nth-child(3) { background: var(--t-yellow); }
.brand-logo i:nth-child(4) { background: var(--t-green); }
.auth-shapes { display: grid; grid-template-columns: repeat(4, 64px); gap: 14px; }
.auth-shapes span { width: 64px; height: 64px; border-radius: 16px; display: grid; place-items: center; box-shadow: 0 6px 0 rgba(0,0,0,.2); }
.auth-shapes svg { width: 30px; height: 30px; fill: #fff; }
.auth-chart { position: absolute; right: -10px; bottom: 90px; width: 58%; opacity: .16; pointer-events: none; }
.auth-panel {
  display: grid; place-items: center; padding: 40px 20px;
  background: radial-gradient(120% 100% at 100% 100%, color-mix(in srgb, var(--accent) 10%, transparent) 0%, transparent 55%);
}
.auth-box {
  width: min(420px, 100%); display: flex; flex-direction: column; gap: 18px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px;
  padding: 32px; box-shadow: var(--shadow-lg);
}
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 14px; background: var(--surface-2); }
.tab { flex: 1; min-height: 40px; white-space: nowrap; padding: 0 10px; border: 0; background: transparent; border-radius: 11px; font: 700 .92rem var(--font); color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; }
.tab.active { background: var(--accent); color: var(--accent-ink); box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 45%, transparent); }
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 28px 20px 26px; gap: 16px; }
  .auth-brand h1 { font-size: 2rem; max-width: none; }
  .auth-shapes, .auth-chart { display: none; }
  .auth-panel { padding: 24px 16px 40px; place-items: start center; background: none; }
  .auth-box { padding: 24px 20px; border-radius: var(--radius); }
}

/* ---------- App shell ---------- */
.shell { min-height: 100%; display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: var(--surface); border-right: 1px solid var(--line); padding: 18px 14px; display: flex; flex-direction: column; gap: 18px; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.nav-link { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 12px; color: var(--ink-2); font-weight: 600; text-decoration: none; position: relative; }
.nav-link:hover { background: var(--surface-2); text-decoration: none; color: var(--ink); }
.nav-link.active { background: var(--accent-soft); color: var(--accent); }
.nav-link .badge { margin-left: auto; }
.nav-link .live-dot { margin-left: auto; width: 9px; height: 9px; border-radius: 50%; background: var(--bad); animation: pulse 1.2s infinite; }
.side-foot { margin-top: auto; display: flex; flex-direction: column; gap: 8px; }
.who { display: flex; align-items: center; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface-2); }
.avatar { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-weight: 800; color: #fff; background: var(--accent); flex: none; font-size: .9rem; }
.main { min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 60px; display: flex; flex-direction: column; gap: 22px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.page-head .sub { color: var(--muted); margin-top: 4px; }
.topbar { display: none; }
.bottom-nav { display: none; }
@media (max-width: 900px) {
  .shell { grid-template-columns: 1fr; }
  .side { display: none; }
  .topbar { display: flex; }
  .main { padding: 18px 16px 110px; }
  .bottom-nav { display: flex; }
}
/* Mise en forme de .topbar/.bottom-nav séparée du @media ci-dessus (qui ne bascule que leur "display") :
   l'espace élève (studentShell, cf. student.js) les force visibles à TOUTE largeur avec un style inline
   ("display:flex"), y compris sur desktop — il leur faut donc leur apparence complète en dehors du mobile. */
.topbar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 16px; background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.bottom-nav { position: fixed; z-index: 60; left: 0; right: 0; bottom: 0; background: var(--surface); border-top: 1px solid var(--line); padding: 6px 6px calc(6px + env(safe-area-inset-bottom, 0px)); justify-content: space-around; max-width: 480px; margin: 0 auto; border-radius: 18px 18px 0 0; box-shadow: 0 -4px 20px rgba(0,0,0,.08); }
.bottom-nav a { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: .68rem; font-weight: 700; color: var(--muted); padding: 6px 2px; border-radius: 10px; position: relative; text-decoration: none; }
.bottom-nav a.active { color: var(--accent); }
.bottom-nav a .badge { position: absolute; top: 0; right: 18%; }

/* ---------- Stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; flex-direction: column; gap: 4px; }
.stat .v { font-family: var(--font-display); font-size: 1.9rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1.1; }
.stat .k { color: var(--muted); font-size: .85rem; font-weight: 600; }
.stat.alert { border-color: color-mix(in srgb, var(--bad) 45%, transparent); background: var(--bad-soft); }
.stat.alert .v { color: var(--bad); }

/* ---------- Quiz cards (student + teacher lists) ---------- */
.qcards { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.qcard { position: relative; background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.qcard-top { padding: 18px 18px 14px; color: #fff; background: linear-gradient(135deg, #5a2fd6, var(--game-bg)); display: flex; flex-direction: column; gap: 10px; min-height: 118px; position: relative; overflow: hidden; }
.qcard-top.lvl-Seconde { background: linear-gradient(135deg, #1a7fe0, #1356b3); }
.qcard-top.lvl-Première { background: linear-gradient(135deg, #0f9d74, #0b6e55); }
.qcard-top.lvl-Terminale { background: linear-gradient(135deg, #6d35e8, #3a1c8c); }
.qcard-top h3 { font-size: 1.2rem; position: relative; }
.qcard-top .pill { background: rgba(255,255,255,.2); color: #fff; align-self: flex-start; }
.qcard-top .deco { position: absolute; right: -14px; bottom: -18px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; opacity: .22; transform: rotate(-12deg); }
.qcard-top .deco svg { width: 34px; height: 34px; fill: #fff; }
.qcard-body { padding: 14px 18px 18px; display: flex; flex-direction: column; gap: 12px; flex: 1; }
.qcard-meta { display: flex; flex-wrap: wrap; gap: 6px 14px; color: var(--muted); font-size: .85rem; font-weight: 600; }
.qcard-meta span { display: inline-flex; align-items: center; gap: 5px; }
.qcard-foot { margin-top: auto; display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; }

/* ---------- Quiz player (Kahoot style, single look by design) ---------- */
.game {
  position: fixed; inset: 0; z-index: 100; overflow: hidden;
  background: radial-gradient(120% 80% at 50% 0%, #4d25b8 0%, var(--game-bg) 45%, var(--game-bg-2) 100%);
  color: #fff; display: flex; flex-direction: column;
  padding: calc(10px + env(safe-area-inset-top, 0px)) 14px calc(12px + env(safe-area-inset-bottom, 0px));
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
  font-family: var(--font);
  color-scheme: light;
}
.game * { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.game input, .game textarea { -webkit-user-select: text; user-select: text; }
.game-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; max-width: 1100px; width: 100%; margin: 0 auto; }
.game-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 99px; background: rgba(255,255,255,.14); font-weight: 800; font-size: .88rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.game-chip.warn { background: #b91c1c; }
.game-progress { height: 6px; border-radius: 99px; background: rgba(255,255,255,.15); overflow: hidden; max-width: 1100px; width: 100%; margin: 10px auto 0; }
.game-progress i { display: block; height: 100%; background: #fff; border-radius: 99px; transition: width .4s ease; }
.game-stage { flex: 1; min-height: 0; display: flex; flex-direction: column; gap: 14px; max-width: 1100px; width: 100%; margin: 12px auto 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding-bottom: 8px; }
.qbox { position: relative; background: #fff; color: #1c1631; border-radius: 18px; padding: 18px 20px; box-shadow: 0 6px 0 rgba(0,0,0,.18); display: flex; gap: 16px; align-items: center; min-height: 92px; }
.qbox .qtext { flex: 1; min-width: 0; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.05rem, .9rem + 1vw, 1.6rem); line-height: 1.25; text-wrap: balance; overflow-wrap: anywhere; }
.qbox .qimg { max-height: 30vh; border-radius: 12px; object-fit: contain; pointer-events: none; }
.qmedia { display: flex; justify-content: center; }
.qmedia img { max-height: 32vh; border-radius: 14px; background: #fff; padding: 6px; pointer-events: none; -webkit-user-drag: none; }
.timer { position: relative; flex: none; width: 64px; height: 64px; }
.timer svg { width: 64px; height: 64px; transform: rotate(-90deg); }
.timer circle { fill: none; stroke-width: 7; }
.timer .bg { stroke: #ece6ff; }
.timer .fg { stroke: #5b2ee0; stroke-linecap: round; transition: stroke-dashoffset .25s linear, stroke .3s; }
.timer.hurry .fg { stroke: #e21b3c; }
.timer b { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-weight: 800; font-size: 1.35rem; color: #1c1631; font-variant-numeric: tabular-nums; }
.timer.hurry b { color: #e21b3c; animation: beat .5s infinite alternate; }
@keyframes beat { to { transform: scale(1.12); } }
.qhint { text-align: center; font-weight: 700; opacity: .85; font-size: .92rem; }
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; flex: 1; min-height: 0; align-content: stretch; }
.tiles.n3 .tile:last-child { grid-column: 1 / -1; }
.tile {
  position: relative; display: flex; align-items: center; gap: 14px; padding: 14px 18px; min-height: 76px;
  border: 0; border-radius: 16px; color: #fff; text-align: left; cursor: pointer;
  font: 800 clamp(.98rem, .9rem + .5vw, 1.3rem)/1.25 var(--font-display);
  box-shadow: 0 6px 0 rgba(0,0,0,.25); transition: transform .08s, box-shadow .08s, filter .15s, opacity .2s;
  -webkit-tap-highlight-color: transparent; overflow-wrap: anywhere;
}
.tile:active { transform: translateY(4px); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.tile .shape { flex: none; width: 34px; height: 34px; }
.tile .shape svg { width: 100%; height: 100%; fill: #fff; }
.tile.c0 { background: var(--t-red); }
.tile.c1 { background: var(--t-blue); }
.tile.c2 { background: var(--t-yellow); }
.tile.c3 { background: var(--t-green); }
.tile.c4 { background: var(--t-purple); }
.tile.c5 { background: var(--t-teal); }
.tile.c6 { background: #c2410c; }
.tile.c7 { background: #475569; }
.tile.selected { outline: 5px solid #fff; outline-offset: -5px; }
.tile.selected::after { content: ""; position: absolute; top: 10px; right: 10px; width: 26px; height: 26px; border-radius: 50%; background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231c1631' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5L20 7'/%3E%3C/svg%3E") center/16px no-repeat; }
.tiles.dim .tile:not(.selected) { opacity: .45; }
.tile.is-correct { outline: 5px solid #fff; outline-offset: -5px; }
.tile.is-wrong { filter: grayscale(.8) brightness(.7); }
.game-actions { display: flex; justify-content: center; gap: 12px; }
.btn-game { min-height: 56px; padding: 0 30px; border-radius: 14px; border: 0; background: #fff; color: #1c1631; font: 800 1.1rem var(--font-display); cursor: pointer; box-shadow: 0 5px 0 rgba(0,0,0,.25); display: inline-flex; align-items: center; gap: 10px; }
.btn-game:active { transform: translateY(3px); box-shadow: 0 2px 0 rgba(0,0,0,.25); }
.btn-game:disabled { opacity: .5; }
.btn-game.ghost { background: rgba(255,255,255,.14); color: #fff; }
.game-input { display: flex; flex-direction: column; gap: 12px; align-items: center; justify-content: center; flex: 1; }
.game-input input { width: min(560px, 100%); min-height: 64px; border-radius: 16px; border: 0; padding: 0 20px; font: 800 1.4rem var(--font-display); text-align: center; color: #1c1631; background: #fff; box-shadow: 0 6px 0 rgba(0,0,0,.2); }
.game-input input:focus { outline: 4px solid #ffd84d; }
.game-input .unit { font-weight: 800; font-size: 1.2rem; }
.order-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; width: min(640px, 100%); margin-inline: auto; }
.order-item { display: flex; align-items: center; gap: 10px; background: #fff; color: #1c1631; border-radius: 14px; padding: 10px 10px 10px 16px; font-weight: 800; box-shadow: 0 4px 0 rgba(0,0,0,.2); touch-action: none; }
.order-item .n { width: 30px; height: 30px; border-radius: 50%; background: #5b2ee0; color: #fff; display: grid; place-items: center; flex: none; font-size: .9rem; }
.order-item .t { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.order-item button { width: 42px; height: 42px; border-radius: 12px; border: 0; background: #ece6ff; color: #3a1c8c; cursor: pointer; display: grid; place-items: center; }
.order-item button:disabled { opacity: .3; }
.order-item.dragging { opacity: .6; transform: scale(1.02); }
.game-center { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 16px; padding: 12px; }
.game-center h2 { font-size: clamp(1.6rem, 1rem + 3vw, 2.8rem); }
.big-count { font-family: var(--font-display); font-weight: 800; font-size: clamp(5rem, 3rem + 10vw, 9rem); line-height: 1; animation: countpop .9s ease both; }
@keyframes countpop { 0% { transform: scale(.4); opacity: 0; } 30% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); } }
.fb { position: fixed; inset: 0; z-index: 120; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 16px; text-align: center; padding: 24px; color: #fff; animation: fade .2s; }
.fb.good { background: #26890c; }
.fb.bad { background: #c0162f; }
.fb.part { background: #c77700; }
.fb.neutral { background: var(--game-bg); }
.fb .fb-icon { width: 96px; height: 96px; border-radius: 50%; background: rgba(255,255,255,.2); display: grid; place-items: center; animation: countpop .5s ease both; }
.fb .fb-icon svg { width: 56px; height: 56px; }
.fb h2 { font-size: clamp(2rem, 1.4rem + 3vw, 3.2rem); }
.fb .pts { font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; background: rgba(0,0,0,.2); padding: 8px 18px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.fb .expl { max-width: 60ch; background: rgba(0,0,0,.18); padding: 12px 16px; border-radius: 14px; font-weight: 600; line-height: 1.45; }
.watermark { position: absolute; inset: -20%; z-index: 105; pointer-events: none; display: flex; flex-wrap: wrap; align-content: space-around; justify-content: space-around; transform: rotate(-24deg); opacity: .07; font-weight: 800; font-size: 15px; gap: 60px 90px; color: #fff; }
.watermark span { white-space: nowrap; }
.game-overlay { position: fixed; inset: 0; z-index: 200; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; color: #fff; }
.game-overlay .box { max-width: 520px; display: flex; flex-direction: column; align-items: center; gap: 16px; }
.game-overlay.lock { background: repeating-linear-gradient(45deg, #7f1d1d 0 22px, #991b1b 22px 44px); }
.game-overlay.shield { background: #120a2e; }
.game-overlay.warning { background: rgba(10, 5, 30, .88); }
.game-overlay.warning .box { background: #fff; color: #1c1631; border-radius: 22px; padding: 26px 22px; border-top: 10px solid #d89e00; }
.game-overlay .ring { width: 96px; height: 96px; border-radius: 50%; background: rgba(255,255,255,.14); display: grid; place-items: center; }
.game-overlay .ring svg { width: 52px; height: 52px; }
.game-overlay h2 { font-size: clamp(1.6rem, 1.2rem + 2vw, 2.4rem); }
.game-overlay p { font-size: 1.05rem; opacity: .95; }
.game-banner { position: fixed; left: 50%; top: calc(12px + env(safe-area-inset-top, 0px)); transform: translateX(-50%); z-index: 150; background: #b91c1c; color: #fff; padding: 10px 16px; border-radius: 14px; font-weight: 800; box-shadow: var(--shadow-lg); width: max-content; max-width: calc(100vw - 32px); text-align: center; animation: toast-in .2s; }
.rules { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.rules li { display: flex; gap: 12px; align-items: flex-start; background: rgba(255,255,255,.1); border-radius: 14px; padding: 12px 14px; text-align: left; font-weight: 600; }
.rules li .icon { margin-top: 1px; }
.start-card { width: min(620px, 100%); display: flex; flex-direction: column; gap: 16px; }
.start-card .check { background: rgba(255,255,255,.12); border-radius: 14px; padding: 14px; font-weight: 700; }
.podium { display: flex; align-items: flex-end; justify-content: center; gap: 10px; }
.podium .p { width: 96px; border-radius: 14px 14px 0 0; display: flex; flex-direction: column; align-items: center; justify-content: flex-start; padding: 10px 6px; font-weight: 800; text-align: center; gap: 4px; }
.podium .p1 { height: 150px; background: #d89e00; }
.podium .p2 { height: 115px; background: #94a3b8; }
.podium .p3 { height: 90px; background: #b45309; }
.podium .medal { font-family: var(--font-display); font-size: 1.6rem; }
@media (max-width: 640px) {
  .tiles { grid-template-columns: 1fr; gap: 10px; }
  .tiles.n3 .tile:last-child { grid-column: auto; }
  .tile { min-height: 60px; padding: 12px 14px; }
  .tile .shape { width: 26px; height: 26px; }
  .qbox { padding: 14px; gap: 12px; min-height: 0; }
  .timer, .timer svg { width: 54px; height: 54px; }
  .timer b { font-size: 1.15rem; }
}
@media (max-height: 560px) and (orientation: landscape) {
  .tiles { grid-template-columns: 1fr 1fr; }
  .tile { min-height: 48px; }
}

/* ---------- Live monitoring ---------- */
.live-layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 18px; align-items: start; }
@media (max-width: 1180px) { .live-layout { grid-template-columns: 1fr; } }
.live-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(270px, 1fr)); gap: 12px; }
.scard { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: flex; flex-direction: column; gap: 10px; position: relative; transition: border-color .2s, box-shadow .2s; }
.scard.st-locked { border-color: var(--bad); box-shadow: 0 0 0 3px var(--bad-soft); }
.scard.st-flash { animation: flash 1s 3; }
@keyframes flash { 50% { box-shadow: 0 0 0 6px color-mix(in srgb, var(--bad) 45%, transparent); } }
.scard-head { display: flex; align-items: center; gap: 10px; }
.scard-head .name { font-weight: 800; line-height: 1.2; }
.scard-head .sub { font-size: .78rem; color: var(--muted); display: flex; gap: 6px; align-items: center; }
.online { width: 10px; height: 10px; border-radius: 50%; background: var(--muted); flex: none; }
.online.on { background: #22c55e; box-shadow: 0 0 0 3px color-mix(in srgb, #22c55e 30%, transparent); }
.dots { display: flex; flex-wrap: wrap; gap: 4px; }
.dot { width: 16px; height: 16px; border-radius: 5px; background: var(--surface-3); position: relative; }
.dot.ok { background: #22c55e; }
.dot.ko { background: #ef4444; }
.dot.part { background: #f59e0b; }
.dot.done { background: var(--accent); }
.dot.to { background: #9ca3af; }
.dot.cx { background: repeating-linear-gradient(45deg, #111 0 3px, #ef4444 3px 6px); }
.dot.cur { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); animation: pulse 1s infinite; }
.qbar { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.qbar i { display: block; height: 100%; background: var(--accent); transition: width .5s linear; }
.qbar.hurry i { background: var(--bad); }
.scard-stats { display: flex; gap: 12px; flex-wrap: wrap; font-size: .8rem; color: var(--ink-2); font-weight: 600; }
.scard-stats span { display: inline-flex; gap: 4px; align-items: center; }
.scard-stats .bad { color: var(--bad); }
.scard-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.feed { display: flex; flex-direction: column; gap: 8px; max-height: 70vh; overflow-y: auto; }
.feed-item { display: flex; gap: 10px; padding: 10px; border-radius: 12px; background: var(--surface-2); font-size: .86rem; }
.feed-item.counted { background: var(--bad-soft); }
.feed-item .t { font-size: .74rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.feed-item .icon { color: var(--bad); }
.code-display { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 1.8rem; font-weight: 800; letter-spacing: .2em; background: var(--surface-2); padding: 4px 14px; border-radius: 12px; }
.chips-bar { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-filter { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); font-weight: 700; font-size: .88rem; cursor: pointer; color: var(--ink-2); }
.chip-filter.active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.chip-filter b { font-variant-numeric: tabular-nums; }

/* ---------- Results ---------- */
.hist { display: flex; align-items: flex-end; gap: 6px; height: 150px; padding-top: 8px; }
.hist .col { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; }
.hist .bar { width: 100%; border-radius: 6px 6px 2px 2px; background: var(--accent); min-height: 2px; }
.hist .col.low .bar { background: var(--bad); }
.hist .col.mid .bar { background: var(--warn); }
.hist .col.high .bar { background: var(--good); }
.hist .lbl { font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.hist .cnt { font-size: .75rem; font-weight: 700; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.meter { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; min-width: 60px; }
.meter i { display: block; height: 100%; border-radius: 99px; }
.qa { display: flex; flex-direction: column; gap: 10px; }
.qa-item { border: 1px solid var(--line); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.qa-item .dist { display: flex; flex-direction: column; gap: 6px; }
.qa-item .dist .r { display: grid; grid-template-columns: minmax(0, 1fr) 120px 36px; gap: 10px; align-items: center; font-size: .86rem; }
.qa-item .dist .r.correct span:first-child { font-weight: 700; color: var(--good); }
.answer-review { border: 1px solid var(--line); border-radius: 16px; padding: 16px; display: flex; flex-direction: column; gap: 10px; background: var(--surface); }
.answer-review.good { border-left: 6px solid var(--good); }
.answer-review.bad { border-left: 6px solid var(--bad); }
.answer-review.part { border-left: 6px solid var(--warn); }
.answer-review .qt { font-weight: 700; line-height: 1.4; }
.opt { display: flex; gap: 10px; align-items: flex-start; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); font-size: .92rem; }
.opt.right { background: var(--good-soft); color: var(--good); font-weight: 700; }
.opt.picked-wrong { background: var(--bad-soft); color: var(--bad); font-weight: 700; }
.opt .icon { margin-top: 1px; }
.expl { background: var(--info-soft); color: var(--info); border-radius: 12px; padding: 10px 12px; font-size: .9rem; }
.timeline { display: flex; flex-direction: column; gap: 0; border-left: 2px solid var(--line); margin-left: 8px; }
.timeline .ev { position: relative; padding: 6px 0 10px 18px; font-size: .88rem; }
.timeline .ev::before { content: ""; position: absolute; left: -7px; top: 10px; width: 12px; height: 12px; border-radius: 50%; background: var(--surface-3); border: 2px solid var(--surface); }
.timeline .ev.counted::before { background: var(--bad); }
.timeline .ev.teacher::before { background: var(--accent); }
.result-hero { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.big-note { font-family: var(--font-display); font-weight: 800; font-size: clamp(3rem, 2rem + 4vw, 4.5rem); line-height: 1; font-variant-numeric: tabular-nums; }
.big-note small { font-size: .4em; color: var(--muted); }

/* ---------- Editor ---------- */
.editor-layout { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 20px; align-items: start; }
@media (max-width: 1100px) { .editor-layout { grid-template-columns: 1fr; } }
.qlist { display: flex; flex-direction: column; gap: 10px; }
.qitem { display: flex; gap: 12px; align-items: flex-start; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); }
.qitem .n { width: 32px; height: 32px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 800; flex: none; font-variant-numeric: tabular-nums; }
.qitem .body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.qitem .prompt { font-weight: 700; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.qitem .tools { display: flex; gap: 2px; flex-wrap: wrap; justify-content: flex-end; }
.choice-row { display: grid; grid-template-columns: 36px minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.choice-row .shape-sq { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.choice-row .shape-sq svg { width: 18px; height: 18px; fill: #fff; }
.correct-toggle { display: inline-flex; align-items: center; gap: 6px; padding: 0 10px; min-height: 40px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; font-size: .82rem; color: var(--muted); white-space: nowrap; }
.correct-toggle.on { background: var(--good-soft); color: var(--good); border-color: color-mix(in srgb, var(--good) 40%, transparent); }
.type-picker { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.type-opt { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-weight: 700; font-size: .88rem; color: var(--ink-2); text-align: left; }
.type-opt.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.img-drop { border: 2px dashed var(--line); border-radius: 14px; padding: 14px; display: flex; gap: 14px; align-items: center; flex-wrap: wrap; }
.img-drop img { max-height: 120px; border-radius: 10px; }
details.settings { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
details.settings > summary { list-style: none; cursor: pointer; padding: 14px 16px; font-weight: 800; display: flex; align-items: center; gap: 10px; }
details.settings > summary::-webkit-details-marker { display: none; }
details.settings > summary::after { content: ""; margin-left: auto; width: 10px; height: 10px; border-right: 2px solid var(--muted); border-bottom: 2px solid var(--muted); transform: rotate(45deg); transition: transform .15s; }
details.settings[open] > summary::after { transform: rotate(-135deg); }
details.settings > .inner { padding: 0 16px 16px; display: flex; flex-direction: column; gap: 14px; }

/* ---------- Demo banner ---------- */
.demo-banner { position: fixed; z-index: 3000; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom, 0px)); background: #111827; color: #fff; border-radius: 12px; padding: 8px 12px; font-size: .78rem; font-weight: 700; box-shadow: var(--shadow-lg); display: flex; gap: 8px; align-items: center; max-width: calc(100vw - 24px); }
.demo-banner button { background: rgba(255,255,255,.15); color: #fff; border: 0; border-radius: 8px; padding: 4px 8px; font: inherit; cursor: pointer; }
@media (max-width: 900px) { .demo-banner { bottom: calc(76px + env(safe-area-inset-bottom, 0px)); } }

/* =====================================================================
   V2 — Calendrier, Mes cours, Suggestions, Notifications
   ===================================================================== */
.accent-text { color: var(--accent); }
.center { text-align: center; }
@media (max-width: 640px) { .hide-sm { display: none; } }
.form-grid.tri { grid-template-columns: 1.4fr 1fr 1fr; }
@media (max-width: 460px) { .form-grid.tri { grid-template-columns: 1fr 1fr; } .form-grid.tri > :first-child { grid-column: 1 / -1; } }
.select-sm { min-height: 34px; padding: 4px 10px; width: auto; font-size: .85rem; }
.tabs-sm .tab { min-height: 34px; font-size: .85rem; }

/* ---------- Notifications ---------- */
.brand-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.bell-btn { position: relative; }
.bell-btn .badge { position: absolute; top: 0; right: 0; transform: translate(25%, -15%); min-width: 18px; height: 18px; font-size: .66rem; box-shadow: 0 0 0 2px var(--surface); }
.nav-link [data-nbadge] { margin-left: auto; }
.bottom-nav a [data-nbadge] .badge { position: absolute; top: 0; right: 14%; min-width: 17px; height: 17px; font-size: .64rem; }
.notif-list { display: flex; flex-direction: column; gap: 6px; }
.notif-item { display: flex; gap: 12px; align-items: flex-start; text-align: left; width: 100%; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.notif-item:hover { background: var(--surface-2); }
.notif-item.unread { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 35%, transparent); }
.notif-item .ic { flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.notif-item.unread .ic { background: var(--accent); color: var(--accent-ink); }
.notif-item .grow { display: flex; flex-direction: column; gap: 2px; font-size: .9rem; }
.notif-item .nb { color: var(--ink-2); font-size: .84rem; }
.notif-item .t { color: var(--muted); font-size: .74rem; }

/* ---------- Types de séance (variable --ev = couleur du type) ---------- */
.ev-type { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; color: var(--ev, var(--accent)); }
.ev-type::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ev, var(--accent)); }
.type-pick, .cat-pick, .cls-pick { display: flex; flex-wrap: wrap; gap: 8px; }
.type-pick button, .cat-pick button { display: inline-flex; align-items: center; gap: 6px; min-height: 40px; padding: 0 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); font: 700 .88rem var(--font); cursor: pointer; }
.type-pick button::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--ev); }
.type-pick button.on { border-color: var(--ev); background: color-mix(in srgb, var(--ev) 14%, var(--surface)); color: var(--ink); }
.cat-pick button.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.cat-pick.small-pick button { min-height: 34px; padding: 0 11px; font-size: .82rem; }
.cls-pick label { display: inline-flex; align-items: center; gap: 8px; min-height: 38px; padding: 0 12px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface); font-weight: 700; font-size: .88rem; cursor: pointer; }
.cls-pick label.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.cls-pick input { accent-color: var(--accent); width: 16px; height: 16px; }
.dur-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.dur-chips button { min-height: 30px; padding: 0 10px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font: 700 .8rem var(--font); cursor: pointer; }
.dur-chips button:hover { border-color: var(--accent); color: var(--accent); }
.form-preview { font-size: .84rem; font-weight: 700; color: var(--accent); }

/* ---------- Calendrier : barre d'outils ---------- */
.cal-shell { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; box-shadow: var(--shadow); }
.cal-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 14px 16px 6px; }
.cal-nav { gap: 4px; }
.cal-label { font-size: 1.15rem; margin: 0 0 0 8px; }
.cal-views { min-width: 230px; }
.cal-legend { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 6px 16px 12px; border-bottom: 1px solid var(--line); }
.legend-chip { display: inline-flex; align-items: center; gap: 6px; min-height: 30px; padding: 0 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); color: var(--ink-2); font: 700 .78rem var(--font); cursor: pointer; }
.legend-chip .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ev); }
.legend-chip.off { opacity: .45; text-decoration: line-through; }
.legend-status { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; font-size: .76rem; color: var(--muted); font-weight: 600; }
.st { display: inline-block; width: 9px; height: 9px; border-radius: 50%; flex: none; }
.st-coming { background: var(--good); } .st-late { background: var(--warn); } .st-absent { background: var(--bad); }
.st-todo { background: transparent; box-shadow: inset 0 0 0 2px var(--accent); }
.cal-body { padding: 14px 16px 18px; min-width: 0; }
@media (max-width: 640px) {
  .cal-toolbar { padding: 12px 12px 4px; } .cal-body { padding: 10px 10px 14px; } .cal-legend { padding: 4px 12px 10px; }
  .cal-views { min-width: 0; width: 100%; } .legend-status { margin-left: 0; width: 100%; }
}

/* ---------- Calendrier : agenda ---------- */
.agenda { display: flex; flex-direction: column; gap: 18px; }
.agenda-day { display: grid; grid-template-columns: 74px minmax(0, 1fr); gap: 14px; }
.agenda-date { display: flex; flex-direction: column; align-items: center; gap: 0; padding-top: 6px; line-height: 1.1; }
.agenda-date .d { font: 800 1.9rem var(--font-display); }
.agenda-date .m { font-size: .8rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.agenda-date .w { margin-top: 4px; font-size: .68rem; font-weight: 700; color: var(--muted); text-align: center; }
.agenda-day.is-today .agenda-date .d { color: var(--accent); }
.agenda-day.is-today .agenda-date .w { color: var(--accent); }
.agenda-list { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.ev-card { display: grid; grid-template-columns: 58px minmax(0, 1fr); gap: 14px; padding: 14px; border-radius: 16px; border: 1px solid var(--line); border-left: 5px solid var(--ev); background: color-mix(in srgb, var(--ev) 5%, var(--surface)); cursor: pointer; transition: transform .1s, box-shadow .1s; }
.ev-card:hover, .ev-card:focus-visible { transform: translateY(-1px); box-shadow: var(--shadow); outline: none; }
.ev-card.pending { border-style: dashed; border-left-style: solid; opacity: .92; }
.ev-card.cancelled { opacity: .6; } .ev-card.cancelled h3 { text-decoration: line-through; }
.ev-time { display: flex; flex-direction: column; align-items: center; font-variant-numeric: tabular-nums; line-height: 1.25; }
.ev-time b { font-size: 1.05rem; } .ev-time span { font-size: .8rem; color: var(--muted); }
.ev-main { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.ev-main h3 { font-size: 1.08rem; margin: 0; }
.ev-meta { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: .84rem; color: var(--ink-2); }
.ev-meta span { display: inline-flex; align-items: center; gap: 5px; }
.my-rsvp { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.rsvp-quick { display: flex; gap: 6px; flex-wrap: wrap; }
@media (max-width: 640px) { .agenda-day { grid-template-columns: 1fr; gap: 6px; } .agenda-date { flex-direction: row; gap: 8px; align-items: baseline; padding: 0; } .agenda-date .d { font-size: 1.4rem; } .agenda-date .w { margin: 0; font-size: .8rem; } .ev-card { grid-template-columns: 1fr; gap: 6px; } .ev-time { flex-direction: row; gap: 6px; align-items: baseline; } }

/* ---------- Calendrier : semaine ---------- */
.week-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 0 -4px; padding: 0 4px; }
.week { min-width: 760px; }
.week-head { display: grid; grid-template-columns: 46px repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--line); }
.wh-day { display: flex; flex-direction: column; align-items: center; padding: 8px 0; gap: 2px; }
.wh-day .w { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.wh-day .n { font: 800 1.15rem var(--font-display); width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; }
.wh-day.today .n { background: var(--accent); color: var(--accent-ink); }
.week-body { position: relative; display: grid; grid-template-columns: 46px repeat(7, minmax(0, 1fr)); }
.week-hours { position: relative; }
.wh-hour { position: absolute; right: 8px; transform: translateY(-50%); font-size: .7rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.week-col { position: relative; border-left: 1px solid var(--line); background-image: linear-gradient(var(--line) 1px, transparent 1px); background-size: 100% var(--hpx); }
.week-col.today { background-color: color-mix(in srgb, var(--accent) 5%, transparent); }
.now-line { position: absolute; left: 0; right: 0; height: 2px; background: var(--bad); z-index: 3; }
.now-line::before { content: ""; position: absolute; left: -4px; top: -3px; width: 8px; height: 8px; border-radius: 50%; background: var(--bad); }
.week-evt { position: absolute; z-index: 2; overflow: hidden; text-align: left; padding: 4px 7px; border-radius: 9px; border: 0; border-left: 4px solid var(--ev); background: color-mix(in srgb, var(--ev) 20%, var(--surface)); color: var(--ink); font: 600 .74rem var(--font); cursor: pointer; display: flex; flex-direction: column; gap: 1px; }
.week-evt b { font-size: .78rem; display: flex; align-items: center; gap: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-evt span { color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.week-evt.pending { border-style: dashed; border-left-style: solid; background: var(--surface-2); }
.week-evt.cancelled { opacity: .5; } .week-evt.cancelled b { text-decoration: line-through; }

/* ---------- Calendrier : mois ---------- */
.month { border: 1px solid var(--line); border-radius: 14px; overflow: hidden; }
.month-head { display: grid; grid-template-columns: repeat(7, 1fr); background: var(--surface-2); }
.month-head div { padding: 8px 4px; text-align: center; font-size: .74rem; font-weight: 700; color: var(--muted); }
.month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.m-cell { min-height: 108px; padding: 5px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); display: flex; flex-direction: column; gap: 3px; cursor: pointer; min-width: 0; }
.m-cell:nth-child(7n) { border-right: 0; }
.m-cell:hover { background: var(--surface-2); }
.m-cell.out { opacity: .45; }
.m-cell.today { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.m-num { font-size: .82rem; font-weight: 800; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; }
.m-cell.today .m-num { background: var(--accent); color: var(--accent-ink); }
.m-evt { display: flex; align-items: center; gap: 4px; width: 100%; min-width: 0; text-align: left; padding: 2px 6px; border-radius: 6px; border: 0; border-left: 3px solid var(--ev); background: color-mix(in srgb, var(--ev) 16%, var(--surface)); color: var(--ink); font: 600 .72rem var(--font); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.m-evt .t { color: var(--ink-2); font-variant-numeric: tabular-nums; }
.m-evt.pending { border-left-style: dashed; background: var(--surface-2); } .m-evt.cancelled { opacity: .5; text-decoration: line-through; }
.m-more { text-align: left; border: 0; background: none; padding: 1px 4px; font: 700 .72rem var(--font); color: var(--accent); cursor: pointer; }
@media (max-width: 640px) {
  .m-cell { min-height: 58px; padding: 3px; }
  .m-evt { padding: 0; height: 7px; border: 0; border-radius: 99px; background: var(--ev); font-size: 0; }
  .m-evt * { display: none; }
}

/* ---------- Fenêtres de séance ---------- */
.evd-head { padding: 14px 16px; border-radius: 14px; border-left: 5px solid var(--ev); background: color-mix(in srgb, var(--ev) 9%, var(--surface-2)); display: flex; flex-direction: column; gap: 6px; }
.evd-head .when { font: 800 1.2rem var(--font-display); }
.evd-head .kv { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: .9rem; }
.evd-head .kv > div { display: inline-flex; align-items: center; gap: 6px; }
.evd-head .kv .icon { width: 17px; height: 17px; color: var(--muted); }
.ev-actions { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line); }
.btn-warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.resp-group { display: flex; flex-direction: column; gap: 4px; }
.resp-row { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.resp-row .reason, .call-row .reason { display: block; font-size: .84rem; color: var(--ink-2); font-style: italic; margin-top: 2px; }
.call-row { display: flex; align-items: center; gap: 10px; padding: 8px 12px; border-radius: 10px; background: var(--surface-2); }
.seg { display: inline-flex; gap: 4px; flex: none; }
.seg button { width: 38px; height: 34px; border-radius: 9px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); font: 800 .85rem var(--font); cursor: pointer; }
.seg button.on.p { background: var(--good); border-color: var(--good); color: #fff; }
.seg button.on.l { background: var(--warn); border-color: var(--warn); color: #fff; }
.seg button.on.a { background: var(--bad); border-color: var(--bad); color: #fff; }
.att { display: flex; flex-direction: column; gap: 6px; }
.att-bar { display: flex; height: 10px; border-radius: 99px; overflow: hidden; background: var(--surface-3); }
.att-bar i.c { background: var(--good); } .att-bar i.l { background: var(--warn); } .att-bar i.a { background: var(--bad); }
.att-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: .78rem; font-weight: 700; color: var(--muted); }
.att-legend .c { color: var(--good); } .att-legend .l { color: var(--warn); } .att-legend .a { color: var(--bad); }
.att.compact .att-bar { height: 6px; } .att.compact .att-legend { font-size: .72rem; }
.rsvp-opts { display: flex; flex-direction: column; gap: 8px; }
.rsvp-opt { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line); background: var(--surface); cursor: pointer; }
.rsvp-opt input { position: absolute; opacity: 0; pointer-events: none; }
.rsvp-opt .ic { flex: none; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-2); }
.rsvp-opt b { display: block; } .rsvp-opt small { color: var(--muted); font-size: .78rem; }
.rsvp-opt.coming.on { border-color: var(--good); background: var(--good-soft); } .rsvp-opt.coming.on .ic { background: var(--good); color: #fff; }
.rsvp-opt.late.on { border-color: var(--warn); background: var(--warn-soft); } .rsvp-opt.late.on .ic { background: var(--warn); color: #fff; }
.rsvp-opt.absent.on { border-color: var(--bad); background: var(--bad-soft); } .rsvp-opt.absent.on .ic { background: var(--bad); color: #fff; }
.req-card { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; border: 1.5px dashed color-mix(in srgb, var(--ev, var(--warn)) 60%, transparent); background: color-mix(in srgb, var(--ev, var(--warn)) 8%, var(--surface)); }
.req-card.neutral { border-style: solid; }
.req-msg { margin-top: 4px; font-size: .9rem; color: var(--ink-2); font-style: italic; }

/* ---------- Encarts d'accueil ---------- */
.dash-extras { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 16px; align-items: start; }
.next-card { border-left: 5px solid var(--ev); background: color-mix(in srgb, var(--ev) 6%, var(--surface)); display: flex; flex-direction: column; gap: 8px; }
.next-card .when { font: 800 1.3rem var(--font-display); } .next-card h3 { margin: 0; }
.dash-doc, .dash-ev { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; cursor: pointer; }
.dash-doc:hover, .dash-ev:hover { background: var(--surface-2); }
.dash-doc .grow, .dash-ev .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dash-ev { border-left: 4px solid var(--ev); }
.dash-ev-date { flex: none; width: 46px; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.dash-ev-date b { font: 800 1.35rem var(--font-display); } .dash-ev-date span { font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.todo-tiles { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.todo-tile { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 6px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); color: inherit; font: inherit; cursor: pointer; text-align: center; }
.todo-tile .v { font: 800 1.7rem var(--font-display); display: grid; place-items: center; min-height: 40px; }
.todo-tile.hot { background: var(--warn-soft); border-color: color-mix(in srgb, var(--warn) 45%, transparent); } .todo-tile.hot .v { color: var(--warn); }

/* ---------- Mes cours ---------- */
.search-box { position: relative; } .search-box.compact { width: min(260px, 100%); }
.search-box .icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search-box input { padding-left: 42px; }
.folder-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; }
.folder { position: relative; display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: 20px; border: 1px solid var(--line); background: var(--surface); box-shadow: var(--shadow); cursor: pointer; transition: transform .12s, box-shadow .12s; }
.folder:hover, .folder:focus-visible { transform: translateY(-2px); box-shadow: var(--shadow-lg); outline: none; }
.folder.draft { border-style: dashed; opacity: .85; }
.folder .num, .chap-head .num { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: linear-gradient(135deg, #5a2fd6, var(--game-bg)); color: #fff; font: 800 1.15rem var(--font-display); }
.folder h3 { font-size: 1.12rem; margin: 0; } .folder .desc { color: var(--ink-2); font-size: .88rem; margin: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.type-dots { display: flex; flex-wrap: wrap; gap: 6px; }
.type-dot { display: inline-flex; align-items: center; gap: 6px; padding: 2px 9px; border-radius: 99px; background: color-mix(in srgb, var(--ev) 14%, var(--surface)); font-size: .74rem; font-weight: 700; }
.type-dot::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ev); }
.folder-move { position: absolute; top: 10px; right: 10px; display: none; gap: 2px; } .folder:hover .folder-move { display: flex; }
.progress { height: 8px; border-radius: 99px; background: var(--surface-3); overflow: hidden; } .progress i { display: block; height: 100%; background: var(--good); border-radius: 99px; transition: width .3s; }
.chap-head { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; } .chap-head .num { width: 52px; height: 52px; font-size: 1.5rem; border-radius: 16px; }
.dropzone { display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center; padding: 22px 16px; border-radius: 20px; border: 2px dashed var(--line); background: var(--surface-2); transition: border-color .12s, background .12s; }
.dropzone .icon { width: 30px; height: 30px; color: var(--accent); }
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); }
.doc-section h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 8px; font-size: .92rem; color: var(--ev); }
.doc-section { display: flex; flex-direction: column; gap: 8px; }
.doc-row { display: flex; align-items: center; gap: 14px; width: 100%; padding: 12px 14px; border-radius: 16px; border: 1px solid var(--line); background: var(--surface); text-align: left; color: inherit; font: inherit; }
.doc-row.clickable { cursor: pointer; transition: background .1s, transform .1s; } .doc-row.clickable:hover { background: var(--surface-2); transform: translateY(-1px); }
.doc-row.seen { opacity: .8; }
.doc-ico { flex: none; display: grid; place-items: center; width: 46px; height: 52px; border-radius: 10px; background: color-mix(in srgb, var(--ev, var(--accent)) 16%, var(--surface)); color: var(--ev, var(--accent)); font: 800 .68rem var(--font); letter-spacing: .04em; }
.doc-row.seen .doc-ico { background: var(--good-soft); color: var(--good); }
.doc-body { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.doc-body b { font-size: .98rem; } .doc-desc { color: var(--ink-2); font-size: .84rem; }
.doc-flags { display: flex; flex-wrap: wrap; gap: 4px; }
.doc-body .meta { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: .76rem; color: var(--muted); }
.doc-views { flex: none; } .doc-views.warn { color: var(--bad); }
.doc-actions { flex: none; display: flex; gap: 0; }
@media (max-width: 700px) { .doc-row { flex-wrap: wrap; } .doc-actions { width: 100%; justify-content: flex-end; } }
.vis-opts { display: flex; flex-direction: column; gap: 8px; }
.upload-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface-2); position: relative; overflow: hidden; }
.upload-item.err { border-color: var(--bad); } .upload-item.done { border-color: var(--good); }
.upload-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.upload-name { font-size: .8rem; color: var(--muted); word-break: break-all; } .upload-err, .upload-item.err .upload-state { color: var(--bad); font-size: .84rem; font-weight: 600; }
.upload-item.done .upload-state { color: var(--good); font-weight: 600; } .upload-state { font-size: .82rem; color: var(--muted); }
.upload-item .fields { display: grid; grid-template-columns: 1fr 190px; gap: 8px; } @media (max-width: 560px) { .upload-item .fields { grid-template-columns: 1fr; } }
.upload-item .bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; } .upload-item .bar i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .2s; }
.upload-item.done .bar i { background: var(--good); }

/* ---------- Visionneuse protégée ---------- */
html.viewer-open, html.viewer-open body { overflow: hidden; }
.viewer { position: fixed; inset: 0; z-index: 2500; display: flex; flex-direction: column; background: #16121f; color: #fff; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.viewer-top { display: flex; align-items: center; gap: 6px; padding: 8px 10px calc(8px); padding-top: max(8px, env(safe-area-inset-top)); background: #211a33; border-bottom: 1px solid rgba(255,255,255,.08); }
.viewer-top .btn { color: #fff; } .viewer-top .btn-ghost:hover { background: rgba(255,255,255,.1); }
.viewer-title { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; } .viewer-title b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .viewer-title span { font-size: .76rem; opacity: .7; }
.viewer-scroll { flex: 1; overflow: auto; -webkit-overflow-scrolling: touch; padding: 14px 0 30px; }
.viewer-pages { --z: 1; margin: 0 auto; width: min(calc(900px * var(--z)), calc(100% * var(--z))); display: flex; flex-direction: column; gap: 12px; padding: 0 8px; }
.vpage { position: relative; width: 100%; background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 6px 24px rgba(0,0,0,.4); }
.vpage canvas { display: block; width: 100%; height: 100%; pointer-events: none; }
.vpage:not(.ready)::after { content: ""; position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; border: 3px solid #ddd; border-top-color: var(--accent); animation: spin .8s linear infinite; }
.vpage.err::after { animation: none; border: 0; content: "Page indisponible — touche pour réessayer"; width: auto; height: auto; margin: 0; transform: translate(-50%, -50%); color: #333; font-size: .85rem; text-align: center; cursor: pointer; }
.vpage-num { position: absolute; right: 8px; bottom: 6px; padding: 1px 8px; border-radius: 99px; background: rgba(0,0,0,.45); color: #fff; font-size: .7rem; pointer-events: none; }
.viewer-mark { position: absolute; left: 0; right: 0; bottom: 34px; text-align: center; font-size: .68rem; opacity: .55; pointer-events: none; padding: 0 12px; }
.viewer-foot { padding: 6px 12px calc(6px + env(safe-area-inset-bottom)); font-size: .72rem; text-align: center; background: #211a33; color: rgba(255,255,255,.7); display: flex; gap: 6px; justify-content: center; align-items: center; }
.viewer-shield { position: absolute; inset: 0; z-index: 5; display: grid; place-items: center; background: #16121f; text-align: center; }
.viewer-shield[hidden] { display: none; } .viewer-shield > div { display: flex; flex-direction: column; align-items: center; gap: 8px; max-width: 280px; } .viewer-shield .icon { width: 36px; height: 36px; }
.viewer.shielded .viewer-pages { visibility: hidden; }
@media print { .viewer { display: none !important; } }

/* ---------- Suggestions ---------- */
.char-count { align-self: flex-end; font-size: .74rem; color: var(--muted); }
.thread { display: flex; flex-direction: column; gap: 12px; padding: 16px; border-radius: 18px; border: 1px solid var(--line); background: var(--surface); }
.thread.unread { border-color: color-mix(in srgb, var(--accent) 50%, transparent); box-shadow: 0 0 0 3px var(--accent-soft); }
.thread-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.bubbles { display: flex; flex-direction: column; gap: 8px; }
.bubble { max-width: 86%; padding: 10px 14px; border-radius: 16px; white-space: pre-wrap; overflow-wrap: anywhere; font-size: .94rem; }
.bubble small { display: block; margin-top: 4px; font-size: .7rem; opacity: .7; }
.bubble.them { align-self: flex-start; background: var(--surface-2); border-bottom-left-radius: 5px; }
.bubble.me { align-self: flex-end; background: var(--accent); color: var(--accent-ink); border-bottom-right-radius: 5px; }
.reply-box { display: flex; align-items: flex-end; gap: 8px; } .reply-box textarea { min-height: 44px; max-height: 220px; resize: none; }
.quick-replies { display: flex; flex-wrap: wrap; gap: 6px; }
.quick-replies button { padding: 5px 11px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface-2); color: var(--ink-2); font: 600 .78rem var(--font); cursor: pointer; }
.quick-replies button:hover { border-color: var(--accent); color: var(--accent); }
.prop-box { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 10px 12px; border-radius: 12px; background: var(--warn-soft); color: var(--warn); font-weight: 700; font-size: .88rem; }
.prop-box.ok { background: var(--good-soft); color: var(--good); }

@media print { body * { visibility: hidden !important; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ======================= Paiements + élèves précis dans le calendrier (2026-09-30) ======================= */
.stat.warn { border-color: color-mix(in srgb, var(--warn) 45%, transparent); background: var(--warn-soft); }
.stat.warn .v { color: var(--warn); }
.back-link { display: inline-flex; align-items: center; gap: 4px; align-self: flex-start; font-weight: 700; font-size: .9rem; color: var(--muted); text-decoration: none; margin-bottom: -8px; }
.back-link:hover { color: var(--accent); }
.bad { color: var(--bad); }
.good { color: var(--good); }
/* 9 entrées dans la barre du bas (professeure) : les libellés trop longs sont coupés proprement */
.bottom-nav a > span:not([data-nbadge]):not([data-badge]) { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Calendrier : élèves choisis un par un */
.stu-toggle { align-self: flex-start; }
.stu-pick { display: flex; flex-direction: column; gap: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); max-height: 320px; overflow: auto; }
.stu-group-head { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 800; margin-bottom: 6px; }
.stu-pick .cls-pick label { min-height: 34px; font-size: .86rem; }
.aud-sum { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--ink-2); background: var(--accent-soft); border-radius: 10px; padding: 8px 12px; }
.aud-sum:empty { display: none; }
.stu-list { display: flex; flex-wrap: wrap; gap: 6px; }
.stu-chip { padding: 5px 10px; border-radius: 99px; background: var(--surface-2); font-weight: 600; font-size: .86rem; }
.stu-chip small { color: var(--muted); font-weight: 600; }
.pay-cta { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px; border: 1.5px solid color-mix(in srgb, var(--accent) 35%, transparent); background: var(--accent-soft); }
.pay-cta .ic { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--accent); color: #fff; flex: none; }
.pay-cta .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }

/* Paiements : listes */
.pay-list { display: flex; flex-direction: column; gap: 8px; }
.pay-card, .pay-hist, .pay-stu { display: flex; align-items: center; gap: 12px; width: 100%; text-align: left; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); background: var(--surface); color: inherit; font: inherit; cursor: pointer; transition: border-color .15s, box-shadow .15s; }
.pay-card:hover, .pay-hist:hover, .pay-stu:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: 0 4px 14px rgba(0,0,0,.06); }
.pay-card, .pay-hist { border-left: 5px solid var(--ev); }
.pay-card.future { opacity: .78; }
.pay-card.cancelled .pay-title { text-decoration: line-through; }
.pay-date { flex: none; width: 44px; display: flex; flex-direction: column; align-items: center; line-height: 1.1; }
.pay-date b { font: 800 1.35rem var(--font-display); }
.pay-date span { font-size: .7rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.pay-card-main, .pay-stu .grow, .pay-hist .grow { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.pay-title { font-size: 1rem; }
.pay-card-side, .pay-stu-side, .pay-hist-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none; text-align: right; }
.pay-sum { font: 800 1.05rem var(--font-display); font-variant-numeric: tabular-nums; }
.pay-upcoming > summary { cursor: pointer; font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; padding: 4px 0 10px; }
.pay-tools { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.rate-chip { display: inline-flex; flex-direction: column; align-items: center; padding: 6px 10px; border-radius: 10px; border: 1.5px dashed var(--line); background: var(--surface-2); font: 800 .92rem var(--font); color: var(--ink); cursor: pointer; line-height: 1.15; flex: none; }
.rate-chip small { font-size: .66rem; color: var(--muted); font-weight: 600; }
.rate-chip.custom { border-style: solid; border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.rate-chip.big { flex-direction: row; gap: 6px; align-items: baseline; padding: 10px 14px; font-size: 1rem; }

/* Paiements : fiche d'une séance (appel + paiement sur la même ligne) */
.pay-h1 { font: 800 1.45rem var(--font-display); margin: 0; }
.pay-bill { margin-top: 8px; }
.pay-summary { position: sticky; top: 8px; z-index: 5; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 18px; padding: 10px 14px; border-radius: 12px; background: var(--surface); border: 1px solid var(--line); box-shadow: 0 6px 18px rgba(0,0,0,.06); font-size: .92rem; }
.pay-summary i { display: inline-block; width: 9px; height: 9px; border-radius: 50%; margin: 0 4px 0 8px; }
.pay-summary .ps-att i:first-child { margin-left: 0; }
.pay-summary i.p { background: var(--good); }
.pay-summary i.l { background: var(--warn); }
.pay-summary i.a { background: var(--bad); }
.pay-summary i.n { background: var(--surface-3); }
.ps-money { font-variant-numeric: tabular-nums; }
.ps-money b { font: 800 1.05rem var(--font-display); }
.ps-saved { margin-left: auto; color: var(--good); font-weight: 700; font-size: .82rem; display: inline-flex; gap: 4px; align-items: center; min-height: 18px; }
.pay-bulk { display: flex; flex-wrap: wrap; gap: 8px; }
.pay-rows { display: flex; flex-direction: column; gap: 10px; }
.pay-row { display: grid; grid-template-columns: minmax(170px, 1.2fr) auto minmax(230px, 1.5fr) minmax(130px, auto); align-items: center; gap: 10px 16px; padding: 12px 14px; border-radius: 14px; border: 1px solid var(--line); border-left: 5px solid var(--line); background: var(--surface); }
.pay-row.st-present { border-left-color: var(--good); }
.pay-row.st-late { border-left-color: var(--warn); }
.pay-row.st-absent { border-left-color: var(--bad); }
.pay-row.is-due { background: color-mix(in srgb, var(--warn) 7%, var(--surface)); }
.pay-who { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.resp-hint { font-size: .8rem; font-style: italic; color: var(--ink-2); }
.resp-hint.absent { color: var(--bad); }
.resp-hint.late { color: var(--warn); }
.note-line { display: inline-flex; gap: 4px; align-items: center; font-size: .8rem; color: var(--info); }
.pay-att { display: inline-flex; gap: 4px; }
.pay-att button { min-width: 76px; height: 40px; padding: 0 10px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink-2); font: 700 .86rem var(--font); cursor: pointer; }
.pay-att button.on.p { background: var(--good); border-color: var(--good); color: #fff; }
.pay-att button.on.l { background: var(--warn); border-color: var(--warn); color: #fff; }
.pay-att button.on.a { background: var(--bad); border-color: var(--bad); color: #fff; }
.pay-amt, .amt-pick { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.amt { min-width: 54px; height: 40px; padding: 0 12px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--surface); color: var(--ink); font: 800 .96rem var(--font); font-variant-numeric: tabular-nums; cursor: pointer; }
.amt.usual { border: 1.5px dashed color-mix(in srgb, var(--accent) 60%, var(--line)); color: var(--accent); }
.amt.on { background: var(--good); border: 1.5px solid var(--good); color: #fff; }
.amt.other { font-weight: 700; color: var(--ink-2); }
.amt.other.on { color: #fff; }
.pay-state { justify-self: end; text-align: right; }
.pay-settle { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 12px 14px; border-radius: 14px; background: var(--warn-soft); }
.add-list { display: flex; flex-direction: column; gap: 6px; max-height: 50vh; overflow: auto; }
.add-item { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font: inherit; color: inherit; text-align: left; }
.add-item:hover { border-color: var(--accent); }
.pay-hist.is-due { border-color: color-mix(in srgb, var(--warn) 55%, var(--line)); }
@media (max-width: 1100px) {
  .pay-row { grid-template-columns: 1fr auto; }
  .pay-amt { grid-column: 1; }
  .pay-state { grid-column: 2; }
}
@media (max-width: 900px) {
  .pay-summary { top: calc(64px + env(safe-area-inset-top, 0px)); }
}
@media (max-width: 640px) {
  .pay-row { grid-template-columns: 1fr; gap: 10px; }
  .pay-amt, .pay-state { grid-column: 1; }
  .pay-att { display: grid; grid-template-columns: repeat(3, 1fr); }
  .pay-att button { min-width: 0; height: 44px; }
  .pay-amt .amt { flex: 1 0 58px; height: 46px; font-size: 1.02rem; }
  .pay-state { justify-self: start; text-align: left; }
  .pay-card, .pay-stu, .pay-hist { flex-wrap: wrap; }
  .pay-card-side, .pay-stu-side, .pay-hist-side { flex-direction: row; align-items: baseline; gap: 8px; width: 100%; justify-content: flex-end; padding-left: 56px; }
  .pay-stu .rate-chip { order: 3; }
  .pay-cta { flex-wrap: wrap; }
  .pay-cta .btn { width: 100%; }
}

/* Logo : ne se laisse plus écraser quand le nom du site est long (ex. « SES - Sciences Économiques et Sociales ») */
.brand-logo { flex: none; }
.brand-mark { min-width: 0; }
.brand-mark > span:last-child { min-width: 0; line-height: 1.2; overflow-wrap: anywhere; }
.side .brand-mark { font-size: 1.02rem; }
.brand-row { align-items: flex-start; }
.brand-row .brand-mark { flex: 1; }
.topbar .brand-mark > span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 1rem; }
.topbar .brand-logo { width: 34px; height: 34px; border-radius: 10px; padding: 5px; }

/* Bilan des entrées */
.inc-chart { display: grid; grid-template-columns: repeat(12, 1fr); gap: 6px; align-items: end; height: 190px; padding-top: 6px; }
.inc-col { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; height: 100%; min-width: 0; }
.inc-bar { width: 100%; max-width: 38px; min-height: 3px; border-radius: 7px 7px 3px 3px; background: color-mix(in srgb, var(--accent) 55%, var(--surface-2)); transition: height .3s; }
.inc-col.now .inc-bar { background: var(--accent); }
.inc-v { font-size: .68rem; font-weight: 800; color: var(--ink-2); font-variant-numeric: tabular-nums; white-space: nowrap; }
.inc-m { font-size: .68rem; font-weight: 700; color: var(--muted); text-transform: uppercase; }
.inc-list { display: flex; flex-direction: column; gap: 4px; }
.inc-row { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border: 0; border-radius: 10px; background: transparent; color: inherit; font: inherit; text-align: left; cursor: pointer; }
.inc-row:hover { background: var(--surface-2); }
.inc-row .grow { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.inc-side { display: flex; flex-direction: column; align-items: flex-end; flex: none; }
@media (max-width: 640px) {
  .inc-chart { height: 150px; gap: 3px; }
  .inc-v { display: none; }
}

/* Retirer un élève de l'appel d'une séance */
.pay-who-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pay-remove { height: 28px; padding: 0 8px; font-size: .78rem; color: var(--muted); gap: 4px; }
.pay-remove:hover { color: var(--bad); background: var(--bad-soft); }
.pay-row.is-out { border-style: dashed; opacity: .92; }
.out-hint { display: inline-flex; align-items: flex-start; gap: 5px; font-size: .8rem; color: var(--warn); font-weight: 600; }

/* ======================= Bloc-notes · Mes dépenses · Accueil élève (2026-09-30) ======================= */
/* Barre du bas de la professeure (10 entrées) : défilement horizontal au lieu d'entasser les icônes */
.shell .bottom-nav { overflow-x: auto; justify-content: flex-start; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.shell .bottom-nav::-webkit-scrollbar { display: none; }
.shell .bottom-nav a { flex: 0 0 62px; }

/* Couleurs des notes (lisibles en clair comme en sombre) */
.c-yellow { --nc: #eab308; } .c-green { --nc: #16a34a; } .c-blue { --nc: #2563eb; }
.c-pink { --nc: #db2777; } .c-purple { --nc: #7c3aed; } .c-gray { --nc: #6b7280; }
.note-quick { display: flex; flex-direction: column; gap: 8px; }
.note-quick textarea { min-height: 64px; resize: vertical; }
.note-grid { columns: 3 260px; column-gap: 14px; }
.note-card { break-inside: avoid; margin: 0 0 14px; display: flex; flex-direction: column; gap: 8px; padding: 12px 14px; border-radius: 14px; background: color-mix(in srgb, var(--nc) 16%, var(--surface)); border: 1px solid color-mix(in srgb, var(--nc) 35%, var(--line)); border-top: 4px solid var(--nc); }
.note-card.done { opacity: .6; }
.note-card.done .note-body, .note-card.done h3 { text-decoration: line-through; }
.note-top { display: flex; align-items: flex-start; gap: 8px; }
.note-top h3 { flex: 1; font-size: 1rem; margin: 2px 0 0; overflow-wrap: anywhere; }
.note-body { white-space: normal; overflow-wrap: anywhere; font-size: .94rem; line-height: 1.45; cursor: text; max-height: 16em; overflow: auto; }
.note-ev { align-self: flex-start; display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; border: 0; background: color-mix(in srgb, var(--nc) 28%, var(--surface)); color: var(--ink); font: 600 .8rem var(--font); cursor: pointer; text-align: left; }
.note-foot { display: flex; align-items: center; justify-content: space-between; color: var(--muted); }
.note-icon { width: 30px; height: 30px; display: grid; place-items: center; border-radius: 8px; border: 0; background: transparent; color: var(--muted); cursor: pointer; flex: none; }
.note-icon:hover { background: color-mix(in srgb, var(--ink) 8%, transparent); color: var(--ink); }
.note-icon.on { color: var(--nc, var(--accent)); }
.note-check { display: inline-flex; flex: none; margin-top: 2px; cursor: pointer; }
.note-check input { position: absolute; opacity: 0; pointer-events: none; }
.note-check span { width: 20px; height: 20px; border-radius: 6px; border: 2px solid color-mix(in srgb, var(--nc) 70%, var(--ink)); display: grid; place-items: center; }
.note-check input:checked + span { background: var(--nc); border-color: var(--nc); }
.note-check input:checked + span::after { content: "✓"; color: #fff; font-weight: 900; font-size: .8rem; }
.note-check input:focus-visible + span { outline: 3px solid var(--accent-soft); }
.note-colors { display: flex; gap: 10px; flex-wrap: wrap; }
.note-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--nc); border: 3px solid var(--surface); box-shadow: 0 0 0 1.5px var(--line); cursor: pointer; }
.note-dot.on { box-shadow: 0 0 0 3px var(--nc); }
.note-area { min-height: 180px; }
/* Notes rattachées à une séance (fiche d'appel) et épinglées (tableau de bord) */
.sess-notes { display: flex; flex-direction: column; gap: 8px; }
.sess-note-list { display: flex; flex-direction: column; gap: 6px; }
.sess-note { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; border: 0; border-left: 4px solid var(--nc); background: color-mix(in srgb, var(--nc) 14%, var(--surface)); color: var(--ink); font: inherit; cursor: pointer; overflow-wrap: anywhere; }
.sess-note span { font-size: .9rem; }
.sess-note.done { opacity: .55; text-decoration: line-through; }

/* Mes dépenses */
.stat.good-stat { border-color: color-mix(in srgb, var(--good) 45%, transparent); background: var(--good-soft); }
.stat.good-stat .v { color: var(--good); }
.exp-grid { display: grid; grid-template-columns: 150px 1fr 170px; gap: 10px; }
.exp-row { display: flex; align-items: center; gap: 12px; padding: 10px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.exp-row .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.exp-chip { flex: none; padding: 4px 10px; border-radius: 99px; background: var(--surface-2); font-size: .76rem; font-weight: 700; color: var(--ink-2); }
.exp-cat-row { display: grid; grid-template-columns: 150px 1fr auto; align-items: center; gap: 10px; font-size: .9rem; }
.exp-cat-bar { height: 10px; border-radius: 99px; background: var(--surface-2); overflow: hidden; }
.exp-cat-bar i { display: block; height: 100%; border-radius: 99px; background: color-mix(in srgb, var(--bad) 70%, var(--surface)); }
.cat-pick { display: flex; flex-wrap: wrap; gap: 6px; }

/* Accueil élève */
.home-grid { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 18px; align-items: start; }
.home-quiz { display: flex; align-items: center; gap: 12px; }
.home-quiz .ic { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); flex: none; }
.home-quiz .grow { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
@media (max-width: 860px) { .home-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .exp-grid { grid-template-columns: 1fr 1fr; }
  .exp-grid .field:nth-child(2) { grid-column: 1 / -1; order: -1; }
  .exp-cat-row { grid-template-columns: 110px 1fr auto; }
  .exp-row { flex-wrap: wrap; }
  .home-quiz { flex-wrap: wrap; }
  .home-quiz .btn { width: 100%; }
}
