/* =====================================================================
   SysAdmin Academy — feuille de style
   Layout : coque d'outil ITSM — barre latérale acier, zone de travail
   claire, cartes à bords nets, signalétique « atelier » (ambre sécurité)
   pour la progression et les alertes.
   ===================================================================== */

:root {
  /* Couleurs — thème clair */
  --bg: #F2F4F6;
  --surface: #FFFFFF;
  --surface-2: #EBEFF3;
  --surface-3: #DFE5EB;
  --border: #D3DAE1;
  --border-strong: #B4BFCA;
  --fg: #17202A;
  --fg-2: #394552;
  --muted: #63707D;
  --accent: #0B6A8F;
  --accent-hover: #095A7A;
  --accent-fg: #FFFFFF;
  --accent-soft: #DCEDF4;
  --accent-ink: #0A5373;
  --signal: #D98E04;
  --signal-soft: #FBEFD2;
  --signal-ink: #6E4A00;
  --side-bg: #131B24;
  --side-fg: #C3CDD7;
  --side-muted: #7B8997;
  --side-active: #213040;
  --side-accent: #5BBFE6;
  --ok: #1F7F55;
  --ok-soft: #DCF0E5;
  --warn: #B86A06;
  --warn-soft: #FAEAD2;
  --crit: #C2302F;
  --crit-soft: #F8DFDE;
  --p1: #C2302F;
  --p2: #D2601A;
  --p3: #A88000;
  --p4: #5A6D80;
  --console-bg: #0F1720;
  --console-fg: #D3E2EC;
  --console-muted: #7D92A4;
  --console-accent: #7FD3A8;
  --console-warn: #F3C969;
  --console-err: #F08A8A;
  --shadow: 0 1px 2px rgba(19, 27, 36, .06), 0 6px 18px rgba(19, 27, 36, .05);
  --focus: 0 0 0 3px rgba(11, 106, 143, .35);

  /* Typographie */
  --font-display: 'Barlow Semi Condensed', 'Arial Narrow', 'Roboto Condensed', system-ui, sans-serif;
  --font-body: 'Source Sans 3', 'Segoe UI', system-ui, -apple-system, Roboto, sans-serif;
  --font-mono: 'JetBrains Mono', 'Cascadia Mono', Consolas, 'Liberation Mono', monospace;
  --fs-xs: .78rem;
  --fs-sm: .875rem;
  --fs-md: 1rem;
  --fs-lg: 1.125rem;
  --fs-xl: 1.4rem;
  --fs-2xl: 1.85rem;
  --fs-3xl: 2.4rem;

  /* Formes */
  --r-sm: 3px;
  --r: 6px;
  --r-lg: 10px;
  --side-w: 252px;
  --top-h: 60px;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0D1318;
    --surface: #141C24;
    --surface-2: #1A242E;
    --surface-3: #223039;
    --border: #273441;
    --border-strong: #3A4959;
    --fg: #E3E9EF;
    --fg-2: #BFCAD5;
    --muted: #8D9BA9;
    --accent: #4AB2DC;
    --accent-hover: #6CC3E6;
    --accent-fg: #04202C;
    --accent-soft: #10303D;
    --accent-ink: #92D4EE;
    --signal: #F1B23B;
    --signal-soft: #36290C;
    --signal-ink: #F6CD7C;
    --side-bg: #090E13;
    --side-fg: #BCC7D2;
    --side-muted: #6F7E8D;
    --side-active: #16212C;
    --side-accent: #5BBFE6;
    --ok: #4CBF89;
    --ok-soft: #10301F;
    --warn: #EE9F4A;
    --warn-soft: #36230F;
    --crit: #F06B6B;
    --crit-soft: #3A1616;
    --p1: #F06B6B;
    --p2: #F08C4C;
    --p3: #E0BC3A;
    --p4: #8DA2B5;
    --console-bg: #070B0F;
    --console-fg: #D3E2EC;
    --console-muted: #7D92A4;
    --console-accent: #7FD3A8;
    --console-warn: #F3C969;
    --console-err: #F08A8A;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3);
    --focus: 0 0 0 3px rgba(74, 178, 220, .4);
    color-scheme: dark;
  }
}

:root[data-theme="dark"] {
  --bg: #0D1318;
  --surface: #141C24;
  --surface-2: #1A242E;
  --surface-3: #223039;
  --border: #273441;
  --border-strong: #3A4959;
  --fg: #E3E9EF;
  --fg-2: #BFCAD5;
  --muted: #8D9BA9;
  --accent: #4AB2DC;
  --accent-hover: #6CC3E6;
  --accent-fg: #04202C;
  --accent-soft: #10303D;
  --accent-ink: #92D4EE;
  --signal: #F1B23B;
  --signal-soft: #36290C;
  --signal-ink: #F6CD7C;
  --side-bg: #090E13;
  --side-fg: #BCC7D2;
  --side-muted: #6F7E8D;
  --side-active: #16212C;
  --side-accent: #5BBFE6;
  --ok: #4CBF89;
  --ok-soft: #10301F;
  --warn: #EE9F4A;
  --warn-soft: #36230F;
  --crit: #F06B6B;
  --crit-soft: #3A1616;
  --p1: #F06B6B;
  --p2: #F08C4C;
  --p3: #E0BC3A;
  --p4: #8DA2B5;
  --console-bg: #070B0F;
  --console-fg: #D3E2EC;
  --console-muted: #7D92A4;
  --console-accent: #7FD3A8;
  --console-warn: #F3C969;
  --console-err: #F08A8A;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3);
  --focus: 0 0 0 3px rgba(74, 178, 220, .4);
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
body::before {
  content: "";
  position: fixed;
  inset: 0 0 auto;
  height: env(safe-area-inset-top, 0px);
  z-index: 60;
  background: var(--surface);
}
[hidden] { display: none !important; }
img, svg { max-width: 100%; }
svg.ico { width: 1.15em; height: 1.15em; flex: none; vertical-align: -0.2em; }
a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent-hover); }
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: .005em;
  text-wrap: balance;
  margin: 0;
  color: var(--fg);
}
h1 { font-size: var(--fs-3xl); font-weight: 700; }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p { margin: 0; }
code, kbd, pre, samp { font-family: var(--font-mono); font-size: .88em; }
:focus-visible { outline: none; box-shadow: var(--focus); border-radius: var(--r-sm); }
button { font: inherit; color: inherit; }
hr { border: 0; border-top: 1px solid var(--border); margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.muted { color: var(--muted); }
.mono { font-family: var(--font-mono); }
.nowrap { white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; }

/* ---------- Coque applicative ---------- */
.app { display: grid; grid-template-columns: var(--side-w) minmax(0, 1fr); min-height: 100vh; }
.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--side-bg);
  color: var(--side-fg);
  display: flex;
  flex-direction: column;
  padding: calc(env(safe-area-inset-top, 0px) + 18px) 14px 18px max(14px, env(safe-area-inset-left, 0px));
  gap: 18px;
  z-index: 40;
}
.brand { display: flex; align-items: center; gap: 10px; color: #fff; text-decoration: none; padding: 4px 6px; }
.brand:hover { color: #fff; }
.brand-mark { width: 34px; height: 34px; color: var(--side-accent); flex: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-text strong { font-family: var(--font-display); font-size: 1.22rem; font-weight: 700; letter-spacing: .01em; color: #F4F8FB; }
.brand-text small { color: var(--side-muted); font-size: var(--fs-xs); letter-spacing: .06em; text-transform: uppercase; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-title {
  margin: 14px 8px 4px;
  font-size: .7rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--side-muted);
  font-weight: 600;
}
.nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--r);
  color: var(--side-fg);
  text-decoration: none;
  font-weight: 600;
  font-size: .95rem;
}
.nav-link:hover { background: var(--side-active); color: #fff; }
.nav-link.active { background: var(--side-active); color: #fff; box-shadow: inset 3px 0 0 var(--side-accent); }
.nav-link svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.side-foot { margin-top: auto; border-top: 1px solid rgba(255, 255, 255, .08); padding: 14px 8px 0; font-size: var(--fs-sm); }
.side-foot .lbl { color: var(--side-muted); font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; }
.side-foot .val { color: #fff; font-weight: 600; margin: 2px 0 8px; }
.side-foot .bar { height: 6px; background: rgba(255, 255, 255, .1); border-radius: 3px; overflow: hidden; }
.side-foot .bar > i { display: block; height: 100%; background: var(--signal); }
.side-foot .xp { margin-top: 6px; color: var(--side-muted); font-variant-numeric: tabular-nums; }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 30;
  display: flex;
  align-items: center;
  gap: 12px;
  height: var(--top-h);
  padding-left: max(20px, env(safe-area-inset-left, 0px));
  padding-right: max(20px, env(safe-area-inset-right, 0px));
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.icon-btn.menu-btn { display: none; }
.crumbs { display: flex; align-items: center; gap: 6px; min-width: 0; flex: 1 1 auto; font-size: var(--fs-sm); color: var(--muted); white-space: nowrap; overflow: hidden; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--fg); }
.crumbs .sep { opacity: .5; }
.crumbs .cur { color: var(--fg); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.search { position: relative; flex: 0 1 340px; min-width: 0; }
.search input {
  width: 100%;
  height: 38px;
  padding: 0 12px 0 36px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface-2);
  color: var(--fg);
  font: inherit;
  font-size: var(--fs-sm);
}
.search input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); background: var(--surface); }
.search-ico { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); color: var(--muted); display: flex; }
.search-ico svg { width: 16px; height: 16px; }
.search-results {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  width: min(460px, 92vw);
  max-height: 70vh;
  overflow-y: auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
  padding: 6px;
}
.search-results a { display: block; padding: 8px 10px; border-radius: var(--r); text-decoration: none; color: var(--fg); }
.search-results a:hover, .search-results a.sel { background: var(--surface-2); }
.search-results .k { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.search-results .t { font-weight: 600; }
.search-results .s { font-size: var(--fs-sm); color: var(--muted); }
.search-results .empty { padding: 12px; color: var(--muted); }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--border);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--fg-2);
  cursor: pointer;
  flex: none;
}
.icon-btn:hover { background: var(--surface-2); color: var(--fg); }
.icon-btn svg { width: 18px; height: 18px; }
.grade-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 12px 0 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  text-decoration: none;
  color: var(--fg);
  font-size: var(--fs-sm);
  font-weight: 600;
  white-space: nowrap;
  flex: none;
}
.grade-chip:hover { background: var(--surface-2); color: var(--fg); }
.grade-chip .lvl {
  display: inline-grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--signal);
  color: #1d1400;
  font-family: var(--font-display);
  font-weight: 700;
}
.grade-chip .xp { color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }

.view {
  flex: 1;
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding-block: 28px 64px;
  padding-left: max(24px, env(safe-area-inset-left, 0px));
  padding-right: max(24px, env(safe-area-inset-right, 0px));
  outline: none;
}
.loading { color: var(--muted); padding: 40px 0; }
.scrim { position: fixed; inset: 0; background: rgba(5, 10, 15, .5); z-index: 35; }
.noscript { padding: 24px; }

/* ---------- Mise en page ---------- */
.stack { display: flex; flex-direction: column; gap: 16px; }
.stack-lg { display: flex; flex-direction: column; gap: 28px; }
.stack-sm { display: flex; flex-direction: column; gap: 8px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row-between { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.grid { display: grid; gap: 16px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.split { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.split > * { min-width: 0; }

.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 24px; }
.page-head .eyebrow { margin-bottom: 6px; }
.page-head .lead { margin-top: 8px; max-width: 70ch; color: var(--fg-2); font-size: var(--fs-lg); }
.eyebrow { font-size: .74rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.section-title h2 { font-size: var(--fs-xl); }
.section-title a { font-size: var(--fs-sm); font-weight: 600; text-decoration: none; }

/* ---------- Cartes ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 18px 20px;
  min-width: 0;
}
.card.flat { box-shadow: none; }
.card.raised { box-shadow: var(--shadow); }
.card h3 { font-size: var(--fs-lg); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; margin-bottom: 10px; }
.card-link { text-decoration: none; color: inherit; display: block; transition: border-color .15s, transform .15s; }
.card-link:hover { border-color: var(--border-strong); color: inherit; }
.card-link:hover h3 { color: var(--accent); }
.panel-title { font-family: var(--font-display); font-weight: 600; font-size: .82rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 10px; }

/* ---------- Boutons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 8px 16px;
  border-radius: var(--r);
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--fg);
  font-weight: 600;
  font-size: var(--fs-sm);
  text-decoration: none;
  cursor: pointer;
  line-height: 1.2;
  text-align: center;
}
.btn:hover { background: var(--surface-2); color: var(--fg); }
.btn svg { width: 16px; height: 16px; flex: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-fg); }
.btn.primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-fg); }
.btn.signal { background: var(--signal); border-color: var(--signal); color: #1d1400; }
.btn.signal:hover { filter: brightness(1.05); color: #1d1400; }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.danger { color: var(--crit); border-color: var(--crit); background: transparent; }
.btn.danger:hover { background: var(--crit-soft); }
.btn.sm { min-height: 30px; padding: 4px 10px; font-size: .8rem; }
.btn[disabled], .btn.disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }

/* ---------- Pastilles ---------- */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .02em;
  border: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--fg-2);
  white-space: nowrap;
  line-height: 1.5;
}
.pill svg { width: 12px; height: 12px; }
.pill.accent { background: var(--accent-soft); color: var(--accent-ink); border-color: transparent; }
.pill.signal { background: var(--signal-soft); color: var(--signal-ink); border-color: transparent; }
.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.crit { background: var(--crit-soft); color: var(--crit); border-color: transparent; }
.prio { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: .78rem; white-space: nowrap; }
.prio::before { content: ""; width: 10px; height: 10px; border-radius: 2px; background: currentColor; }
.prio.p1 { color: var(--p1); }
.prio.p2 { color: var(--p2); }
.prio.p3 { color: var(--p3); }
.prio.p4 { color: var(--p4); }
.lvl-badge {
  display: inline-grid;
  place-items: center;
  min-width: 30px;
  height: 22px;
  padding: 0 6px;
  border-radius: var(--r-sm);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .8rem;
  background: var(--fg);
  color: var(--surface);
  letter-spacing: .04em;
}
.tag { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; font-weight: 700; color: var(--muted); }

/* ---------- Barres de progression ---------- */
.progress { height: 8px; background: var(--surface-3); border-radius: 4px; overflow: hidden; }
.progress > i { display: block; height: 100%; background: var(--accent); border-radius: 4px; transition: width .3s; }
.progress.signal > i { background: var(--signal); }
.progress.ok > i { background: var(--ok); }
.progress.thin { height: 5px; }

/* ---------- Tuiles de stats ---------- */
.tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.tile { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 14px 16px; min-width: 0; }
.tile .k { font-size: .74rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.tile .v { font-family: var(--font-display); font-size: 1.9rem; font-weight: 700; line-height: 1.1; margin-top: 4px; font-variant-numeric: tabular-nums; }
.tile .v small { font-size: 1rem; color: var(--muted); font-weight: 500; }
.tile .s { font-size: var(--fs-sm); color: var(--muted); }

/* ---------- Accueil ---------- */
.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 24px;
}
.hero-main { padding: 28px 28px 24px; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.hero-main h1 { font-size: clamp(1.9rem, 3.4vw, 2.6rem); }
.hero-main p { color: var(--fg-2); font-size: var(--fs-lg); max-width: 58ch; }
.hero-side {
  background: var(--side-bg);
  color: var(--side-fg);
  padding: 22px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-width: 0;
}
.hero-side .eyebrow { color: var(--side-muted); }
.hero-side h3 { color: #fff; }
.hero-side p { color: var(--side-fg); font-size: var(--fs-sm); }
.shift-board { font-family: var(--font-mono); font-size: .8rem; display: grid; gap: 6px; }
.shift-board div { display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px dashed rgba(255, 255, 255, .12); padding-bottom: 5px; }
.shift-board span:last-child { color: var(--side-accent); text-align: right; }
.resume-card { display: flex; gap: 14px; align-items: center; }
.resume-card .ico { width: 44px; height: 44px; border-radius: var(--r); display: grid; place-items: center; background: var(--accent-soft); color: var(--accent-ink); flex: none; }
.resume-card .ico svg { width: 22px; height: 22px; }

.activity { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; }
.activity li { display: flex; gap: 10px; align-items: baseline; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: var(--fs-sm); }
.activity li:last-child { border-bottom: 0; }
.activity time { color: var(--muted); font-variant-numeric: tabular-nums; flex: none; width: 92px; }

/* ---------- Cours ---------- */
.bloc { display: flex; flex-direction: column; gap: 14px; }
.bloc-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; border-bottom: 2px solid var(--fg); padding-bottom: 8px; }
.bloc-head .num { font-family: var(--font-display); font-weight: 700; font-size: 1rem; color: var(--surface); background: var(--fg); padding: 1px 8px; border-radius: var(--r-sm); }
.bloc-head h2 { font-size: var(--fs-xl); }
.bloc-head p { color: var(--muted); font-size: var(--fs-sm); flex-basis: 100%; }
.module-card { display: flex; flex-direction: column; gap: 10px; height: 100%; }
.module-card .code { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); }
.module-card p { color: var(--fg-2); font-size: var(--fs-sm); flex: 1; }
.module-card .meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .8rem; color: var(--muted); }

.lesson-list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); overflow: hidden; }
.lesson-list li + li { border-top: 1px solid var(--border); }
.lesson-list a { display: grid; grid-template-columns: 34px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 14px 18px; text-decoration: none; color: var(--fg); }
.lesson-list a:hover { background: var(--surface-2); }
.lesson-list .n { width: 30px; height: 30px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--border-strong); font-weight: 700; font-size: .85rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.lesson-list .done .n { border-color: var(--ok); background: var(--ok); color: #fff; }
.lesson-list .n svg { width: 14px; height: 14px; }
.lesson-list .t { font-weight: 600; }
.lesson-list .d { font-size: var(--fs-sm); color: var(--muted); }

.lesson-layout { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 32px; align-items: start; }
.lesson-layout > * { min-width: 0; }
.lesson-aside { position: sticky; top: calc(var(--top-h) + 20px); display: flex; flex-direction: column; gap: 16px; }
.toc { list-style: none; margin: 0; padding: 0; border-left: 2px solid var(--border); }
.toc a { display: block; padding: 4px 12px; font-size: var(--fs-sm); color: var(--muted); text-decoration: none; margin-left: -2px; border-left: 2px solid transparent; }
.toc a:hover { color: var(--fg); border-left-color: var(--border-strong); }
.toc .lv3 a { padding-left: 24px; font-size: .82rem; }
.lesson-nav { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 32px; padding-top: 20px; border-top: 1px solid var(--border); }

/* Contenu rédactionnel */
.prose { max-width: 74ch; font-size: 1.02rem; color: var(--fg); }
.prose > * + * { margin-top: 1em; }
.prose h2 { font-size: 1.55rem; margin-top: 1.8em; padding-top: .2em; scroll-margin-top: calc(var(--top-h) + 16px); }
.prose h3 { font-size: 1.22rem; margin-top: 1.5em; scroll-margin-top: calc(var(--top-h) + 16px); }
.prose h4 { font-size: 1.05rem; margin-top: 1.2em; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: .3em; }
.prose li > ul, .prose li > ol { margin-top: .3em; }
.prose strong { font-weight: 700; }
.prose code { background: var(--surface-2); border: 1px solid var(--border); padding: .05em .35em; border-radius: var(--r-sm); font-size: .86em; overflow-wrap: anywhere; }
.prose a { font-weight: 600; }
.prose .table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r); }
.prose table { border-collapse: collapse; width: 100%; font-size: .93rem; }
.prose th, .prose td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.prose th { background: var(--surface-2); font-weight: 700; font-size: .85rem; letter-spacing: .02em; }
.prose tr:last-child td { border-bottom: 0; }
.prose hr { margin: 2em 0; }

.code-block { position: relative; background: var(--console-bg); color: var(--console-fg); border-radius: var(--r); overflow: hidden; }
.code-block .code-head { display: flex; justify-content: space-between; align-items: center; padding: 6px 10px 6px 14px; background: rgba(255, 255, 255, .05); font-family: var(--font-mono); font-size: .72rem; color: var(--console-muted); letter-spacing: .04em; text-transform: uppercase; }
.code-block pre { margin: 0; padding: 12px 14px 14px; overflow-x: auto; font-size: .84rem; line-height: 1.55; }
.code-block code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; overflow-wrap: normal; }
.copy-btn { border: 1px solid rgba(255, 255, 255, .15); background: transparent; color: var(--console-muted); border-radius: var(--r-sm); font-size: .72rem; padding: 2px 8px; cursor: pointer; font-family: var(--font-body); }
.copy-btn:hover { color: #fff; border-color: rgba(255, 255, 255, .35); }

.callout { border: 1px solid var(--border); border-left-width: 4px; border-radius: var(--r); padding: 12px 16px; background: var(--surface); }
.callout > .callout-title { font-family: var(--font-display); font-weight: 700; font-size: .85rem; letter-spacing: .08em; text-transform: uppercase; margin-bottom: 4px; display: flex; align-items: center; gap: 6px; }
.callout > .callout-title svg { width: 15px; height: 15px; }
.callout > .callout-body > * + * { margin-top: .6em; }
.callout.tip { border-left-color: var(--ok); background: var(--ok-soft); }
.callout.tip > .callout-title { color: var(--ok); }
.callout.warn { border-left-color: var(--crit); background: var(--crit-soft); }
.callout.warn > .callout-title { color: var(--crit); }
.callout.info { border-left-color: var(--accent); background: var(--accent-soft); }
.callout.info > .callout-title { color: var(--accent-ink); }
.callout.bellerive { border-left-color: var(--signal); background: var(--signal-soft); }
.callout.bellerive > .callout-title { color: var(--signal-ink); }
.callout.exam { border-left-color: var(--fg); background: var(--surface-2); }
.callout code { background: var(--surface); }

/* Quiz */
.quiz-q { display: flex; flex-direction: column; gap: 12px; }
.quiz-q .qn { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.quiz-q h3 { font-size: 1.25rem; font-family: var(--font-body); font-weight: 700; line-height: 1.35; }
.options { display: flex; flex-direction: column; gap: 8px; }
.option {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--surface);
  cursor: pointer;
  width: 100%;
  line-height: 1.4;
}
.option:hover:not([disabled]) { border-color: var(--accent); background: var(--accent-soft); }
.option .letter { flex: none; width: 24px; height: 24px; display: grid; place-items: center; border-radius: 50%; background: var(--surface-3); font-weight: 700; font-size: .8rem; }
.option.correct { border-color: var(--ok); background: var(--ok-soft); }
.option.correct .letter { background: var(--ok); color: #fff; }
.option.wrong { border-color: var(--crit); background: var(--crit-soft); }
.option.wrong .letter { background: var(--crit); color: #fff; }
.option[disabled] { cursor: default; }
.explain { padding: 12px 14px; border-radius: var(--r); background: var(--surface-2); border: 1px solid var(--border); font-size: .95rem; }

/* ---------- File de tickets (style ITSM) ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.seg { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r); overflow: hidden; flex-wrap: wrap; }
.seg button { border: 0; background: var(--surface); padding: 6px 12px; font-size: .82rem; font-weight: 600; cursor: pointer; color: var(--fg-2); border-right: 1px solid var(--border); }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--surface-2); }
.seg button.on { background: var(--fg); color: var(--surface); }
select.input, input.input, textarea.input {
  font: inherit;
  font-size: var(--fs-sm);
  padding: 7px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--surface);
  color: var(--fg);
  min-height: 36px;
  max-width: 100%;
}
textarea.input { width: 100%; font-family: var(--font-mono); font-size: .8rem; min-height: 90px; }
input.input:focus, select.input:focus, textarea.input:focus { outline: none; border-color: var(--accent); box-shadow: var(--focus); }

.queue-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.queue { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 680px; }
.queue th { text-align: left; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 14px; background: var(--surface-2); border-bottom: 1px solid var(--border); font-weight: 700; white-space: nowrap; }
.queue td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.queue tr:last-child td { border-bottom: 0; }
.queue tbody tr { cursor: pointer; }
.queue tbody tr:hover td { background: var(--surface-2); }
.queue tbody tr.locked { cursor: not-allowed; opacity: .55; }
.queue .tid { font-family: var(--font-mono); font-size: .8rem; color: var(--muted); white-space: nowrap; }
.queue .ttl { font-weight: 600; }
.queue .ttl small { display: block; font-weight: 400; color: var(--muted); font-size: .82rem; }
.queue .grade { font-family: var(--font-display); font-weight: 700; font-size: 1.05rem; }

.theme-strip { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 10px; }
.theme-btn { text-align: left; padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.theme-btn:hover { border-color: var(--border-strong); }
.theme-btn.on { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.theme-btn .nm { font-weight: 700; font-size: .92rem; }
.theme-btn .ct { font-size: .78rem; color: var(--muted); }

.levels { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px; }
.level { border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 14px; background: var(--surface); display: flex; flex-direction: column; gap: 4px; }
.level .n { font-family: var(--font-display); font-weight: 700; font-size: 1.4rem; }
.level .nm { font-weight: 600; font-size: .88rem; }
.level .st { font-size: .78rem; color: var(--muted); }
.level.locked { background: var(--surface-2); color: var(--muted); }
.level.locked .n { color: var(--muted); }

/* ---------- Vue ticket ---------- */
.ticket-head { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; margin-bottom: 18px; }
.ticket-head .top { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ticket-head .tid { font-family: var(--font-mono); font-size: .85rem; color: var(--muted); }
.ticket-head h1 { font-size: clamp(1.5rem, 2.6vw, 2rem); }
.meta-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 10px 18px; font-size: var(--fs-sm); border-top: 1px solid var(--border); padding-top: 12px; }
.meta-grid .k { font-size: .7rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.meta-grid .v { font-weight: 600; overflow-wrap: anywhere; }
.sla { display: flex; flex-direction: column; gap: 5px; }
.sla .progress { height: 6px; }
.sla.late .progress > i { background: var(--crit); }
.sla.warn .progress > i { background: var(--warn); }

.thread { display: flex; flex-direction: column; gap: 14px; }
.msg { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
.msg .bubble { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 16px; min-width: 0; }
.msg .bubble .who { font-size: var(--fs-sm); font-weight: 700; display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; margin-bottom: 4px; }
.msg .bubble .who time { font-weight: 400; color: var(--muted); font-size: .8rem; }
.msg .bubble .body { white-space: pre-line; }
.msg.user .bubble { border-top-left-radius: 2px; }
.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: .95rem;
  color: #fff;
  flex: none;
  letter-spacing: .02em;
}
.avatar.sm { width: 30px; height: 30px; font-size: .78rem; }
.avatar.lg { width: 56px; height: 56px; font-size: 1.2rem; }

.log-entry { display: grid; grid-template-columns: 40px minmax(0, 1fr); gap: 12px; }
.log-entry .dot { width: 40px; display: flex; justify-content: center; padding-top: 6px; }
.log-entry .dot i { width: 12px; height: 12px; border-radius: 50%; background: var(--border-strong); box-shadow: 0 0 0 4px var(--bg); }
.log-entry .dot i.r-ex, .log-entry .dot i.r-good { background: var(--ok); }
.log-entry .dot i.r-bad, .log-entry .dot i.r-meh { background: var(--warn); }
.log-entry .dot i.r-sec { background: var(--crit); }
.log-entry .content { min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.log-entry .act { font-weight: 600; }
.log-entry .act time { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); font-weight: 400; margin-right: 8px; }
.log-entry .narr { color: var(--fg-2); }
.fb { font-size: .9rem; border-radius: var(--r); padding: 8px 12px; border: 1px solid var(--border); background: var(--surface-2); }
.fb .lbl { font-weight: 700; margin-right: 6px; }
.fb.r-ex, .fb.r-good { background: var(--ok-soft); border-color: transparent; }
.fb.r-ex .lbl, .fb.r-good .lbl { color: var(--ok); }
.fb.r-bad, .fb.r-meh { background: var(--warn-soft); border-color: transparent; }
.fb.r-bad .lbl, .fb.r-meh .lbl { color: var(--warn); }
.fb.r-sec { background: var(--crit-soft); border-color: transparent; }
.fb.r-sec .lbl { color: var(--crit); }

.step-card { background: var(--surface); border: 2px solid var(--accent); border-radius: var(--r-lg); padding: 18px 20px; display: flex; flex-direction: column; gap: 14px; scroll-margin-top: calc(var(--top-h) + 16px); }
.step-card .narr { font-size: 1.02rem; }
.step-card .narr > * + * { margin-top: .7em; }
.step-card .prompt { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.choices { display: flex; flex-direction: column; gap: 8px; }
.choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  text-align: left;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r);
  background: var(--surface);
  cursor: pointer;
  line-height: 1.4;
}
.choice:hover { border-color: var(--accent); background: var(--accent-soft); }
.choice .cost { font-family: var(--font-mono); font-size: .75rem; color: var(--muted); white-space: nowrap; display: inline-flex; align-items: center; gap: 4px; }
.choice .cost svg { width: 13px; height: 13px; }
.choice .kind { display: block; font-size: .68rem; letter-spacing: .1em; text-transform: uppercase; font-weight: 700; color: var(--muted); margin-bottom: 2px; }

.console { background: var(--console-bg); color: var(--console-fg); border-radius: var(--r); overflow: hidden; }
.console .bar { display: flex; align-items: center; gap: 8px; padding: 7px 12px; background: rgba(255, 255, 255, .06); font-family: var(--font-mono); font-size: .74rem; color: var(--console-muted); }
.console .bar i { width: 9px; height: 9px; border-radius: 50%; background: rgba(255, 255, 255, .18); }
.console pre { margin: 0; padding: 12px 14px; overflow-x: auto; font-size: .8rem; line-height: 1.55; white-space: pre; }
.console .hl-ok { color: var(--console-accent); }
.console .hl-warn { color: var(--console-warn); }
.console .hl-err { color: var(--console-err); }

.side-panel { display: flex; flex-direction: column; gap: 14px; position: sticky; top: calc(var(--top-h) + 16px); }
.person { display: flex; gap: 12px; align-items: center; }
.person .nm { font-weight: 700; }
.person .rl { font-size: var(--fs-sm); color: var(--muted); }
.kv { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 12px; font-size: var(--fs-sm); }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; font-weight: 600; overflow-wrap: anywhere; }
.gauge { display: flex; flex-direction: column; gap: 4px; }
.gauge .row-between { font-size: var(--fs-sm); }

.matrix { border-collapse: collapse; font-size: .85rem; width: 100%; }
.matrix th, .matrix td { border: 1px solid var(--border); padding: 6px 8px; text-align: center; }
.matrix th { background: var(--surface-2); font-weight: 700; }
.matrix td.p1 { color: var(--p1); font-weight: 700; }
.matrix td.p2 { color: var(--p2); font-weight: 700; }
.matrix td.p3 { color: var(--p3); font-weight: 700; }
.matrix td.p4 { color: var(--p4); font-weight: 700; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px; }
.radio-row label { display: inline-flex; align-items: center; gap: 8px; padding: 8px 12px; border: 1px solid var(--border-strong); border-radius: var(--r); cursor: pointer; font-weight: 600; font-size: .9rem; background: var(--surface); }
.radio-row label:hover { border-color: var(--accent); }
.radio-row input { accent-color: var(--accent); }
.radio-row label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

/* Débrief */
.debrief-top { display: grid; grid-template-columns: 170px minmax(0, 1fr); gap: 24px; align-items: center; }
.grade-big {
  width: 150px;
  height: 150px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 4.2rem;
  border: 8px solid var(--border);
  position: relative;
  line-height: 1;
}
.grade-big small { position: absolute; bottom: 24px; font-size: .85rem; font-family: var(--font-body); font-weight: 600; color: var(--muted); }
.grade-S { color: var(--signal); border-color: var(--signal); }
.grade-A { color: var(--ok); border-color: var(--ok); }
.grade-B { color: var(--accent); border-color: var(--accent); }
.grade-C { color: var(--warn); border-color: var(--warn); }
.grade-D { color: var(--crit); border-color: var(--crit); }
.score-bars { display: grid; gap: 10px; }
.score-bar { display: grid; grid-template-columns: 150px minmax(0, 1fr) 46px; gap: 10px; align-items: center; font-size: var(--fs-sm); }
.score-bar .progress { height: 10px; }
.score-bar b { text-align: right; font-variant-numeric: tabular-nums; }
.path-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; counter-reset: step; }
.path-list li { display: grid; grid-template-columns: 28px minmax(0, 1fr); gap: 10px; font-size: .92rem; }
.path-list li::before { counter-increment: step; content: counter(step); width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); font-weight: 700; font-size: .75rem; }

/* ---------- Carrière ---------- */
.career-top { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; margin-bottom: 24px; }
.career-top > * { min-width: 0; }
.chapter-list { display: flex; flex-direction: column; gap: 0; position: relative; }
.chapter { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 16px; position: relative; padding-bottom: 18px; }
.chapter::before { content: ""; position: absolute; left: 27px; top: 50px; bottom: 0; width: 2px; background: var(--border); }
.chapter:last-child::before { display: none; }
.chapter .num {
  width: 56px;
  height: 56px;
  border-radius: var(--r-lg);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.3rem;
  background: var(--surface);
  border: 2px solid var(--border-strong);
  color: var(--fg-2);
  z-index: 1;
}
.chapter.done .num { background: var(--ok); border-color: var(--ok); color: #fff; }
.chapter.current .num { background: var(--signal); border-color: var(--signal); color: #1d1400; }
.chapter.locked .num { color: var(--muted); background: var(--surface-2); border-style: dashed; }
.chapter .card { display: flex; flex-direction: column; gap: 8px; }
.chapter.locked .card { background: var(--surface-2); }
.stars { display: inline-flex; gap: 2px; color: var(--signal); }
.stars svg { width: 16px; height: 16px; }
.stars .off { color: var(--border-strong); }

.day-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 20px; align-items: start; }
.day-layout > * { min-width: 0; }
.clock-card { display: flex; align-items: center; gap: 16px; }
.clock { font-family: var(--font-mono); font-size: 2.2rem; font-weight: 600; letter-spacing: .02em; font-variant-numeric: tabular-nums; }
.dayline { position: relative; height: 10px; background: var(--surface-3); border-radius: 5px; overflow: visible; }
.dayline > i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--signal); border-radius: 5px; }
.dayline .mk { position: absolute; top: -3px; width: 3px; height: 16px; background: var(--fg-2); border-radius: 2px; }
.teams { display: flex; flex-direction: column; gap: 10px; max-height: 520px; overflow-y: auto; }
.teams .tm { display: grid; grid-template-columns: 30px minmax(0, 1fr); gap: 10px; font-size: .9rem; }
.teams .tm .who { font-weight: 700; font-size: .82rem; }
.teams .tm .who time { font-weight: 400; color: var(--muted); margin-left: 6px; font-family: var(--font-mono); font-size: .74rem; }
.teams .tm .tx { background: var(--surface-2); border-radius: 2px var(--r-lg) var(--r-lg) var(--r-lg); padding: 8px 12px; margin-top: 2px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; font-weight: 700; white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.new { color: var(--accent); }
.status.open { color: var(--warn); }
.status.done { color: var(--ok); }
.status.wait { color: var(--muted); }
.dialog { display: flex; flex-direction: column; gap: 14px; }
.dialog .line { display: grid; grid-template-columns: 56px minmax(0, 1fr); gap: 14px; align-items: start; }
.dialog .line .tx { background: var(--surface); border: 1px solid var(--border); border-radius: 2px var(--r-lg) var(--r-lg) var(--r-lg); padding: 12px 16px; }
.dialog .line .tx .who { font-weight: 700; font-size: var(--fs-sm); margin-bottom: 2px; }

/* ---------- Univers ---------- */
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 20px; overflow-x: auto; }
.tabs button { border: 0; background: none; padding: 10px 14px; font-weight: 600; color: var(--muted); cursor: pointer; border-bottom: 3px solid transparent; margin-bottom: -1px; white-space: nowrap; font-size: .95rem; }
.tabs button:hover { color: var(--fg); }
.tabs button.on { color: var(--fg); border-bottom-color: var(--accent); }
.persona { display: flex; flex-direction: column; gap: 10px; }
.persona .head { display: flex; gap: 12px; align-items: center; }
.persona .head .nm { font-weight: 700; font-size: 1.02rem; }
.persona .head .rl { color: var(--muted); font-size: var(--fs-sm); }
.persona .trait { font-size: .92rem; color: var(--fg-2); }
.persona .tip { font-size: .88rem; border-top: 1px dashed var(--border); padding-top: 8px; }
.persona .tip b { color: var(--signal-ink); }
.diagram { overflow-x: auto; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px; }
.diagram svg { display: block; min-width: 760px; width: 100%; height: auto; }
.diagram svg.plan { min-width: 600px; }
.diagram svg text { font-family: var(--font-body); }
.map-zone { cursor: pointer; }
.map-zone:hover rect, .map-zone.on rect { stroke: var(--accent); stroke-width: 3; }
.data-table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.data-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.data-table th { text-align: left; font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 9px 12px; background: var(--surface-2); border-bottom: 1px solid var(--border); white-space: nowrap; }
.data-table td { padding: 9px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.data-table tr:last-child td { border-bottom: 0; }
.data-table td.mono { font-size: .82rem; white-space: nowrap; }
.rules { counter-reset: rule; list-style: none; padding: 0; margin: 0; display: grid; gap: 10px; }
.rules li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 10px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 12px 14px; }
.rules li::before { counter-increment: rule; content: counter(rule); width: 30px; height: 30px; border-radius: var(--r); background: var(--fg); color: var(--surface); display: grid; place-items: center; font-family: var(--font-display); font-weight: 700; }
.rules b { display: block; }

/* ---------- Mémo, glossaire, outils ---------- */
.memo-sec { display: flex; flex-direction: column; gap: 10px; }
.cmd-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.cmd-table td { padding: 8px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
.cmd-table tr:last-child td { border-bottom: 0; }
.cmd-table td:first-child { width: 48%; }
.cmd-table code { font-family: var(--font-mono); font-size: .8rem; background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 2px 6px; display: inline-block; overflow-wrap: anywhere; cursor: copy; text-align: left; color: var(--fg); }
.cmd-table code:hover { border-color: var(--accent); }
.gloss-letters { display: flex; flex-wrap: wrap; gap: 4px; }
.gloss-letters a { width: 30px; height: 30px; display: grid; place-items: center; border-radius: var(--r-sm); border: 1px solid var(--border); text-decoration: none; font-weight: 700; font-size: .85rem; color: var(--fg-2); background: var(--surface); }
.gloss-letters a:hover { border-color: var(--accent); color: var(--accent); }
.gloss { display: grid; grid-template-columns: 200px minmax(0, 1fr); gap: 4px 20px; margin: 0; }
.gloss dt { font-weight: 700; padding-top: 10px; border-top: 1px solid var(--border); }
.gloss dd { margin: 0; padding: 10px 0 2px; border-top: 1px solid var(--border); color: var(--fg-2); }
.gloss dd small { display: block; color: var(--muted); margin-top: 2px; }
.gloss-letter { font-family: var(--font-display); font-size: 1.6rem; font-weight: 700; grid-column: 1 / -1; margin-top: 18px; scroll-margin-top: calc(var(--top-h) + 16px); }
.calc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; }
.calc-out { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 10px 12px; }
.calc-out .k { font-size: .72rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); font-weight: 700; }
.calc-out .v { font-family: var(--font-mono); font-weight: 600; font-size: .95rem; overflow-wrap: anywhere; }
.bits { font-family: var(--font-mono); font-size: .8rem; overflow-x: auto; white-space: nowrap; padding: 10px 12px; background: var(--console-bg); color: var(--console-fg); border-radius: var(--r); }
.bits .net { color: var(--console-accent); }
.bits .host { color: var(--console-warn); }
.field { display: flex; flex-direction: column; gap: 4px; font-size: var(--fs-sm); font-weight: 600; }
.field .hint { font-weight: 400; color: var(--muted); font-size: .8rem; }
.ex-row { display: grid; grid-template-columns: 170px minmax(0, 1fr) 30px; gap: 10px; align-items: center; }
.ex-row .mark { font-weight: 700; }
.ex-row .mark.ok { color: var(--ok); }
.ex-row .mark.ko { color: var(--crit); }

/* ---------- Profil ---------- */
.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; }
.badge { display: grid; grid-template-columns: 42px minmax(0, 1fr); gap: 10px; align-items: center; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); }
.badge .ic { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 50%; background: var(--signal-soft); color: var(--signal-ink); }
.badge .ic svg { width: 20px; height: 20px; }
.badge .nm { font-weight: 700; font-size: .9rem; }
.badge .ds { font-size: .78rem; color: var(--muted); }
.badge.off { background: var(--surface-2); }
.badge.off .ic { background: var(--surface-3); color: var(--muted); }
.badge.off .nm { color: var(--muted); }
.switch { display: flex; align-items: flex-start; gap: 12px; cursor: pointer; }
.switch input { width: 40px; height: 22px; appearance: none; background: var(--surface-3); border-radius: 11px; position: relative; cursor: pointer; flex: none; border: 1px solid var(--border-strong); margin: 2px 0 0; transition: background .15s; }
.switch input::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--surface); box-shadow: 0 1px 2px rgba(0, 0, 0, .3); transition: transform .15s; }
.switch input:checked { background: var(--accent); border-color: var(--accent); }
.switch input:checked::after { transform: translateX(18px); }
.switch b { display: block; }
.switch span { font-size: var(--fs-sm); color: var(--muted); }
.ranks { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 8px; }
.rank { border: 1px solid var(--border); border-radius: var(--r); padding: 10px; font-size: .82rem; background: var(--surface); }
.rank b { display: block; font-size: .9rem; }
.rank.on { border-color: var(--signal); background: var(--signal-soft); }
.rank.past { opacity: .7; }

/* ---------- Toasts & modale ---------- */
.toasts { position: fixed; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; z-index: 80; max-width: min(380px, calc(100vw - 32px)); }
.toast { background: var(--fg); color: var(--surface); padding: 10px 14px; border-radius: var(--r); box-shadow: 0 8px 24px rgba(0, 0, 0, .25); font-size: var(--fs-sm); display: flex; gap: 10px; align-items: center; animation: toast-in .2s ease-out; }
.toast.xp { background: var(--signal); color: #1d1400; font-weight: 700; }
.toast svg { width: 18px; height: 18px; flex: none; }
.empty-state h2 { display: flex; align-items: center; justify-content: center; gap: 8px; }
@keyframes toast-in { from { transform: translateY(8px); opacity: .4; } to { transform: none; opacity: 1; } }
.modal-back { position: fixed; inset: 0; background: rgba(5, 10, 15, .55); z-index: 90; display: grid; place-items: center; padding: 16px; }
.modal { background: var(--surface); border-radius: var(--r-lg); border: 1px solid var(--border); max-width: 520px; width: 100%; padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .3); }

.empty-state { text-align: center; padding: 40px 20px; color: var(--muted); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); }
.empty-state > * + * { margin-top: 10px; }
.lock-note { display: inline-flex; align-items: center; gap: 6px; font-size: .8rem; color: var(--muted); }
.lock-note svg { width: 14px; height: 14px; }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .split, .lesson-layout, .day-layout, .career-top { grid-template-columns: minmax(0, 1fr); }
  .lesson-aside, .side-panel { position: static; }
  .lesson-aside .toc-card { display: none; }
  .meta-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 960px) {
  .app { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: min(280px, 86vw); transform: translateX(-100%); transition: transform .2s ease; }
  .sidebar.open { transform: none; box-shadow: 0 0 40px rgba(0, 0, 0, .4); }
  .icon-btn.menu-btn { display: inline-flex; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .levels { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .ranks { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .topbar { gap: 8px; padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  .crumbs { display: none; }
  .search { flex: 1 1 auto; }
  .grade-chip .xp, .grade-chip .gname { display: none; }
  .grade-chip { padding: 0 6px; }
  .view { padding-block: 20px 48px; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .meta-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .levels { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ranks { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .debrief-top { grid-template-columns: minmax(0, 1fr); justify-items: center; }
  .score-bar { grid-template-columns: 110px minmax(0, 1fr) 40px; }
  .gloss { grid-template-columns: minmax(0, 1fr); }
  .gloss dd { border-top: 0; padding-top: 0; }
  .hero-main { padding: 20px; }
  h1 { font-size: 1.9rem; }
  .ex-row { grid-template-columns: minmax(0, 1fr) 30px; }
  .ex-row label { grid-column: 1 / -1; }
  .msg, .log-entry { grid-template-columns: 30px minmax(0, 1fr); gap: 10px; }
  .msg .avatar { width: 30px; height: 30px; font-size: .75rem; }
  .log-entry .dot { width: 30px; }
  .dialog .line { grid-template-columns: 40px minmax(0, 1fr); }
  .dialog .line .avatar { width: 40px; height: 40px; }
  .chapter { grid-template-columns: 44px minmax(0, 1fr); gap: 12px; }
  .chapter .num { width: 44px; height: 44px; font-size: 1.1rem; }
  .chapter::before { left: 21px; top: 44px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
