/* EDUNOVA — feuille de style unique, mobile d'abord. */
:root {
  --bg: #f4f6fb; --surface: #ffffff; --surface-2: #f0f3fa; --border: #e2e7f2; --text: #131a33; --muted: #5d6680;
  --primary: #3b5bfd; --primary-2: #2a44d6; --primary-soft: #e8edff; --accent: #ffb020;
  --ok: #12a150; --ok-soft: #e3f7ec; --warn: #d88a00; --warn-soft: #fff3d9; --ko: #e0344b; --ko-soft: #fde8eb;
  --ink: #1d2b6b; --radius: 16px; --radius-sm: 10px; --shadow: 0 1px 2px rgba(20,30,70,.06), 0 6px 24px rgba(20,30,70,.06);
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --display: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --side: 248px; --tabbar: 64px; --fs: 16px;
  color-scheme: light;
}
[data-theme="dark"] {
  --bg: #0c1122; --surface: #141b33; --surface-2: #1b2442; --border: #27314f; --text: #e9edf8; --muted: #9aa5c3;
  --primary: #7089ff; --primary-2: #8c9fff; --primary-soft: #1f2a55; --ink: #0a0f22;
  --ok-soft: #10301f; --warn-soft: #36290a; --ko-soft: #3a1520; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.25);
  color-scheme: dark;
}
[data-font="large"] { --fs: 18px; }
.reduce-motion *, .reduce-motion *::before, .reduce-motion *::after { transition: none !important; animation: none !important; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

*, *::before, *::after { box-sizing: border-box; }
html { font-size: var(--fs); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--bg); color: var(--text); line-height: 1.55; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .4em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.55rem, 4.5vw, 2.1rem); }
h2 { font-size: 1.2rem; }
h3 { font-size: 1.05rem; }
p { margin: 0 0 .8em; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; border-radius: 6px; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--primary); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { left: 8px; }
.ico { display: inline-block; vertical-align: -0.22em; width: 20px; height: 20px; flex-shrink: 0; }
.muted { color: var(--muted); } .small { font-size: .875rem; } .tiny { font-size: .75rem; } .center { text-align: center; }
.ok-t { color: var(--ok); } .ko-t { color: var(--ko); } .mt { margin-top: 1.2rem; }
.row { display: flex; align-items: center; } .gap { gap: .6rem; } .wrap { flex-wrap: wrap; } .end { justify-content: flex-end; } .grow { flex: 1; } .center-row { justify-content: center; margin: 1rem 0; }

/* ---------- Coquille ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar { display: none; }
.main-col { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: .75rem; padding: .6rem 1rem; padding-top: max(.6rem, env(safe-area-inset-top)); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
.topbar-title { flex: 1; font-weight: 600; font-size: .95rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; }
.brand { display: flex; align-items: center; gap: .6rem; font-weight: 800; letter-spacing: .04em; }
.brand.center { justify-content: center; margin-bottom: .8rem; }
.logo { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-family: var(--display); font-size: 1.3rem; font-weight: 700; background: linear-gradient(135deg, var(--primary), #8b5cf6); box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 35%, transparent); }
.brand-text small { display: block; font-weight: 500; font-size: .62rem; letter-spacing: .12em; color: var(--muted); text-transform: uppercase; }
.brand-mobile .brand-text { font-size: .95rem; }
#view { flex: 1; outline: none; padding-bottom: calc(var(--tabbar) + 24px + env(safe-area-inset-bottom)); }
.page { width: 100%; max-width: 1180px; margin: 0 auto; padding: 1.1rem 1rem 2rem; animation: fade .25s ease; }
.page.narrow { max-width: 820px; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tabbar { position: fixed; bottom: 0; left: 0; right: 0; z-index: 30; display: grid; grid-template-columns: repeat(5, 1fr); height: calc(var(--tabbar) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--border); }
.tab { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: .68rem; font-weight: 600; color: var(--muted); background: none; border: 0; cursor: pointer; }
.tab.active { color: var(--primary); }
.tab.active .ico { transform: translateY(-1px); }
body.focus-mode .tabbar, body.focus-mode .topbar { display: none; }
body.focus-mode #view { padding-bottom: 0; }

@media (min-width: 960px) {
  .sidebar { display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; width: var(--side); flex-shrink: 0; padding: 1.2rem .9rem; background: var(--surface); border-right: 1px solid var(--border); overflow-y: auto; }
  .sidebar .brand { padding: 0 .5rem 1.2rem; }
  #side-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
  .nav-link { display: flex; align-items: center; gap: .75rem; padding: .62rem .75rem; border-radius: 10px; font-weight: 550; color: var(--muted); transition: background .15s, color .15s; }
  .nav-link:hover { background: var(--surface-2); color: var(--text); }
  .nav-link.active { background: var(--primary-soft); color: var(--primary); }
  .nav-sep { margin: 1rem .75rem .35rem; font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 700; }
  .side-foot { display: grid; gap: .5rem; padding-top: 1rem; border-top: 1px solid var(--border); }
  .tabbar, .brand-mobile { display: none; }
  .topbar { padding: .75rem 2rem; }
  #view { padding-bottom: 2rem; }
  .page { padding: 1.8rem 2rem 3rem; }
  body.focus-mode .sidebar { display: none; }
}

/* ---------- Composants ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; box-shadow: var(--shadow); }
a.card { display: block; transition: transform .15s, box-shadow .15s, border-color .15s; }
a.card:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--primary) 40%, var(--border)); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px; padding: .6rem 1.1rem; border-radius: 12px; border: 1px solid transparent; font-weight: 650; cursor: pointer; transition: background .15s, transform .1s, box-shadow .15s; white-space: nowrap; text-align: center; }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn.primary { background: var(--primary); color: #fff; box-shadow: 0 4px 14px color-mix(in srgb, var(--primary) 30%, transparent); }
.btn.primary:hover { background: var(--primary-2); }
.btn.primary.success { background: var(--ok); }
.btn.ghost { background: var(--surface); border-color: var(--border); }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { background: var(--ko); color: #fff; }
.btn.danger-ghost { background: transparent; color: var(--ko); border-color: color-mix(in srgb, var(--ko) 35%, var(--border)); }
.btn.sm { min-height: 36px; padding: .4rem .8rem; font-size: .875rem; border-radius: 10px; }
.btn.lg { min-height: 52px; padding: .8rem 1.4rem; font-size: 1.02rem; }
.btn.block { width: 100%; }
.btn.icon-only { padding: 0; width: 48px; }
.btn.loading { position: relative; color: transparent !important; }
.btn.loading::after { content: ""; position: absolute; width: 18px; height: 18px; border: 2.5px solid #fff; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }
.btn.ghost.loading::after { border-color: var(--primary); border-right-color: transparent; }
@keyframes spin { to { transform: rotate(360deg); } }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 10px; border: 0; background: transparent; color: var(--muted); cursor: pointer; position: relative; flex-shrink: 0; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn:disabled { opacity: .35; }
.link { color: var(--primary); font-weight: 600; display: inline-flex; align-items: center; gap: .2rem; background: none; border: 0; cursor: pointer; padding: 0; }
.link .ico { width: 16px; height: 16px; }
.avatar { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; color: #fff; background: linear-gradient(135deg, #8b5cf6, var(--primary)); flex-shrink: 0; }
.avatar.sm { width: 30px; height: 30px; font-size: .8rem; } .avatar.lg { width: 64px; height: 64px; font-size: 1.6rem; }
.avatar-top { width: 34px; height: 34px; font-size: .9rem; }
.notif-btn .dot { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 9px; background: var(--ko); color: #fff; font-size: .66rem; font-weight: 800; display: grid; place-items: center; border: 2px solid var(--bg); }
.user-chip { display: flex; align-items: center; gap: .65rem; padding: .5rem; border-radius: 12px; }
.user-chip:hover { background: var(--surface-2); }
.user-chip b { display: block; font-size: .92rem; } .user-chip small { color: var(--muted); font-size: .78rem; }
.tag { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 700; padding: .2rem .55rem; border-radius: 999px; color: var(--c); background: color-mix(in srgb, var(--c) 13%, transparent); white-space: nowrap; }
.tag::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--c); }
.pill { display: inline-flex; align-items: center; gap: .25rem; font-size: .75rem; font-weight: 650; padding: .2rem .6rem; border-radius: 999px; background: var(--surface-2); color: var(--muted); border: 1px solid var(--border); white-space: nowrap; }
.pill .ico { width: 13px; height: 13px; }
.pill.ok { background: var(--ok-soft); color: var(--ok); border-color: transparent; }
.pill.warn { background: var(--warn-soft); color: var(--warn); border-color: transparent; }
.pill.ko { background: var(--ko-soft); color: var(--ko); border-color: transparent; }
.eyebrow { display: block; font-size: .72rem; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--primary); margin-bottom: .35rem; }
.back { display: inline-flex; align-items: center; gap: .3rem; color: var(--muted); font-weight: 600; font-size: .9rem; margin-bottom: .9rem; }
.back .ico { width: 18px; height: 18px; }
.bar { height: 8px; border-radius: 99px; background: var(--surface-2); overflow: hidden; flex: 1; }
.bar i { display: block; height: 100%; background: var(--primary); border-radius: inherit; transition: width .4s; }
.bar i.good { background: var(--ok); } .bar i.mid { background: var(--warn); } .bar i.low { background: var(--ko); }
.bar.inline { display: inline-block; width: 70px; vertical-align: middle; }
.ring { --s: 64px; width: var(--s); height: var(--s); border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; background: conic-gradient(var(--rc, var(--primary)) calc(var(--p) * 1%), var(--surface-2) 0); }
.ring span { width: calc(var(--s) - 10px); height: calc(var(--s) - 10px); border-radius: 50%; background: var(--surface); display: grid; place-items: center; font-weight: 800; font-size: calc(var(--s) * .24); }
.ring.good { --rc: var(--ok); } .ring.mid { --rc: var(--warn); } .ring.low { --rc: var(--ko); }
.empty { text-align: center; padding: 2rem 1rem; color: var(--muted); }
.empty-art { width: 56px; height: 56px; margin: 0 auto .8rem; border-radius: 16px; display: grid; place-items: center; font-size: 1.4rem; color: var(--primary); background: var(--primary-soft); }
.empty h3 { color: var(--text); }
.loader { display: flex; justify-content: center; gap: 6px; padding: 3rem; }
.loader span { width: 9px; height: 9px; border-radius: 50%; background: var(--primary); animation: bounce 1s infinite ease-in-out; }
.loader span:nth-child(2) { animation-delay: .15s; } .loader span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 80%, 100% { transform: scale(.5); opacity: .4; } 40% { transform: scale(1); opacity: 1; } }
code { font-family: var(--mono); font-size: .88em; background: var(--surface-2); padding: .1em .35em; border-radius: 5px; }
.code-pill { display: inline-block; font-family: var(--mono); font-weight: 700; letter-spacing: .12em; background: var(--primary-soft); color: var(--primary); padding: .25rem .6rem; border-radius: 8px; }

/* ---------- Formulaires ---------- */
.form { display: grid; gap: .9rem; }
label { display: grid; gap: .35rem; font-weight: 600; font-size: .9rem; }
input:not([type=checkbox]):not([type=radio]), select, textarea { width: 100%; min-height: 46px; padding: .65rem .8rem; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); font-weight: 450; font-size: 1rem; transition: border-color .15s, box-shadow .15s; }
textarea { resize: vertical; min-height: 90px; line-height: 1.5; }
textarea.mono { font-family: var(--mono); font-size: .9rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
input[type=checkbox], input[type=radio] { width: 20px; height: 20px; accent-color: var(--primary); }
.check-line { display: flex; align-items: center; gap: .6rem; font-weight: 500; }
.form-error { color: var(--ko); font-weight: 600; font-size: .9rem; margin: 0; min-height: 0; }
.form-error:empty { display: none; }
.two, .three { display: grid; gap: .9rem; }
@media (min-width: 640px) { .two { grid-template-columns: 1fr 1fr; } .three { grid-template-columns: 1fr 1fr 1fr; } }
.seg { display: inline-flex; flex-wrap: wrap; background: var(--surface-2); border-radius: 12px; padding: 4px; gap: 4px; }
.seg label { display: block; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: .45rem .9rem; border-radius: 9px; font-weight: 600; cursor: pointer; color: var(--muted); }
.seg input:checked + span { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg input:focus-visible + span { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); }
.switch { position: relative; display: inline-block; width: 46px; height: 26px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; border-radius: 99px; background: var(--border); cursor: pointer; transition: background .2s; }
.switch span::before { content: ""; position: absolute; width: 20px; height: 20px; left: 3px; top: 3px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 1px 3px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--ok); }
.switch input:checked + span::before { transform: translateX(20px); }

/* ---------- Mise en page ---------- */
.page-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.2rem; }
.page-head p { margin: .2rem 0 0; }
.section { margin-top: 2rem; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: .8rem; }
.section-head h2 { margin: 0; }
.grid { display: grid; gap: .9rem; }
@media (min-width: 640px) { .cards-2, .cards-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1100px) { .cards-3 { grid-template-columns: repeat(3, 1fr); } }
.filters { display: grid; gap: .7rem; margin-bottom: 1rem; padding: .9rem; }
.filter-row { display: grid; grid-template-columns: 1fr 1fr; gap: .6rem; }
.search { position: relative; display: block; }
.search .ico { position: absolute; left: .8rem; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 2.6rem !important; }
.chips { display: flex; flex-wrap: wrap; gap: .45rem; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; padding-bottom: .4rem; margin-bottom: .6rem; scrollbar-width: none; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip { flex-shrink: 0; min-height: 38px; padding: .4rem .9rem; border-radius: 999px; border: 1px solid var(--border); background: var(--surface); font-weight: 600; font-size: .88rem; cursor: pointer; color: var(--muted); }
.chip.active { background: var(--text); color: var(--surface); border-color: var(--text); }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--border); margin-bottom: 1.2rem; overflow-x: auto; }
.tabs a { padding: .7rem 1rem; font-weight: 650; color: var(--muted); border-bottom: 2.5px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--primary); border-color: var(--primary); }
.table-wrap { overflow-x: auto; padding: 0; }
.table { width: 100%; border-collapse: collapse; font-size: .92rem; }
.table th { text-align: left; font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: .8rem 1rem; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: .8rem 1rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.table tr:last-child td { border-bottom: 0; }
.table select { min-height: 38px; padding: .35rem .5rem; width: auto; }

/* ---------- Accueil (visiteur) ---------- */
.hero { display: grid; gap: 1.5rem; align-items: center; padding: 1rem 0 1.5rem; }
.hero h1 { font-family: var(--display); font-size: clamp(2.2rem, 8vw, 3.6rem); font-weight: 700; letter-spacing: -.02em; }
.hero h1 em { color: var(--primary); }
.hero p { font-size: 1.08rem; color: var(--muted); max-width: 36rem; }
.trust { display: flex; flex-wrap: wrap; gap: .4rem 1rem; margin-top: 1.1rem; font-size: .88rem; color: var(--muted); font-weight: 600; }
.trust span { display: inline-flex; align-items: center; gap: .3rem; } .trust .ico { color: var(--ok); width: 18px; }
.hero-card { position: relative; overflow: hidden; color: #fff; background: radial-gradient(circle at 80% 0%, #6d5dfc 0, transparent 55%), linear-gradient(160deg, #1d2b6b, #101a44); border-radius: 24px; padding: 1.6rem; box-shadow: 0 20px 50px rgba(29,43,107,.35); }
.hero-card .ring span { background: #18245c; color: #fff; }
.hero-card .ring { --rc: var(--accent); margin: .8rem 0 1rem; background: conic-gradient(var(--accent) calc(var(--p) * 1%), rgba(255,255,255,.12) 0); }
.hero-card p { color: rgba(255,255,255,.72); font-size: .95rem; }
.hc-top { display: flex; justify-content: space-between; align-items: center; font-size: .72rem; letter-spacing: .14em; text-transform: uppercase; color: rgba(255,255,255,.7); font-weight: 700; }
.live { width: 9px; height: 9px; border-radius: 50%; background: #3ee08a; box-shadow: 0 0 0 4px rgba(62,224,138,.2); }
.hc-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-top: 1rem; }
.hc-stats div { background: rgba(255,255,255,.08); border-radius: 14px; padding: .7rem .9rem; }
.hc-stats b { display: block; font-size: 1.2rem; } .hc-stats small { color: rgba(255,255,255,.65); }
.features { display: grid; gap: .8rem; margin: 1rem 0 0; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.1rem; }
.feature .ico { width: 34px; height: 34px; padding: 7px; border-radius: 10px; background: var(--primary-soft); color: var(--primary); margin-bottom: .7rem; }
.feature p { color: var(--muted); font-size: .93rem; margin: 0; }
.cta-band { margin: 2.5rem 0 1rem; padding: 2rem 1.2rem; text-align: center; border-radius: 24px; color: #fff; background: linear-gradient(135deg, var(--primary), #7c3aed); }
.cta-band p { color: rgba(255,255,255,.85); }
.cta-band .btn.primary { background: #fff; color: var(--primary); }
.foot { text-align: center; color: var(--muted); font-size: .85rem; padding: 1rem 0; }
.foot a { color: var(--primary); }
@media (min-width: 760px) { .hero { grid-template-columns: 1.3fr 1fr; padding: 2rem 0 2.5rem; } .features { grid-template-columns: repeat(3, 1fr); } }

/* ---------- Tableau de bord ---------- */
.level-chip { display: grid; grid-template-columns: auto 120px; align-items: center; gap: .25rem .7rem; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: .55rem .9rem; }
.level-chip span { font-weight: 800; color: var(--primary); grid-row: span 2; }
.level-chip small { color: var(--muted); font-size: .72rem; }
.level-chip .bar i { background: linear-gradient(90deg, var(--accent), #ff7a45); }
.kpis { display: grid; grid-template-columns: 1fr 1fr; gap: .7rem; margin-bottom: 1rem; }
.kpi { display: flex; align-items: center; gap: .75rem; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: .85rem; box-shadow: var(--shadow); }
.kpi b { display: block; font-size: 1.35rem; line-height: 1.1; } .kpi small { color: var(--muted); font-size: .78rem; }
.kpi-ico { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; flex-shrink: 0; }
.kpi-ico.flame { background: #fff1e6; color: #f26b1d; } .kpi-ico.blue { background: var(--primary-soft); color: var(--primary); }
.kpi-ico.green { background: var(--ok-soft); color: var(--ok); } .kpi-ico.purple { background: #f1e9ff; color: #7c3aed; }
[data-theme="dark"] .kpi-ico.flame { background: #3a2412; } [data-theme="dark"] .kpi-ico.purple { background: #2b1f4a; }
@media (min-width: 760px) { .kpis { grid-template-columns: repeat(4, 1fr); } .kpis.six { grid-template-columns: repeat(6, 1fr); } }
@media (max-width: 759px) { .kpis.six { grid-template-columns: repeat(3, 1fr); } .kpis.six .kpi { flex-direction: column; text-align: center; padding: .7rem .4rem; } .kpis.six .kpi-ico { display: none; } }
.dash-grid { display: grid; gap: .9rem; }
@media (min-width: 900px) { .dash-grid { grid-template-columns: 1fr 1fr; } .span-2 { grid-column: span 2; } }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: .6rem; margin-bottom: .7rem; }
.card-head h2 { margin: 0; font-size: 1.05rem; }
.checklist, .reco-list, .attempt-list, .subj-list, .notif-list, .goal-list, .card-list, .doc-list, .member-list, .ag-list, .audit { list-style: none; margin: 0; padding: 0; }
.checklist li a { display: flex; align-items: center; gap: .7rem; padding: .65rem .2rem; border-bottom: 1px solid var(--border); font-weight: 550; }
.checklist li:last-child a { border: 0; }
.checklist li a > .ico:last-child { margin-left: auto; width: 18px; }
.check { width: 24px; height: 24px; border-radius: 50%; border: 2px solid var(--border); display: grid; place-items: center; flex-shrink: 0; }
.check .ico { width: 14px; height: 14px; }
.checklist .done .check { background: var(--ok); border-color: var(--ok); color: #fff; }
.checklist .done a { color: var(--muted); text-decoration: line-through; }
.success-note { margin: .7rem 0 0; color: var(--ok); font-weight: 650; }
.reco-list li a, .notif-list li a { display: flex; align-items: center; gap: .8rem; padding: .7rem .2rem; border-bottom: 1px solid var(--border); }
.reco-list li:last-child a { border: 0; }
.reco-list b, .notif-list b { display: block; font-size: .95rem; } .reco-list small, .notif-list small { color: var(--muted); font-size: .82rem; }
.reco-list a > span:nth-child(2), .notif-list a > span:nth-child(2) { flex: 1; min-width: 0; }
.reco-ico { width: 40px; height: 40px; border-radius: 12px; background: var(--surface-2); display: grid; place-items: center; font-size: 1.15rem; flex-shrink: 0; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: .5rem; align-items: end; height: 130px; }
.wday { display: grid; grid-template-rows: 1fr auto; height: 100%; gap: .35rem; text-align: center; }
.wbar { display: flex; align-items: flex-end; background: var(--surface-2); border-radius: 8px; overflow: hidden; }
.wbar i { display: block; width: 100%; min-height: 4px; background: linear-gradient(180deg, #8b5cf6, var(--primary)); border-radius: 8px; }
.wday small { color: var(--muted); font-weight: 700; text-transform: uppercase; font-size: .7rem; }
.subj-list li { display: grid; grid-template-columns: 130px 1fr 44px; align-items: center; gap: .7rem; padding: .45rem 0; }
.subj-list b { text-align: right; font-size: .9rem; }
.attempt-list li a { display: flex; align-items: center; gap: .8rem; padding: .6rem .2rem; border-bottom: 1px solid var(--border); }
.attempt-list li:last-child a { border: 0; }
.attempt-list a > span:nth-child(2) { flex: 1; min-width: 0; } .attempt-list b { display: block; } .attempt-list small { color: var(--muted); }
.attempt-list .score { font-weight: 800; }
.notif-list li { border-radius: 12px; }
.notif-list li.unread { background: var(--primary-soft); }
.notif-list li a { padding: .75rem; }

/* ---------- Ressources ---------- */
.resource-card { display: flex !important; flex-direction: column; gap: .4rem; }
.resource-card h3 { margin: .3rem 0 0; } .resource-card p { color: var(--muted); font-size: .92rem; margin: 0; flex: 1; }
.rc-top { display: flex; align-items: center; flex-wrap: wrap; gap: .5rem; margin-bottom: .3rem; }
.rc-foot { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; }
.star-on { color: var(--accent); margin-left: auto; font-size: 1.1rem; }
.reader { padding: 1.3rem; }
@media (min-width: 760px) { .reader { padding: 2rem 2.4rem; } }
.reader h1 { font-family: var(--display); font-size: clamp(1.7rem, 5vw, 2.4rem); margin-top: .4rem; }
.lead { font-size: 1.08rem; color: var(--muted); }
.reader-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin: .8rem 0 1.4rem; padding-bottom: 1.2rem; border-bottom: 1px solid var(--border); }
.prose { font-size: 1.03rem; line-height: 1.75; }
.prose h2, .prose h3 { margin: 1.6em 0 .5em; font-size: 1.25rem; }
.prose h3 { font-size: 1.08rem; }
.prose ul { padding-left: 1.3rem; margin: 0 0 1em; } .prose li { margin: .25em 0; }
.prose pre { background: #0f172a; color: #e2e8f0; border-radius: 12px; padding: 1rem; overflow-x: auto; font-size: .9rem; line-height: 1.55; }
.prose pre code { background: none; padding: 0; color: inherit; }
.prose blockquote { margin: 0 0 1em; padding: .6rem 1rem; border-left: 4px solid var(--primary); background: var(--primary-soft); border-radius: 0 10px 10px 0; }
.prose strong { color: var(--text); }
.source { margin-top: 1.5rem; font-size: .85rem; } .source a { color: var(--primary); word-break: break-all; }
.reader-done { margin-top: 1.5rem; padding-top: 1.2rem; border-top: 1px solid var(--border); display: flex; justify-content: center; }
.exam-mini { display: flex !important; align-items: center; gap: .7rem; } .exam-mini b { flex: 1; } .exam-mini > .ico:first-child { color: var(--primary); }

/* ---------- Examens ---------- */
.exam-card h3 { margin: .3rem 0; }
.exam-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem .9rem; font-size: .85rem; color: var(--muted); font-weight: 600; }
.exam-meta span { display: inline-flex; align-items: center; gap: .3rem; } .exam-meta .ico { width: 16px; }
.best { margin-left: auto; padding: .15rem .55rem; border-radius: 99px; background: var(--surface-2); }
.best.good { color: var(--ok); background: var(--ok-soft); } .best.mid { color: var(--warn); background: var(--warn-soft); } .best.low { color: var(--ko); background: var(--ko-soft); }
.exam-intro h1 { margin-top: .4rem; }
.exam-facts { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin: 1rem 0; }
.exam-facts div { background: var(--surface-2); border-radius: 12px; padding: .7rem; text-align: center; }
.exam-facts b { display: block; font-size: 1.2rem; } .exam-facts small { color: var(--muted); }
.rules { list-style: none; padding: 0; margin: 0 0 1.2rem; display: grid; gap: .55rem; color: var(--muted); font-size: .93rem; }
.rules li { display: flex; gap: .6rem; align-items: flex-start; } .rules .ico { color: var(--primary); margin-top: 2px; }

.runner { min-height: 100vh; display: flex; flex-direction: column; background: var(--bg); }
.runner-top { position: sticky; top: 0; z-index: 10; display: flex; align-items: center; gap: .7rem; padding: .7rem 1rem; padding-top: max(.7rem, env(safe-area-inset-top)); background: var(--surface); border-bottom: 1px solid var(--border); }
.runner-title { flex: 1; min-width: 0; } .runner-title small { display: block; color: var(--muted); font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; }
.runner-title b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.timer { font-family: var(--mono); font-weight: 800; font-size: 1.15rem; padding: .35rem .75rem; border-radius: 10px; background: var(--primary-soft); color: var(--primary); }
.timer.urgent { background: var(--ko-soft); color: var(--ko); animation: pulse 1s infinite; }
@keyframes pulse { 50% { opacity: .6; } }
.counter { font-weight: 700; color: var(--muted); font-size: .9rem; }
.runner-progress { height: 4px; background: var(--surface-2); } .runner-progress i { display: block; height: 100%; width: 0; background: var(--ok); transition: width .3s; }
.qdots { display: flex; gap: .4rem; padding: .8rem 1rem; overflow-x: auto; max-width: 820px; width: 100%; margin: 0 auto; }
.qdot { flex-shrink: 0; width: 36px; height: 36px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface); font-weight: 700; font-size: .85rem; cursor: pointer; color: var(--muted); }
.qdot.done { background: var(--primary-soft); color: var(--primary); border-color: transparent; }
.qdot.current { border-color: var(--primary); color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 18%, transparent); }
.runner-body { flex: 1; width: 100%; max-width: 820px; margin: 0 auto; padding: .5rem 1rem 1.5rem; }
.question h2 { font-size: clamp(1.15rem, 3.5vw, 1.45rem); margin: .6rem 0 1.2rem; line-height: 1.4; }
.q-meta { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; font-size: .82rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.choices { display: grid; gap: .6rem; margin-bottom: 1rem; }
.choice { display: flex; align-items: center; gap: .8rem; padding: .85rem 1rem; min-height: 56px; border: 1.5px solid var(--border); border-radius: 14px; background: var(--surface); cursor: pointer; font-weight: 500; font-size: 1rem; transition: border-color .15s, background .15s; }
.choice:hover { border-color: color-mix(in srgb, var(--primary) 50%, var(--border)); }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice .cid { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex-shrink: 0; background: var(--surface-2); font-weight: 800; font-size: .85rem; color: var(--muted); }
.choice.selected { border-color: var(--primary); background: var(--primary-soft); }
.choice.selected .cid { background: var(--primary); color: #fff; }
.choice:has(input:focus-visible) { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); }
.choice.right { border-color: var(--ok); background: var(--ok-soft); } .choice.right .cid { background: var(--ok); color: #fff; }
.choice.wrong { border-color: var(--ko); background: var(--ko-soft); } .choice.wrong .cid { background: var(--ko); color: #fff; }
.runner-foot { position: sticky; bottom: 0; display: flex; align-items: center; justify-content: space-between; gap: .6rem; padding: .7rem 1rem; padding-bottom: max(.7rem, env(safe-area-inset-bottom)); background: var(--surface); border-top: 1px solid var(--border); }
.runner-foot .btn { min-width: 120px; }
@media (min-width: 760px) { .runner-foot { justify-content: center; gap: 2rem; } }

.result-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 1rem; padding: 1.6rem; }
@media (min-width: 640px) { .result-hero { flex-direction: row; text-align: left; } }
.result-hero h1 { margin: .2rem 0; }
.correction { list-style: none; padding: 0; margin: 0; display: grid; gap: .7rem; }
.correction li { border-left: 4px solid var(--ok); }
.correction li.ko { border-left-color: var(--ko); }
.corr-head { display: flex; align-items: center; gap: .6rem; } .corr-head .muted { margin-left: auto; }
.corr-badge { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: var(--ok); }
.ko .corr-badge { background: var(--ko); } .corr-badge .ico { width: 15px; height: 15px; }
.corr-prompt { margin: .6rem 0; font-weight: 550; }
.corr-expected { color: var(--ok); margin: 0 0 .4rem; }
.corr-expl { display: flex; gap: .5rem; color: var(--muted); font-size: .93rem; margin: 0; } .corr-expl .ico { color: var(--accent); }

/* ---------- Entraînement ---------- */
.practice-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: .5rem; margin-bottom: .9rem; }
.practice-stats div { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: .55rem .3rem; text-align: center; }
.practice-stats b { display: block; font-size: 1.1rem; } .practice-stats small { color: var(--muted); font-size: .7rem; }
.practice-card { padding: 1.2rem; }
.q-prompt { font-size: clamp(1.15rem, 3.5vw, 1.4rem); margin: .6rem 0 1rem; line-height: 1.4; }
.practice-card input[name=text] { margin-bottom: 1rem; font-size: 1.05rem; }
.hint-box { display: flex; gap: .5rem; padding: .8rem 1rem; border-radius: 12px; background: var(--warn-soft); color: var(--text); margin-bottom: 1rem; }
.hint-box .ico { color: var(--warn); }
.feedback { padding: .9rem 1rem; border-radius: 14px; margin: 1rem 0; border: 1px solid transparent; }
.feedback p { margin: .4rem 0 0; display: flex; gap: .4rem; align-items: flex-start; } .feedback p .ico { flex-shrink: 0; margin-top: 3px; }
.feedback.ok { background: var(--ok-soft); border-color: color-mix(in srgb, var(--ok) 30%, transparent); } .feedback.ok > b { color: var(--ok); }
.feedback.ko { background: var(--ko-soft); border-color: color-mix(in srgb, var(--ko) 30%, transparent); } .feedback.ko > b { color: var(--ko); }

/* ---------- Fiches ---------- */
.deck-row { display: flex; gap: .6rem; overflow-x: auto; padding-bottom: .5rem; margin-bottom: 1rem; scrollbar-width: thin; }
.deck { flex-shrink: 0; text-align: left; min-width: 150px; padding: .8rem 1rem; border-radius: 14px; border: 1.5px solid var(--border); background: var(--surface); cursor: pointer; }
.deck b { display: block; } .deck small { color: var(--muted); }
.deck.active { border-color: var(--primary); background: var(--primary-soft); }
.due { color: var(--ko); font-weight: 700; }
.card-list { display: grid; gap: .6rem; }
.fc { display: flex; flex-direction: column; gap: .6rem; padding: .9rem 1rem; }
.fc-main b { display: block; } .fc-main span { display: block; font-size: .93rem; white-space: pre-wrap; }
.fc-meta { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; } .fc-meta small { margin-right: auto; }
@media (min-width: 760px) { .fc { flex-direction: row; align-items: center; } .fc-main { flex: 1; } .fc-meta small { margin-right: 0; } }
.review .runner-body { display: flex; align-items: center; justify-content: center; }
.flash { width: 100%; max-width: 640px; }
.flash-face { background: var(--surface); border: 1px solid var(--border); border-radius: 22px; padding: 2rem 1.3rem; box-shadow: var(--shadow); text-align: center; min-height: 300px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1rem; animation: fade .25s ease; }
.flash-face h2 { font-size: clamp(1.4rem, 5vw, 2rem); white-space: pre-wrap; margin: 0; }
.flash-face .feedback { width: 100%; }
.typed { display: flex; gap: .5rem; width: 100%; max-width: 420px; }
.rate { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; width: 100%; margin-top: .6rem; }
.rate-btn { border: 0; border-radius: 14px; padding: .7rem .3rem; cursor: pointer; font-weight: 700; color: #fff; display: grid; gap: 2px; }
.rate-btn small { font-weight: 500; opacity: .85; font-size: .75rem; }
.rate-btn.again { background: var(--ko); } .rate-btn.hard { background: #f08c1a; } .rate-btn.good { background: var(--ok); } .rate-btn.easy { background: var(--primary); }
.done-screen { text-align: center; max-width: 480px; } .big-emoji { font-size: 4rem; }

/* ---------- Classes ---------- */
.join-form { display: grid; gap: .6rem; margin-bottom: 1rem; }
@media (min-width: 640px) { .join-form { grid-template-columns: 1fr auto; align-items: end; } .join-form .form-error { grid-column: 1 / -1; } }
.join-form input { text-transform: uppercase; letter-spacing: .1em; font-family: var(--mono); }
.class-card h3 { margin: .3rem 0; }
.code-box { display: flex; align-items: center; gap: .6rem; background: var(--surface); border: 1px dashed var(--primary); border-radius: 14px; padding: .5rem .5rem .5rem 1rem; }
.code-box small { color: var(--muted); font-size: .75rem; display: block; }
.code-box code { font-size: 1.3rem; font-weight: 800; letter-spacing: .18em; background: none; color: var(--primary); padding: 0; }
.class-layout { display: grid; gap: 1rem; }
@media (min-width: 960px) { .class-layout { grid-template-columns: 1fr 300px; align-items: start; } }
.assignment { margin-bottom: .8rem; }
.assignment.past { opacity: .88; }
.as-head { display: flex; justify-content: space-between; gap: .8rem; align-items: flex-start; }
.as-head h3 { margin: 0 0 .2rem; } .as-head small { display: inline-flex; gap: .3rem; align-items: center; } .as-head small .ico { width: 15px; }
.as-status { display: flex; flex-wrap: wrap; gap: .3rem; justify-content: flex-end; }
.as-text { margin: .7rem 0; color: var(--text); font-size: .95rem; }
.grade { font-size: 1.15rem; font-weight: 800; color: var(--primary); background: var(--primary-soft); padding: .2rem .65rem; border-radius: 10px; }
.members h2 { font-size: 1.05rem; }
.member-list li { display: flex; align-items: center; gap: .6rem; padding: .5rem 0; border-bottom: 1px solid var(--border); }
.member-list li > span:nth-child(2) { flex: 1; } .member-list b { display: block; font-size: .92rem; } .member-list small { color: var(--muted); }
.members .btn { margin-top: 1rem; }
.subs { display: grid; gap: .7rem; margin-top: .8rem; }
.sub.missing { opacity: .6; box-shadow: none; }
.sub-head { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; } .sub-head small { margin-left: auto; }
.sub-text { background: var(--surface-2); padding: .8rem; border-radius: 10px; margin: .7rem 0; font-size: .93rem; white-space: normal; }
.grade-form { display: grid; grid-template-columns: 100px 1fr; gap: .6rem; align-items: end; }
.grade-form .btn { grid-column: 1 / -1; }
@media (min-width: 640px) { .grade-form { grid-template-columns: 100px 1fr auto; } .grade-form .btn { grid-column: auto; } }

/* ---------- Agenda ---------- */
.agenda-layout { display: grid; gap: 1rem; }
@media (min-width: 960px) { .agenda-layout { grid-template-columns: 1.3fr 1fr; align-items: start; } }
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: .6rem; }
.cal-head h2 { margin: 0; text-transform: capitalize; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-dow { text-align: center; font-size: .72rem; font-weight: 800; color: var(--muted); text-transform: uppercase; padding: .3rem 0; }
.cal-day { aspect-ratio: 1; border: 0; border-radius: 10px; background: var(--surface-2); cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-weight: 650; min-height: 40px; }
.cal-day.today span { color: var(--primary); font-weight: 900; }
.cal-day.sel { background: var(--primary); color: #fff; } .cal-day.sel span { color: #fff; }
.cal-day i { display: flex; gap: 2px; height: 6px; } .cal-day em { width: 6px; height: 6px; border-radius: 50%; background: var(--primary); }
.cal-day em.assignment { background: var(--accent); } .cal-day.sel em { background: #fff; }
.day-list h2 { text-transform: capitalize; }
.ag-item { display: flex; align-items: center; gap: .7rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
.ag-item > div { flex: 1; min-width: 0; } .ag-item b { display: block; } .ag-item small { color: var(--muted); }
.ag-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--primary); flex-shrink: 0; }
.ag-item.assignment .ag-dot { background: var(--accent); }

/* ---------- Progression ---------- */
.level-chip.big { grid-template-columns: auto 160px; }
.goal-list li { display: flex; align-items: center; gap: .8rem; padding: .65rem 0; border-bottom: 1px solid var(--border); }
.goal-list li > div { flex: 1; } .goal-list small { display: block; color: var(--muted); margin-bottom: .35rem; }
.badges { display: grid; grid-template-columns: repeat(2, 1fr); gap: .6rem; }
@media (min-width: 640px) { .badges { grid-template-columns: repeat(5, 1fr); } }
.badge { text-align: center; padding: .9rem .5rem; border-radius: 14px; background: var(--surface-2); opacity: .5; filter: grayscale(1); }
.badge span { font-size: 1.8rem; display: block; } .badge b { display: block; font-size: .85rem; margin-top: .3rem; } .badge small { color: var(--muted); font-size: .72rem; line-height: 1.3; display: block; }
.badge.earned { opacity: 1; filter: none; background: linear-gradient(160deg, #fff7e0, #fff); border: 1px solid #ffe2a3; }
[data-theme="dark"] .badge.earned { background: linear-gradient(160deg, #3a2e0d, var(--surface)); border-color: #5a4614; }

/* ---------- Assistant ---------- */
.chat { display: flex; flex-direction: column; padding: 0; overflow: hidden; height: calc(100vh - 230px); min-height: 440px; }
.chat-opts { display: flex; gap: .5rem; flex-wrap: wrap; padding: .8rem; border-bottom: 1px solid var(--border); align-items: center; }
.chat-opts select { width: auto; min-height: 40px; padding: .4rem .6rem; font-size: .9rem; }
.ctx { background: var(--primary-soft); color: var(--primary); border: 0; } .ctx .link { font-size: 1.1rem; margin-left: .2rem; }
.chat-log { flex: 1; overflow-y: auto; padding: 1rem; display: flex; flex-direction: column; gap: .7rem; }
.bubble { max-width: 88%; padding: .75rem 1rem; border-radius: 18px; background: var(--surface-2); border-bottom-left-radius: 6px; }
.bubble p:last-child, .bubble .prose > :last-child { margin-bottom: 0; }
.bubble .prose { font-size: .97rem; line-height: 1.6; } .bubble .prose h2 { margin-top: .5em; }
.bubble.me { align-self: flex-end; background: var(--primary); color: #fff; border-radius: 18px; border-bottom-right-radius: 6px; }
.sources { display: flex; flex-wrap: wrap; gap: .4rem; margin: .6rem 0 .3rem; }
.suggests { display: flex; flex-wrap: wrap; gap: .4rem; }
.chat-input { display: flex; gap: .5rem; padding: .7rem; border-top: 1px solid var(--border); align-items: flex-end; }
.chat-input textarea { min-height: 48px; resize: none; }
.chat > .tiny { padding: 0 .8rem .6rem; margin: 0; }
.typing { display: flex; gap: 4px; padding: .3rem 0; } .typing span { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); animation: bounce 1s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; } .typing span:nth-child(3) { animation-delay: .3s; }
@media (max-width: 959px) { .chat { height: calc(100vh - 250px - var(--tabbar)); } }

/* ---------- Documents ---------- */
.dropzone { display: flex; flex-direction: column; align-items: center; gap: .35rem; padding: 2rem 1rem; border: 2px dashed var(--border); cursor: pointer; text-align: center; box-shadow: none; }
.dropzone .ico { width: 36px; height: 36px; color: var(--primary); }
.dropzone.over { border-color: var(--primary); background: var(--primary-soft); }
.quota { display: flex; align-items: center; gap: .8rem; margin: .9rem 0 1.2rem; }
.doc-list { display: grid; gap: .6rem; }
.doc { display: flex; align-items: center; gap: .8rem; padding: .7rem .9rem; }
.doc-ico { font-size: 1.5rem; } .doc-main { flex: 1; min-width: 0; } .doc-main b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-actions { display: flex; }

/* ---------- Studio ---------- */
.editor-layout { display: grid; gap: 1rem; }
@media (min-width: 1100px) { .editor-layout { grid-template-columns: 1fr 1fr; align-items: start; } .preview { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; } }
.q-edit { display: grid; gap: .8rem; margin-bottom: .8rem; border-left: 4px solid var(--primary); }
.qe-head { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; }
.qe-head select { width: auto; min-height: 38px; padding: .3rem .5rem; }
.pts { display: flex; align-items: center; gap: .4rem; font-size: .85rem; } .pts input { width: 70px !important; min-height: 38px !important; padding: .3rem .5rem !important; }
.choice-edit { display: grid; gap: .5rem; }
.ce-row { display: flex; gap: .5rem; align-items: center; }
.ce-right { display: flex; align-items: center; gap: .35rem; cursor: pointer; flex-shrink: 0; }
.ce-right span { font-weight: 800; color: var(--muted); width: 16px; }
.add-q { margin-bottom: 1rem; }
.sticky-save { position: sticky; bottom: calc(var(--tabbar) + 10px + env(safe-area-inset-bottom)); z-index: 5; display: grid; gap: .6rem; }
@media (min-width: 960px) { .sticky-save { bottom: 12px; } }
.audit li { display: grid; grid-template-columns: 1fr; gap: .1rem; padding: .6rem 0; border-bottom: 1px solid var(--border); }
@media (min-width: 760px) { .audit li { grid-template-columns: 170px 160px 200px 1fr; gap: .8rem; align-items: center; } }

/* ---------- Compte ---------- */
.page.narrow > section.card { margin-bottom: 1rem; }
.plans { display: grid; gap: .7rem; margin-bottom: .7rem; }
@media (min-width: 640px) { .plans { grid-template-columns: repeat(3, 1fr); } }
.plan { border: 1.5px solid var(--border); border-radius: 14px; padding: .9rem; display: grid; gap: .4rem; align-content: start; }
.plan.current { border-color: var(--primary); background: var(--primary-soft); }
.plan ul { list-style: none; padding: 0; margin: 0; font-size: .88rem; color: var(--muted); display: grid; gap: .3rem; }
.plan li { display: flex; gap: .35rem; } .plan .ico { width: 16px; color: var(--ok); }

/* ---------- Authentification ---------- */
.auth-page { display: grid; place-items: center; min-height: calc(100vh - 140px); }
.auth-card { width: 100%; max-width: 440px; padding: 1.8rem 1.4rem; }
.auth-card h1 { text-align: center; } .auth-card > p { text-align: center; }
.auth-card .form { margin: 1.2rem 0; }
.demo-box { margin-top: 1rem; padding: .8rem 1rem; border-radius: 12px; background: var(--surface-2); }
.demo-box summary { cursor: pointer; font-weight: 650; display: flex; align-items: center; gap: .4rem; list-style: none; }
.demo-box summary .ico { color: var(--accent); }
.demo-accounts { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ---------- Modale, menu, toasts ---------- */
.modal-backdrop { position: fixed; inset: 0; z-index: 60; background: rgba(10,15,35,.5); display: flex; align-items: flex-end; justify-content: center; opacity: 0; transition: opacity .2s; }
.modal-backdrop.open { opacity: 1; }
.modal { position: relative; width: 100%; max-height: 92vh; overflow-y: auto; background: var(--surface); border-radius: 22px 22px 0 0; padding: 1.4rem 1.2rem; padding-bottom: max(1.4rem, env(safe-area-inset-bottom)); transform: translateY(30px); transition: transform .22s ease; }
.modal-backdrop.open .modal { transform: none; }
.modal-close { position: absolute; top: .6rem; right: .6rem; }
.modal h2 { padding-right: 2.5rem; }
.confirm-text { font-size: 1.05rem; font-weight: 550; padding-right: 2rem; margin-bottom: 1.2rem; }
@media (min-width: 640px) { .modal-backdrop { align-items: center; } .modal { max-width: 520px; border-radius: 22px; padding: 1.6rem; } .modal-wide { max-width: 820px; } }
.menu-sheet { position: fixed; inset: 0; z-index: 50; }
.menu-backdrop { position: absolute; inset: 0; background: rgba(10,15,35,.45); opacity: 0; transition: opacity .2s; }
.menu-panel { position: absolute; left: 0; right: 0; bottom: 0; background: var(--surface); border-radius: 22px 22px 0 0; padding: .6rem 1rem calc(1rem + env(safe-area-inset-bottom)); transform: translateY(100%); transition: transform .22s ease; }
.menu-sheet.open .menu-backdrop { opacity: 1; } .menu-sheet.open .menu-panel { transform: none; }
.menu-grab { width: 42px; height: 5px; border-radius: 3px; background: var(--border); margin: 0 auto .8rem; }
.menu-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: .6rem; }
.menu-item { display: flex; flex-direction: column; align-items: center; gap: .4rem; padding: .9rem .3rem; border-radius: 14px; background: var(--surface-2); font-size: .8rem; font-weight: 650; text-align: center; }
.menu-item .ico { width: 24px; height: 24px; color: var(--primary); }
#toasts { position: fixed; z-index: 80; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar) + 14px + env(safe-area-inset-bottom)); display: grid; gap: .5rem; width: min(92vw, 420px); pointer-events: none; }
@media (min-width: 960px) { #toasts { bottom: 24px; } }
body.focus-mode #toasts { bottom: 90px; }
.toast { background: var(--text); color: var(--surface); padding: .8rem 1rem; border-radius: 12px; font-weight: 600; box-shadow: var(--shadow); opacity: 0; transform: translateY(10px); transition: all .25s; text-align: center; }
.toast.show { opacity: 1; transform: none; }
.toast-success { background: var(--ok); color: #fff; } .toast-error { background: var(--ko); color: #fff; }
