:root {
  --bg: #f9f6ef;
  --ink: #1f2a37;
  --muted: #546072;
  --card: #ffffff;
  --line: #d7deea;
  --primary: #006d77;
  --primary-strong: #00535a;
  --accent: #f4a261;
  --good: #0b7a4f;
  --bad: #a01d2f;
  --shadow: 0 20px 60px rgba(15, 30, 48, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
}

body {
  position: relative;
  font-family: "IBM Plex Sans", sans-serif;
  color: var(--ink);
  background: linear-gradient(170deg, #fef8e7 0%, #f3f8ff 52%, #eaf8f0 100%);
  overflow-x: hidden;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  pointer-events: none;
  filter: blur(0.5px);
  z-index: 0;
}

.bg-shape-a {
  width: 320px;
  height: 320px;
  top: -120px;
  right: -60px;
  background: radial-gradient(circle at 30% 40%, #ffd58f 0%, #f4a261 70%, transparent 72%);
  opacity: 0.22;
}

.bg-shape-b {
  width: 380px;
  height: 380px;
  bottom: -180px;
  left: -90px;
  background: radial-gradient(circle at 62% 48%, #67c9c2 0%, #198f9a 62%, transparent 64%);
  opacity: 0.18;
}

.app-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 18px;
  padding: 20px;
}

.sidebar {
  position: sticky;
  top: 20px;
  align-self: start;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.sidebar-fixed-top {
  flex-shrink: 0;
}

.brand {
  display: flex;
  align-items: center;
}

.brand-logo {
  width: 150px;
  height: auto;
  display: block;
}

.sidebar-kicker {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #4c6377;
}

.side-nav {
  display: grid;
  gap: 5px;
}

.side-link {
  border: 1px solid #d6e0ec;
  background: #fff;
  border-radius: 11px;
  padding: 10px 12px;
  text-align: left;
  font: inherit;
  font-size: 0.9rem;
  color: #22384f;
  cursor: pointer;
  transition: border-color 130ms ease, background-color 130ms ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.side-link-icon {
  font-size: 1.05rem;
  flex-shrink: 0;
  width: 1.2em;
  text-align: center;
}

.side-link:hover {
  border-color: #aac0d1;
}

.side-link.is-active {
  border-color: #2d7d8d;
  background: rgba(45, 125, 141, 0.12);
  font-weight: 600;
}

.side-nav-divider {
  display: block;
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8ca0b3;
  padding: 0.5rem 0.25rem 0;
  margin-top: 0.25rem;
}

.side-link:disabled {
  cursor: not-allowed;
  opacity: 0.55;
  background: #f6f9fc;
}

.side-link-disabled {
  font-style: italic;
}

.nav-helper {
  margin: 2px 0 0;
  font-size: 0.83rem;
  line-height: 1.35;
  color: #4c6377;
}

.workspace {
  position: relative;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 0 10px 30px 0;
}

.utility-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 14px;
  padding-bottom: 14px;
}

.utility-title-group {
  display: grid;
  gap: 2px;
}

.utility-kicker {
  margin: 0;
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5c6f83;
}

.utility-title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
  color: #21374d;
  font-weight: 700;
}

.utility-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.utility-btn {
  border: 1px solid #d4ddeb;
  background: #fff;
  color: #334a60;
  border-radius: 11px;
  padding: 7px 12px;
  font: inherit;
  font-size: 0.88rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.utility-btn:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

/* Bouton sélecteur de langue */
.lang-toggle {
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  background: linear-gradient(135deg, #eef4ff 0%, #f0f9f0 100%);
  border: 2px solid #7aaad0;
  color: #1a3a5c;
  transition: background 0.2s, transform 0.15s, box-shadow 0.2s;
  flex-shrink: 0;
  min-width: 72px;
  text-align: center;
}
.lang-toggle:hover {
  background: linear-gradient(135deg, #ddeeff 0%, #e0f4e0 100%);
  border-color: #3b82f6;
  transform: scale(1.06);
  box-shadow: 0 2px 8px rgba(59,130,246,0.25);
}
.lang-toggle:active {
  transform: scale(0.97);
}
/* Flash d'animation quand la langue vient de changer */
@keyframes langSwitchFlash {
  0%   { box-shadow: 0 0 0 0 rgba(59,130,246,0.6); }
  50%  { box-shadow: 0 0 0 6px rgba(59,130,246,0.15); }
  100% { box-shadow: 0 0 0 0 rgba(59,130,246,0); }
}
.lang-toggle.lang-just-switched {
  animation: langSwitchFlash 0.6s ease-out;
}

/* ── Topbar Gamification Mini-Banner ──────────────────────── */
.topbar-gamif {
  display: flex;
  align-items: center;
  gap: 8px;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  border-radius: 10px;
  padding: 5px 12px;
  cursor: pointer;
  transition: opacity 0.15s, transform 0.15s;
  flex-shrink: 0;
}
.topbar-gamif:hover {
  opacity: 0.92;
  transform: translateY(-1px);
}
.topbar-gamif-icon {
  font-size: 1.1rem;
  line-height: 1;
}
.topbar-gamif-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.topbar-gamif-level {
  font-size: 0.75rem;
  font-weight: 600;
  color: #e0e7ff;
  white-space: nowrap;
  letter-spacing: 0.01em;
}
.topbar-gamif-xpbar {
  width: 64px;
  height: 4px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 99px;
  overflow: hidden;
}
.topbar-gamif-xpfill {
  height: 100%;
  background: #a5f3fc;
  border-radius: 99px;
  transition: width 0.6s ease;
}
.topbar-gamif-badges {
  font-size: 0.72rem;
  color: #c7d2fe;
  white-space: nowrap;
}

/* ── Topbar Avatar + Greeting ─────────────────────────────── */
.topbar-avatar-zone {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  border-radius: 999px;
  padding: 3px 10px 3px 3px;
  transition: background 0.15s, transform 0.15s;
}
.topbar-avatar-zone:hover {
  background: rgba(124, 58, 237, 0.1);
  transform: translateY(-1px);
}
.topbar-avatar-circle {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #7c3aed;
  color: #fff;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(124, 58, 237, 0.35);
  transition: box-shadow 0.15s;
}
.topbar-avatar-zone:hover .topbar-avatar-circle {
  box-shadow: 0 4px 14px rgba(124, 58, 237, 0.5);
}
.topbar-greeting {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  white-space: nowrap;
}

/* ── Profile Avatar Upload Overlay ───────────────────────── */
.profile-avatar-wrap {
  position: relative;
  display: inline-block;
  cursor: pointer;
}
.profile-avatar-overlay {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
  font-size: 1.5rem;
  color: #fff;
}
.profile-avatar-wrap:hover .profile-avatar-overlay {
  opacity: 1;
}

.utility-count {
  min-width: 20px;
  border: 1px solid #bfd0e2;
  border-radius: 999px;
  padding: 1px 6px;
  background: #f1f6fb;
  color: #26425b;
  font-size: 0.78rem;
  text-align: center;
}

.utility-count.has-alert {
  border-color: rgba(160, 29, 47, 0.5);
  background: rgba(160, 29, 47, 0.1);
  color: #8f1a2a;
}

.utility-panel {
  position: absolute;
  top: 74px;
  right: 14px;
  width: min(420px, calc(100vw - 44px));
  border: 1px solid #d5dfeb;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 40px rgba(19, 36, 57, 0.18);
  z-index: 14;
  padding: 12px;
  display: grid;
  gap: 10px;
}

#milestonesPanel {
  right: 170px;
}

.utility-panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.utility-panel-head h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.02rem;
}

.utility-panel-list {
  max-height: min(60vh, 460px);
  overflow-y: auto;
  display: grid;
  gap: 8px;
}

.utility-row {
  border: 1px solid #d7e2ee;
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
  display: grid;
  gap: 4px;
}

.utility-row.is-unread {
  border-color: #3f8ea1;
  background: rgba(63, 142, 161, 0.08);
}

.utility-row.is-complete {
  border-color: rgba(11, 122, 79, 0.42);
  background: rgba(11, 122, 79, 0.1);
}

.utility-row-title {
  margin: 0;
  font-weight: 700;
  color: #22384f;
}

.utility-row-meta {
  margin: 0;
  font-size: 0.82rem;
  color: #4b5f74;
}

.utility-row-desc {
  margin: 0;
  font-size: 0.87rem;
  color: #32495f;
}

.panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.8);
  border-radius: 18px;
  padding: 20px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(4px);
}

.panel h2 {
  margin: 0 0 16px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.3rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.topbar-copy h1 {
  margin: 6px 0 8px;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.6rem, 2.5vw, 2.2rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.eyebrow {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #0a666f;
}

.hero-text {
  margin: 0;
  max-width: 66ch;
  color: var(--muted);
  font-size: 0.9rem;
}

.topbar-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
  flex-shrink: 0;
}

.topbar-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.topbar-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.view {
  display: grid;
  gap: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.dashboard-panel {
  display: grid;
  gap: 14px;
}

.dashboard-quick-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: 1.4fr 1fr;
}

.quick-card {
  border: 1px solid #d7e1ee;
  border-radius: 14px;
  background: #fff;
  padding: 14px;
  display: grid;
  gap: 8px;
}

.quick-card h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.quick-card p {
  margin: 0;
  color: #3f5368;
  font-size: 0.92rem;
  line-height: 1.45;
}

.quick-card-muted {
  background: linear-gradient(180deg, #f9fbff 0%, #ffffff 70%);
}

.quick-card-action {
  border-color: #3d7aed;
  background: linear-gradient(135deg, #ebf2ff 0%, #ffffff 60%);
}

.quick-card-action .btn {
  justify-self: start;
}

/* Domain mastery bars */
.domain-bar-wrap {
  display: grid;
  gap: 6px;
}

.domain-bar-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
  font-size: 0.82rem;
}

.domain-bar-label {
  color: #3f5368;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.domain-bar-track {
  width: 100%;
  height: 6px;
  background: #e8edf4;
  border-radius: 3px;
  overflow: hidden;
  grid-column: 1 / -1;
}

.domain-bar-fill {
  height: 100%;
  border-radius: 3px;
  background: #3d7aed;
  transition: width 0.4s ease;
}

.domain-bar-fill.low { background: #e74c3c; }
.domain-bar-fill.medium { background: #f39c12; }
.domain-bar-fill.good { background: #27ae60; }

.quick-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.auth-status {
  margin: 0 0 10px;
  color: #3e5164;
  font-size: 0.92rem;
}

.auth-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.auth-user-email {
  margin: 0;
  color: #253a4f;
  font-weight: 600;
}

.dashboard-hint {
  margin: 0;
  color: #4d6176;
  font-size: 0.92rem;
}

.dashboard-stats {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.stat-card {
  border: 1px solid #d7e2ee;
  border-radius: 12px;
  background: #fff;
  padding: 12px 14px;
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}
.stat-card:hover {
  box-shadow: 0 4px 12px rgba(15, 30, 48, 0.08);
  transform: translateY(-1px);
}

.stat-card p {
  margin: 0;
}

.stat-icon {
  font-size: 1.3rem;
  line-height: 1;
  display: block;
  margin-bottom: 6px;
}

.stat-label {
  font-size: 0.8rem;
  color: #5b6d80;
}

.stat-value {
  margin-top: 3px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
  font-weight: 600;
  color: #23384f;
}

/* Count badge: soft pill used inline in section headers */
.count-badge {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(0, 109, 119, 0.08);
  color: var(--primary, #006d77);
  border: 1px solid rgba(0, 109, 119, 0.15);
  vertical-align: middle;
  margin-left: 4px;
}

.history-list {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.history-toolbar {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dashboard-breakdown {
  margin-top: 10px;
}

.dashboard-split {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.75fr);
  gap: 12px;
}

.dashboard-primary,
.dashboard-secondary {
  display: grid;
  gap: 10px;
  align-content: start;
}

.side-metric-card {
  border: 1px solid #d7e2ee;
  border-radius: 14px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 8px;
}

.side-metric-card h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.learning-hero {
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  gap: 12px;
}

.learning-hero-main,
.learning-hero-stats {
  border: 1px solid #d7e2ee;
  border-radius: 14px;
  padding: 14px;
  background: #fff;
}

.learning-hero-main h3 {
  margin: 8px 0 6px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.08rem;
}

.module-title-wrap {
  display: grid;
  gap: 4px;
}

.module-subtitle {
  margin: 0;
  color: #43576c !important;
  font-size: 0.85rem !important;
}

.module-progress-track {
  height: 8px;
}

.module-progress-fill {
  background: linear-gradient(90deg, #006d77 0%, #3fa9b2 100%);
}

.game-stage {
  margin-top: 10px;
  border: 1px solid #d7e2ee;
  border-radius: 12px;
  background: #fff;
  padding: 12px;
  display: grid;
  gap: 12px;
}

.game-headline {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  color: #22384f;
}

.game-meta {
  margin: 0;
  color: #41576c;
  font-size: 0.92rem;
}

.game-options {
  display: grid;
  gap: 8px;
}

.game-option-btn {
  border: 1px solid #d4dfeb;
  border-radius: 10px;
  background: #fff;
  color: #22384f;
  font: inherit;
  text-align: left;
  padding: 10px;
  cursor: pointer;
}

.game-option-btn:hover {
  border-color: #8ba8be;
}

.game-option-btn:disabled {
  cursor: default;
}

.game-option-btn.is-good {
  border-color: rgba(11, 122, 79, 0.42);
  background: rgba(11, 122, 79, 0.1);
  color: #0f6f4a;
}

.game-option-btn.is-bad {
  border-color: rgba(160, 29, 47, 0.45);
  background: rgba(160, 29, 47, 0.1);
  color: #8f1b2b;
}

.game-feedback {
  border-radius: 10px;
  padding: 10px;
  font-size: 0.9rem;
}

.game-feedback.is-good {
  border: 1px solid rgba(11, 122, 79, 0.42);
  background: rgba(11, 122, 79, 0.1);
  color: #0f6f4a;
}

.game-feedback.is-bad {
  border: 1px solid rgba(160, 29, 47, 0.45);
  background: rgba(160, 29, 47, 0.1);
  color: #8f1b2b;
}

.history-item {
  border: 1px solid #d7e2ee;
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
}

.history-item-compact {
  padding: 8px 10px;
}

.history-item.is-success {
  border-color: rgba(11, 122, 79, 0.38);
  background: rgba(11, 122, 79, 0.08);
}

.history-item-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.history-item .inline-actions {
  display: flex;
  gap: 6px;
}

.history-item p {
  margin: 2px 0 0;
  color: #32475d;
  font-size: 0.88rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.field {
  display: grid;
  gap: 6px;
}

.field span {
  font-size: 0.9rem;
  color: #3e4b5b;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  color: inherit;
  background: #fff;
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(0, 109, 119, 0.28);
  outline-offset: 1px;
}

.actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.actions.compact {
  margin-top: 0;
}

.btn {
  border: 0;
  border-radius: 12px;
  padding: 10px 14px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
}

.btn-primary {
  color: #fff;
  background: linear-gradient(120deg, var(--primary) 0%, #198f9a 100%);
}

.btn-primary:hover {
  background: linear-gradient(120deg, var(--primary-strong) 0%, #137e87 100%);
}

.btn-ghost {
  background: #fff;
  color: #2a3644;
  border: 1px solid var(--line);
}

.btn-danger {
  background: #dc2626;
  color: #fff;
  border: 1px solid #dc2626;
}
.btn-danger:hover { background: #b91c1c; border-color: #b91c1c; }
.btn-danger:focus-visible { outline: 3px solid rgba(220, 38, 38, 0.4); }

.btn-full {
  width: 100%;
}

.btn-small {
  padding: 6px 10px;
  font-size: 0.84rem;
}

.btn:focus-visible,
.side-link:focus-visible,
.utility-btn:focus-visible,
.field input:focus-visible,
.field select:focus-visible,
.option-item:focus-within,
.revisit-toggle input:focus-visible,
.palette-btn:focus-visible {
  outline: 3px solid rgba(0, 109, 119, 0.4);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.quiz-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  align-items: baseline;
}

.exam-meta-strip {
  margin-top: 8px;
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.exam-meta-group {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

#pauseSessionBtn.is-paused {
  border-color: rgba(0, 109, 119, 0.5);
  background: rgba(0, 109, 119, 0.14);
  color: #00525a;
}

#quizMeta {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.session-bar {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.progress-block {
  min-width: min(100%, 440px);
  flex: 1;
}

.progress-label {
  margin: 0 0 6px;
  font-size: 0.88rem;
  color: #4a5d71;
}

.progress-track {
  width: 100%;
  height: 10px;
  border-radius: 999px;
  background: #dce8ef;
  overflow: hidden;
}

.progress-fill {
  width: 0%;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #006d77 0%, #3aa8b1 100%);
  transition: width 200ms ease;
}

.session-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  border: 1px solid #ced9e6;
  border-radius: 999px;
  padding: 6px 10px;
  font-size: 0.84rem;
  background: #fff;
  color: #304355;
}

.badge-timer {
  font-weight: 700;
}

.badge-success {
  border-color: #27ae60;
  background: #eafaf1;
  color: #1e8449;
}

.badge-warning {
  border-color: #f39c12;
  background: #fef9e7;
  color: #b7950b;
}

.badge-danger {
  border-color: #e74c3c;
  background: #fdedec;
  color: #c0392b;
}

.badge.has-alert {
  border-color: rgba(160, 29, 47, 0.45);
  background: rgba(160, 29, 47, 0.1);
  color: #8e1a2a;
}

.exam-shell {
  margin-top: 14px;
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(240px, 0.9fr);
  gap: 14px;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 16px;
  background: #fff;
}

.question-card.single {
  min-height: 360px;
}

.question-card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  line-height: 1.4;
}

.question-state-line {
  margin: -2px 0 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.session-paused-note {
  margin: 0 0 10px;
  border: 1px solid rgba(0, 109, 119, 0.4);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.88rem;
  color: #00525a;
  background: rgba(0, 109, 119, 0.12);
}

.question-state-badge {
  border: 1px solid #cedae8;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.8rem;
  font-weight: 600;
  background: #fff;
  color: #355066;
}

.question-state-badge.is-good {
  border-color: rgba(11, 122, 79, 0.45);
  background: rgba(11, 122, 79, 0.1);
  color: #0f6f4a;
}

.question-state-badge.is-bad {
  border-color: rgba(160, 29, 47, 0.45);
  background: rgba(160, 29, 47, 0.1);
  color: #8e1a2a;
}

.question-state-badge.is-ready {
  border-color: rgba(0, 109, 119, 0.5);
  background: rgba(0, 109, 119, 0.12);
  color: #00545c;
}

.question-state-badge.is-warn {
  border-color: rgba(200, 95, 0, 0.55);
  background: rgba(255, 152, 0, 0.14);
  color: #8a4400;
  font-weight: 700;
  animation: badge-pulse 1.5s ease-in-out infinite;
}

@keyframes badge-pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.65; }
}

.question-state-badge.is-revisit {
  border-color: rgba(240, 152, 73, 0.5);
  background: rgba(240, 152, 73, 0.16);
  color: #825800;
}

.question-state-badge.is-plain {
  border-color: #cedae8;
  background: #fff;
}

.option-list {
  display: grid;
  gap: 8px;
}

.option-item {
  border: 2px solid #dbe3ef;
  border-radius: 12px;
  padding: 14px 16px;
  display: flex;
  gap: 14px;
  align-items: center;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease, transform 150ms ease;
  background: #fff;
}

.option-item:hover {
  border-color: #96b3c3;
  box-shadow: 0 4px 12px rgba(0, 109, 119, 0.10);
  transform: translateY(-1px);
}

.option-item input[type="radio"] {
  display: none;
}

.option-letter-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #f0f4f8;
  color: #3e5060;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1rem;
  flex-shrink: 0;
  transition: background-color 150ms ease, color 150ms ease;
}

.option-text {
  flex: 1;
  font-size: 0.95rem;
  line-height: 1.45;
}

.option-item.is-selected {
  border-color: #3f8ea1;
  background: rgba(63, 142, 161, 0.06);
}

.option-item.is-selected .option-letter-badge {
  background: var(--primary);
  color: #fff;
}

.option-item.is-good {
  border-color: rgba(11, 122, 79, 0.6);
  background: rgba(11, 122, 79, 0.06);
}

.option-item.is-good .option-letter-badge {
  background: #0b7a4f;
  color: #fff;
}

.option-item.is-bad {
  border-color: rgba(160, 29, 47, 0.6);
  background: rgba(160, 29, 47, 0.06);
}

.option-item.is-bad .option-letter-badge {
  background: #a01d2f;
  color: #fff;
}

.explain {
  margin-top: 10px;
  font-size: 0.92rem;
  line-height: 1.45;
  color: #2d3d4f;
  border-left: 3px solid #9fb5c7;
  padding-left: 10px;
}

.question-source {
  margin-top: 8px;
  font-size: 0.82rem;
  color: #5f6f82;
}

.question-tools {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px;
  background: #fff;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tools-title {
  margin: 0;
  font-size: 0.92rem;
  color: #3e4f5f;
}

.keyboard-hint {
  margin: 2px 0 0;
  font-size: 0.78rem;
  line-height: 1.4;
  color: #52677b;
}

.keyboard-hint kbd {
  border: 1px solid #cfdae6;
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0 6px;
  background: #fff;
  color: #2f465b;
  font-family: "IBM Plex Sans", sans-serif;
  font-size: 0.75rem;
}

.confidence-required-label {
  font-size: 0.75rem;
  color: #dc2626;
  font-weight: 600;
  margin-left: 6px;
}

.confidence-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.confidence-grid.confidence-required {
  animation: confidencePulse 1.5s ease-in-out infinite;
  border: 2px solid #dc2626;
  border-radius: 12px;
  padding: 8px;
}

@keyframes confidencePulse {
  0%, 100% { border-color: #dc2626; }
  50% { border-color: #fca5a5; }
}

.chip {
  border: 1px solid #d4dfeb;
  background: #fff;
  color: #314253;
  text-align: center;
}

.chip.is-active {
  border-color: #006d77;
  background: rgba(0, 109, 119, 0.12);
  color: #004f56;
}

/* Confidence button — colored active states */
.confidence-low.is-active {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.10);
  color: #991b1b;
}
.confidence-medium.is-active {
  border-color: #d97706;
  background: rgba(217, 119, 6, 0.10);
  color: #92400e;
}
.confidence-high.is-active {
  border-color: #059669;
  background: rgba(5, 150, 105, 0.10);
  color: #065f46;
}

.revisit-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.9rem;
  color: #3a4c5f;
}

.nav-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.question-palette {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.palette-legend {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.legend-chip {
  border: 1px solid #cdd9e6;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 0.78rem;
  background: #fff;
  color: #31465a;
}

.legend-chip.is-correct {
  border-color: rgba(11, 122, 79, 0.45);
  color: #0d6d48;
}

.legend-chip.is-incorrect {
  border-color: rgba(160, 29, 47, 0.45);
  color: #8e1a2a;
}

.legend-chip.is-unanswered {
  border-color: rgba(163, 109, 0, 0.45);
  color: #825800;
}

.legend-chip.is-revisit {
  border-color: rgba(0, 109, 119, 0.45);
  color: #00535a;
}

.legend-chip.is-current {
  border-color: #006d77;
  color: #004f56;
}

.palette-btn {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  border: 1px solid #cad8e4;
  background: #fff;
  color: #2f4358;
  font-weight: 700;
  cursor: pointer;
}

.palette-btn.is-answered {
  border-color: #3f8ea1;
  background: rgba(63, 142, 161, 0.14);
}

.palette-btn.is-revisit {
  border-color: #f09849;
  background: rgba(240, 152, 73, 0.16);
}

.palette-btn.is-current {
  border-color: #006d77;
  box-shadow: inset 0 0 0 1px #006d77;
}

.palette-btn.is-correct {
  border-color: rgba(11, 122, 79, 0.6);
  background: rgba(11, 122, 79, 0.18);
}

.palette-btn.is-incorrect {
  border-color: rgba(160, 29, 47, 0.6);
  background: rgba(160, 29, 47, 0.16);
}

.explain.is-good {
  border-left-color: rgba(11, 122, 79, 0.65);
  background: rgba(11, 122, 79, 0.09);
  padding: 10px 12px;
  border-radius: 10px;
}

.explain.is-bad {
  border-left-color: rgba(160, 29, 47, 0.7);
  background: rgba(160, 29, 47, 0.09);
  padding: 10px 12px;
  border-radius: 10px;
}

.explain p {
  margin: 0;
}

.feedback-explanation {
  margin-top: 8px !important;
  color: #2b4055;
  line-height: 1.45;
}

.score-line {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
}

.score-line strong {
  color: #0b6670;
}

.score-message {
  margin: 6px 0 0;
  color: #3f4f60;
}

.review-sticky {
  position: sticky;
  top: 8px;
  z-index: 3;
  margin: -4px -4px 10px;
  padding: 4px 4px 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 75%, rgba(255, 255, 255, 0));
}

.result-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.domain-performance {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.domain-item {
  border: 1px solid #d5dfeb;
  border-radius: 10px;
  padding: 9px 10px;
  background: #fff;
  display: grid;
  gap: 6px;
}

.domain-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  font-size: 0.84rem;
  color: #42566b;
}

.domain-title {
  font-family: "Space Grotesk", sans-serif;
  color: #21384d;
  font-weight: 700;
}

.domain-track {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: #deebf1;
  overflow: hidden;
}

.domain-fill {
  height: 100%;
  width: 0%;
  border-radius: 999px;
  background: linear-gradient(90deg, #006d77 0%, #3aa8b1 100%);
  transition: width 180ms ease;
}

.result-filters {
  margin-top: 12px;
  display: flex;
  gap: 8px;
  flex-wrap: nowrap;
  overflow-x: auto;
  padding-bottom: 2px;
}

.result-search-wrap {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 8px;
}

.result-search-field {
  margin: 0;
  min-width: min(100%, 420px);
  flex: 1;
}

.result-search-field span {
  font-size: 0.82rem;
}

.chip-filter {
  border: 1px solid #c9d8e6;
  background: #fff;
  color: #2f455b;
  white-space: nowrap;
}

.chip-filter.is-active {
  border-color: #006d77;
  background: rgba(0, 109, 119, 0.12);
  color: #004f56;
}

.result-actions {
  margin-top: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.flashcards-panel {
  display: grid;
  gap: 12px;
}

.flashcards-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Progress bar ── */
.flashcard-progress-bar {
  width: 100%;
  height: 5px;
  background: var(--line, #e2e8f0);
  border-radius: 999px;
  overflow: hidden;
  margin-bottom: 6px;
}
.flashcard-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #2d7d8d, #38bdf8);
  border-radius: 999px;
  transition: width 0.4s ease;
}

/* ── 3D Flip card ── */
.flashcard-card {
  perspective: 1000px;
  height: 340px;        /* hauteur fixe : front/back (position:absolute) doivent hériter d'un height défini */
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.flashcard-inner {
  position: relative;
  width: 100%;
  height: 100%;         /* remplit le parent au lieu de min-height flottant */
  transform-style: preserve-3d;
  transition: transform 0.55s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.flashcard-card.is-back .flashcard-inner {
  transform: rotateY(180deg);
}

.flashcard-front,
.flashcard-back {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
}

.flashcard-front {
  background: linear-gradient(180deg, #ffffff 0%, #f6f9fd 100%);
  align-items: center;
  justify-content: center;
  padding: 28px 32px 44px;
}

.flashcard-back {
  background: linear-gradient(180deg, #f4fffb 0%, #eef7ff 100%);
  box-shadow: inset 0 0 0 1px rgba(0, 109, 119, 0.2);
  transform: rotateY(180deg);
  align-items: center;
  justify-content: center;
  padding: 28px 32px 44px;
  overflow-y: auto;     /* scroll si contenu dépasse — utile sur mobile */
}

/* Texte du recto : grand, centré */
.flashcard-content {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  line-height: 1.45;
  text-align: center;
  max-width: 46ch;
  word-break: break-word;
  color: #1a2e3b;
}

/* ── Verso structuré ── */
/* Métadonnée domaine/principe */
.fc-back-meta {
  font-size: 0.72rem;
  font-weight: 600;
  color: #4a7a85;
  background: rgba(0, 109, 119, 0.08);
  border-radius: 6px;
  padding: 3px 10px;
  margin-bottom: 12px;
  display: inline-block;
  letter-spacing: 0.02em;
}

/* Réponse principale : bloc vert */
.fc-back-answer {
  font-size: 1.05rem;
  font-weight: 500;
  color: #0c3d44;
  line-height: 1.65;
  background: rgba(16, 185, 129, 0.09);
  border-left: 3px solid #10b981;
  padding: 12px 18px;
  border-radius: 0 8px 8px 0;
  margin-bottom: 10px;
  max-width: 56ch;
  text-align: center;
  width: 100%;
}

/* Bloc "Pourquoi pas" */
.fc-back-why-not {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
}

/* Un item "Pourquoi pas" */
.fc-back-why-item {
  font-size: 0.8rem;
  color: #5a6a7a;
  line-height: 1.5;
  padding: 6px 10px 6px 10px;
  background: rgba(239, 68, 68, 0.04);
  border-left: 2px solid #fca5a5;
  border-radius: 0 6px 6px 0;
}

/* Label "Pourquoi pas X :" en rouge */
.fc-why-label {
  font-weight: 700;
  color: #dc2626;
  font-size: 0.75rem;
  margin-right: 4px;
}

/* Texte brut (fallback si pas de structure détectée) */
.fc-back-plain {
  font-size: 0.9rem;
  line-height: 1.6;
  color: #1a2e3b;
  margin: 0;
  word-break: break-word;
  text-align: left;
}

.fc-back-itto-line {
  font-size: 1.05rem;
  color: #1a3a4a;
  line-height: 1.65;
  padding: 6px 0;
  text-align: center;
  max-width: 52ch;
}
.fc-back-itto-line strong {
  color: #006d77;
}
.fc-back-formula {
  font-size: 1.4rem;
  text-align: center;
  padding: 14px 0;
  color: #006d77;
  letter-spacing: 0.03em;
}
.fc-back-formula-line {
  font-size: 0.95rem;
  color: #3a5a6a;
  line-height: 1.6;
  padding: 4px 0;
  text-align: center;
  max-width: 52ch;
}
.fc-back-formula-line strong {
  color: #006d77;
}
.flashcard-side-label {
  position: absolute;
  bottom: 10px;
  right: 14px;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #aab8c9;
  pointer-events: none;
}

/* ── Rating buttons ── */
.flashcard-rating {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.flashcard-rating-hint {
  font-size: 0.78rem;
  color: #6b7f8e;
  text-align: center;
  margin: 0 0 2px;
  line-height: 1.45;
  max-width: 480px;
}

.flashcard-rating-buttons {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.flashcard-rate-no {
  border-color: #fca5a5 !important;
  color: #dc2626 !important;
}
.flashcard-rate-no:hover:not(:disabled) {
  background: #fef2f2 !important;
}

.flashcard-rate-maybe {
  border-color: #fcd34d !important;
  color: #d97706 !important;
}
.flashcard-rate-maybe:hover:not(:disabled) {
  background: #fffbeb !important;
}

.flashcard-rate-yes {
  border-color: #86efac !important;
  color: #16a34a !important;
}
.flashcard-rate-yes:hover:not(:disabled) {
  background: #f0fdf4 !important;
}

.result-list {
  margin-top: 14px;
  display: grid;
  gap: 12px;
  max-width: 1020px;
}

.result-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px;
  background: #fff;
  display: grid;
  gap: 10px;
  transition: border-color 120ms ease;
}

.result-card.status-correct {
  border-color: rgba(11, 122, 79, 0.35);
  background: linear-gradient(180deg, rgba(11, 122, 79, 0.08), #fff 46%);
}

.result-card.status-incorrect {
  border-color: rgba(160, 29, 47, 0.4);
  background: linear-gradient(180deg, rgba(160, 29, 47, 0.08), #fff 46%);
}

.result-card.status-unanswered {
  border-color: rgba(163, 109, 0, 0.4);
  background: linear-gradient(180deg, rgba(244, 162, 97, 0.14), #fff 46%);
}

.result-card.is-revisit {
  box-shadow: inset 0 0 0 1px rgba(0, 109, 119, 0.3);
}

.result-card-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: flex-start;
}

.result-card-title {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.result-card-badges {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.review-badge {
  border: 1px solid #cfdae8;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 0.76rem;
  font-weight: 600;
  background: #fff;
}

.badge-correct {
  border-color: rgba(11, 122, 79, 0.45);
  color: #0d6d48;
}

.badge-incorrect {
  border-color: rgba(160, 29, 47, 0.45);
  color: #8e1a2a;
}

.badge-unanswered {
  border-color: rgba(163, 109, 0, 0.45);
  color: #825800;
}

.badge-revisit {
  border-color: rgba(0, 109, 119, 0.45);
  color: #00535a;
}

.result-stem {
  margin: 0;
  color: #22384f;
  line-height: 1.45;
  font-weight: 600;
  max-width: 96ch;
}

.result-answer-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.answer-box {
  border: 1px solid #d8e3ef;
  border-radius: 10px;
  padding: 10px;
  background: #fff;
}

.answer-box.is-good {
  border-color: rgba(11, 122, 79, 0.45);
  background: rgba(11, 122, 79, 0.08);
}

.answer-box.is-bad {
  border-color: rgba(160, 29, 47, 0.45);
  background: rgba(160, 29, 47, 0.08);
}

.answer-box.is-plain {
  border-color: rgba(163, 109, 0, 0.45);
  background: rgba(244, 162, 97, 0.16);
}

.answer-label {
  margin: 0;
  font-size: 0.8rem;
  color: #55697c;
}

.answer-value {
  margin: 4px 0 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1rem;
}

.answer-subvalue {
  margin: 6px 0 0;
  font-size: 0.84rem;
  color: #42596f;
  line-height: 1.35;
}

.result-explanation {
  margin: 0;
  line-height: 1.42;
  color: #2b4055;
  max-width: 96ch;
}

.result-meta-line {
  margin: 0;
  font-size: 0.84rem;
  color: #4f6378;
}

.result-card-actions {
  display: flex;
  justify-content: flex-end;
}

.result-empty {
  border: 1px dashed #c7d5e2;
  border-radius: 12px;
  padding: 12px;
  color: #4a5d71;
  background: rgba(255, 255, 255, 0.75);
  font-size: 0.92rem;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

@media (max-width: 1120px) {
  .app-shell {
    grid-template-columns: 220px minmax(0, 1fr);
  }
}

/* Tablette compacte — sidebar visible mais réduite */
@media (max-width: 940px) {
  .app-shell {
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 12px;
    padding: 14px;
  }

  .sidebar {
    padding: 14px 10px;
    gap: 10px;
  }

  .side-nav {
    gap: 4px;
  }

  .side-link {
    font-size: 0.82rem;
    padding: 8px 8px;
  }

  .workspace {
    padding: 0 0 20px;
  }
}

/* Mobile — sidebar passe en grille compacte en haut */
@media (max-width: 700px) {
  .app-shell {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 10px;
  }

  .sidebar {
    position: static;
    align-self: auto;
    gap: 8px;
  }

  .side-nav {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .side-nav-divider {
    display: none;
  }

  .workspace {
    padding: 0 0 20px;
  }
}

@media (max-width: 700px) {
  .app-shell {
    padding: 10px;
  }

  .topbar {
    flex-direction: column;
  }

  .topbar-right {
    align-items: flex-start;
    width: 100%;
  }

  .topbar-badges {
    justify-content: flex-start;
  }

  /* Responsive gamification + avatar sur mobile */
  .topbar-gamif-info {
    display: none;
  }
  .topbar-greeting {
    display: none;
  }

  .dashboard-quick-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-split {
    grid-template-columns: 1fr;
  }

  .auth-grid,
  .form-grid,
  .dashboard-stats,
  .exam-shell,
  .learning-hero {
    grid-template-columns: 1fr;
  }

  /* quick-answer-grid removed */

  .exam-meta-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .exam-meta-group {
    width: 100%;
  }

  #pauseSessionBtn {
    width: 100%;
  }

  .result-actions .btn {
    width: 100%;
  }

  .result-search-wrap {
    align-items: stretch;
  }

  .result-search-wrap .btn {
    width: 100%;
  }

  .flashcards-head .actions .btn {
    width: 100%;
  }

  .review-sticky {
    position: static;
    margin: 0;
    padding: 0;
    background: transparent;
  }

  .result-answer-grid {
    grid-template-columns: 1fr;
  }

  .side-nav {
    grid-template-columns: 1fr;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
  }

  .utility-panel,
  #milestonesPanel {
    right: 8px;
    left: 8px;
    width: auto;
    top: 136px;
  }

  .keypoints-grid { grid-template-columns: 1fr; }
  .glossary-list { columns: 1; }
}

/* ===== CONTENT SOURCE TOGGLE ===== */
.content-source-toggle {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

/* ===== KEY POINTS / FICHES DE REVISION ===== */
/* ── Keypoint accordion groups ── */
.keypoint-group {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 12px;
}

.keypoint-group-header {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: transparent;
  border: none;
  border-bottom: 1px solid transparent;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ink);
  cursor: pointer;
  text-align: left;
  transition: background 0.15s;
}
.keypoint-group-header:hover { background: rgba(0, 109, 119, 0.04); }
.keypoint-group.is-open .keypoint-group-header { border-bottom-color: var(--line); }

.keypoint-group-chevron {
  display: inline-block;
  font-size: 0.8rem;
  transition: transform 0.25s ease;
  color: var(--muted);
}
.keypoint-group.is-open .keypoint-group-chevron { transform: rotate(0deg); }
.keypoint-group:not(.is-open) .keypoint-group-chevron { transform: rotate(-90deg); }

.keypoint-group-title { flex: 1; }

.keypoint-group-count {
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--muted);
  background: #f1f5f9;
  padding: 2px 10px;
  border-radius: 999px;
}

.keypoint-mark-all {
  display: block;
  margin: 0 18px 6px auto;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.15s;
}
.keypoint-mark-all:hover { border-color: var(--primary); color: var(--primary); }
.keypoint-mark-all.is-all-done {
  background: var(--good);
  color: #fff;
  border-color: var(--good);
}
.keypoint-group:not(.is-open) .keypoint-mark-all { display: none; }

.keypoint-group-body {
  padding: 12px 18px 18px;
  transition: max-height 0.35s ease, opacity 0.25s ease;
  overflow: hidden;
}
.keypoint-group:not(.is-open) .keypoint-group-body {
  max-height: 0;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}
.keypoint-group.is-open .keypoint-group-body {
  max-height: 4000px;
  opacity: 1;
}

/* ── Keypoint card grid (inside each group) ── */
.keypoints-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1rem;
}

.keypoint-card {
  background: #fafcff;
  border-radius: 12px;
  padding: 1.25rem;
  border-left: 5px solid var(--primary);
  box-shadow: 0 2px 8px rgba(15, 30, 48, 0.06);
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.keypoint-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(15, 30, 48, 0.1);
}

.keypoint-card.type-exam_tip { border-left-color: #3b82f6; }
.keypoint-card.type-remember { border-left-color: #f97316; }
.keypoint-card.type-keep_in_mind { border-left-color: #22c55e; }

.keypoint-card .keypoint-type {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: 2px 8px;
  border-radius: 4px;
  margin-bottom: 0.5rem;
}
.keypoint-card.type-exam_tip .keypoint-type { background: #dbeafe; color: #1d4ed8; }
.keypoint-card.type-remember .keypoint-type { background: #ffedd5; color: #c2410c; }
.keypoint-card.type-keep_in_mind .keypoint-type { background: #dcfce7; color: #15803d; }

.keypoint-card .keypoint-text {
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0.5rem 0;
}

.keypoint-card .keypoint-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.75rem;
  font-size: 0.75rem;
  color: var(--muted);
}

.keypoint-card .keypoint-reviewed {
  cursor: pointer;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  transition: all 0.15s ease;
}
.keypoint-card .keypoint-reviewed.is-reviewed {
  background: var(--good);
  color: white;
  border-color: var(--good);
}

/* ===== GLOSSARY SOURCE BANNER ===== */
.glossary-source-banner {
  font-size: 0.78rem;
  color: var(--muted);
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--color-border, #e2e8f0);
  border-radius: 8px;
  padding: 0.5rem 0.85rem;
  margin-bottom: 1.25rem;
  line-height: 1.5;
  font-style: italic;
}

/* ===== SCENARIOS ===== */
.scenarios-list {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.scenario-card {
  background: var(--card);
  border-radius: 12px;
  padding: 1.5rem;
  box-shadow: var(--shadow);
  border-left: 5px solid var(--primary);
  transition: border-left-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}
.scenario-card:hover {
  box-shadow: 0 6px 20px rgba(15, 30, 48, 0.1);
  transform: translateY(-2px);
}

.scenario-card .scenario-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 0.5rem;
}

.scenario-card .scenario-title-wrap { flex: 1; min-width: 0; }

.scenario-card .scenario-title {
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
}

.scenario-card .scenario-badges {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.scenario-card .badge-domain {
  font-size: 0.7rem;
  border-radius: 1rem;
  padding: 0.15rem 0.6rem;
}

/* ---- Context truncation ---- */
.scenario-context-wrap {
  position: relative;
  margin: 0.5rem 0 1rem;
}
.scenario-card .scenario-context {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--ink);
  white-space: pre-line;
  transition: max-height 0.35s ease;
}
.scenario-card .scenario-context.is-truncated {
  max-height: 4.8em; /* ~3 lines */
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 60%, transparent 100%);
}
.scenario-expand-btn {
  background: none;
  border: none;
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0.25rem 0;
  display: block;
}
.scenario-expand-btn:hover { text-decoration: underline; }

.scenario-card .scenario-reveal-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 0.5rem 1.25rem;
  border-radius: 8px;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.15s ease;
}
.scenario-card .scenario-reveal-btn:hover { background: var(--primary-strong); }

.scenario-card .scenario-answer {
  margin-top: 1rem;
  padding: 1rem;
  background: #f0f9f4;
  border-radius: 8px;
  border: 1px solid #bbf7d0;
  font-size: 0.9rem;
  line-height: 1.6;
  white-space: pre-line;
  animation: scenarioSlideDown 0.3s ease;
}
@keyframes scenarioSlideDown {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: translateY(0); }
}

.scenario-card .scenario-rating {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  align-items: center;
}
.scenario-rating-label {
  font-size: 0.8rem;
  color: var(--muted);
}

.scenario-card .scenario-star {
  cursor: pointer;
  font-size: 1.5rem;
  background: none;
  border: none;
  color: var(--line);
  transition: color 0.15s ease;
}
.scenario-card .scenario-star.is-active { color: #f59e0b; }

/* ---- Pagination ---- */
.scenario-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem 0 0.5rem;
}
.scenario-page-info {
  font-size: 0.85rem;
  color: var(--muted);
  font-weight: 500;
  min-width: 80px;
  text-align: center;
}

/* ===== GLOSSARY ===== */
.glossary-list {
  columns: 2;
  column-gap: 1.5rem;
}

.glossary-group {
  break-inside: avoid;
  margin-bottom: 1.5rem;
}

.glossary-group-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--primary);
  margin: 0 0 0.75rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--primary);
}

.glossary-item {
  background: var(--card);
  border-radius: 10px;
  padding: 1rem;
  margin-bottom: 0.75rem;
  box-shadow: 0 4px 12px rgba(15, 30, 48, 0.06);
  break-inside: avoid;
}

.glossary-item .glossary-term {
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  margin: 0 0 0.25rem;
}

.glossary-item .glossary-definition {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.glossary-item .glossary-badges {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

/* ===== GLOSSARY A-Z BAR ===== */
.glossary-az-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 10px 0 14px;
  position: sticky;
  top: 0;
  background: var(--bg, #f5f7fa);
  z-index: 10;
  border-bottom: 1px solid var(--line);
  margin-bottom: 1.25rem;
}

.glossary-az-btn {
  width: 30px;
  height: 30px;
  border: 1.5px solid #dbe3ef;
  border-radius: 6px;
  background: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  font-family: "Space Grotesk", sans-serif;
  color: #a0b0c0;
  cursor: default;
  padding: 0;
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease, transform 0.1s ease;
}

.glossary-az-btn.is-available {
  border-color: var(--primary);
  color: var(--primary);
  cursor: pointer;
}

.glossary-az-btn.is-available:hover {
  background: var(--primary);
  color: #fff;
  transform: scale(1.12);
}

.glossary-az-btn.is-current-letter {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.glossary-az-btn:disabled {
  opacity: 0.3;
}

/* Highlighted search text */
mark.glossary-highlight {
  background: rgba(255, 210, 80, 0.45);
  color: inherit;
  border-radius: 3px;
  padding: 0 2px;
}

/* ===== GLOSSARY PAGINATION ===== */
.glossary-pagination {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  justify-content: center;
  padding: 1.5rem 0 0.5rem;
  border-top: 1px solid var(--color-border);
  margin-top: 1.5rem;
  flex-wrap: wrap;
}
.glossary-page-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-text-secondary);
  min-width: 90px;
  text-align: center;
}
.glossary-pagination-info {
  font-size: 0.78rem;
  color: var(--color-text-tertiary);
  width: 100%;
  text-align: center;
  margin-top: 0.25rem;
}

/* ===== CONTENT HUB MODULE LIST ===== */
.module-list-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
}
.module-list-item:hover { background: rgba(0, 109, 119, 0.06); }
.module-list-item.is-active { background: rgba(0, 109, 119, 0.1); font-weight: 600; }

.module-list-num {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
  font-weight: 700;
  flex-shrink: 0;
}

.module-list-info { flex: 1; min-width: 0; }
.module-list-info h4 { margin: 0; font-size: 0.85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.module-list-info p { margin: 0; font-size: 0.7rem; color: var(--muted); }

/* ===== REGISTRY CONTENT CARDS ===== */
.registry-content-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem;
  border-radius: 10px;
  cursor: pointer;
  border: 1px solid var(--line);
  transition: all 0.15s ease;
  background: var(--card);
}
.registry-content-card:hover { border-color: var(--primary); box-shadow: 0 2px 8px rgba(0,109,119,0.08); }
.registry-content-card .card-icon { font-size: 1.5rem; flex-shrink: 0; }
.registry-content-card .card-body { flex: 1; min-width: 0; }
.registry-content-card .card-body h4 { margin: 0; font-size: 0.85rem; }
.registry-content-card .card-body p { margin: 0.15rem 0 0; font-size: 0.72rem; color: var(--muted); }
.registry-content-card .card-badge {
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 1rem;
  background: var(--bg);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* Champ recherche bibliothèque */
.field-search { grid-column: 1 / -1; }
.field-search input[type="search"] {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid #d4dfeb;
  border-radius: 8px;
  font: inherit;
  font-size: 0.9rem;
  background: #fff;
  transition: border-color 150ms ease;
}
.field-search input[type="search"]:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0,109,119,0.1);
}

.reader-callout {
  padding: 1rem 1.25rem;
  border-radius: 10px;
  margin: 1rem 0;
  font-size: 0.9rem;
  line-height: 1.6;
}
.reader-callout.callout-exam-tip {
  background: #eff6ff;
  border-left: 4px solid #3b82f6;
}
.reader-callout.callout-remember {
  background: #fff7ed;
  border-left: 4px solid #f97316;
}
.reader-callout.callout-keep-in-mind {
  background: #f0fdf4;
  border-left: 4px solid #22c55e;
}
.reader-callout .callout-label {
  font-weight: 700;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 0.25rem;
}
.reader-callout.callout-exam-tip .callout-label { color: #2563eb; }
.reader-callout.callout-remember .callout-label { color: #ea580c; }
.reader-callout.callout-keep-in-mind .callout-label { color: #16a34a; }

.reader-figure {
  margin: 1.5rem 0;
  text-align: center;
}
.reader-figure img {
  max-width: 100%;
  border-radius: 8px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}
.reader-figure figcaption {
  font-size: 0.8rem;
  color: var(--muted);
  margin-top: 0.5rem;
  font-style: italic;
}

.reader-comparison {
  background: var(--card);
  border-radius: 10px;
  padding: 1rem;
  margin: 1rem 0;
  border: 1px solid var(--line);
}
.reader-comparison h4 {
  margin: 0 0 0.5rem;
  font-size: 0.9rem;
  color: var(--primary);
}

/* ---------- Learning Plan - Chapter badges ---------- */
.part-chapters-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin: 0.75rem 0;
}
.chapter-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 1rem;
  background: var(--bg);
  border: 1px solid var(--line);
  color: var(--muted);
  transition: all 0.2s ease;
}
.chapter-badge:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.chapter-badge.is-read {
  background: #059669;
  color: #fff;
  border-color: #059669;
}
.chapter-badge.is-read:hover {
  background: #047857;
  border-color: #047857;
}
.module-actions-area {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

/* ===== PROFILE CARD ===== */
.profile-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  padding: 1.5rem;
  background: linear-gradient(135deg, #f0fdf4 0%, #eff6ff 100%);
  border-radius: 12px;
  margin-bottom: 1.5rem;
  border: 1px solid var(--line);
}
.profile-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  font-weight: 700;
  flex-shrink: 0;
  font-family: "Space Grotesk", sans-serif;
}
.profile-info h3 {
  margin: 0;
  font-size: 1.15rem;
  font-family: "Space Grotesk", sans-serif;
}
.profile-info .auth-user-email {
  font-size: 0.85rem;
  color: var(--muted);
  margin: 0.15rem 0 0.4rem;
}
.badge-admin {
  background: #7c3aed !important;
  color: #fff !important;
}
.badge-warning {
  background: #f59e0b !important;
  color: #fff !important;
}
.badge-expired {
  background: #ef4444 !important;
  color: #fff !important;
}
/* ── RGPD section (Art. 17 + Art. 20) ─────────────────── */
.rgpd-section {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}
.rgpd-section-title {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 0 0 0.4rem;
  font-family: "Space Grotesk", sans-serif;
  color: var(--text);
}
.rgpd-section-desc {
  font-size: 0.84rem;
  color: var(--muted);
  margin: 0 0 1rem;
  line-height: 1.55;
}
.rgpd-section .actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
/* ────────────────────────────────────────────────────── */

.auth-pending-msg {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  background: #fef3c7;
  border: 1px solid #fcd34d;
  border-radius: 8px;
  color: #92400e;
  font-size: 0.85rem;
  font-weight: 500;
}

/* ===== ADMIN PANEL ===== */
.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}
.admin-stat-card {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 1rem 1.25rem;
  background: var(--card);
  border-radius: 12px;
  border: 1px solid var(--line);
  box-shadow: 0 2px 8px rgba(15, 30, 48, 0.04);
}
.admin-stat-icon {
  font-size: 1.5rem;
}
.admin-stat-value {
  font-size: 1.4rem;
  font-weight: 700;
  font-family: "Space Grotesk", sans-serif;
  color: var(--primary);
  margin: 0;
  line-height: 1.2;
}
.admin-stat-label {
  font-size: 0.75rem;
  color: var(--muted);
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.admin-user-list {
  display: grid;
  gap: 0.5rem;
}
.admin-user-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  background: var(--card);
  border-radius: 10px;
  border: 1px solid var(--line);
  transition: all 0.15s ease;
}
.admin-user-row:hover {
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(0, 109, 119, 0.08);
}
.admin-user-pending {
  border-left: 3px solid #f59e0b;
  background: #fffbeb;
}
.admin-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  font-weight: 700;
  flex-shrink: 0;
}
.admin-user-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
}
.admin-user-info strong {
  font-size: 0.9rem;
}
.admin-user-email {
  font-size: 0.8rem;
  color: var(--muted);
}
.admin-user-meta {
  font-size: 0.75rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.admin-user-actions {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
}
.empty-state {
  text-align: center;
  color: var(--muted);
  font-size: 0.9rem;
  padding: 2rem;
}

/* ===== MODAL ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  backdrop-filter: blur(4px);
}
.modal-content {
  background: var(--card);
  border-radius: 16px;
  padding: 2rem;
  width: 100%;
  max-width: 520px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
  max-height: 90vh;
  overflow-y: auto;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.modal-header h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.15rem;
}
.modal-header .btn {
  font-size: 1.3rem;
  padding: 0.25rem 0.5rem;
  line-height: 1;
}

/* ===== CSV TEMPLATE PREVIEW ===== */
.csv-template-preview {
  background: #1f2937;
  color: #a5f3fc;
  padding: 1rem 1.25rem;
  border-radius: 10px;
  font-family: "IBM Plex Mono", "Fira Code", monospace;
  font-size: 0.78rem;
  line-height: 1.8;
  overflow-x: auto;
}
.csv-template-preview code {
  background: transparent;
  color: inherit;
  padding: 0;
}

/* ===== PHASE 4: GLOBAL POLISH ===== */
/* Unified border-radius for all .panel cards */
.panel {
  border-radius: 12px;
}
/* Unified shadow for cards */
.quick-card,
.side-metric-card,
.admin-stat-card,
.glossary-item {
  box-shadow: 0 2px 8px rgba(15, 30, 48, 0.05);
}
/* Improve section-head spacing */
.section-head h2 {
  font-family: "Space Grotesk", sans-serif;
}
/* Better empty state styling */
.empty-state {
  background: var(--bg);
  border-radius: 12px;
}

/* ===== RESPONSIVE OVERRIDES FOR NEW VIEWS ===== */
/* Must come AFTER the new view base styles to win the cascade */
@media (max-width: 820px) {
  .glossary-list { columns: 1; }
  .keypoints-grid { grid-template-columns: 1fr; }
  .part-chapters-list { grid-template-columns: repeat(3, 1fr); }
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-user-row { flex-direction: column; align-items: flex-start; gap: 0.5rem; }
  .admin-user-actions { width: 100%; justify-content: flex-end; }
  .profile-card { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
  .admin-stats-grid { grid-template-columns: 1fr; }
  .modal-content { padding: 1.25rem; border-radius: 12px; }
}

/* ════════════════════════════════════════════════════════
   PROGRESS ENGINE — Composants UI
   (Dashboard progression, badges, toasts, certificat)
════════════════════════════════════════════════════════ */

/* ─── Sidebar badge XP ─── */
.side-link-badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  background: var(--accent, #6366f1);
  color: #fff;
  border-radius: 999px;
  padding: 1px 7px;
  margin-left: auto;
  flex-shrink: 0;
}

/* ─── Progress Hero ─── */
.progress-hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
  padding: 1.75rem 2rem;
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #fff;
  border-radius: 16px;
}
.progress-hero-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex: 1;
  min-width: 260px;
}
.progress-level-badge {
  font-size: 3rem;
  width: 72px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255,255,255,.12);
  border-radius: 50%;
  flex-shrink: 0;
}
.progress-xp-label { font-size: .85rem; opacity: .75; margin: .15rem 0 .5rem; }
.progress-xp-bar-wrap {
  height: 8px;
  background: rgba(255,255,255,.18);
  border-radius: 999px;
  overflow: hidden;
  width: 260px;
  max-width: 100%;
}
.progress-xp-bar {
  height: 100%;
  border-radius: 999px;
  background: #34d399;
  transition: width .6s cubic-bezier(.4,0,.2,1);
}
.progress-xp-next { font-size: .75rem; opacity: .6; margin-top: .35rem; }
.progress-hero-right {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.progress-hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: rgba(255,255,255,.1);
  border-radius: 12px;
  padding: .75rem 1.25rem;
  min-width: 70px;
}
.progress-stat-num { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.progress-stat-lbl { font-size: .7rem; opacity: .65; margin-top: .2rem; text-align: center; }

/* ─── Course Progress ─── */
.progress-course-list { display: flex; flex-direction: column; gap: .75rem; }
.progress-course-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: .85rem 1rem;
  background: var(--bg-subtle, #f8fafc);
  border-radius: 10px;
  border: 1px solid var(--border, #e2e8f0);
}
.progress-course-info { display: flex; align-items: center; gap: .75rem; flex: 1; min-width: 200px; }
.progress-course-icon { font-size: 1.6rem; }
.progress-course-title { font-weight: 600; font-size: .95rem; }
.progress-course-meta { font-size: .78rem; color: var(--muted, #64748b); }
.progress-course-bar-wrap {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex: 1;
  min-width: 140px;
  background: var(--border, #e2e8f0);
  border-radius: 999px;
  height: 8px;
  position: relative;
}
.progress-course-bar {
  height: 8px;
  border-radius: 999px;
  background: #6366f1;
  transition: width .5s ease;
}
.progress-course-pct {
  font-size: .75rem;
  font-weight: 700;
  color: var(--fg, #0f172a);
  white-space: nowrap;
  min-width: 2.5rem;
  text-align: right;
}
.progress-cert-btn { margin-left: auto; }

/* ─── Stats / Domain grids ─── */
.progress-stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
.progress-section-title { margin: 0 0 1rem; font-size: 1rem; font-weight: 600; }
.progress-stats-list { display: flex; flex-direction: column; gap: .4rem; }
.progress-stat-row {
  display: flex;
  align-items: center;
  gap: .5rem;
  font-size: .85rem;
  padding: .35rem 0;
  border-bottom: 1px solid var(--border, #f1f5f9);
}
.progress-stat-row-icon { width: 1.4rem; text-align: center; }
.progress-stat-row-label { flex: 1; color: var(--muted, #64748b); }
.progress-stat-row-val { font-weight: 700; color: var(--fg, #0f172a); }

.progress-domain-breakdown { display: flex; flex-direction: column; gap: .65rem; }
.progress-domain-row { display: flex; align-items: center; gap: .6rem; font-size: .82rem; }
.progress-domain-name { min-width: 160px; color: var(--muted, #64748b); }
.progress-domain-bar-wrap {
  flex: 1;
  height: 8px;
  background: var(--border, #e2e8f0);
  border-radius: 999px;
  overflow: hidden;
}
.progress-domain-bar { height: 100%; border-radius: 999px; transition: width .5s; }
.progress-domain-pct { font-weight: 700; min-width: 2.5rem; text-align: right; }
.progress-domain-count { color: var(--muted, #64748b); min-width: 5rem; text-align: right; }

/* ─── Badge filters ─── */
.progress-badge-filters { display: flex; flex-wrap: wrap; gap: .4rem; }

/* ─── Badges grid ─── */
.progress-badges-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: .75rem;
  margin-top: .75rem;
}
.progress-badge-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  padding: 1rem .5rem .75rem;
  border-radius: 12px;
  border: 2px solid transparent;
  text-align: center;
  position: relative;
  transition: transform .15s, box-shadow .15s;
  cursor: default;
}
.progress-badge-card.earned {
  border-color: #6366f1;
  background: #eef2ff;
  box-shadow: 0 2px 8px rgba(99,102,241,.15);
}
.progress-badge-card.earned:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(99,102,241,.22);
}
.progress-badge-card.locked {
  border-color: var(--border, #e2e8f0);
  background: var(--bg-subtle, #f8fafc);
  opacity: .55;
  filter: grayscale(.8);
}
.progress-badge-icon { font-size: 2rem; line-height: 1; }
.progress-badge-label { font-size: .7rem; font-weight: 600; color: var(--fg, #0f172a); line-height: 1.2; }
.progress-badge-check {
  position: absolute;
  top: 6px;
  right: 8px;
  font-size: .65rem;
  color: #6366f1;
  font-weight: 700;
}

/* ─── Leaderboard ─── */
.progress-leaderboard { display: flex; flex-direction: column; gap: .45rem; }
.progress-lb-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .65rem 1rem;
  border-radius: 10px;
  background: var(--bg-subtle, #f8fafc);
  border: 1px solid var(--border, #e2e8f0);
  font-size: .88rem;
}
.progress-lb-row.is-me {
  background: #eef2ff;
  border-color: #6366f1;
  font-weight: 600;
}
.progress-lb-rank { font-size: 1.1rem; min-width: 2rem; text-align: center; }
.progress-lb-name { flex: 1; }
.progress-lb-xp { color: #6366f1; font-weight: 700; min-width: 70px; text-align: right; }
.progress-lb-streak { color: #f59e0b; min-width: 50px; text-align: right; }

/* ─── XP Log ─── */
.progress-xp-log { display: flex; flex-direction: column; gap: .3rem; }
.progress-log-row {
  display: flex;
  align-items: center;
  gap: .75rem;
  font-size: .82rem;
  padding: .3rem 0;
  border-bottom: 1px solid var(--border, #f1f5f9);
}
.progress-log-label { flex: 1; color: var(--muted, #64748b); }
.progress-log-xp { color: #10b981; font-weight: 700; min-width: 3.5rem; text-align: right; }
.progress-log-time { font-size: .72rem; color: var(--muted, #94a3b8); min-width: 90px; text-align: right; }

/* ─── Badge Toast (notification hors-écran) ─── */
.badge-toast {
  position: fixed;
  top: 1.5rem;
  right: 1.5rem;
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #1e1b4b;
  color: #fff;
  padding: .9rem 1.4rem;
  border-radius: 14px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  font-size: .9rem;
  min-width: 240px;
  transform: translateX(110%);
  transition: transform .35s cubic-bezier(.34,1.56,.64,1);
  pointer-events: none;
}
.badge-toast.badge-toast-visible { transform: translateX(0); }
.badge-toast-levelup { background: linear-gradient(135deg, #f59e0b, #d97706); }
.badge-toast-icon { font-size: 2rem; flex-shrink: 0; }

/* ─── Certificat ─── */
.cert-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.cert-modal {
  background: #fff;
  border-radius: 20px;
  padding: 2rem;
  max-width: 600px;
  width: 100%;
  box-shadow: 0 24px 60px rgba(0,0,0,.2);
  position: relative;
}
.cert-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: #94a3b8;
}
.cert-content {
  text-align: center;
  padding: 1.5rem;
  border: 3px solid #6366f1;
  border-radius: 16px;
  background: linear-gradient(135deg, #fafafa 0%, #f0f0ff 100%);
}
.cert-logo { font-size: 3.5rem; margin-bottom: .5rem; }
.cert-issued-by { font-size: .8rem; color: #6366f1; font-weight: 600; letter-spacing: .1em; text-transform: uppercase; margin-bottom: .5rem; }
.cert-title { font-size: 1.8rem; font-weight: 800; color: #1e1b4b; margin: .25rem 0 1rem; }
.cert-body { font-size: .9rem; color: #64748b; margin: .3rem 0; }
.cert-name { font-size: 1.6rem; font-weight: 700; color: #1e1b4b; margin: .5rem 0; }
.cert-course { font-size: 1.05rem; font-weight: 600; color: #4f46e5; margin: .5rem 0; }
.cert-date { font-size: .85rem; color: #94a3b8; margin-top: .75rem; }
.cert-footer { display: flex; justify-content: center; gap: 1rem; margin-top: 1.25rem; flex-wrap: wrap; }
.cert-badge {
  background: #eef2ff;
  color: #4f46e5;
  padding: .35rem .9rem;
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  border: 1px solid #c7d2fe;
}
.cert-actions { display: flex; gap: 1rem; justify-content: center; margin-top: 1.25rem; flex-wrap: wrap; }

/* ─── Admin Analytics ─── */
.admin-analytics-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: .75rem;
  margin-bottom: 1.5rem;
}
.admin-section-title { font-size: 1rem; font-weight: 600; margin: 1.5rem 0 .75rem; }
.admin-leaderboard { display: flex; flex-direction: column; gap: .4rem; margin-bottom: 1.5rem; }
.admin-lb-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: .55rem .9rem;
  background: var(--bg-subtle, #f8fafc);
  border-radius: 8px;
  font-size: .85rem;
}
.admin-lb-rank { min-width: 2rem; font-size: 1rem; text-align: center; }
.admin-lb-name { flex: 1; font-weight: 500; }
.admin-lb-xp { color: #6366f1; font-weight: 700; }
.admin-lb-badges { color: #f59e0b; }
.admin-lb-streak { color: #ef4444; }
.admin-analytics-table-wrap { overflow-x: auto; }
.admin-analytics-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .82rem;
}
.admin-analytics-table th,
.admin-analytics-table td {
  padding: .5rem .75rem;
  border-bottom: 1px solid var(--border, #e2e8f0);
  text-align: left;
  white-space: nowrap;
}
.admin-analytics-table th {
  font-weight: 600;
  color: var(--muted, #64748b);
  background: var(--bg-subtle, #f8fafc);
}
.admin-analytics-table tr:hover td { background: #f0f7ff; }

/* ─── Responsive ─── */
@media (max-width: 900px) {
  .progress-stats-grid { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .progress-hero { flex-direction: column; }
  .progress-hero-left { flex-direction: column; align-items: flex-start; }
  .progress-hero-right { width: 100%; justify-content: space-around; }
  .progress-domain-name { min-width: 110px; font-size: .75rem; }
  .progress-badges-grid { grid-template-columns: repeat(3, 1fr); }
  .cert-modal { padding: 1.25rem; }
  .cert-title { font-size: 1.35rem; }
  .cert-name { font-size: 1.2rem; }
}

@media print {
  .cert-modal-overlay { position: static; background: none; padding: 0; }
  .cert-modal { box-shadow: none; border-radius: 0; padding: 0; max-width: 100%; }
  .cert-close-btn, .cert-actions { display: none !important; }
  .cert-content { border: 3px solid #6366f1; }
}

/* ══════════════════════════════════════════════════════════════
   POLISH GLOBAL — Micro-animations, cohérence, responsive
   ══════════════════════════════════════════════════════════════ */

/* ── Option items: click feedback ─────────────────────────── */
.option-item {
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.option-item:active {
  transform: scale(0.985);
  box-shadow: none;
}
.option-item.is-selected .option-letter-badge {
  box-shadow: 0 0 0 3px rgba(63, 142, 161, 0.25);
}

/* ── Confidence buttons: cleaner active state ──────────────── */
.btn.chip:active { transform: scale(0.96); }
.btn.chip.is-active {
  background: rgba(0, 109, 119, 0.12);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 600;
}

/* ── Palette buttons: smoother hover ──────────────────────── */
.palette-btn { transition: background 0.12s ease, transform 0.1s ease; }
.palette-btn:hover:not(:disabled):not(.is-current) { transform: scale(1.08); }
.palette-btn:active { transform: scale(0.94); }

/* ── Flashcard: click shrink on flip button ────────────────── */
#flashcardFlipBtn:active { transform: scale(0.96); }
.flashcard-rate-no:active,
.flashcard-rate-maybe:active,
.flashcard-rate-yes:active { transform: scale(0.93); }

/* ── KeyPoint card hover ───────────────────────────────────── */
.keypoint-card {
  transition: box-shadow 0.2s ease, transform 0.15s ease;
}
.keypoint-card:hover {
  box-shadow: 0 4px 14px rgba(15, 30, 48, 0.1);
  transform: translateY(-1px);
}

/* ── Glossary items: hover border ─────────────────────────── */
.glossary-item {
  transition: box-shadow 0.18s ease, border-color 0.18s ease;
  border: 1px solid transparent;
}
.glossary-item:hover {
  border-color: rgba(0, 109, 119, 0.2);
  box-shadow: 0 4px 14px rgba(0, 109, 119, 0.08);
}

/* ── Registry content cards: cleaner grid ─────────────────── */
.registry-content-card {
  transition: box-shadow 0.18s ease, transform 0.15s ease;
}
.registry-content-card:hover {
  box-shadow: 0 5px 18px rgba(15, 30, 48, 0.12);
  transform: translateY(-2px);
}

/* ── Nav sidebar: progress badge pulse on new XP ──────────── */
@keyframes xpPulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.18); }
  100% { transform: scale(1); }
}
.side-link-badge.is-pulsing { animation: xpPulse 0.45s ease; }

/* ── Smooth page transitions via view show/hide ───────────── */
.view:not(.hidden) {
  animation: viewFadeIn 0.22s ease;
}
@keyframes viewFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Badge filter chips: smoother ─────────────────────────── */
.chip-filter { transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease; }
.chip-filter:active { transform: scale(0.95); }

/* ── Buttons global active state ──────────────────────────── */
.btn:not(:disabled):active { filter: brightness(0.93); }
.btn-primary:not(:disabled):active { transform: scale(0.98); }

/* ── Question state badge ──────────────────────────────────── */
.question-state-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 0.8rem;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: 500;
}
.question-state-badge.is-warn { background: #fff8e1; color: #b45309; border: 1px solid #fde68a; }
.question-state-badge.is-ready { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.question-state-badge.is-good { background: #dcfce7; color: #14532d; border: 1px solid #86efac; }
.question-state-badge.is-bad { background: #fee2e2; color: #7f1d1d; border: 1px solid #fca5a5; }
.question-state-badge.is-plain { background: #f0f4f8; color: #4a5568; border: 1px solid #e2e8f0; }
.question-state-badge.is-revisit { background: #ffe4e6; color: #9f1239; border: 1px solid #fda4af; }

/* ── Responsive polish: mobile (≤ 640px) ─────────────────── */
@media (max-width: 640px) {
  .option-item { padding: 12px 14px; gap: 10px; }
  .option-letter-badge { width: 30px; height: 30px; font-size: 0.85rem; }
  .scenario-card { padding: 1rem; }
  .scenario-card .scenario-badges { flex-wrap: nowrap; overflow-x: auto; }
  .glossary-list { columns: 1; }
  .glossary-az-bar { gap: 3px; }
  .glossary-az-btn { width: 26px; height: 26px; font-size: 0.72rem; }
  .flashcard-card { height: 280px; }
  .flashcard-content { font-size: 1rem; }
}

/* ── Responsive polish: tablet (641–1024px) ───────────────── */
@media (min-width: 641px) and (max-width: 1024px) {
  .glossary-list { columns: 1; }
  .flashcard-card { height: 310px; }
}

/* ── Dark mode improvements (if var(--bg) is dark) ────────── */
@media (prefers-color-scheme: dark) {
  .option-item { background: var(--card, #1e293b); border-color: rgba(255,255,255,0.1); }
  .option-letter-badge { background: rgba(255,255,255,0.1); color: #e2e8f0; }
  .glossary-az-btn { background: var(--card, #1e293b); border-color: rgba(255,255,255,0.1); }
  mark.glossary-highlight { background: rgba(255, 210, 80, 0.25); }
}

/* ═══════════════════════════════════════════════════════════════════════════
   SÉCURITÉ / CONFORMITÉ — Bannière RGPD + Indicateur force mot de passe
   Phase S2 — ajouté 2026-03-12
════════════════════════════════════════════════════════════════════════════ */

/* ── Indicateur de force du mot de passe ────────────────────────────────── */
.password-strength-wrap {
  padding: 6px 0 2px;
  transition: opacity 0.2s;
}
.password-strength-bar {
  display: flex;
  gap: 4px;
  margin-bottom: 5px;
}
.psb-seg {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: #dde1e7;
  transition: background 0.3s;
}
.psb-seg.active-1 { background: #ef4444; }
.psb-seg.active-2 { background: #f97316; }
.psb-seg.active-3 { background: #eab308; }
.psb-seg.active-4 { background: #22c55e; }
.password-strength-label {
  font-size: 0.75rem;
  color: var(--muted, #6b7280);
  margin: 0;
  transition: color 0.3s;
}
.password-strength-label.psl-1 { color: #ef4444; }
.password-strength-label.psl-2 { color: #f97316; }
.password-strength-label.psl-3 { color: #eab308; }
.password-strength-label.psl-4 { color: #22c55e; }

/* ── Bannière RGPD — barre fixe en bas ──────────────────────────────────── */
.rgpd-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9999;
  background: #1e293b;
  color: #f1f5f9;
  border-top: 2px solid var(--primary, #006d77);
  box-shadow: 0 -4px 24px rgba(0,0,0,0.2);
  animation: slideUpBanner 0.35s ease-out;
}
@keyframes slideUpBanner {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.rgpd-banner-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.rgpd-banner-text {
  flex: 1;
  min-width: 240px;
}
.rgpd-banner-title {
  font-weight: 600;
  font-size: 0.9rem;
  margin: 0 0 4px;
  color: #f8fafc;
}
.rgpd-banner-body {
  font-size: 0.8rem;
  color: #94a3b8;
  margin: 0;
  line-height: 1.5;
}
.rgpd-banner-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
  flex-wrap: wrap;
}

/* ── Modal RGPD étendue ─────────────────────────────────────────────────── */
.rgpd-modal-box {
  max-width: 560px;
  max-height: 80vh;
  overflow-y: auto;
}
.rgpd-modal-content h3 {
  font-size: 0.95rem;
  font-weight: 600;
  margin: 1.1rem 0 0.4rem;
  color: var(--primary, #006d77);
}
.rgpd-modal-content p,
.rgpd-modal-content li {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--text-muted, #6b7280);
}
.rgpd-modal-content ul {
  padding-left: 1.2rem;
}
.rgpd-modal-content a {
  color: var(--primary, #006d77);
  text-decoration: underline;
}

/* ── Vue Audit Log (admin) ───────────────────────────────────────────────── */
.audit-log-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
  margin-top: 0.75rem;
}
.audit-log-table th {
  text-align: left;
  padding: 6px 10px;
  background: rgba(0, 109, 119, 0.08);
  border-bottom: 1px solid var(--line, #e5e7eb);
  font-weight: 600;
  white-space: nowrap;
}
.audit-log-table td {
  padding: 6px 10px;
  border-bottom: 1px solid var(--line, #e5e7eb);
  vertical-align: middle;
}
.audit-log-table tr:hover td { background: rgba(0,109,119,0.04); }
.audit-action-badge {
  display: inline-block;
  padding: 2px 7px;
  border-radius: 10px;
  font-size: 0.73rem;
  font-weight: 500;
  background: #e0f2fe;
  color: #0369a1;
}
.audit-action-badge.fail  { background: #fee2e2; color: #b91c1c; }
.audit-action-badge.warn  { background: #fef9c3; color: #854d0e; }
.audit-action-badge.ok    { background: #dcfce7; color: #15803d; }

@media (max-width: 640px) {
  .rgpd-banner-inner { flex-direction: column; align-items: flex-start; gap: 12px; }
  .rgpd-banner-actions { width: 100%; }
  .rgpd-banner-actions .btn { flex: 1; text-align: center; }
}

/* ═══════════════════════════════════════════════════════════════════
   FORMULES & CALCULS
   ═══════════════════════════════════════════════════════════════════ */

/* Section groupée par catégorie */
.formula-section { margin-bottom: 2rem; }
.formula-section-header {
  display: flex; align-items: center; gap: 0.6rem;
  padding: 0.6rem 0; margin-bottom: 0.75rem;
  border-bottom: 2px solid var(--primary, #006d77);
}
.formula-section-icon { font-size: 1.2rem; }
.formula-section-title { margin: 0; font-size: 1rem; font-weight: 700; flex: 1; }
.formula-section-count {
  font-size: 0.75rem; color: var(--text-muted, #6b7280);
  background: #f3f4f6; padding: 2px 8px; border-radius: 12px;
}
.formula-cards-row {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 0.85rem;
}

/* Carte formule */
.formula-card {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow 0.18s, transform 0.1s;
}
.formula-card:hover { box-shadow: 0 6px 20px rgba(0,109,119,0.14); transform: translateY(-1px); }
.formula-card.is-revealed { border-color: var(--primary, #006d77); }

/* Top bar */
.formula-card-top {
  padding: 0.85rem 1rem 0.6rem;
  border-bottom: 1px solid var(--line, #e5e7eb);
}
.formula-card-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.35rem; }
.formula-cat-badge {
  font-size: 0.65rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em;
  padding: 2px 8px; border-radius: 20px;
  background: rgba(0,109,119,0.1); color: var(--primary, #006d77);
}
.formula-cat-badge--evm          { background: #dbeafe; color: #1d4ed8; }
.formula-cat-badge--pert         { background: #dcfce7; color: #15803d; }
.formula-cat-badge--risk         { background: #ffedd5; color: #c2410c; }
.formula-cat-badge--communication{ background: #fae8ff; color: #9333ea; }
.formula-cat-badge--procurement  { background: #fef9c3; color: #854d0e; }
.formula-self-test-hint { font-size: 0.68rem; color: var(--text-muted, #6b7280); font-style: italic; }
.formula-name { margin: 0; font-size: 0.92rem; font-weight: 700; color: var(--text, #111827); }

/* Zone de révélation */
.formula-reveal-zone { background: #f8fafc; padding: 1rem; text-align: center; min-height: 70px; display: flex; align-items: center; justify-content: center; }
.formula-cover { display: flex; flex-direction: column; align-items: center; gap: 0.3rem; }
.formula-cover-icon { font-size: 1.6rem; }
.formula-cover-text { font-size: 0.78rem; color: var(--text-muted, #6b7280); font-style: italic; }
.formula-expression-wrap { width: 100%; }
.formula-expression {
  font-family: 'Courier New', monospace;
  font-size: 1.25rem; font-weight: 800;
  color: var(--primary, #006d77);
  background: rgba(0,109,119,0.07);
  padding: 0.6rem 1rem; border-radius: 8px;
  letter-spacing: 0.04em;
  display: inline-block;
}

/* Badges d'interprétation */
.formula-interp { display: flex; gap: 0.5rem; justify-content: center; margin-top: 0.5rem; flex-wrap: wrap; }
.fi-good {
  font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 12px;
  background: #dcfce7; color: #15803d;
}
.fi-bad {
  font-size: 0.72rem; font-weight: 600; padding: 2px 8px; border-radius: 12px;
  background: #fee2e2; color: #b91c1c;
}

/* Détails (révélés après clic) */
.formula-details { padding: 0.75rem 1rem; border-top: 1px solid var(--line, #e5e7eb); }

/* Variables */
.formula-vars-list { margin-bottom: 0.6rem; }
.fv-row {
  display: grid; grid-template-columns: 50px 110px 1fr;
  gap: 0.3rem 0.6rem; padding: 3px 0; font-size: 0.8rem; align-items: baseline;
}
.fv-sym  { font-family: 'Courier New', monospace; font-weight: 700; color: var(--primary, #006d77); }
.fv-label{ font-weight: 600; color: var(--text, #111827); }
.fv-desc { color: var(--text-muted, #6b7280); }

.formula-vars-text { font-size: 0.82rem; color: var(--text-muted, #6b7280); margin-bottom: 0.4rem; }
.formula-example {
  font-size: 0.81rem; color: var(--text, #111827);
  background: #f1f5f9; padding: 0.4rem 0.6rem; border-radius: 6px;
  margin-bottom: 0.5rem;
}
.formula-tip {
  display: flex; gap: 0.5rem; align-items: flex-start;
  background: #fefce8; border-left: 3px solid #eab308;
  padding: 0.45rem 0.7rem; border-radius: 0 6px 6px 0;
  font-size: 0.8rem; color: #713f12; margin-bottom: 0.4rem;
}
.formula-tip-icon { flex-shrink: 0; }
.formula-ref { font-size: 0.72rem; color: #9ca3af; margin-top: 0.2rem; }

/* ═══════════════════════════════════════════════════════════════════
   TABLEAUX COMPARATIFS
   ═══════════════════════════════════════════════════════════════════ */
.comparisons-grid { display: flex; flex-direction: column; gap: 1.25rem; }

.comparison-card {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e7eb);
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.15s;
}
.comparison-card:hover { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
.comparison-card-header {
  padding: 0.9rem 1.1rem 0.6rem;
  border-bottom: 1px solid var(--line, #e5e7eb);
}
.comparison-theme-badge {
  display: inline-block;
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 8px; border-radius: 20px; margin-bottom: 0.4rem;
  background: rgba(0,109,119,0.1); color: var(--primary, #006d77);
}
.cmp-theme--pmbok_versions { background: #dbeafe; color: #1d4ed8; }
.cmp-theme--methodology    { background: #dcfce7; color: #15803d; }
.cmp-theme--roles          { background: #fae8ff; color: #9333ea; }
.cmp-theme--processes      { background: #ffedd5; color: #c2410c; }

.comparison-title { margin: 0; font-size: 0.97rem; font-weight: 700; color: var(--text, #111827); }

/* Table */
.comparison-table-wrap { overflow-x: auto; }
.comparison-table { width: 100%; border-collapse: collapse; font-size: 0.82rem; min-width: 400px; }
.comparison-table thead th {
  background: var(--primary, #006d77); color: #fff;
  padding: 7px 12px; text-align: left; font-weight: 600;
  white-space: nowrap;
}
.comparison-table thead th.col-pmbok8 {
  background: #059669; /* Green highlight for PMBOK 8 column */
}
.comparison-table tbody td {
  padding: 7px 12px; border-bottom: 1px solid #f3f4f6;
  vertical-align: top; color: var(--text, #111827);
}
.comparison-table tbody td.col-pmbok8 {
  background: rgba(5,150,105,0.06); font-weight: 500;
}
.comparison-table tbody tr.row-alt td { background: #f8fafc; }
.comparison-table tbody tr.row-alt td.col-pmbok8 { background: rgba(5,150,105,0.10); }
.comparison-table tbody tr:last-child td { border-bottom: none; }

/* Key takeaway */
.comparison-takeaway {
  display: flex; gap: 0.6rem; align-items: flex-start;
  margin: 0; padding: 0.7rem 1.1rem;
  background: #fefce8; border-top: 1px solid #fde68a;
  font-size: 0.83rem; color: #713f12; font-weight: 500;
}
.cmp-takeaway-icon { flex-shrink: 0; font-size: 1rem; }
.comparison-ref {
  font-size: 0.72rem; color: #9ca3af;
  padding: 0.4rem 1.1rem; border-top: 1px solid var(--line, #e5e7eb);
}

/* ═══════════════════════════════════════════════════════════════════
   MNEMONIQUES
   ═══════════════════════════════════════════════════════════════════ */
.mnemoniques-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1rem;
}

.mnemonic-card {
  background: var(--surface, #fff);
  border: 1px solid var(--line, #e5e7eb);
  border-left: 4px solid #8b5cf6;
  border-radius: 12px;
  overflow: hidden;
  transition: box-shadow 0.18s;
}
.mnemonic-card:hover { box-shadow: 0 6px 20px rgba(139,92,246,0.13); }
.mnemonic-type-acronym { border-left-color: #7c3aed; }
.mnemonic-type-list    { border-left-color: #0891b2; }
.mnemonic-type-visual  { border-left-color: #d97706; }
.mnemonic-type-story   { border-left-color: #059669; }

.mnemonic-card-header {
  padding: 0.85rem 1rem 0.6rem;
  border-bottom: 1px solid var(--line, #e5e7eb);
}
.mnemonic-card-header-left { display: flex; align-items: center; gap: 0.5rem; margin-bottom: 0.35rem; }
.mnemonic-type-badge {
  font-size: 0.65rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em;
  padding: 2px 8px; border-radius: 20px;
}
.mn-badge--acronym { background: #ede9fe; color: #7c3aed; }
.mn-badge--list    { background: #e0f2fe; color: #0369a1; }
.mn-badge--visual  { background: #ffedd5; color: #c2410c; }
.mn-badge--story   { background: #dcfce7; color: #15803d; }
.mnemonic-domain-icon { font-size: 0.75rem; color: var(--text-muted, #6b7280); }
.mnemonic-title { margin: 0; font-size: 0.92rem; font-weight: 700; color: var(--text, #111827); }

/* Body */
.mnemonic-body { padding: 0.85rem 1rem; }

/* Acronyme : affichage des lettres en grand */
.mn-acronym-display {
  display: flex; gap: 0.3rem; justify-content: center;
  margin-bottom: 0.85rem;
  flex-wrap: wrap;
}
.mn-acro-letter {
  width: 2.4rem; height: 2.4rem;
  display: flex; align-items: center; justify-content: center;
  background: var(--primary, #006d77); color: #fff;
  font-size: 1.2rem; font-weight: 800;
  border-radius: 8px;
  box-shadow: 0 2px 6px rgba(0,109,119,0.25);
}

/* Décomposition lettre par lettre */
.mn-breakdown { display: flex; flex-direction: column; gap: 0.35rem; }
.mn-letter-row {
  display: grid; grid-template-columns: 1.8rem 110px 1fr;
  gap: 0.4rem; align-items: center; padding: 4px 0;
  border-bottom: 1px solid #f3f4f6;
}
.mn-letter-row:last-child { border-bottom: none; }
.mn-letter-char {
  width: 1.8rem; height: 1.8rem;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,109,119,0.1); color: var(--primary, #006d77);
  font-weight: 800; font-size: 0.95rem; border-radius: 5px;
  flex-shrink: 0;
}
.mn-letter-word { font-weight: 700; font-size: 0.83rem; color: var(--text, #111827); }
.mn-letter-detail { font-size: 0.78rem; color: var(--text-muted, #6b7280); }

/* Mot-clé pour story/list/visual */
.mn-keyword {
  font-size: 1.15rem; font-weight: 800; letter-spacing: 0.05em;
  color: #7c3aed; margin-bottom: 0.6rem; text-align: center;
  padding: 0.4rem; background: #faf5ff; border-radius: 8px;
}
.mn-items-list, .mn-visual-list {
  margin: 0; padding-left: 1.2rem; font-size: 0.84rem;
  color: var(--text, #111827); line-height: 1.65;
}
.mn-items-list li, .mn-visual-list li { margin-bottom: 0.2rem; }

/* Exemple et astuce */
.mn-example {
  margin: 0; padding: 0.55rem 1rem;
  background: #f8fafc; border-top: 1px solid var(--line, #e5e7eb);
  font-size: 0.81rem; color: var(--text-muted, #6b7280);
}
.mn-tip {
  display: flex; gap: 0.5rem; align-items: flex-start;
  padding: 0.55rem 1rem;
  background: #fefce8; border-top: 1px solid #fde68a;
  font-size: 0.8rem; color: #713f12;
}

/* ═══════════════════════════════════════════════════════════════════
   MODE EXAMEN REALISTE
   ═══════════════════════════════════════════════════════════════════ */
.examen-realiste-panel { display: flex; flex-direction: column; gap: 1.5rem; }

.examen-realiste-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
}
.er-stat-card {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  background: linear-gradient(135deg, rgba(0,109,119,0.06), rgba(0,109,119,0.02));
  border: 1px solid rgba(0,109,119,0.2);
  border-radius: 12px; padding: 1.2rem 0.5rem; text-align: center;
}
.er-stat-num { font-size: 2.2rem; font-weight: 800; color: var(--primary, #006d77); line-height: 1; }
.er-stat-lbl { font-size: 0.75rem; color: var(--text-muted, #6b7280); margin-top: 0.35rem; font-weight: 500; }

.examen-realiste-rules { }
.examen-realiste-rules h3 { font-size: 0.95rem; font-weight: 700; margin: 0 0 0.6rem; }
.examen-realiste-rules ul { margin: 0; padding-left: 1.1rem; }
.examen-realiste-rules li { font-size: 0.86rem; margin-bottom: 0.35rem; color: var(--text, #111827); }

.examen-realiste-dist h3 { font-size: 0.95rem; font-weight: 700; margin: 0 0 0.75rem; }
.er-domain-dist { display: flex; flex-direction: column; gap: 0.6rem; }
.er-domain-bar { display: flex; align-items: center; gap: 0.75rem; }
.er-domain-name { font-size: 0.82rem; width: 100px; flex-shrink: 0; font-weight: 500; }
.er-domain-track {
  flex: 1; height: 12px; background: #e5e7eb; border-radius: 6px; overflow: hidden;
}
.er-domain-fill { height: 100%; border-radius: 6px; background: var(--primary, #006d77); transition: width 0.6s ease; }
.er-domain-fill--process  { background: #3b82f6; }
.er-domain-fill--business { background: #f59e0b; }
.er-domain-pct { font-size: 0.82rem; font-weight: 700; width: 36px; text-align: right; color: var(--text, #111827); }

/* Readiness indicator */
.er-readiness { border-radius: 8px; padding: 0.85rem 1rem; }
.er-readiness--low  { background: #fef2f2; border: 1px solid #fca5a5; }
.er-readiness--med  { background: #fffbeb; border: 1px solid #fcd34d; }
.er-readiness--high { background: #f0fdf4; border: 1px solid #86efac; }
.er-readiness-bar {
  height: 8px; background: #e5e7eb; border-radius: 4px; overflow: hidden; margin-bottom: 0.5rem;
}
.er-readiness-fill { height: 100%; border-radius: 4px; background: var(--primary, #006d77); transition: width 0.6s ease; }
.er-readiness--low  .er-readiness-fill { background: #ef4444; }
.er-readiness--med  .er-readiness-fill { background: #f59e0b; }
.er-readiness--high .er-readiness-fill { background: #22c55e; }
.er-readiness-msg { font-size: 0.84rem; margin: 0; font-weight: 500; }
.er-readiness--low  .er-readiness-msg { color: #b91c1c; }
.er-readiness--med  .er-readiness-msg { color: #92400e; }
.er-readiness--high .er-readiness-msg { color: #15803d; }

.er-warning {
  background: #fffbeb; border: 1px solid #fcd34d; border-radius: 8px;
  padding: 0.75rem 1rem; font-size: 0.85rem; color: #92400e;
}
.examen-realiste-actions { text-align: center; padding-top: 0.5rem; display: flex; flex-direction: column; align-items: center; gap: 0.6rem; }
.er-best-score { font-size: 0.85rem; color: var(--primary, #006d77); font-weight: 600; margin: 0; }

@media (max-width: 768px) {
  .examen-realiste-stats { grid-template-columns: repeat(2, 1fr); }
  .formula-cards-row { grid-template-columns: 1fr; }
  .mnemoniques-grid { grid-template-columns: 1fr; }
  .mn-letter-row { grid-template-columns: 1.6rem 90px 1fr; }
  .fv-row { grid-template-columns: 44px 90px 1fr; }
}
