/* Forcer la hauteur à 100% pour les panels de contenu */
#images-body,
#slides-body,
#formations-body {
  height: 100%;
  min-height: 100%;
  width: 100%;
  min-width: 100%;
  box-sizing: border-box;
}
/* ─────────────────────────────────────────────
   TOKENS
───────────────────────────────────────────── */
:root, :root[data-theme="dark"] {
  --bg:        #0f172a;
  --surf:      #1e293b;
  --surf2:     #273449;
  --surf3:     #2f3f58;
  --border:    #334155;
  --border2:   #3d4f68;
  --text:      #e2e8f0;
  --text2:     #cbd5e1;
  --muted:     #94a3b8;
  --accent:    #6366f1;
  --accent2:   #818cf8;
  --accent-bg: rgba(99,102,241,.12);
  --warm:      #f59e0b;
  --warm-bg:   rgba(245,158,11,.12);
  --teal:      #14b8a6;
  --teal-bg:   rgba(20,184,166,.12);
  --rose:      #f43f5e;
  --purple:    #a855f7;
  --purple-bg: rgba(168,85,247,.1);
  --green:     #22c55e;
  --rail-w:    196px;
  --rail-collapsed-w: 72px;
  --radius:    10px;
  --radius-sm: 6px;
}
:root[data-theme="light"] {
  --bg:        #f1f5f9;
  --surf:      #ffffff;
  --surf2:     #f8fafc;
  --surf3:     #f1f5f9;
  --border:    #e2e8f0;
  --border2:   #cbd5e1;
  --text:      #0f172a;
  --text2:     #1e293b;
  --muted:     #64748b;
  --accent:    #4f46e5;
  --accent2:   #6366f1;
  --accent-bg: rgba(79,70,229,.08);
  --warm:      #d97706;
  --warm-bg:   rgba(217,119,6,.09);
  --teal:      #0d9488;
  --teal-bg:   rgba(13,148,136,.09);
  --rose:      #e11d48;
  --purple:    #9333ea;
  --purple-bg: rgba(147,51,234,.08);
  --green:     #16a34a;
  --rail-w:    196px;
  --rail-collapsed-w: 72px;
}

body { --rail-current-w: var(--rail-w); }
body.rail-collapsed { --rail-current-w: var(--rail-collapsed-w); }

/* nav.css injecte padding-left sur body.has-rail — on l'annule ici,
   car index.html utilise margin-left sur .stage à la place */
body.has-rail { padding-left: 0 !important; }

/* .stage a déjà margin-left pour le rail — le .page-topbar ne doit pas en ajouter un second */
.stage .page-topbar { margin-left: 0; }

/* ─────────────────────────────────────────────
   RESET & BASE
───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { min-height: 100%; }
body {
  min-height: 100%; background: var(--bg); color: var(--text);
  font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 13px; line-height: 1.5;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
svg { display: block; flex-shrink: 0; }

/* ─────────────────────────────────────────────
   SHELL
───────────────────────────────────────────── */
.shell { display: block; }

/* ─────────────────────────────────────────────
   RAIL (SIDEBAR)
───────────────────────────────────────────── */
.rail {
  width: var(--rail-current-w); flex-shrink: 0;
  background: var(--surf);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  padding: 0; overflow: hidden;
  position: fixed; top: 0; left: 0; bottom: 0;
  z-index: 100;
  transition: width .18s ease;
}

/* Logo */
.rail-logo {
  position: relative;
  padding: 18px 16px 14px;
  display: flex; align-items: center; gap: 10px;
  flex-shrink: 0;
}
.rail-collapse-btn {
  position: absolute;
  right: 8px;
  top: 8px;
  width: 22px;
  height: 22px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: var(--surf2);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .12s, color .12s, transform .12s;
}
.rail-collapse-btn:hover { background: var(--surf3); color: var(--text); }
.rail-logo-img { height: 50px; width: auto; display: block; }
.rail-logo-embed {
  width: 140px;
  height: 44px;
  border: 0;
  display: block;
  background: transparent;
  pointer-events: none;
  border-radius: 12px;
  margin: 0 auto;
  box-shadow: 0 2px 12px 0 rgba(0,0,0,0.07);
  transition: box-shadow .18s;
}
.rail-logo-favicon { width: 34px; height: 34px; border-radius: 8px; display: none; }
:root[data-theme="dark"]  .logo-light { display: none; }
:root:not([data-theme="dark"]) .logo-dark { display: none; }
.rail-badge {
  font-size: 9px; font-weight: 700; letter-spacing: .04em;
  text-transform: uppercase; background: var(--warm-bg);
  color: var(--warm); border: 1px solid rgba(245,158,11,.25);
  border-radius: 4px; padding: 1px 5px; margin-left: auto;
}

/* Nav */
.rail-nav { flex: 1; padding: 8px; overflow-y: auto; scrollbar-width: none; }
.rail-nav::-webkit-scrollbar { display: none; }
.rail-section-label {
  font-size: 9px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
  padding: 8px 8px 4px; margin-top: 4px;
}
.rail-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 10px; border-radius: var(--radius-sm);
  font-size: 12.5px; font-weight: 500; color: var(--muted);
  transition: background .12s, color .12s;
  border: none; background: transparent; width: 100%; text-align: left;
}
.rail-item:hover { background: var(--surf2); color: var(--text); }
.rail-item.active { background: var(--accent-bg); color: var(--accent2); font-weight: 600; }
.rail-item-ico {
  width: 18px; height: 18px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; opacity: .8;
}
.rail-separator { height: 1px; background: var(--border); margin: 6px 8px; }

/* Footer */
.rail-footer {
  border-top: 1px solid var(--border); padding: 10px 8px;
  display: flex; flex-direction: column; gap: 2px; flex-shrink: 0;
}
.rail-user {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px; border-radius: var(--radius-sm);
  font-size: 12px; font-weight: 500; color: var(--muted);
  overflow: hidden;
}
.rail-user-avatar {
  width: 26px; height: 26px; border-radius: 6px; flex-shrink: 0;
  background: var(--accent-bg); border: 1px solid var(--border2);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent2); font-size: 11px; font-weight: 700;
}
#userLabel2 {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  flex: 1; min-width: 0;
}

/* ─────────────────────────────────────────────
   STAGE (MAIN AREA)
───────────────────────────────────────────── */
.stage {
  margin-left: var(--rail-current-w, 220px);
  transition: margin-left .18s ease;
  display: flex; flex-direction: column;
  min-height: 100vh;
  flex: 1; min-width: 0;
}

.rail.collapsed .rail-logo {
  padding: 14px 8px 12px;
  justify-content: center;
}
.rail.collapsed .rail-logo-img { display: none; }
.rail.collapsed .rail-logo-embed { display: none; }
.rail.collapsed .rail-logo-favicon { display: block; }
.rail.collapsed .rail-badge,
.rail.collapsed .rail-section-label,
.rail.collapsed #userLabel2 { display: none !important; }
.rail.collapsed .rail-nav { padding: 8px 6px; }
.rail.collapsed .rail-item {
  justify-content: center;
  padding: 9px 0;
  font-size: 0;
}
.rail.collapsed .rail-item-ico {
  width: 20px;
  height: 20px;
  opacity: 1;
}
.rail.collapsed .rail-user {
  justify-content: center;
  padding: 6px 0;
}
.rail.collapsed .rail-collapse-btn {
  transform: rotate(180deg);
  right: 50%;
  margin-right: -11px;
}

/* Topbar */
.topbar {
  position: sticky; top: 0; z-index: 50;
  background: var(--bg); border-bottom: 1px solid var(--border);
  padding: 0 28px;
  height: 52px; display: flex; align-items: center; gap: 12px;
  flex-shrink: 0;
}
.topbar-greeting {
  flex: 1; font-size: 14px; font-weight: 700; min-width: 0;
  display: flex; align-items: center; gap: 10px;
}
.topbar-logo-img { height: 22px; width: auto; display: block; }
.topbar-greeting em {
  font-style: normal;
  background: linear-gradient(90deg, var(--accent2), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.topbar-actions { display: flex; align-items: center; gap: 8px; }

.btn-launch {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--accent); color: #fff;
  border: none; border-radius: 7px;
  padding: 7px 14px; font-size: 12px; font-weight: 700;
  transition: background .15s, transform .1s;
}
.btn-launch:hover { background: var(--accent2); transform: translateY(-1px); }

.btn-icon-top {
  width: 32px; height: 32px; border-radius: 7px;
  border: 1px solid var(--border); background: transparent;
  color: var(--muted); display: flex; align-items: center; justify-content: center;
  transition: background .12s, color .12s, border-color .12s;
}
.btn-icon-top:hover { background: var(--surf2); color: var(--text); border-color: var(--border2); }

/* ─────────────────────────────────────────────
   MAIN CONTENT
───────────────────────────────────────────── */
.stage-main {
  flex: 1;
  padding: 24px 28px 48px;
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
}

/* ── Stats strip ── */
.stats-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.stat-chip {
  display: flex; align-items: center; gap: 12px;
  background: var(--surf); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 14px 16px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  cursor: pointer; text-decoration: none; color: inherit;
}
.stat-chip:hover {
  border-color: var(--accent2);
  box-shadow: 0 4px 16px rgba(99,102,241,.12);
  transform: translateY(-2px);
}
.stat-chip-icon {
  width: 38px; height: 38px; border-radius: 9px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}
.stat-chip-icon.indigo { background: var(--accent-bg); }
.stat-chip-icon.teal   { background: var(--teal-bg); }
.stat-chip-icon.warm   { background: var(--warm-bg); }
.stat-chip-icon.purple { background: var(--purple-bg); }
.stat-chip-body { min-width: 0; }
.stat-chip-val  { font-size: 22px; font-weight: 800; line-height: 1; }
.stat-chip-lbl  { font-size: 11px; color: var(--muted); margin-top: 2px; }

/* ── Quick tools ── */
.section-label {
  font-size: 10px; font-weight: 700; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted); margin-bottom: 10px;
}
.tools-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tool-card {
  display: flex; align-items: flex-start; gap: 12px;
  background: var(--surf); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 16px;
  transition: border-color .15s, box-shadow .15s, transform .15s;
  color: inherit;
}
.tool-card:hover {
  border-color: var(--accent2);
  box-shadow: 0 6px 20px rgba(99,102,241,.1);
  transform: translateY(-2px);
}
.tool-card-body { flex: 1; min-width: 0; }
.tool-card-title { font-size: 13px; font-weight: 700; margin-bottom: 3px; }
.tool-card-desc  { font-size: 11px; color: var(--muted); line-height: 1.55; }
.tool-card-arrow {
  margin-left: auto; color: var(--muted); font-size: 16px;
  align-self: center; transition: transform .15s, color .15s;
}
.tool-card:hover .tool-card-arrow { transform: translateX(3px); color: var(--accent2); }

/* ── Two-col layout ── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── Panel card ── */
.panel {
  background: var(--surf); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.panel-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; user-select: none;
  transition: background .1s;
}
.panel-head:hover { background: var(--surf2); }
.panel-head-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px; font-weight: 700; flex: 1;
}
.panel-badge {
  background: var(--accent-bg); color: var(--accent2);
  border-radius: 20px; font-size: 10px; font-weight: 700;
  padding: 1px 8px; min-width: 22px; text-align: center;
}
.panel-chev { color: var(--muted); font-size: 10px; transition: transform .2s; }
.panel-body { padding: 12px 16px; }
.panel-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 12px 0; }

/* ── Phrase du jour ── */
.phrase-panel .panel-body { display: flex; flex-direction: column; gap: 8px; }
.phrase-row { display: flex; gap: 8px; align-items: center; }
.phrase-input {
  flex: 1; background: var(--surf2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); color: var(--text);
  font-size: 12px; font-family: inherit;
  padding: 8px 12px; outline: none;
  transition: border-color .15s;
}
.phrase-input:focus { border-color: var(--accent); }
.phrase-status { font-size: 11px; color: var(--muted); min-height: 16px; }

/* ── Boutons ── */
.btn-sm {
  display: inline-flex; align-items: center; gap: 5px;
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  background: transparent; color: var(--muted);
  font-size: 11px; font-weight: 600; font-family: inherit;
  padding: 6px 12px; white-space: nowrap;
  transition: background .12s, color .12s, border-color .12s;
}
.btn-sm:hover { background: var(--surf2); color: var(--text); border-color: var(--border2); }
.btn-sm.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-sm.primary:hover { background: var(--accent2); border-color: var(--accent2); }

/* ── Radio (éléments cachés, conservés pour JS) ── */
.radio-controls { display: flex; align-items: center; gap: 8px; }
.radio-btn2 {
  width: 30px; height: 30px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent;
  color: var(--text); display: flex; align-items: center; justify-content: center;
  font-size: 12px; transition: background .12s, border-color .12s;
}
.radio-btn2:hover { background: var(--surf2); border-color: var(--border2); }
.radio-vol-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
input[type=range].radio-slider { flex: 1; accent-color: var(--accent); cursor: pointer; }
.radio-list { margin-top: 8px; display: flex; flex-direction: column; gap: 2px; }

/* ── Collapsible body toggle ── */
.collapse-body { display: block; }
.collapse-body.closed { display: none; }
/* Panneaux pliables : le corps est masqué tant que le panneau n'est pas .open */
.panel:not(.open) > .collapse-body { display: none; }
.missions-toggle-chev { transition: transform .2s; }
.panel:not(.open) .missions-toggle-chev { transform: rotate(-90deg); }

/* ── Items listes (formations / slides / missions) ── */
.mission-item {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; text-decoration: none; color: inherit;
  border-bottom: 1px solid var(--border);
}
.mission-item:last-child { border-bottom: none; }
a.mission-item {
  transition: background .12s, padding .12s;
  border-radius: var(--radius-sm);
}
a.mission-item:hover {
  background: var(--surf2);
  padding-left: 8px; padding-right: 8px;
  margin-left: -8px; margin-right: -8px;
}
.mission-item-body { flex: 1; min-width: 0; }
.mission-item-title {
  font-size: 13px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.4;
}
.mission-item-date { font-size: 11px; color: var(--muted); margin-top: 2px; }
.mission-item-badge {
  flex-shrink: 0; font-size: 10px; font-weight: 700;
  padding: 2px 9px; border-radius: 20px;
  background: var(--accent-bg); color: var(--accent2);
  white-space: nowrap;
}
.mission-item-badge.teal { background: var(--teal-bg); color: var(--teal); }
.mission-item-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.missions-empty { color: var(--muted); font-size: 12px; text-align: center; padding: 16px 0; }

/* ── Grille miniatures images ── */
.img-thumb-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  padding: 4px 0;
}
.img-thumb-item {
  aspect-ratio: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--border);
  display: block;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.img-thumb-item:hover {
  transform: scale(1.04);
  border-color: var(--accent2);
  box-shadow: 0 4px 12px rgba(99,102,241,.15);
}
.img-thumb-item img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ─────────────────────────────────────────────
   PUBLIC HOME (utilisateur non connecté)
───────────────────────────────────────────── */
#publicHome {
  flex: 1; padding: 60px 40px 80px;
  margin-left: 0; /* pas de rail quand non connecté */
}
/* Cacher le rail quand la page publique est affichée */
body.public-mode .rail { display: none; }
body.public-mode { padding-left: 0 !important; }

.ph-container {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 32px;
  margin-left: calc(var(--rail-current-w, var(--rail-w)) + 28px);
  padding: 40px 28px 64px;
}
body.public-mode .ph-container {
  margin-left: 0;
}

.hero-card {
  background: var(--surf); border: 1px solid var(--border);
  border-radius: 20px; padding: 56px 52px 48px;
  position: relative; overflow: hidden;
}
.hero-logo-embed {
  width: 220px;
  height: 66px;
  border: 0;
  display: block;
  background: transparent;
  pointer-events: none;
  margin: 0 auto 14px auto;
  border-radius: 16px;
  box-shadow: 0 4px 24px 0 rgba(0,0,0,0.10);
}
.hero-card::before {
  content: ''; position: absolute;
  top: -80px; right: -80px; width: 420px; height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(99,102,241,.18) 0%, transparent 70%);
  pointer-events: none;
}
.hero-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: .18em;
  text-transform: uppercase; color: var(--accent2); margin-bottom: 18px;
}
.hero-h1 {
  font-size: 42px; font-weight: 800; line-height: 1.05;
  letter-spacing: -.6px; margin-bottom: 16px;
}
.hero-h1 span {
  background: linear-gradient(90deg, var(--accent2), var(--purple));
  -webkit-background-clip: text; -webkit-text-fill-color: transparent;
  background-clip: text;
}
.hero-desc { font-size: 15px; color: var(--muted); line-height: 1.75; max-width: 600px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 32px; }
.btn-hero-primary {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--accent); color: #fff; border-radius: 10px;
  padding: 13px 26px; font-size: 15px; font-weight: 700; border: none;
  transition: background .15s, transform .1s;
}
.btn-hero-primary:hover { background: var(--accent2); transform: translateY(-1px); }
.btn-hero-ghost {
  display: inline-flex; align-items: center; gap: 8px;
  background: transparent; color: var(--text2);
  border: 1px solid var(--border2); border-radius: 10px;
  padding: 13px 26px; font-size: 15px; font-weight: 600;
  transition: background .15s, border-color .15s;
}
.btn-hero-ghost:hover { background: var(--surf2); border-color: var(--border2); }

/* Feature cards */
.feat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.feat-card {
  background: var(--surf); border: 1px solid var(--border);
  border-radius: 14px; padding: 24px;
  display: flex; flex-direction: column; gap: 12px;
  transition: border-color .15s, transform .15s;
}
.feat-card:hover { border-color: var(--accent2); transform: translateY(-2px); }
.feat-icon {
  width: 44px; height: 44px; border-radius: 11px;
  background: var(--accent-bg);
  display: flex; align-items: center; justify-content: center;
  color: var(--accent2); flex-shrink: 0;
}
.feat-title { font-size: 14px; font-weight: 700; color: var(--text); }
.feat-desc  { font-size: 13px; color: var(--muted); line-height: 1.65; flex: 1; }
.feat-link  { font-size: 12px; color: var(--accent2); font-weight: 600; margin-top: auto; }

/* Quick access grid */
.quick-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.quick-card {
  background: var(--surf); border: 1px solid var(--border);
  border-radius: 12px; padding: 22px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 600; color: var(--muted); text-align: center;
  transition: background .12s, border-color .12s, color .12s, transform .12s;
}
.quick-card:hover {
  background: var(--accent-bg); border-color: var(--accent2);
  color: var(--accent2); transform: translateY(-2px);
}
.quick-icon { color: var(--accent2); }

/* Steps */
.steps-row { display: flex; align-items: flex-start; gap: 12px; }
.step { flex: 1; text-align: center; }
.step-num {
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--accent-bg); border: 2px solid var(--accent);
  color: var(--accent2); font-size: 18px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 12px;
}
.step-title { font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.step-desc  { font-size: 11px; color: var(--muted); line-height: 1.65; }
.step-arrow { color: var(--border2); font-size: 20px; flex-shrink: 0; margin-top: 10px; }

/* ─────────────────────────────────────────────
   BOTTOM NAV (mobile only)
───────────────────────────────────────────── */
.bottom-nav {
  display: none;
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 200;
  background: var(--surf);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bottom-nav-inner { display: flex; align-items: stretch; height: 56px; }
.bnav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font-size: 10px; font-weight: 600;
  text-decoration: none; border: none; background: transparent;
  font-family: inherit; cursor: pointer;
  transition: color .15s;
  -webkit-tap-highlight-color: transparent;
}
.bnav-item:active { opacity: .7; }
.bnav-item.active { color: var(--accent2); }
.bnav-item svg { flex-shrink: 0; }
.bnav-center { flex: 1; padding: 0; }
.bnav-launch-btn {
  width: 46px; height: 46px; border-radius: 14px;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 14px rgba(99,102,241,.4);
  border: none; cursor: pointer; font-family: inherit;
  transition: background .15s, transform .1s;
  -webkit-tap-highlight-color: transparent;
}
.bnav-launch-btn:active { transform: scale(.93); }

/* ─────────────────────────────────────────────
   TABLET (≤ 900px)
───────────────────────────────────────────── */
@media (max-width: 900px) {
  :root { --rail-w: 0px; }
  body,
  body.has-rail,
  body.has-rail.rail-collapsed { --rail-current-w: 0px; }
  .rail { display: none; }
  .bottom-nav { display: block; }
  .bnav-item.bnav-mobile-hide { display: none; }
  .stage { margin-left: 0; padding-bottom: calc(56px + env(safe-area-inset-bottom, 0px)); }
  .stats-strip { grid-template-columns: repeat(2, 1fr); }
  .tools-grid  { grid-template-columns: repeat(2, 1fr); }
  .two-col     { grid-template-columns: 1fr; }
  .feat-grid   { grid-template-columns: repeat(2, 1fr); }
  .quick-grid  { grid-template-columns: repeat(2, 1fr); }
  .topbar      { padding: 0 16px; }
}

/* ─────────────────────────────────────────────
   MOBILE (≤ 540px)
───────────────────────────────────────────── */
@media (max-width: 540px) {
  .hero-logo-embed { width: 170px; height: 50px; }
  .topbar { height: 48px; padding: 0 14px; gap: 8px; }
  .topbar-greeting { font-size: 13px; }
  .stage-main { padding: 14px 14px 20px; gap: 14px; }
  .stats-strip { grid-template-columns: 1fr 1fr; gap: 8px; }
  .stat-chip { padding: 12px; gap: 10px; }
  .stat-chip-val  { font-size: 18px; }
  .stat-chip-lbl  { font-size: 10px; }
  .tools-grid { grid-template-columns: 1fr; gap: 8px; }
  .tool-card  { padding: 14px; }
  .panel-head  { padding: 14px 14px; min-height: 48px; }
  .panel-body  { padding: 10px 14px; }
  .panel-badge { font-size: 10px; padding: 2px 8px; }
  .phrase-row { flex-direction: column; }
  .phrase-input { width: 100%; }
  .btn-sm { width: 100%; justify-content: center; padding: 10px; }
  .radio-btn2 { width: 38px; height: 38px; font-size: 14px; }
  .hero-card { padding: 24px 20px; border-radius: 12px; }
  .hero-h1   { font-size: 22px; }
  .feat-grid { grid-template-columns: 1fr; gap: 8px; }
  .quick-grid{ grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .steps-row { flex-direction: column; align-items: center; }
  .step-arrow { transform: rotate(90deg); margin: 4px 0; }
  #publicHome { padding: 20px 14px 80px; }
}

/* ─────────────────────────────────────────────
   UTILITAIRES — styles extraits des inline d'index.html
   (la visibilité display:none reste inline, pilotée par index.js)
───────────────────────────────────────────── */
.active-formation-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
}
.active-formation-label { color: var(--muted); }
.active-formation-name {
  color: var(--text);
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sound-import-label {
  cursor: pointer;
  margin-left: auto;
  margin-right: 8px;
}

.beta-badge--inline {
  vertical-align: middle;
  margin-left: 6px;
}

.section-label--spaced { margin-bottom: 12px; }

.workflow-panel { padding: 24px; }
.workflow-title {
  font-size: 16px;
  font-weight: 700;
  margin-bottom: 20px;
}
