/* lab proxmox, facon shadcn zinc, tt en tokens pr le mode sombre */
@font-face { font-family: 'Geist'; font-weight: 400; font-display: swap; src: url('/assets/fonts/Geist-400.ttf'); }
@font-face { font-family: 'Geist'; font-weight: 500; font-display: swap; src: url('/assets/fonts/Geist-500.ttf'); }
@font-face { font-family: 'Geist'; font-weight: 600; font-display: swap; src: url('/assets/fonts/Geist-600.ttf'); }
@font-face { font-family: 'Geist'; font-weight: 700; font-display: swap; src: url('/assets/fonts/Geist-700.ttf'); }
@font-face { font-family: 'Geist Mono'; font-weight: 400; font-display: swap; src: url('/assets/fonts/GeistMono-400.ttf'); }
@font-face { font-family: 'Geist Mono'; font-weight: 500; font-display: swap; src: url('/assets/fonts/GeistMono-500.ttf'); }
@font-face { font-family: 'Geist Mono'; font-weight: 600; font-display: swap; src: url('/assets/fonts/GeistMono-600.ttf'); }

:root {
  --bg: #ffffff; --fg: #09090b; --card: #ffffff; --soft: #f4f4f5; --soft2: #fafafa;
  --muted: #71717a; --muted2: #a1a1aa; --border: #e4e4e7; --input: #e4e4e7; --ring: #a1a1aa;
  --primary: #18181b; --primary-fg: #fafafa; --diff-off: #e4e4e7;
  --shadow: 0 1px 2px rgb(0 0 0 / .04), 0 1px 3px rgb(0 0 0 / .05);
  --shadow-lg: 0 10px 30px -10px rgb(0 0 0 / .18), 0 4px 10px -6px rgb(0 0 0 / .1);
  --ok: #10b981; --ok-bg: #ecfdf5; --ok-bd: #a7f3d0; --ok-fg: #047857;
  --wip: #f59e0b; --wip-bg: #fffbeb; --wip-bd: #fde68a; --wip-fg: #b45309;
  --ko: #ef4444; --ko-bg: #fef2f2; --ko-bd: #fecaca; --ko-fg: #b91c1c;
  --info-bg: #f8fafc; --info-bd: #e2e8f0; --tip-bg: #f0fdf4; --tip-bd: #bbf7d0;
  --vio-bg: #f5f3ff; --vio-bd: #ddd6fe;
  --ease: cubic-bezier(.22, 1, .36, 1);
  --lv: #71717a;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #09090b; --fg: #fafafa; --card: #0c0c0e; --soft: #18181b; --soft2: #111113;
    --muted: #a1a1aa; --muted2: #71717a; --border: #27272a; --input: #303036; --ring: #52525b;
    --primary: #fafafa; --primary-fg: #18181b; --diff-off: #3f3f46;
    --shadow: 0 1px 2px rgb(0 0 0 / .4); --shadow-lg: 0 16px 40px -12px rgb(0 0 0 / .7);
    --ok-bg: #052e22; --ok-bd: #065f46; --ok-fg: #6ee7b7;
    --wip-bg: #2b1d05; --wip-bd: #78450a; --wip-fg: #fcd34d;
    --ko-bg: #2c0b0b; --ko-bd: #7f1d1d; --ko-fg: #fca5a5;
    --info-bg: #0d1420; --info-bd: #1e293b; --tip-bg: #04170f; --tip-bd: #14532d;
    --vio-bg: #160f2b; --vio-bd: #3b2a75;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #09090b; --fg: #fafafa; --card: #0c0c0e; --soft: #18181b; --soft2: #111113;
  --muted: #a1a1aa; --muted2: #71717a; --border: #27272a; --input: #303036; --ring: #52525b;
  --primary: #fafafa; --primary-fg: #18181b; --diff-off: #3f3f46;
  --shadow: 0 1px 2px rgb(0 0 0 / .4); --shadow-lg: 0 16px 40px -12px rgb(0 0 0 / .7);
  --ok-bg: #052e22; --ok-bd: #065f46; --ok-fg: #6ee7b7;
  --wip-bg: #2b1d05; --wip-bd: #78450a; --wip-fg: #fcd34d;
  --ko-bg: #2c0b0b; --ko-bd: #7f1d1d; --ko-fg: #fca5a5;
  --info-bg: #0d1420; --info-bd: #1e293b; --tip-bg: #04170f; --tip-bd: #14532d;
  --vio-bg: #160f2b; --vio-bd: #3b2a75;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 88px; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0; background: var(--bg); color: var(--fg); font: 15px/1.6 'Geist', ui-sans-serif, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased; transition: background-color .3s var(--ease), color .3s var(--ease);
}
a { color: inherit; }
.mono, code, pre, kbd { font-family: 'Geist Mono', ui-monospace, monospace; }
b, strong { font-weight: 600; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.dim { opacity: .5; }
[hidden] { display: none !important; }
::selection { background: color-mix(in srgb, var(--lv) 30%, transparent); }

.ico { width: 16px; height: 16px; flex-shrink: 0; }
.ico.big { width: 32px; height: 32px; color: var(--muted2); }

/* ---------- animations ---------- */
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.97); } to { opacity: 1; transform: none; } }
@keyframes ping { 75%, 100% { transform: scale(2.2); opacity: 0; } }
@keyframes flash {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--lv) 55%, transparent); background-color: color-mix(in srgb, var(--lv) 12%, transparent); }
  100% { box-shadow: 0 0 0 6px transparent; }
}
@keyframes here {
  0%, 100% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--lv) 70%, transparent), 0 0 0 6px color-mix(in srgb, var(--lv) 12%, transparent); }
  50% { box-shadow: 0 0 0 2px color-mix(in srgb, var(--lv) 70%, transparent), 0 0 0 10px color-mix(in srgb, var(--lv) 4%, transparent); }
}
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes shimmer { from { background-position: -200% 0; } to { background-position: 200% 0; } }
.reveal { animation: rise .6s var(--ease) both; animation-delay: calc(var(--i, 0) * 55ms); }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- barre du haut ---------- */
.topbar {
  position: sticky; top: 0; z-index: 40; height: 60px; display: flex; align-items: center; gap: 16px;
  padding: 0 20px; background: color-mix(in srgb, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px);
  border-bottom: 1px solid var(--border);
}
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; flex-shrink: 0; }
.brand img { width: 28px; height: 28px; border-radius: 8px; transition: transform .4s var(--ease); }
.brand:hover img { transform: rotate(-8deg) scale(1.06); }
.wm { font-weight: 700; letter-spacing: -.02em; font-size: 15px; }
.wm b { font-weight: 700; } .wm i { font-style: normal; color: var(--muted2); }
.brand-sep { width: 1px; height: 18px; background: var(--border); }
.brand-sub { font-size: 13px; color: var(--muted); font-weight: 500; }
.tb-mid { flex: 1; display: flex; align-items: center; justify-content: center; gap: 16px; min-width: 0; }
.tb-right { display: flex; align-items: center; gap: 6px; }
.crumb {
  display: inline-flex; align-items: center; gap: 4px; font-size: 13px; color: var(--muted); text-decoration: none;
  padding: 4px 8px 4px 4px; border-radius: 8px; transition: background .2s, color .2s;
}
.crumb:hover { background: var(--soft); color: var(--fg); }
main > .crumb { margin-bottom: 12px; }

.iconbtn {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; border: 1px solid transparent;
  background: transparent; color: var(--muted); cursor: pointer; transition: all .2s var(--ease);
}
.iconbtn:hover { background: var(--soft); color: var(--fg); }
.iconbtn:active { transform: scale(.94); }
.i-moon { display: none; }
:root[data-theme="dark"] .i-sun { display: none; }
:root[data-theme="dark"] .i-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme]) .i-sun { display: none; }
  :root:not([data-theme]) .i-moon { display: block; }
}

/* menu deroulant */
.menu { position: relative; }
.menu-btn {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px 4px 4px; border-radius: 12px; border: 1px solid transparent;
  background: transparent; color: var(--fg); cursor: pointer; font: inherit; transition: background .2s, border-color .2s;
}
.menu-btn:hover, .menu.open .menu-btn { background: var(--soft); }
.menu-who { display: flex; flex-direction: column; line-height: 1.15; text-align: left; }
.menu-who b { font-size: 13px; } .menu-who small { font-size: 11px; color: var(--muted); }
.chev { width: 14px; height: 14px; color: var(--muted); transition: transform .25s var(--ease); }
.menu.open .chev { transform: rotate(180deg); }
.menu-pop {
  position: absolute; right: 0; top: calc(100% + 6px); min-width: 240px; padding: 6px; z-index: 50;
  background: var(--card); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  opacity: 0; transform: translateY(-4px) scale(.98); transform-origin: top right; pointer-events: none;
  transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.menu.open .menu-pop { opacity: 1; transform: none; pointer-events: auto; }
.menu-pop button {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border: 0; border-radius: 8px;
  background: transparent; color: var(--fg); font: inherit; font-size: 14px; cursor: pointer; text-align: left;
}
.menu-pop button:hover { background: var(--soft); }
.menu-pop button.danger { color: var(--ko-fg); }
.menu-pop .ico { color: var(--muted); } .menu-pop .danger .ico { color: inherit; }
.menu-h { padding: 6px 10px 8px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); margin-bottom: 4px; }

/* ---------- boutons, champs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 38px; padding: 0 16px;
  border-radius: 10px; border: 1px solid var(--primary); background: var(--primary); color: var(--primary-fg);
  font: 500 14px/1 'Geist', sans-serif; text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: transform .15s var(--ease), background .2s, box-shadow .2s, opacity .2s;
  box-shadow: var(--shadow);
}
.btn:hover { opacity: .9; }
.btn:active { transform: scale(.97); }
.btn:focus-visible, .in:focus-visible, .seg-o:focus-visible, .iconbtn:focus-visible { outline: none; box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 45%, transparent); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.full { width: 100%; height: 42px; }
.btn.ghost { background: transparent; color: var(--fg); border-color: var(--border); box-shadow: none; }
.btn.ghost:hover { background: var(--soft); opacity: 1; }
.btn.glass { background: rgb(255 255 255 / .08); border-color: rgb(255 255 255 / .16); color: #fafafa; box-shadow: none; }
.btn.glass:hover { background: rgb(255 255 255 / .14); opacity: 1; }
.btn.ok { background: var(--ok); border-color: var(--ok); color: #fff; }
.btn.danger { background: var(--ko); border-color: var(--ko); color: #fff; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.btn .ico { width: 15px; height: 15px; }
.btn .spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; }

.in {
  width: 100%; font: inherit; font-size: 14px; color: var(--fg); background: var(--card);
  border: 1px solid var(--input); border-radius: 10px; padding: 8px 12px; outline: none;
  transition: border-color .2s, box-shadow .25s var(--ease), background .2s;
}
.in::placeholder { color: var(--muted2); }
.in:hover { border-color: color-mix(in srgb, var(--ring) 60%, var(--input)); }
.in:focus { border-color: color-mix(in srgb, var(--lv) 70%, var(--ring)); box-shadow: 0 0 0 3px color-mix(in srgb, var(--lv) 18%, transparent); }
textarea.in { resize: none; line-height: 1.55; min-height: 44px; overflow: hidden; display: block; }
.in.mono { font-family: 'Geist Mono', monospace; font-size: 13px; }
.in[readonly] { cursor: default; }
.in[readonly]:focus { box-shadow: none; border-color: var(--input); }
.lbl-f { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 500; margin-bottom: 14px; }
.form-err { color: var(--ko-fg); background: var(--ko-bg); border: 1px solid var(--ko-bd); border-radius: 8px; padding: 8px 12px; font-size: 13px; animation: pop .25s var(--ease); }

/* toggle group facon shadcn */
.seg { display: inline-flex; gap: 2px; padding: 3px; background: var(--soft); border-radius: 10px; flex-wrap: wrap; }
.seg-o {
  border: 0; background: transparent; color: var(--muted); font: 500 13px 'Geist', sans-serif; padding: 6px 12px;
  border-radius: 7px; cursor: pointer; transition: all .2s var(--ease);
}
.seg-o:hover { color: var(--fg); }
.seg-o.on { background: var(--card); color: var(--fg); box-shadow: var(--shadow), 0 0 0 1px var(--border); }
.seg-o:active { transform: scale(.96); }
.seg.locked .seg-o { pointer-events: none; }

/* switch */
.switch { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; user-select: none; }
.switch input { display: none; }
.sw { width: 34px; height: 20px; border-radius: 99px; background: var(--input); position: relative; transition: background .25s var(--ease); }
.sw::after { content: ""; position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgb(0 0 0 / .3); transition: transform .3s var(--ease); }
.switch input:checked + .sw { background: var(--lv); }
.switch input:checked + .sw::after { transform: translateX(14px); }
.switch:has(input:checked) { color: var(--fg); }

/* ---------- petits elements ---------- */
.avatar {
  position: relative; width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; flex-shrink: 0;
  background: linear-gradient(135deg, var(--soft), color-mix(in srgb, var(--fg) 8%, var(--soft)));
  border: 1px solid var(--border); font: 600 14px 'Geist', sans-serif; color: var(--fg);
}
.avatar.sm { width: 30px; height: 30px; border-radius: 9px; font-size: 11px; }
.avatar.xs { width: 20px; height: 20px; border-radius: 6px; font-size: 9px; background: rgb(255 255 255 / .12); border-color: rgb(255 255 255 / .2); color: #fff; }
.avatar.lg { width: 56px; height: 56px; border-radius: 16px; font-size: 18px; }
.pres { position: absolute; right: -3px; bottom: -3px; width: 12px; height: 12px; border-radius: 50%; background: var(--muted2); border: 2px solid var(--card); transition: background .3s; }
.pres.on { background: var(--ok); }
.pres.on::after { content: ""; position: absolute; inset: -2px; border-radius: 50%; background: var(--ok); animation: ping 1.6s cubic-bezier(0, 0, .2, 1) infinite; }
.live-dot { position: relative; width: 8px; height: 8px; border-radius: 50%; background: var(--muted2); display: inline-block; flex-shrink: 0; }
.live-dot.on { background: var(--ok); }
.live-dot.on::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--ok); animation: ping 1.6s cubic-bezier(0, 0, .2, 1) infinite; }
.pill {
  display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); background: var(--soft2);
}
.pill .dot, .panel-h .dot, .hero-over .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--lv); display: inline-block; }
.pill.glass { background: rgb(255 255 255 / .07); border-color: rgb(255 255 255 / .14); color: #e4e4e7; height: 32px; }
.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 99px; font-size: 12px; font-weight: 500; animation: pop .3s var(--ease); }
.badge.warn { background: var(--wip-bg); color: var(--wip-fg); border: 1px solid var(--wip-bd); }
.overline { font: 500 12px 'Geist Mono', monospace; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }

.bar { --c: var(--primary); height: 6px; border-radius: 99px; background: var(--soft); overflow: hidden; flex: 1; position: relative; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--c); width: 0; transition: width .8s var(--ease); }
.mini { height: 5px; border-radius: 99px; background: var(--soft); overflow: hidden; }
.mini i { display: block; height: 100%; background: var(--lv); width: 0; transition: width .8s var(--ease); border-radius: inherit; }

.ring, .ring-big { --p: 0; position: relative; display: inline-grid; place-items: center; flex-shrink: 0; }
.ring svg, .ring-big svg { transform: rotate(-90deg); width: 100%; height: 100%; }
.rg-bg { fill: none; stroke: var(--soft); stroke-width: 3.2; }
.rg-fg { fill: none; stroke: var(--lv); stroke-width: 3.2; stroke-linecap: round; stroke-dasharray: var(--p) 100; transition: stroke-dasharray .8s var(--ease); }
.ring { width: 18px; height: 18px; }
.ring .rg-bg, .ring .rg-fg { stroke-width: 3; }
.ring.full .rg-fg { stroke: var(--ok); }
.ring-big { width: 92px; height: 92px; --lv: var(--primary); }
.ring-big .rg-fg { stroke: var(--fg); }
.ring-big span { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; line-height: 1; }
.ring-big b { font-size: 24px; letter-spacing: -.03em; }
.ring-big small { font-size: 10px; color: var(--muted); margin-top: 3px; }

.vchip { display: inline-flex; align-items: center; gap: 5px; font-size: 11.5px; font-weight: 500; padding: 2px 8px; border-radius: 99px; border: 1px solid transparent; white-space: nowrap; transition: all .3s var(--ease); }
.vchip:empty { display: none; }
.vchip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.vchip.acquis { background: var(--ok-bg); color: var(--ok-fg); border-color: var(--ok-bd); }
.vchip.en_cours { background: var(--wip-bg); color: var(--wip-fg); border-color: var(--wip-bd); }
.vchip.non_acquis { background: var(--ko-bg); color: var(--ko-fg); border-color: var(--ko-bd); }
.vchip.done { background: var(--soft); color: var(--fg); border-color: var(--border); }
.vchip.pop { animation: pop .35s var(--ease); }

/* ---------- mise en page ---------- */
.wrap { max-width: 1120px; margin: 0 auto; padding: 32px 20px 96px; }
.wrap.wide { max-width: 1320px; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; margin-bottom: 28px; flex-wrap: wrap; }
.page-head h1 { font-size: 32px; letter-spacing: -.035em; line-height: 1.1; margin: 0 0 8px; }
.page-head p { margin: 0; max-width: 620px; }
.who { display: flex; align-items: center; gap: 16px; }
.who h1 { margin-bottom: 2px; font-size: 28px; }
.head-act { display: flex; align-items: center; gap: 16px; }

.panel { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 18px 20px; box-shadow: var(--shadow); margin-bottom: 20px; }
.panel.sticky { position: sticky; top: 80px; }
.panel-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.panel-h h2 { font-size: 15px; margin: 0; display: flex; align-items: center; gap: 8px; letter-spacing: -.01em; }
.panel-h h2 .ico { color: var(--muted); }
.sep-h { font: 500 11px 'Geist Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin: 16px 0 6px; }
.row-link { display: flex; align-items: center; gap: 10px; padding: 8px 10px; margin: 0 -10px; border-radius: 10px; text-decoration: none; font-size: 14px; transition: background .2s; }
.row-link:hover { background: var(--soft); }
.row-link span { flex: 1; }
.row-link .ico { color: var(--muted); }
.row-link.strong { font-weight: 500; }
.row-link:hover .ico.dim { opacity: 1; transform: translateX(2px); }
.row-link .ico.dim { transition: transform .2s var(--ease), opacity .2s; }

.empty { text-align: center; padding: 80px 20px; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.empty.soft { padding: 56px 24px; border: 1px dashed var(--border); border-radius: 16px; background: var(--soft2); }
.empty h2, .empty h3 { margin: 0; letter-spacing: -.02em; }
.empty p { margin: 0 0 8px; max-width: 420px; }
.empty-code { font-size: 64px; font-weight: 600; color: var(--muted2); letter-spacing: -.04em; }

/* ---------- login ---------- */
.pg-login .topbar { display: none; }
.pg-login .wrap { padding: 0; max-width: none; }
.login { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.login-art { position: relative; background: #0a0a0b; color: #fafafa; overflow: hidden; display: flex; align-items: flex-end; padding: 48px; }
.login-art .hero-topo { position: absolute; inset: 0; width: 100%; height: 100%; }
.login-art-in { position: relative; animation: rise .9s var(--ease) both; }
.login-logo { width: 56px; height: 56px; border-radius: 14px; margin-bottom: 28px; box-shadow: 0 10px 40px -10px rgb(255 255 255 / .2); }
.login-quote { font-size: 34px; font-weight: 600; letter-spacing: -.035em; line-height: 1.1; }
.login-sub { color: #a1a1aa; margin-top: 12px; max-width: 380px; }
.login-card { align-self: center; justify-self: center; width: 100%; max-width: 380px; padding: 32px 24px; }
.login-card h1 { font-size: 26px; letter-spacing: -.03em; margin: 28px 0 4px; }
.login-card > p { margin: 0 0 24px; }
@media (max-width: 860px) {
  .login { grid-template-columns: 1fr; }
  .login-art { min-height: 200px; padding: 28px 20px; }
  .login-quote { font-size: 24px; } .login-logo { width: 40px; height: 40px; margin-bottom: 16px; }
}

/* ---------- accueil stagiaire ---------- */
.grid-docs { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; margin-bottom: 24px; }
.dcard {
  position: relative; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 20px;
  display: flex; flex-direction: column; gap: 10px; box-shadow: var(--shadow); overflow: hidden;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.dcard::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: var(--lv); transform: scaleX(.12); transform-origin: left; transition: transform .6s var(--ease); }
.dcard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: color-mix(in srgb, var(--lv) 35%, var(--border)); }
.dcard:hover::before { transform: scaleX(1); }
.dcard-top { display: flex; justify-content: space-between; align-items: center; }
.dcard h3 { margin: 4px 0 0; font-size: 20px; letter-spacing: -.025em; }
.dcard p { margin: 0; }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.dcard-prog { display: flex; align-items: center; gap: 10px; margin-top: auto; padding-top: 6px; }
.dcard-act { display: flex; gap: 8px; margin-top: 4px; }
.feedback { display: flex; flex-direction: column; gap: 10px; }
.fb { display: flex; gap: 12px; padding: 12px; border: 1px solid var(--border); border-radius: 12px; text-decoration: none; transition: background .2s, transform .2s var(--ease); animation: rise .4s var(--ease) both; }
.fb:hover { background: var(--soft2); transform: translateX(2px); }
.fb-l { width: 3px; border-radius: 99px; background: var(--lv); flex-shrink: 0; }
.fb-b { flex: 1; min-width: 0; }
.fb-t { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 14px; font-weight: 500; }
.fb-c { font-size: 14px; color: var(--muted); margin-top: 4px; white-space: pre-wrap; }
.fb-m { font-size: 12px; color: var(--muted2); margin-top: 4px; }
[data-empty]:empty::before { content: attr(data-empty); display: block; color: var(--muted); font-size: 14px; padding: 18px 4px; text-align: center; }

/* ---------- tuteur ---------- */
.tgrid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 20px; align-items: start; }
.tcol { min-width: 0; }
@media (max-width: 1040px) { .tgrid { grid-template-columns: 1fr; } .panel.sticky { position: static; } }
.icards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.icard {
  display: flex; flex-direction: column; gap: 12px; padding: 18px; border-radius: 16px; background: var(--card);
  border: 1px solid var(--border); box-shadow: var(--shadow); text-decoration: none;
  transition: transform .3s var(--ease), box-shadow .3s var(--ease), border-color .3s;
}
.icard:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--ring); }
.icard-top { display: flex; align-items: center; gap: 12px; }
.icard-who { flex: 1; display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.icard-where { min-height: 20px; display: flex; align-items: center; gap: 6px; }
.icard-where.on { color: var(--fg); }
.icard-prog { display: flex; align-items: center; gap: 10px; }
.lvls { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.lvl { display: flex; flex-direction: column; gap: 4px; font: 500 11px 'Geist Mono', monospace; color: var(--muted); }
.lvl .bar { height: 4px; flex: none; }

.feed { display: flex; flex-direction: column; max-height: 560px; overflow: auto; margin: 0 -8px; padding: 0 8px; }
.fi { display: flex; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; line-height: 1.4; }
.fi:last-child { border-bottom: 0; }
.fi.new { animation: rise .45s var(--ease) both; }
.fi-ic { width: 26px; height: 26px; border-radius: 8px; display: grid; place-items: center; flex-shrink: 0; background: var(--soft); color: var(--muted); font-size: 11px; font-weight: 600; }
.fi-ic.done { background: var(--soft); color: var(--fg); }
.fi-ic.acquis { background: var(--ok-bg); color: var(--ok-fg); }
.fi-ic.en_cours { background: var(--wip-bg); color: var(--wip-fg); }
.fi-ic.non_acquis { background: var(--ko-bg); color: var(--ko-fg); }
.fi-b { flex: 1; min-width: 0; }
.fi-b a { text-decoration: none; font-weight: 500; }
.fi-b a:hover { text-decoration: underline; }
.fi-t { font-size: 11.5px; color: var(--muted2); margin-top: 1px; }

.lvl-block .panel-h h2 { font-size: 16px; }
.lvl-h-r { display: flex; align-items: center; gap: 12px; }
.lvl-prog { display: flex; align-items: center; gap: 8px; width: 160px; }
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 10px; }
.tile {
  display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid var(--border); border-radius: 12px;
  text-decoration: none; background: var(--soft2); transition: transform .25s var(--ease), border-color .25s, background .25s;
}
.tile.wide { grid-column: 1 / -1; }
.tile:hover { transform: translateY(-2px); border-color: color-mix(in srgb, var(--lv) 50%, var(--border)); background: var(--card); }
.tile.flash { animation: flash 1.2s var(--ease); }
.tile-top { display: flex; justify-content: space-between; align-items: center; gap: 6px; min-height: 22px; }
.tile-n { font-weight: 600; color: var(--lv); font-size: 13px; }
.tile-t { font-size: 13.5px; font-weight: 500; line-height: 1.35; flex: 1; }
.tile .bar { flex: none; height: 4px; }
.tile-f { display: flex; justify-content: space-between; align-items: center; }
.done-chip { font-size: 11px; font-weight: 500; color: var(--fg); }
.done-chip::before { content: "✓ "; color: var(--ok); }

.secret { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px dashed var(--ring); border-radius: 10px; background: var(--soft2); font-size: 15px; margin-bottom: 16px; word-break: break-all; }

/* ---------- dialogues ---------- */
.dlg { border: 0; padding: 0; background: transparent; color: var(--fg); max-width: calc(100vw - 32px); }
.dlg::backdrop { background: rgb(0 0 0 / .45); backdrop-filter: blur(3px); animation: fade .2s var(--ease); }
.dlg[open] .dlg-card { animation: pop .28s var(--ease); }
.dlg-card { width: 420px; max-width: 100%; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 24px; box-shadow: var(--shadow-lg); }
.dlg-card h3 { margin: 0 0 4px; font-size: 18px; letter-spacing: -.02em; }
.dlg-card > p { margin: 0 0 18px; font-size: 14px; }
.dlg-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.role-seg { align-self: flex-start; }

/* ---------- toasts ---------- */
#toasts { position: fixed; right: 20px; bottom: 20px; z-index: 80; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; pointer-events: none; }
.toast {
  pointer-events: auto; display: flex; gap: 10px; align-items: flex-start; min-width: 280px; max-width: 380px; padding: 12px 14px;
  background: var(--card); color: var(--fg); border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg);
  font-size: 14px; animation: toastIn .4s var(--ease) both;
}
.toast.out { animation: toastOut .3s var(--ease) both; }
.toast .t-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 7px; flex-shrink: 0; background: var(--muted2); }
.toast.ok .t-dot { background: var(--ok); } .toast.warn .t-dot { background: var(--wip); } .toast.err .t-dot { background: var(--ko); }
.toast b { display: block; font-size: 14px; }
.toast span { color: var(--muted); font-size: 13px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateX(16px) scale(.98); } }

/* ---------- indicateur de sauvegarde ---------- */
.save { display: inline-flex; align-items: center; gap: 8px; height: 30px; padding: 0 12px; border-radius: 99px; border: 1px solid var(--border); background: var(--card); font-size: 12.5px; color: var(--muted); transition: all .3s var(--ease); }
.save-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); transition: background .3s; }
.save[data-state="dirty"] .save-dot { background: var(--wip); }
.save[data-state="saving"] .save-dot { background: transparent; border: 1.5px solid var(--muted); border-right-color: transparent; width: 10px; height: 10px; animation: spin .7s linear infinite; }
.save[data-state="error"] { color: var(--ko-fg); border-color: var(--ko-bd); background: var(--ko-bg); }
.save[data-state="error"] .save-dot { background: var(--ko); }

/* ---------- hero des fiches ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: 20px; background: #0a0a0b; color: #fafafa; padding: 40px 44px 36px;
  margin-bottom: 28px; border: 1px solid #1f1f23; animation: rise .6s var(--ease) both;
}
.hero-topo { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero::after { content: ""; position: absolute; inset: auto -10% -60% 40%; height: 120%; background: radial-gradient(closest-side, color-mix(in srgb, var(--lv) 22%, transparent), transparent); pointer-events: none; }
.hero-in { position: relative; z-index: 1; }
.hero-over { display: flex; align-items: center; gap: 10px; font: 500 12px 'Geist Mono', monospace; letter-spacing: .14em; text-transform: uppercase; color: #a1a1aa; }
.hero-code { margin-left: auto; letter-spacing: .06em; color: #52525b; }
.hero h1 { font-size: 44px; letter-spacing: -.04em; line-height: 1.04; margin: 14px 0 10px; }
.hero-sub { color: #b4b4bb; font-size: 17px; max-width: 640px; margin: 0; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 20px; }
.chip { border: 1px solid #3f3f46; background: #18181b; color: #d4d4d8; border-radius: 99px; padding: 3px 12px; font-size: 12.5px; font-weight: 500; }
.hero-row { display: flex; align-items: center; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
.hero-diff { display: flex; align-items: center; gap: 10px; font: 500 11px 'Geist Mono', monospace; text-transform: uppercase; letter-spacing: .12em; color: #71717a; margin-right: 8px; }
.live-pill .live-dot { background: #52525b; }

/* ---------- page fiche ---------- */
.doc-grid { display: grid; grid-template-columns: 250px minmax(0, 1fr); gap: 40px; align-items: start; }
.toc { position: sticky; top: 84px; max-height: calc(100vh - 100px); overflow: auto; animation: rise .6s var(--ease) .1s both; }
.toc-h { display: flex; justify-content: space-between; align-items: center; font: 500 11px 'Geist Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.toc-bar { flex: none; height: 4px; margin-bottom: 12px; --c: var(--lv); }
.toc-bar i { background: var(--lv); }
.toc nav { display: flex; flex-direction: column; gap: 1px; }
.toc-i {
  display: flex; align-items: center; gap: 9px; padding: 7px 8px; border-radius: 9px; text-decoration: none; font-size: 13.5px;
  color: var(--muted); transition: background .2s, color .2s; position: relative;
}
.toc-i:hover { background: var(--soft); color: var(--fg); }
.toc-i.on { background: var(--soft); color: var(--fg); font-weight: 500; }
.toc-i.on::before { content: ""; position: absolute; left: -10px; top: 8px; bottom: 8px; width: 2px; border-radius: 2px; background: var(--lv); }
.toc-n { font-size: 11.5px; color: var(--lv); font-weight: 600; }
.toc-t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.toc-st { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; transition: all .3s; }
.toc-st.acquis { background: var(--ok); } .toc-st.en_cours { background: var(--wip); } .toc-st.non_acquis { background: var(--ko); }
.toc-st.done { background: transparent; border: 2px solid var(--fg); width: 9px; height: 9px; }
.toc-st.here { background: var(--lv); position: relative; }
.toc-st.here::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--lv); animation: ping 1.4s cubic-bezier(0, 0, .2, 1) infinite; }

@media (max-width: 960px) {
  .doc-grid { grid-template-columns: 1fr; gap: 16px; }
  .toc { position: sticky; top: 60px; z-index: 30; max-height: none; overflow: visible; margin: 0 -20px; padding: 10px 20px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); border-bottom: 1px solid var(--border); }
  .toc-h, .toc-bar { display: none; }
  .toc nav { flex-direction: row; overflow-x: auto; gap: 6px; scrollbar-width: none; }
  .toc-i { flex-shrink: 0; border: 1px solid var(--border); padding: 5px 10px; }
  .toc-i .toc-t { max-width: 160px; }
  .toc-i.on::before { display: none; }
  .hero { padding: 28px 22px; border-radius: 16px; }
  .hero h1 { font-size: 32px; }
  .hero-code { display: none; }
  .topbar .brand-sub, .topbar .brand-sep, .menu-who { display: none; }
}

/* ---------- contenu des fiches ---------- */
.doc { max-width: 820px; font-size: 15px; }
.doc h2 { font-size: 26px; letter-spacing: -.03em; line-height: 1.15; margin: 0 0 14px; }
.doc h3 { font-size: 17px; letter-spacing: -.015em; margin: 30px 0 10px; }
.doc h4 { font-size: 15px; margin: 20px 0 6px; }
.doc p { margin: 0 0 12px; }
.doc ul, .doc ol { margin: 0 0 12px; padding-left: 22px; }
.doc li { margin-bottom: 4px; }
.doc code { font-size: .86em; background: var(--soft); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; }
.doc .lead { font-size: 17px; color: color-mix(in srgb, var(--fg) 78%, var(--bg)); line-height: 1.6; }
.doc .small { font-size: 13.5px; color: var(--muted); }

.w-sec { scroll-margin-top: 84px; }
.part { margin-bottom: 64px; }
.exo { margin-bottom: 72px; }
.exo-head { border: 1px solid var(--border); border-radius: 16px; padding: 22px 24px 18px; margin-bottom: 24px; background: var(--soft2); position: relative; overflow: hidden; }
.exo-head::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--lv); }
.exo-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.exo-num { font: 600 12px 'Geist Mono', monospace; letter-spacing: .08em; color: var(--lv); border: 1px solid color-mix(in srgb, var(--lv) 50%, transparent); background: var(--card); border-radius: 99px; padding: 3px 11px; }
.exo-meta { display: inline-flex; align-items: center; font-size: 13px; color: var(--muted); }
.exo-meta .sep { width: 1px; height: 14px; background: var(--border); margin: 0 12px; }
.exo-head h2 { margin-bottom: 12px; }
.obj { display: flex; gap: 12px; align-items: flex-start; }
.objlbl { font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; padding-top: 4px; min-width: 76px; }
.obj ul { margin: 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 6px; }
.obj li { margin: 0; background: var(--card); border: 1px solid var(--border); border-radius: 7px; padding: 2px 9px; font-size: 13px; }
.exo-prog { display: flex; align-items: center; gap: 12px; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--border); }
.exo-prog .bar { --c: var(--lv); }
.exo-prog .pct { font: 500 12px 'Geist Mono', monospace; color: var(--muted); min-width: 40px; text-align: right; }

.diff { white-space: nowrap; display: inline-flex; align-items: center; }
.diff-md .diff-svg { width: 18px; height: 13px; }
.diff-lbl { margin-left: 7px; font-size: 13px; font-weight: 500; color: var(--muted); }
.diff-lg .diff-svg { width: 26px; height: 18px; }
.diff-lg .diff-lbl { font-size: 13px; color: #d4d4d8; letter-spacing: 0; text-transform: none; font-family: 'Geist', sans-serif; }
.dcard-top .diff-lbl { font-size: 12px; }

ol.steps { list-style: none; padding: 0; counter-reset: st; margin: 0 0 16px; }
ol.steps > li { counter-increment: st; position: relative; padding-left: 38px; margin-bottom: 12px; min-height: 26px; }
ol.steps > li::before { content: counter(st); position: absolute; left: 0; top: 0; width: 24px; height: 24px; border-radius: 50%; background: var(--primary); color: var(--primary-fg); font: 600 12px/24px 'Geist', sans-serif; text-align: center; }
ol.steps > li:not(:last-child)::after { content: ""; position: absolute; left: 11.5px; top: 28px; bottom: -10px; width: 1px; background: var(--border); }

.code { border: 1px solid #27272a; border-radius: 12px; margin: 8px 0 18px; overflow: hidden; background: #0a0a0b; }
.code-title { display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 14px; background: #18181b; border-bottom: 1px solid #27272a; font: 12px 'Geist Mono', monospace; color: #a1a1aa; }
.code-title > span:first-child { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.code-title .lang { color: #52525b; }
.copy { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 9px; border-radius: 7px; border: 1px solid #27272a; background: transparent; color: #a1a1aa; font: 500 12px 'Geist', sans-serif; cursor: pointer; transition: all .2s var(--ease); }
.copy svg { width: 13px; height: 13px; }
.copy:hover { background: #27272a; color: #fafafa; }
.copy.ok { color: #6ee7b7; border-color: #065f46; }
.code pre { margin: 0; padding: 14px 16px; color: #e4e4e7; font-size: 13px; line-height: 1.6; overflow-x: auto; white-space: pre; }

.callout { display: flex; gap: 12px; border: 1px solid var(--border); border-radius: 12px; padding: 14px 16px; margin: 10px 0 18px; background: var(--card); }
.callout .ico { min-width: 22px; width: 22px; height: 22px; border-radius: 50%; font: 700 11px/22px 'Geist Mono', monospace; text-align: center; color: #fff; background: var(--primary); }
.callout .cbody { flex: 1; min-width: 0; }
.callout .ctitle { font-weight: 600; margin-bottom: 4px; }
.callout .cbody p:last-child, .callout .cbody ul:last-child { margin-bottom: 0; }
.callout.info { background: var(--info-bg); border-color: var(--info-bd); } .callout.info .ico { background: #3b82f6; }
.callout.warn { background: var(--wip-bg); border-color: var(--wip-bd); } .callout.warn .ico { background: #f59e0b; }
.callout.danger { background: var(--ko-bg); border-color: var(--ko-bd); } .callout.danger .ico { background: #ef4444; }
.callout.tip { background: var(--tip-bg); border-color: var(--tip-bd); } .callout.tip .ico { background: #10b981; }
.callout.tuteur { background: var(--vio-bg); border-color: var(--vio-bd); } .callout.tuteur .ico { background: #8b5cf6; }

/* zones a remplir */
.doc > section textarea.in.ta { margin: 4px 0 16px; }
.fields { display: grid; gap: 12px 18px; margin: 8px 0 18px; }
.fields.c1 { grid-template-columns: 1fr; } .fields.c2 { grid-template-columns: 1fr 1fr; } .fields.c3 { grid-template-columns: 1fr 1fr 1fr; }
@media (max-width: 640px) { .fields.c2, .fields.c3 { grid-template-columns: 1fr; } }
.field { display: flex; flex-direction: column; gap: 6px; }
.field .lbl { font-size: 13px; color: var(--muted); font-weight: 500; }
.field .hint { font: 11px 'Geist Mono', monospace; color: var(--muted2); }
.question { margin: 14px 0 18px; }
.question .qt { font-weight: 500; display: flex; gap: 10px; margin-bottom: 8px; }
.qtext { flex: 1; }
.qn { font: 600 12px 'Geist Mono', monospace; color: var(--lv); min-width: 26px; padding-top: 3px; }
.question textarea.in { margin: 0 !important; }
.cmdbox { border: 1px dashed var(--ring); border-radius: 12px; padding: 10px 12px 12px; margin: 8px 0 18px; background: var(--soft2); }
.cmdlbl { font: 500 11px 'Geist Mono', monospace; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin-bottom: 8px; }
.cmdbox textarea.in { margin: 0 !important; background: var(--card); }

ul.checks { list-style: none; padding: 0; margin: 6px 0 18px; }
ul.checks.c2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 20px; }
ul.checks li { margin-bottom: 6px; }
.ck { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; padding: 6px 8px; margin: 0 -8px; border-radius: 9px; transition: background .2s; }
.ck:hover { background: var(--soft2); }
.ck input { position: absolute; opacity: 0; pointer-events: none; }
.ckbox { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--ring); display: grid; place-items: center; flex-shrink: 0; margin-top: 2px; transition: all .2s var(--ease); background: var(--card); }
.ckbox svg { width: 12px; height: 12px; color: var(--primary-fg); transform: scale(0); transition: transform .25s var(--ease); }
.ck input:checked + .ckbox { background: var(--primary); border-color: var(--primary); }
.ck input:checked + .ckbox svg { transform: scale(1); }
.ck input:checked ~ span:last-child { color: var(--muted); }
.ck input:focus-visible + .ckbox { box-shadow: 0 0 0 3px color-mix(in srgb, var(--ring) 45%, transparent); }
.mode-view .ck { cursor: default; }
.box { display: inline-block; width: 13px; height: 13px; border: 1.5px solid var(--ring); border-radius: 4px; vertical-align: -1px; }

.choice { display: flex; align-items: center; gap: 12px; margin: 10px 0 18px; flex-wrap: wrap; border-radius: 12px; }
.choice .lbl { font-size: 14px; color: var(--muted); font-weight: 500; }
.mode-view .choice .seg { pointer-events: none; }

.tbl-wrap { overflow-x: auto; margin: 8px 0 20px; border: 1px solid var(--border); border-radius: 12px; background: var(--card); }
.tbl { width: 100%; border-collapse: collapse; font-size: 14px; min-width: 520px; }
.tbl th { text-align: left; font-weight: 600; font-size: 11.5px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--soft2); padding: 10px 12px; border-bottom: 1px solid var(--border); }
.tbl td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.tbl tr:last-child td { border-bottom: none; }
.tbl td + td, .tbl th + th { border-left: 1px solid var(--border); }
.tbl td.blank { padding: 0; background: color-mix(in srgb, var(--soft2) 60%, transparent); }
.tbl tbody tr { transition: background .2s; }
.tbl tbody tr:hover td.blank { background: var(--soft2); }
textarea.in.cell { border: 0; border-radius: 0; background: transparent; min-height: 42px; padding: 10px 12px; font-size: 14px; }
textarea.in.cell:focus { background: var(--card); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--lv) 55%, transparent); }
.sommaire td { vertical-align: middle; }
.sommaire a { text-decoration: none; font-weight: 600; }
.sommaire a.sum-t { font-weight: 400; } .sommaire a.sum-t:hover { text-decoration: underline; }

/* validation */
.wv { margin: 28px 0 8px; border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; background: var(--card); box-shadow: var(--shadow); position: relative; transition: border-color .3s, background .3s; }
.wv::before { content: ""; position: absolute; inset: -1px; border-radius: inherit; pointer-events: none; border: 1px solid transparent; transition: border-color .3s; }
.wv.acquis { border-color: var(--ok-bd); background: color-mix(in srgb, var(--ok-bg) 60%, var(--card)); }
.wv.en_cours { border-color: var(--wip-bd); background: color-mix(in srgb, var(--wip-bg) 60%, var(--card)); }
.wv.non_acquis { border-color: var(--ko-bd); background: color-mix(in srgb, var(--ko-bg) 60%, var(--card)); }
.wv-h { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.wv-t { font: 700 11px 'Geist', sans-serif; text-transform: uppercase; letter-spacing: .12em; display: flex; align-items: center; gap: 8px; }
.wv-c { margin-top: 10px; font-size: 14px; white-space: pre-wrap; color: color-mix(in srgb, var(--fg) 85%, var(--bg)); }
.wv-c:empty { display: none; }
.wv-m { margin-top: 6px; font-size: 12px; color: var(--muted); }
.wv textarea.in { margin-top: 12px !important; background: var(--card); }
.wv .seg-o.on[data-v="acquis"] { color: var(--ok-fg); } .wv .seg-o.on[data-v="en_cours"] { color: var(--wip-fg); } .wv .seg-o.on[data-v="non_acquis"] { color: var(--ko-fg); }
.wv-wait { font-size: 13px; color: var(--muted); }

.exo-foot { display: flex; justify-content: flex-end; align-items: center; gap: 12px; margin-top: 16px; }
.exo-foot:empty { display: none; }
.exo-foot .hint-t { font-size: 13px; color: var(--muted); }
.btn.done-btn.is-done { background: var(--card); color: var(--fg); border-color: var(--border); box-shadow: none; }
.btn.done-btn.is-done .ico { color: var(--ok); }

/* le stagiaire est ici / champ mis a jour en direct */
.in.here, .choice.here { animation: here 1.6s ease-in-out infinite; border-color: var(--lv) !important; }
.in.flash, .choice.flash, .ck.flash { animation: flash 1.1s var(--ease); }
.in.here.flash { animation: flash 1.1s var(--ease), here 1.6s ease-in-out infinite 1.1s; }

/* divers repris du pdf */
.kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 16px; margin: 6px 0 12px; font-size: 14px; }
.kv .k { color: var(--muted); font-weight: 500; }
.kv .v { font-weight: 500; word-break: break-word; }
.kv .v.mono { font-size: 13px; }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; gap: 0 0; } .kv .v { margin-bottom: 8px; } }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 720px) { .two { grid-template-columns: 1fr; } }
.card { border: 1px solid var(--border); border-radius: 14px; padding: 16px 18px; margin-bottom: 14px; background: var(--card); }
.card[style] { margin-top: 14px !important; }
.card .ct { font-weight: 600; margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.rule-n { font: 600 11px 'Geist Mono', monospace; color: var(--primary-fg); background: var(--primary); border-radius: 5px; padding: 1px 7px; }
.spec { border: 1px solid var(--border); border-radius: 14px; padding: 14px 18px 8px; margin-bottom: 14px; background: var(--card); }
.spec-h { font-size: 11px; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; color: var(--muted); margin-bottom: 8px; }
.diff-legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-top: 6px; }
.schema { margin: 10px 0 20px; padding: 16px; border: 1px solid var(--border); border-radius: 14px; background: #fff; }
.schema svg { width: 100%; height: auto; display: block; }
.answer-key { border-left: 3px solid #8b5cf6; padding: 4px 0 4px 16px; margin: 8px 0 16px; }
.answer-key p:last-child, .answer-key ul:last-child { margin-bottom: 0; }
.inl { display: inline-block; min-width: 120px; border-bottom: 1px solid var(--ring); }
.doc [style*="margin-top:1mm"], .doc [style*="margin-top:1.5mm"] { margin-top: 6px !important; }

/* mobile : on empeche les tableaux de pousser la page et on resserre la barre du haut */
.doc, .tcol, .doc-grid > * { min-width: 0; }
.save { white-space: nowrap; }
@media (max-width: 960px) { .doc-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .topbar { padding: 0 12px; gap: 8px; }
  .brand .wm { display: none; }
  .tb-mid { justify-content: flex-end; }
  .switch { font-size: 0; gap: 0; }
  .wrap { padding: 20px 16px 80px; }
  .toc { margin: 0 -16px; padding: 10px 16px; }
  .page-head h1 { font-size: 26px; }
  .hero h1 { font-size: 28px; }
  .hero-sub { font-size: 15px; }
  .exo-head { padding: 18px 16px 14px; }
  .obj { flex-direction: column; gap: 6px; }
  .lvl-h-r { width: 100%; } .lvl-prog { flex: 1; width: auto; }
  .icards { grid-template-columns: 1fr; }
  #toasts { left: 12px; right: 12px; bottom: 12px; align-items: stretch; }
  .toast { min-width: 0; max-width: none; }
}
