/* Runtime étudiant : hub chapitres, tuiles, validation / contenu / QCM / exercice */
.runtime {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 1rem 3rem;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.runtime__header {
  margin-bottom: 1.5rem;
}

.runtime__header h1 {
  margin: 0 0 0.25rem;
  font-size: 1.5rem;
}

.runtime__subtitle {
  margin: 0;
  color: #64748b;
  font-size: 0.95rem;
}

.runtime__breadcrumb {
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
}

.runtime__breadcrumb a {
  color: #2563eb;
  text-decoration: none;
}

.runtime__breadcrumb a:hover {
  text-decoration: underline;
}

.runtime__back {
  margin-top: 2rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
}

.runtime__back a {
  color: #2563eb;
  text-decoration: none;
}

.runtime__back a:hover {
  text-decoration: underline;
}

/* Liste tuiles / chapitres */
.runtime-tiles {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.runtime-tiles__item {
  margin: 0;
}

.runtime-tiles__card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 1rem 1.25rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.runtime-tiles__card--chapter {
  display: block;
  color: inherit;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s;
}

.runtime-tiles__card--chapter:hover {
  border-color: #94a3b8;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.runtime-tiles__card-title {
  display: block;
  font-weight: 600;
  font-size: 1.1rem;
  margin-bottom: 0.25rem;
}

.runtime-tiles__card-meta {
  font-size: 0.875rem;
  color: #64748b;
}

.runtime-tiles__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.75rem;
}

.runtime-tiles__btn {
  display: inline-block;
  padding: 0.4rem 0.75rem;
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid #e5e7eb;
  background: #f8fafc;
  color: #0f172a;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

a.runtime-tiles__btn:hover {
  background: #e2e8f0;
  border-color: #cbd5e1;
}

.runtime-tiles__btn.is-locked {
  opacity: 0.7;
  cursor: not-allowed;
  color: #64748b;
}

.runtime-course-shell {
  max-width: 26.25rem;
  height: min(45.5rem, 94dvh);
}

.runtime-course-summary {
  align-items: center;
}

.runtime-course-completed-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.runtime-course-restart-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: flex-start;
  margin-top: 0.25rem;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #475569;
  font-size: 0.75rem;
  font-weight: 700;
  text-decoration: none;
}

.runtime-course-restart-btn:hover {
  background: #f8fafc;
  border-color: #93c5fd;
  color: #1e40af;
}

.runtime-course-bottom-nav {
  height: 4.75rem;
  flex: 0 0 auto;
  display: flex;
  justify-content: space-around;
  align-items: flex-start;
  padding-top: 0.75rem;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.04);
}

.runtime-course-bottom-nav__item {
  width: 4.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.2rem;
  text-decoration: none;
  color: #94a3b8;
}

.runtime-course-bottom-nav__icon {
  width: 1.9rem;
  height: 1.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.runtime-course-bottom-nav__icon svg {
  width: 1.35rem;
  height: 1.35rem;
}

.runtime-course-bottom-nav__icon--active {
  color: #2563eb;
}

.runtime-course-bottom-nav__label {
  font-size: 0.625rem;
  font-weight: 800;
}

.runtime-course-bottom-nav__label--active {
  color: #2563eb;
}

@media (max-width: 28rem) {
  .runtime-course-shell {
    max-width: none;
    width: 100%;
    height: min(46rem, 96dvh);
  }

  .runtime-course-completed-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.runtime-placeholder {
  padding: 2rem;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  color: #64748b;
}

.runtime-placeholder__message {
  margin: 0 0 0.5rem;
  font-weight: 600;
  color: #475569;
}

.runtime-placeholder__hint {
  margin: 0;
  font-size: 0.9rem;
  color: #94a3b8;
}

.runtime-content {
  margin: 1rem 0;
}

.runtime-validate {
  margin: 1rem 0;
}

/* QCM intégratif */
.runtime-qcm {
  margin: 1rem 0 2rem;
}

.runtime-qcm__header {
  margin-bottom: 1.5rem;
}

.runtime-qcm__info {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  color: #64748b;
}

.runtime-qcm__progress {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.runtime-qcm__progress-text {
  font-size: 0.85rem;
  color: #64748b;
}

.runtime-qcm__progress-bar-wrap {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
  overflow: hidden;
}

.runtime-qcm__progress-bar {
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #3b82f6, #22c55e);
  transition: width 0.2s ease-out;
}

.runtime-qcm__questions {
  margin-top: 1rem;
}

.runtime-qcm-question {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
}

.runtime-qcm-question + .runtime-qcm-question {
  margin-top: 1.25rem;
}

.runtime-qcm-question--hidden {
  display: none;
}

.runtime-qcm-question__header {
  margin-bottom: 0.5rem;
}

.runtime-qcm-question__title {
  margin: 0;
  font-size: 1.05rem;
}

.runtime-qcm-question__section {
  margin: 0.15rem 0 0;
  font-size: 0.8rem;
  color: #94a3b8;
}

.runtime-qcm-question__body {
  margin-top: 0.5rem;
}

.runtime-qcm-question__image img {
  max-width: 100%;
  border-radius: 8px;
  margin: 0.5rem 0;
}

.runtime-qcm-question__choices {
  list-style: none;
  margin: 0.5rem 0 0;
  padding: 0;
}

.runtime-qcm-question__choice {
  margin: 0.25rem 0;
}

.runtime-qcm-question__choice label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
}

.runtime-qcm-question__correction {
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid #e5e7eb;
  font-size: 0.9rem;
}

.runtime-qcm-question__explication {
  margin: 0.35rem 0 0;
}

.runtime-qcm-question--correct {
  border-color: #22c55e;
  background: #ecfdf3;
}

.runtime-qcm-question--wrong {
  border-color: #f97316;
  background: #fff7ed;
}

.runtime-qcm__footer {
  margin-top: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.runtime-qcm__validate-btn,
.runtime-qcm__next-btn,
.runtime-qcm__restart-btn {
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
}

.runtime-qcm__validate-btn {
  background: #1d4ed8;
  border-color: #1d4ed8;
  color: #fff;
}

.runtime-qcm__validate-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.runtime-qcm__next-btn {
  background: #fff;
  border-color: #e5e7eb;
  color: #374151;
}

.runtime-qcm__next-btn:disabled {
  opacity: 0.6;
  cursor: default;
}

.runtime-qcm__final {
  margin-top: 1.5rem;
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #f9fafb;
}

.runtime-qcm__final-text {
  margin: 0 0 0.75rem;
  font-weight: 600;
}

.runtime-qcm__restart-btn {
  background: #fff;
  border-color: #3b82f6;
  color: #1d4ed8;
}

.runtime-qcm__final.is-hidden {
  display: none;
}

/* Exercice corrigé (V1) */
.runtime-exercise-empty {
  padding: 2rem;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 12px;
  color: #64748b;
}

.runtime-exercise-empty__message {
  margin: 0 0 0.5rem;
  font-weight: 600;
  color: #475569;
}

.runtime-exercise-empty__hint {
  margin: 0;
  font-size: 0.9rem;
  color: #94a3b8;
}

.runtime-exercise {
  margin: 1rem 0;
}

.runtime-exercise__meta {
  margin-bottom: 1.5rem;
}

.runtime-exercise__title {
  margin: 0 0 0.25rem;
  font-size: 1.35rem;
}

/* -------- QCM intégratif (vrai rendu cartes) -------- */

/* Conteneur principal du QCM (on reste dans la carte runtime existante) */
#qcm-root {
  margin: 1rem 0 2rem;
}

/* .qcm-progress: l'en-tête Progression est déjà géré par la structure du template. */

#qcm-progress-container {
  display: flex;
  gap: 2px;
  height: 8px;
  border-radius: 999px;
  overflow: hidden;
  background: #ffffff;
  border: 1px solid #e5e7eb;
}

.qcm-seg {
  flex: 1 1 0;
  transition: background-color 0.2s ease;
}

/* Cartes de question */
.qcm-card {
  padding: 1rem 1.25rem;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #ffffff;
}

.qcm-card.hidden {
  display: none;
}

.qcm-options {
  margin-top: 0.25rem;
}

.qcm-opt {
  display: block;
  width: 100%;
  text-align: left;
  padding: 0.75rem;
  border-radius: 0.75rem;
  border: 1px solid #e5e7eb;
  background: #ffffff;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.qcm-opt:hover {
  background: #eff6ff; /* bleu très clair */
}

/* Utilitaires de couleur (mappage Tailwind) utilisés par le JS */
.border-green-500 {
  border-color: #22c55e !important;
}

.bg-green-50 {
  background-color: #ecfdf3 !important;
}

.border-red-500 {
  border-color: #ef4444 !important;
}

.bg-red-50 {
  background-color: #fef2f2 !important;
}

.ring-2 {
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.0);
}

.ring-blue-300 {
  box-shadow: 0 0 0 2px #93c5fd;
}

.bg-blue-50 {
  background-color: #eff6ff !important;
}

/* Bouton d'action du QCM */
#qcm-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  border-radius: 0.75rem;
  border: none;
  background: #2563eb;
  color: #ffffff;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

#qcm-action:hover {
  background: #1d4ed8;
}

/* Zone d'explication sous forme de bandeau bleu clair */
#qcm-explanation-area {
  margin-top: 0.25rem;
}

#qcm-explanation-area .prose {
  margin: 0;
}

/* Popup image (copié du composant de référence) */
.qcm-media-wrap {
  width: 100%;
  max-width: 300px;
}

.qcm-media-wrap img,
.qcm-media-wrap picture,
.qcm-media-wrap svg {
  display: block;
  max-width: 100%;
  max-height: 200px;
  height: auto;
  object-fit: contain;
}

.image-popup {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 9999;
  cursor: pointer;
}

.image-popup img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.runtime-exercise__difficulty {
  margin: 0;
  font-size: 1rem;
  color: #f59e0b;
  letter-spacing: 0.05em;
}

.runtime-exercise__items {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.runtime-exercise__qr {
  padding: 1rem 1.25rem;
  background: #fffbeb;
  border: 1px solid #fde68a;
  border-radius: 12px;
}

.runtime-exercise__question-label {
  margin: 0 0 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #92400e;
}

.runtime-exercise__question-text {
  margin: 0 0 1rem;
}

.runtime-exercise__toggle {
  display: inline-block;
  padding: 0.5rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e40af;
  background: #fff;
  border: 1px solid #93c5fd;
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.runtime-exercise__toggle:hover {
  background: #eff6ff;
  border-color: #3b82f6;
}

.runtime-exercise__answer {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid #fde68a;
}

.runtime-exercise__answer.is-hidden {
  display: none;
}

/* =============================================================================
   Flow élève — cohérence visuelle (cartes, formulaires, mobile)
   Largeur max unifiée : 30rem (480px)
   ============================================================================= */

/* Flow onboarding : fond plus profond (évite le « plat » uniforme) */
.runtime-flow {
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(ellipse 110% 80% at 50% 0%, #1e3a8a 0%, #0f172a 45%, #020617 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(0.75rem, env(safe-area-inset-top)) 0.75rem max(1rem, env(safe-area-inset-bottom));
  box-sizing: border-box;
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

.runtime-flow--premium {
  background: radial-gradient(ellipse 120% 90% at 50% -10%, #2563eb 0%, #1e3a8a 28%, #0f172a 55%, #020617 100%);
}

.runtime-flow--with-nav {
  padding-bottom: calc(max(5.5rem, env(safe-area-inset-bottom) + 4.75rem));
}

/* Mobile-first : colonne lisible, pas trop large sur téléphone */
.runtime-flow__inner {
  width: 100%;
  max-width: min(22.5rem, calc(100vw - 1.25rem));
  margin: 0 auto;
}

@media (min-width: 28rem) {
  .runtime-flow__inner {
    max-width: 26rem;
  }
}

.runtime-flow-card {
  background: #fff;
  border-radius: 1rem;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
  border: 1px solid #e2e8f0;
  overflow: hidden;
}

/* Carte « premium » : relief, légère teinte, pas une feuille A4 */
.runtime-flow-card--premium {
  background: linear-gradient(165deg, #ffffff 0%, #f8fafc 45%, #f1f5f9 100%);
  border-radius: 1.35rem;
  border: 1px solid rgba(148, 163, 184, 0.38);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.12) inset,
    0 2px 4px rgba(15, 23, 42, 0.06),
    0 24px 48px -14px rgba(15, 23, 42, 0.5),
    0 0 36px -12px rgba(37, 99, 235, 0.18);
}

.runtime-flow-card--premium .runtime-flow-card__head {
  background: linear-gradient(180deg, rgba(239, 246, 255, 0.55) 0%, rgba(255, 255, 255, 0) 100%);
  border-bottom-color: rgba(226, 232, 240, 0.95);
}

/* Sections profil : encadré léger sans tout écraser */
.runtime-flow-panel {
  border-radius: 0.875rem;
  padding: 1rem 1rem 1.125rem;
  margin-bottom: 1.125rem;
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.9) 0%, rgba(248, 250, 252, 0.65) 100%);
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.runtime-flow-panel:last-child {
  margin-bottom: 0;
}

.runtime-subject-grid {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.runtime-subject-card {
  display: block;
  cursor: pointer;
}

.runtime-subject-card__input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.runtime-subject-card__box {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 0.35rem;
  min-height: 4.35rem;
  padding: 0.95rem 1rem;
  border-radius: 1rem;
  border: 1px solid rgba(191, 219, 254, 0.5);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(239, 246, 255, 0.92) 100%);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.7) inset,
    0 10px 22px -20px rgba(37, 99, 235, 0.2);
  transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, transform 0.08s ease;
}

.runtime-subject-card:hover .runtime-subject-card__box {
  border-color: rgba(96, 165, 250, 0.75);
  box-shadow: 0 14px 24px -22px rgba(37, 99, 235, 0.28);
}

.runtime-subject-card__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.runtime-subject-card__input:checked + .runtime-subject-card__box {
  border-color: #2563eb;
  background: linear-gradient(180deg, rgba(219, 234, 254, 0.96) 0%, rgba(191, 219, 254, 0.92) 100%);
  box-shadow:
    0 0 0 3px rgba(37, 99, 235, 0.14),
    0 14px 24px -22px rgba(37, 99, 235, 0.22);
}

.runtime-subject-card__input:active + .runtime-subject-card__box {
  transform: scale(0.99);
}

.runtime-subject-card__title {
  font-size: 1rem;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.25;
}

.runtime-subject-card__check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.45rem;
  height: 1.45rem;
  flex: 0 0 auto;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: #ffffff;
  color: transparent;
  font-size: 0.85rem;
  font-weight: 900;
  line-height: 1;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease, transform 0.16s ease;
}

.runtime-subject-card__input:checked + .runtime-subject-card__box .runtime-subject-card__check {
  background: #2563eb;
  border-color: #2563eb;
  color: #ffffff;
  transform: scale(1.02);
}

.runtime-subject-card--disabled {
  cursor: not-allowed;
}

.runtime-subject-card--disabled .runtime-subject-card__box {
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.96) 0%, rgba(241, 245, 249, 0.92) 100%);
  border-color: rgba(203, 213, 225, 0.65);
  box-shadow: none;
}

.runtime-subject-card--disabled .runtime-subject-card__check {
  border-color: rgba(203, 213, 225, 0.8);
  background: #f8fafc;
}

#runtime-subject-submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  filter: grayscale(0.08);
}

.runtime-flow-card__logout {
  display: flex;
  justify-content: flex-end;
  padding: 0.75rem 1rem 0;
}

.runtime-flow-card__logout button {
  font-size: 0.6875rem;
  color: #94a3b8;
  background: none;
  border: none;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.runtime-flow-card__logout button:hover {
  color: #64748b;
}

.runtime-progress-header {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.runtime-progress-header__top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 0.5rem;
}

.runtime-progress-header__spacer {
  width: 1px;
  height: 1px;
  justify-self: end;
}

.runtime-progress-back {
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 2rem;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 700;
  color: #475569;
  background: rgba(255, 255, 255, 0.88);
  border: 1px solid rgba(203, 213, 225, 0.95);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.runtime-progress-back:hover {
  color: #1e293b;
  background: #fff;
  border-color: #bfdbfe;
}

.runtime-progress-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-width: 0;
}

.runtime-progress-brand__mark {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  font-size: 0.75rem;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #2563eb 0%, #1d4ed8 100%);
  box-shadow: 0 8px 18px -12px rgba(37, 99, 235, 0.55);
}

.runtime-progress-brand__text {
  min-width: 0;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: #0f172a;
  white-space: nowrap;
}

.runtime-progress-bar {
  width: 100%;
  height: 0.375rem;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.95);
  overflow: hidden;
}

.runtime-progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #2563eb 0%, #38bdf8 100%);
}

.runtime-progress-fill--level {
  width: 28%;
}

.runtime-progress-fill--auth {
  width: 56%;
}

.runtime-progress-fill--profile {
  width: 82%;
}

.runtime-flow-card__head {
  text-align: center;
  padding: 0.5rem 1.25rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
}

.runtime-flow-card__head--flush {
  padding-top: 0.2rem;
}

.runtime-flow-card__title {
  margin: 0;
  font-size: clamp(1.25rem, 4.5vw, 1.45rem);
  font-weight: 800;
  color: #0f172a;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

.runtime-flow-card__lead {
  margin: 0.5rem 0 0;
  font-size: 0.875rem;
  color: #64748b;
  line-height: 1.5;
}

.runtime-flow-card__lead--center {
  text-align: center;
}

.runtime-flow-card__body {
  padding: 1.125rem 1.125rem 1.35rem;
}

@media (min-width: 28rem) {
  .runtime-flow-card__body {
    padding: 1.25rem 1.25rem 1.5rem;
  }
}

.runtime-flow-block {
  margin-bottom: 1.75rem;
}

.runtime-flow-block:last-of-type {
  margin-bottom: 0;
}

.runtime-flow-block__label {
  display: block;
  font-size: 0.6875rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  margin: 0 0 0.35rem;
}

.runtime-flow-block__hint {
  font-size: 0.8125rem;
  color: #64748b;
  margin: 0 0 1rem;
  line-height: 1.45;
}

.runtime-flow-field {
  margin-bottom: 1rem;
}

.runtime-flow-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #334155;
  margin-bottom: 0.35rem;
}

.runtime-flow-field input,
.runtime-flow-field select,
.runtime-flow-field textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 2.875rem;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #0f172a;
}

.runtime-flow-field input::placeholder,
.runtime-flow-field textarea::placeholder {
  color: #94a3b8;
}

.runtime-flow-field input:focus,
.runtime-flow-field select:focus,
.runtime-flow-field textarea:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  background: #fff;
}

/* Champs / boutons formulaires Django (.runtime-field, signup, login, etc.) */
.runtime-field {
  margin-bottom: 1rem;
}

.runtime-field label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #334155;
  margin-bottom: 0.35rem;
}

.runtime-field input,
.runtime-field select,
.runtime-field textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 2.875rem;
  padding: 0.65rem 0.85rem;
  font-size: 1rem;
  border: 1px solid #cbd5e1;
  border-radius: 0.75rem;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  color: #0f172a;
}

.runtime-field input:focus,
.runtime-field select:focus,
.runtime-field textarea:focus {
  outline: none;
  border-color: #10b981;
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
  background: #fff;
}

.runtime-field__error {
  margin: 0.35rem 0 0;
  font-size: 0.8125rem;
  color: #b91c1c;
}

.runtime-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.25rem;
}

.runtime-btn {
  display: block;
  width: 100%;
  text-align: center;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 0.875rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.06s ease, box-shadow 0.15s ease;
}

.runtime-btn:active {
  transform: scale(0.99);
}

.runtime-btn--primary {
  background: linear-gradient(180deg, #059669 0%, #047857 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

.runtime-btn--primary:hover {
  background: linear-gradient(180deg, #047857 0%, #065f46 100%);
}

.runtime-btn--ghost {
  background: #fff;
  color: #475569;
  border: 1px solid #e2e8f0;
  font-weight: 600;
}

.runtime-btn--ghost:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.runtime-alert {
  font-size: 0.8125rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  margin-bottom: 1rem;
}

.runtime-alert--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.runtime-flow-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 1.25rem;
}

.runtime-flow-actions--tight {
  margin-top: 0;
}

.runtime-flow-btn {
  display: block;
  width: 100%;
  text-align: center;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 0.875rem;
  border: none;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
  font-family: inherit;
  transition: background 0.15s ease, transform 0.06s ease, box-shadow 0.15s ease;
}

.runtime-flow-btn:active {
  transform: scale(0.99);
}

.runtime-flow-btn--primary {
  background: linear-gradient(180deg, #059669 0%, #047857 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(5, 150, 105, 0.35);
}

.runtime-flow-btn--primary:hover {
  background: linear-gradient(180deg, #047857 0%, #065f46 100%);
}

.runtime-flow-btn--blue {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.runtime-flow-btn--blue:hover {
  filter: brightness(1.06);
}

.runtime-flow-btn--ghost {
  background: #fff;
  color: #475569;
  border: 1px solid #e2e8f0;
  font-weight: 600;
}

.runtime-flow-btn--ghost:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
}

.runtime-flow-btn--skip {
  background: transparent;
  color: #94a3b8;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.5rem 0.75rem;
  border: 1px solid transparent;
}

.runtime-flow-btn--skip:hover {
  color: #64748b;
  border-color: #e2e8f0;
  background: #fafafa;
}

.runtime-flow-btn--filter {
  display: inline-block;
  width: auto;
  margin-left: auto;
  padding: 0.5rem 0.85rem;
  font-size: 0.8125rem;
  font-weight: 600;
  color: #475569;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.75rem;
  cursor: pointer;
  font-family: inherit;
}

.runtime-flow-btn--filter:hover {
  background: #f8fafc;
  color: #334155;
}

.runtime-flow-filter-row {
  display: flex;
  justify-content: stretch;
  margin-top: 0.25rem;
}

.runtime-flow-filter-row .runtime-flow-btn--filter {
  width: 100%;
  margin-left: 0;
}

.runtime-flow-alert {
  font-size: 0.8125rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  margin-top: 0.75rem;
}

.runtime-flow-alert--warn {
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: #92400e;
}

.runtime-flow-alert--error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
}

.runtime-flow-divider {
  margin: 1.5rem 0 0;
  padding-top: 1.5rem;
  border-top: 1px solid #f1f5f9;
}

.runtime-flow-field--flush {
  margin-top: 0;
}

.runtime-flow-stack-sm {
  margin-top: 0.75rem;
}

.runtime-no-scrollbar::-webkit-scrollbar {
  display: none;
}

.runtime-no-scrollbar {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.runtime-bottom-nav {
  height: 4.25rem;
  display: flex;
  align-items: center;
  justify-content: space-around;
  gap: 0.5rem;
  background: rgba(255, 255, 255, 0.98);
  border-top: 1px solid #e2e8f0;
  box-shadow: 0 -4px 18px rgba(15, 23, 42, 0.04);
  z-index: 30;
}

.runtime-bottom-nav--shell {
  flex: 0 0 auto;
  padding: 0 0.5rem max(0.4rem, env(safe-area-inset-bottom));
}

.runtime-bottom-nav--floating {
  position: fixed;
  left: 50%;
  bottom: max(0.75rem, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: min(26rem, calc(100vw - 1.5rem));
  border: 1px solid rgba(226, 232, 240, 0.95);
  border-radius: 1.25rem;
  padding: 0 0.5rem;
}

.runtime-bottom-nav-item {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
  min-height: 100%;
  text-decoration: none;
  color: #94a3b8;
}

.runtime-bottom-nav-item__icon {
  width: 1.6rem;
  height: 1.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.runtime-bottom-nav-item__icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.runtime-bottom-nav-item__label {
  font-size: 0.64rem;
  font-weight: 800;
  line-height: 1;
}

.runtime-bottom-nav-item.active {
  color: #2563eb;
}

.runtime-bottom-nav-item:not(.active):hover {
  color: #64748b;
}

/* Menu « Matières » : uniquement les matières suivies (pas choose_subjects) */
.runtime-bottom-nav-dropdown {
  flex: 1 1 0;
  min-width: 0;
  position: relative;
  display: flex;
  justify-content: center;
}

.runtime-bottom-nav-dropdown__trigger {
  list-style: none;
  cursor: pointer;
  width: 100%;
}

.runtime-bottom-nav-dropdown__trigger::-webkit-details-marker {
  display: none;
}

.runtime-bottom-nav-dropdown__panel {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 12rem;
  max-width: min(18rem, 92vw);
  padding: 0.35rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  box-shadow: 0 -8px 28px rgba(15, 23, 42, 0.12);
  z-index: 60;
}

.runtime-bottom-nav-dropdown__option {
  display: block;
  padding: 0.55rem 0.65rem;
  border-radius: 0.55rem;
  font-size: 0.85rem;
  font-weight: 700;
  color: #0f172a;
  text-decoration: none;
}

.runtime-bottom-nav-dropdown__option:hover {
  background: #f1f5f9;
}

.runtime-bottom-nav-dropdown__option.is-active {
  background: #eff6ff;
  color: #1d4ed8;
}

.runtime-bottom-nav-spacer {
  flex: 1 1 0;
  min-width: 0;
}

.hidden {
  display: none !important;
}

/* Ecrans runtime ouverts depuis les tuiles : shell mobile commun */
.runtime-mobile-app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem;
  box-sizing: border-box;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.16), transparent 30rem),
    #071120;
}

.runtime-mobile-shell {
  width: 100%;
  max-width: 26.5rem;
  height: min(46rem, 95dvh);
  background: #f8fafc;
  border-radius: 2.25rem;
  border: 0.5rem solid #1f2937;
  box-shadow: 0 24px 48px -28px rgba(15, 23, 42, 0.62);
  overflow: hidden;
}

.runtime-mobile-screen {
  height: 100%;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.runtime-mobile-header {
  padding: 1rem 1.15rem 0.95rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 1) 100%);
  border-bottom: 1px solid #e2e8f0;
}

.runtime-mobile-header__top {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.runtime-mobile-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.25rem;
  min-height: 2.25rem;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 0.75rem;
  font-weight: 800;
  color: #334155;
  background: #ffffff;
  border: 1px solid #dbeafe;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.05);
}

.runtime-mobile-back:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.runtime-mobile-header__copy {
  min-width: 0;
  flex: 1 1 auto;
}

.runtime-mobile-header__eyebrow {
  margin: 0 0 0.2rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #94a3b8;
}

.runtime-mobile-header__title {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 900;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #0f172a;
}

.runtime-mobile-header__subtitle {
  margin: 0.2rem 0 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: #64748b;
}

.runtime-mobile-body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 1rem;
  background: #f8fafc;
}

.runtime-mobile-body--scroll {
  overflow-y: auto;
}

.runtime-mobile-body--flush {
  padding: 0;
}

.runtime-mobile-panel {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1.35rem;
  box-shadow: 0 12px 24px -22px rgba(15, 23, 42, 0.18);
  padding: 1rem;
}

.runtime-mobile-panel--prose {
  padding: 1rem 1rem 1.2rem;
}

.runtime-mobile-empty {
  background: #ffffff;
  border: 1px dashed #cbd5e1;
  border-radius: 1.25rem;
  padding: 1.5rem 1.25rem;
  color: #64748b;
}

.runtime-flow--with-nav {
  padding-bottom: calc(max(5.5rem, env(safe-area-inset-bottom) + 4.75rem));
}

.runtime-mobile-footer {
  padding: 0 1rem 1rem;
}

.runtime-mobile-footer .runtime__back {
  margin: 0;
  padding: 0;
  border-top: 0;
}

.runtime-validate-header {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 0.85rem;
  padding: 0.95rem 1rem 0.85rem;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 1) 100%);
  border-bottom: 1px solid #e2e8f0;
}

.runtime-validate-header__close {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 999px;
  text-decoration: none;
  font-size: 2rem;
  line-height: 1;
  color: #94a3b8;
  background: #ffffff;
  border: 1px solid #e2e8f0;
}

.runtime-validate-header__close:hover {
  color: #475569;
  background: #f8fafc;
}

.runtime-validate-header__progress-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.runtime-validate-progress-track {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.runtime-validate-progress-segment {
  flex: 1 1 0;
  height: 0.85rem;
  border-radius: 999px;
  background: #d1d5db;
  transition: background-color 0.18s ease, transform 0.18s ease;
}

.runtime-validate-progress-segment.is-done {
  background: #22c55e;
}

.runtime-validate-progress-segment.is-bad {
  background: #ef4444;
}

.runtime-validate-progress-segment.is-current {
  background: #3b82f6;
  transform: scaleY(1.05);
}

.runtime-validate-header__hearts {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  min-width: 3.5rem;
  justify-content: flex-end;
}

.runtime-validate-header__hearts-count {
  font-size: 0.95rem;
  font-weight: 900;
  color: #ef4444;
}

.runtime-validate-header__hearts-icon {
  font-size: 1.35rem;
  line-height: 1;
  color: #ef4444;
}

/* Cours / exercice */
.runtime-mobile-panel .runtime__header,
.runtime-mobile-panel .runtime__breadcrumb,
.runtime-mobile-panel .runtime__subtitle {
  margin: 0;
}

/* QCM */
.runtime-qcm-app {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
}

.runtime-qcm-progress-head {
  padding: 0.9rem 1rem 0.8rem;
  background: #ffffff;
  border-bottom: 1px solid #e2e8f0;
}

.runtime-qcm-progress-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.runtime-qcm-progress-label,
.runtime-qcm-progress-counter {
  font-size: 0.75rem;
  font-weight: 700;
  color: #64748b;
}

#qcm-progress-container {
  display: flex;
  gap: 0.3rem;
  min-height: 0.55rem;
}

.qcm-seg {
  flex: 1 1 0;
  min-height: 0.55rem;
  border-radius: 999px;
  background: #e2e8f0;
  transition: background-color 0.2s ease;
}

.runtime-qcm-stage {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 1rem;
}

.qcm-card {
  min-height: 100%;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 1.25rem;
  padding: 1rem;
  box-sizing: border-box;
}

.runtime-qcm-media-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.qcm-image {
  display: block;
  width: 100%;
  border-radius: 0.85rem;
  box-shadow: 0 8px 18px -16px rgba(15, 23, 42, 0.22);
  cursor: pointer;
}

.qcm-options {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.qcm-opt {
  width: 100%;
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 0.95rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #0f172a;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.runtime-qcm-controls {
  padding: 1rem;
  background: #ffffff;
  border-top: 1px solid #e2e8f0;
}

.runtime-qcm-action-row {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.runtime-qcm-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 0.95rem;
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
}

.runtime-qcm-action-btn:hover {
  filter: brightness(1.04);
}

.runtime-qcm-explanation-box {
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
}

.runtime-qcm-end-popup {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(15, 23, 42, 0.5);
  z-index: 9999;
}

.runtime-qcm-end-card {
  width: min(100%, 22rem);
  background: #ffffff;
  border-radius: 1.25rem;
  padding: 1.5rem 1.25rem;
  text-align: center;
  box-shadow: 0 24px 48px -28px rgba(15, 23, 42, 0.32);
}

.runtime-qcm-end-card__emoji {
  font-size: 3rem;
  line-height: 1;
  margin-bottom: 0.75rem;
}

.runtime-qcm-end-card__title {
  margin: 0 0 0.35rem;
  font-size: 1.4rem;
  font-weight: 900;
  color: #0f172a;
}

.runtime-qcm-end-card__score {
  margin: 0 0 1rem;
  font-size: 1rem;
  color: #475569;
}

.runtime-qcm-end-card__score span {
  font-weight: 900;
  color: #2563eb;
}

/* Validation */
.runtime-validate-app {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.tile-validate-progress {
  margin: 0 0 0.5rem;
  font-size: 0.85rem;
  color: #64748b;
}

.tile-validate-question-card {
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 1rem;
  margin-bottom: 1rem;
}

.tile-validate-question-title {
  font-size: 1.05rem;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 0.5rem;
  white-space: pre-wrap;
}

.tile-validate-question-image {
  max-width: 100%;
  border-radius: 0.75rem;
}

.tile-validate-choices {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tile-validate-choice--interactive {
  width: 100%;
  box-sizing: border-box;
  text-align: left;
  padding: 0.85rem 1rem;
  border-radius: 0.95rem;
  border: 2px solid #e2e8f0;
  background: #ffffff;
  font-size: 0.95rem;
  font-weight: 600;
}

.tile-validate-choice--blank,
.tile-validate-inline-choice,
.tile-validate-drag-item {
  width: 100%;
  box-sizing: border-box;
  padding: 0.85rem 1rem;
  border-radius: 0.95rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #0f172a;
}

.tile-validate-choice-stack,
.tile-validate-column__list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.tile-validate-gap-label,
.tile-validate-column__title {
  margin: 0 0 0.45rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #334155;
}

.tile-validate-grid {
  display: grid;
  gap: 0.75rem;
}

.tile-validate-column {
  padding: 0.9rem;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  min-height: 7.5rem;
}

.tile-validate-inline-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.tile-validate-inline-btn {
  padding: 0.7rem 0.8rem;
  border-radius: 0.8rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  color: #475569;
  cursor: pointer;
}

.tile-validate-drop-placeholder,
.tile-validate-content-text {
  color: #64748b;
  line-height: 1.6;
  white-space: pre-wrap;
}

.tile-validate-feedback {
  margin-top: 1rem;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  padding: 1rem;
}

.tile-validate-actions {
  margin-top: 1rem;
  display: flex;
  gap: 0.75rem;
}

.tile-validate-btn {
  min-height: 3rem;
  padding: 0.8rem 1rem;
  border: none;
  border-radius: 0.95rem;
  font-size: 0.9rem;
  font-weight: 800;
  color: #ffffff;
  cursor: pointer;
}

.tile-validate-btn--next {
  background: linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
}

.tile-validate-btn--verify {
  background: linear-gradient(180deg, #059669 0%, #047857 100%);
}

.tile-validate-result-title {
  margin: 0 0 1rem;
  font-size: 1.2rem;
  font-weight: 900;
  color: #0f172a;
}

.tile-validate-result-score {
  margin: 0 0 0.4rem;
  font-size: 1.5rem;
  font-weight: 900;
  color: #2563eb;
}

.tile-validate-result-points,
.tile-validate-result-gain {
  margin: 0 0 0.3rem;
}

.tile-validate-result-unlocks {
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  padding: 1rem;
  margin-bottom: 1rem;
  background: #f8fafc;
}

.tile-validate-guest-cta {
  margin-bottom: 1rem;
}

.tile-validate-guest-cta-link,
.tile-validate-back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.8rem 1rem;
  border-radius: 0.95rem;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: none;
}

.tile-validate-guest-cta-link {
  background: linear-gradient(180deg, #059669 0%, #047857 100%);
  color: #ffffff;
}

.tile-validate-back-link {
  background: #0f172a;
  color: #ffffff;
}

.border-emerald-200 { border-color: #a7f3d0 !important; }
.bg-emerald-50 { background: #ecfdf5 !important; }
.border-rose-200 { border-color: #fecdd3 !important; }
.bg-rose-50 { background: #fff1f2 !important; }
.border-slate-200 { border-color: #e2e8f0 !important; }
.bg-white { background: #ffffff !important; }

@media (min-width: 28rem) {
  .runtime-qcm-media-layout {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    align-items: start;
  }

  .runtime-qcm-action-row {
    flex-direction: row;
    align-items: flex-start;
  }

  .runtime-qcm-action-row > :first-child {
    flex: 0 0 auto;
  }

  .runtime-qcm-action-row > :last-child {
    flex: 1 1 auto;
  }
}

@media (max-width: 28rem) {
  .runtime-validate-header {
    padding: 0.85rem 0.9rem 0.8rem;
    gap: 0.7rem;
  }

  .runtime-validate-header__close {
    width: 2.3rem;
    height: 2.3rem;
    font-size: 1.8rem;
  }

  .runtime-validate-progress-track {
    gap: 0.35rem;
  }

  .runtime-validate-progress-segment {
    height: 0.75rem;
  }

  .runtime-validate-header__hearts-count {
    font-size: 0.9rem;
  }
}

/* Hub eleve — coeur d'application mobile, sans navigation basse */
.runtime-hub-app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem;
  box-sizing: border-box;
  overflow-x: hidden;
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.18), transparent 30rem),
    #071120;
}

.runtime-hub-shell {
  width: 100%;
  max-width: 24.375rem;
  min-height: calc(100dvh - 1.75rem);
  background: #f8fafc;
  border-radius: 2.5rem;
  border: 0.5rem solid #1f2937;
  box-shadow: 0 24px 48px -28px rgba(15, 23, 42, 0.62);
  overflow: hidden;
}

.runtime-hub-screen {
  min-height: calc(100dvh - 1.75rem);
  display: flex;
  flex-direction: column;
  font-family: "Avenir Next Rounded", "Nunito Sans", "Trebuchet MS", "Segoe UI", system-ui, sans-serif;
}

.runtime-hub-header {
  padding: 2.3rem 1.5rem 1rem;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(248, 250, 252, 1) 100%);
  border-bottom: 2px solid #f1f5f9;
}

.runtime-hub-header__top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.runtime-hub-header__copy {
  min-width: 0;
}

.runtime-hub-header__context {
  margin: 0 0 0.28rem;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: #94a3b8;
}

.runtime-hub-header__title {
  margin: 0;
  font-size: 2.25rem;
  font-weight: 900;
  letter-spacing: -0.05em;
  line-height: 1.02;
  color: #0f172a;
}

.runtime-hub-profile {
  width: 3.15rem;
  height: 3.15rem;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.18rem;
  background: conic-gradient(from 220deg, #3b82f6 0deg 126deg, #e2e8f0 126deg 360deg);
  color: #2563eb;
  box-shadow: 0 6px 16px -16px rgba(37, 99, 235, 0.45);
}

.runtime-hub-profile:hover {
  transform: translateY(-1px);
}

.runtime-hub-profile__inner {
  width: 100%;
  height: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 2px solid rgba(226, 232, 240, 0.95);
}

.runtime-hub-profile svg {
  width: 1.25rem;
  height: 1.25rem;
}

.runtime-hub-chips {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
}

.runtime-hub-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.3rem;
  padding: 0.52rem 1.15rem;
  border-radius: 999px;
  background: #ffffff;
  border: 2px solid #e5e7eb;
  color: #64748b;
  font-size: 0.82rem;
  font-weight: 900;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: 0 2px 0 #e5e7eb;
}

.runtime-hub-chip:hover {
  border-color: #93c5fd;
  color: #1e293b;
}

.runtime-hub-chip.is-active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
  box-shadow: 0 3px 0 #000000;
}

.runtime-hub-body {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 1rem 1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: #f8fafc;
}

.runtime-hub-current-card {
  position: relative;
  padding: 1.25rem 1rem 1rem;
  border-radius: 1.7rem;
  background: #ffffff;
  border: 2px solid #3b82f6;
  box-shadow:
    0 8px 0 #1cb0f6,
    0 16px 24px -24px rgba(37, 99, 235, 0.25);
}

@keyframes runtime-hub-border-pulse {
  0% { border-color: rgba(59, 130, 246, 0.55); box-shadow: 0 8px 0 #1cb0f6, 0 0 0 0 rgba(59, 130, 246, 0.18); }
  50% { border-color: rgba(59, 130, 246, 1); box-shadow: 0 8px 0 #1cb0f6, 0 0 0 6px rgba(59, 130, 246, 0.08); }
  100% { border-color: rgba(59, 130, 246, 0.55); box-shadow: 0 8px 0 #1cb0f6, 0 0 0 0 rgba(59, 130, 246, 0.18); }
}

.runtime-hub-current-card--active {
  animation: runtime-hub-border-pulse 2.2s ease-in-out infinite;
}

.runtime-hub-current-card__top {
  display: flex;
  align-items: flex-start;
  gap: 0.95rem;
}

.runtime-hub-current-card__icon {
  position: relative;
  width: 3.95rem;
  height: 3.95rem;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1.1rem;
  background:
    linear-gradient(180deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.35),
    0 4px 0 #1d4ed8,
    0 12px 16px -16px rgba(37, 99, 235, 0.6);
}

.runtime-hub-current-card__icon svg {
  width: 1.8rem;
  height: 1.8rem;
  margin-left: 0.1rem;
}

.runtime-hub-current-card__copy {
  min-width: 0;
  flex: 1 1 auto;
}

.runtime-hub-current-card__badge {
  display: inline-flex;
  align-items: center;
  padding: 0.28rem 0.62rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #3b82f6;
  font-size: 0.6875rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.runtime-hub-current-card__title {
  margin: 0.15rem 0 0;
  font-size: 1.85rem;
  font-weight: 900;
  letter-spacing: -0.045em;
  line-height: 1.05;
  color: #0f172a;
}

.runtime-hub-current-card__meta {
  margin-top: 1.1rem;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
}

.runtime-hub-current-card__meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.runtime-hub-current-card__steps {
  display: block;
  margin-bottom: 0;
  font-size: 0.95rem;
  font-weight: 800;
  color: #2563eb;
}

.runtime-hub-current-card__meta-label {
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  white-space: nowrap;
}

.runtime-hub-progress {
  width: 100%;
  height: 0.65rem;
  appearance: none;
  border: none;
  border-radius: 999px;
  overflow: hidden;
  background: #e2e8f0;
  box-shadow: inset 0 1px 2px rgba(148, 163, 184, 0.14);
}

.runtime-hub-progress::-webkit-progress-bar {
  background: #e8eef8;
}

.runtime-hub-progress::-webkit-progress-value {
  border-radius: 999px;
  background: #3b82f6;
}

.runtime-hub-progress::-moz-progress-bar {
  border-radius: 999px;
  background: #3b82f6;
}

.runtime-hub-current-card__cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 0.95rem;
  padding: 1.02rem 1rem 1.05rem;
  box-sizing: border-box;
  border-radius: 999px;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  font-size: 0.95rem;
  font-weight: 900;
  color: #ffffff;
  background: linear-gradient(180deg, #58cc02 0%, #46a302 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 6px 0 #46a302,
    0 12px 16px -16px rgba(70, 163, 2, 0.45);
}

.runtime-hub-current-card__cta:hover {
  background: linear-gradient(180deg, #61da04 0%, #4cad03 100%);
}

.runtime-hub-section__head {
  margin-bottom: 0.75rem;
}

.runtime-hub-section__title {
  margin: 0;
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #94a3b8;
}

.runtime-hub-group + .runtime-hub-group {
  margin-top: 1rem;
}

.runtime-hub-group__title {
  margin: 0 0 0.55rem;
  font-size: 0.68rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: #94a3b8;
}

.runtime-hub-list {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
}

.runtime-hub-chapter-card {
  display: flex;
  align-items: center;
  gap: 0.875rem;
  padding: 0.95rem 0.95rem;
  border-radius: 1.5rem;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow:
    0 6px 0 #e5e7eb,
    0 12px 22px -22px rgba(15, 23, 42, 0.28);
  text-decoration: none;
}

.runtime-hub-chapter-card:hover {
  border-color: #bfdbfe;
  transform: translateY(-1px);
  box-shadow: 0 14px 24px -20px rgba(37, 99, 235, 0.24);
}

.runtime-hub-chapter-card__index {
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  background: linear-gradient(180deg, #fff2de 0%, #ffedd5 100%);
  color: #fb923c;
  font-size: 0.875rem;
  font-weight: 800;
}

.runtime-hub-chapter-card__eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 700;
  color: #94a3b8;
}

.runtime-hub-chapter-card__copy {
  min-width: 0;
  flex: 1 1 auto;
}

.runtime-hub-chapter-card__title {
  margin: 0;
  font-size: 0.96rem;
  font-weight: 800;
  line-height: 1.25;
  color: #0f172a;
}

.runtime-hub-chapter-card__meta {
  margin: 0.2rem 0 0;
  font-size: 0.8125rem;
  color: #64748b;
}

.runtime-hub-chapter-card__status {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.48rem 0.78rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 800;
  white-space: nowrap;
}

.runtime-hub-chapter-card__status--available {
  background: #ffffff;
  border: 2px solid #e2e8f0;
  color: #94a3b8;
  box-shadow: 0 2px 0 #f1f5f9;
}

.runtime-hub-empty {
  padding: 1.5rem 1.25rem;
  border-radius: 1.15rem;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  text-align: center;
  font-size: 0.9375rem;
  color: #64748b;
}

/* Shell « app » hub / chapitres / tuiles — même largeur max, bordure légère */
.runtime-flow-shell {
  width: 100%;
  max-width: 30rem;
  min-height: min(600px, 90vh);
  margin: 0 auto;
  background: #f8fafc;
  border-radius: 1.5rem;
  box-shadow: 0 25px 50px -12px rgba(15, 23, 42, 0.35);
  border: 1px solid rgba(148, 163, 184, 0.45);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.runtime-flow-shell--tall {
  min-height: min(640px, 92vh);
}

.runtime-flow-shell--tiles {
  min-height: min(600px, 90vh);
}

.runtime-flow-hero-icon {
  width: 5rem;
  height: 5rem;
  border-radius: 9999px;
  background: linear-gradient(145deg, #3b82f6 0%, #2563eb 45%, #1d4ed8 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.25rem;
  box-shadow:
    0 0 0 3px rgba(59, 130, 246, 0.25),
    0 12px 28px rgba(37, 99, 235, 0.45);
}

.runtime-flow-hero-icon svg {
  width: 2.5rem;
  height: 2.5rem;
  color: #fff;
}

/* Ecran d'entree runtime/start/ - plein ecran mobile, vivant sans surcharge */
.runtime-start-flow {
  min-height: 100dvh;
  height: 100dvh;
  padding:
    max(0.875rem, env(safe-area-inset-top))
    0.875rem
    max(1rem, env(safe-area-inset-bottom));
  box-sizing: border-box;
  overflow-x: hidden;
  overflow-y: hidden;
  background:
    radial-gradient(circle at top, rgba(59, 130, 246, 0.18), transparent 28rem),
    radial-gradient(circle at 50% 120%, rgba(34, 197, 94, 0.08), transparent 24rem),
    #071120;
}

.runtime-start-shell {
  width: 100%;
  max-width: 26.5rem;
  height: 100%;
}

.runtime-start-card {
  min-height: 100%;
  height: 100%;
  border-radius: 1.75rem;
  overflow: hidden;
  box-shadow: 0 18px 36px -28px rgba(15, 23, 42, 0.55);
}

.runtime-start-layout {
  min-height: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.125rem 1rem 1rem;
  box-sizing: border-box;
}

.runtime-start-top {
  display: flex;
  justify-content: center;
  padding-top: 0.125rem;
}

.runtime-start-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.runtime-start-orb {
  width: 4.25rem;
  height: 4.25rem;
  border-radius: 999px;
  display: grid;
  place-items: center;
  font-size: 1.85rem;
  background:
    radial-gradient(circle at 30% 30%, #fef9c3 0%, #fde68a 28%, #f59e0b 62%, #ea580c 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.65),
    0 10px 20px -16px rgba(234, 88, 12, 0.45);
}

.runtime-start-kicker {
  margin: 0 0 0.875rem;
  font-size: 0.8125rem;
  font-weight: 700;
  line-height: 1.5;
  color: #2563eb;
}

.runtime-start-title {
  margin: 0;
  max-width: 18rem;
  font-size: clamp(1.85rem, 8vw, 2.45rem);
  line-height: 1.14;
}

.runtime-start-description {
  margin: 0.875rem auto 0;
  max-width: 18.5rem;
  font-size: 0.9375rem;
  line-height: 1.5;
  color: #475569;
}

.runtime-start-bottom {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.runtime-start-actions {
  margin-top: 0;
  gap: 0.75rem;
}

.runtime-start-primary {
  padding: 0.975rem 1.125rem;
  font-size: 1rem;
  border-radius: 0.95rem;
  box-shadow: 0 14px 24px -16px rgba(37, 99, 235, 0.5);
}

.runtime-start-secondary {
  background: #ffffff;
  color: #475569;
  border-color: #dbeafe;
  box-shadow: none;
}

.runtime-start-secondary:hover {
  background: #f8fafc;
  border-color: #bfdbfe;
}

.runtime-start-badges {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0;
}

.runtime-start-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 4rem;
  padding: 0.4375rem 0.75rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.68);
  border: 1px solid rgba(37, 99, 235, 0.12);
  font-size: 0.75rem;
  font-weight: 700;
  color: #1e3a8a;
}

.runtime-flow-readonly-label {
  display: block;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #334155;
  margin-bottom: 0.35rem;
}

.runtime-flow-readonly-value {
  margin: 0;
  font-size: 0.9375rem;
  color: #0f172a;
  font-weight: 600;
}

.runtime-flow-readonly-value--muted {
  color: #94a3b8;
  font-weight: 500;
}

@media (max-width: 28rem) {
  .runtime-hub-app {
    padding: 0;
  }

  .runtime-hub-shell {
    max-width: none;
    min-height: 100dvh;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }

  .runtime-hub-screen {
    min-height: 100dvh;
  }

  .runtime-hub-header {
    padding: 0.95rem 0.9rem 0.82rem;
  }

  .runtime-hub-header__title {
    font-size: 1.9rem;
  }

  .runtime-hub-body {
    padding: 0.9rem;
  }

  .runtime-hub-current-card {
    padding: 0.9rem;
  }

  .runtime-hub-current-card__title {
    font-size: 1.55rem;
  }

  .runtime-hub-current-card__meta-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.2rem;
  }

  .runtime-hub-chapter-card {
    padding: 0.85rem 0.9rem;
  }

  .runtime-hub-profile {
    width: 2.9rem;
    height: 2.9rem;
  }

  .runtime-hub-chapter-card__status {
    padding: 0.4rem 0.65rem;
    font-size: 0.6875rem;
  }

  .runtime-progress-header {
    gap: 0.625rem;
    margin-bottom: 0.875rem;
  }

  .runtime-progress-back {
    padding: 0.3rem 0.55rem;
    font-size: 0.6875rem;
  }

  .runtime-progress-brand__text {
    font-size: 0.75rem;
  }

  .runtime-start-flow {
    padding:
      max(0.75rem, env(safe-area-inset-top))
      0.75rem
      max(0.875rem, env(safe-area-inset-bottom));
  }

  .runtime-start-layout {
    padding: 1rem 0.875rem 0.875rem;
    gap: 0.875rem;
  }

  .runtime-start-orb {
    width: 3.9rem;
    height: 3.9rem;
    font-size: 1.7rem;
  }

  .runtime-start-title {
    font-size: clamp(1.65rem, 7.2vw, 2rem);
    max-width: 16.5rem;
  }

  .runtime-start-description {
    max-width: 17rem;
    font-size: 0.875rem;
  }

  .runtime-start-primary,
  .runtime-start-secondary {
    padding-top: 0.875rem;
    padding-bottom: 0.875rem;
    font-size: 0.95rem;
  }

  .runtime-flow-card__body {
    padding: 1rem 1rem 1.25rem;
  }
}

/* -------------------------------------------------------------------------- */
/* Profil élève V1 (runtime)                                                   */
/* -------------------------------------------------------------------------- */

.runtime-profile {
  min-height: 100dvh;
  background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
  padding: 0 0 5.5rem;
  box-sizing: border-box;
}

.runtime-profile__shell {
  max-width: 26.5rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 0;
}

.runtime-profile__header {
  margin-bottom: 1.25rem;
}

.runtime-profile__title {
  margin: 0 0 0.35rem;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.runtime-profile__lead {
  margin: 0;
  font-size: 0.9rem;
  color: #64748b;
  line-height: 1.45;
}

.runtime-profile__card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  padding: 1rem 1.1rem;
  margin-bottom: 0.85rem;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.runtime-profile__card--muted {
  background: #fafafa;
  border-style: dashed;
}

.runtime-profile__card-title {
  margin: 0 0 0.75rem;
  font-size: 0.8125rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
}

.runtime-profile__dl {
  margin: 0;
}

.runtime-profile__row {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.35rem 1rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 0.9375rem;
}

.runtime-profile__row:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.runtime-profile__row dt {
  margin: 0;
  color: #64748b;
  font-weight: 600;
}

.runtime-profile__row dd {
  margin: 0;
  text-align: right;
  color: #0f172a;
  font-weight: 600;
  max-width: 65%;
}

.runtime-profile__stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
}

.runtime-profile__stat {
  background: #f8fafc;
  border-radius: 0.75rem;
  padding: 0.65rem 0.5rem;
  text-align: center;
  border: 1px solid #e2e8f0;
}

.runtime-profile__stat-value {
  display: block;
  font-size: 1.35rem;
  font-weight: 800;
  color: #1d4ed8;
  line-height: 1.2;
}

.runtime-profile__stat-label {
  display: block;
  margin-top: 0.2rem;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #64748b;
}

.runtime-profile__hint {
  margin: 0.75rem 0 0;
  font-size: 0.75rem;
  color: #94a3b8;
  line-height: 1.4;
}

.runtime-profile__muted {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: #64748b;
}

.runtime-profile__tags {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.runtime-profile__tag {
  display: inline-block;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  font-size: 0.8125rem;
  font-weight: 700;
}

.runtime-profile__actions {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.runtime-profile__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.85rem 1rem;
  border-radius: 0.85rem;
  font-size: 0.95rem;
  font-weight: 800;
  text-decoration: none;
  text-align: center;
}

.runtime-profile__btn--primary {
  background: #2563eb;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
}

.runtime-profile__btn--primary:hover {
  background: #1d4ed8;
}

.runtime-profile__more-list {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
  font-size: 0.875rem;
  color: #64748b;
}

.runtime-profile__more-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #e2e8f0;
}

.runtime-profile__more-list li:last-child {
  border-bottom: none;
}

.runtime-profile__more-placeholder {
  color: #94a3b8;
}

.runtime-profile__badge {
  font-size: 0.65rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  background: #f1f5f9;
  padding: 0.15rem 0.45rem;
  border-radius: 999px;
}

.runtime-profile__secondary {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  align-items: flex-start;
}

.runtime-profile__link {
  font-size: 0.875rem;
  font-weight: 700;
  color: #2563eb;
  text-decoration: none;
}

.runtime-profile__link:hover {
  text-decoration: underline;
}

.runtime-profile__logout {
  margin: 0;
}

.runtime-profile__link-btn {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 600;
  color: #64748b;
  cursor: pointer;
  text-decoration: underline;
}

.runtime-profile__link-btn:hover {
  color: #0f172a;
}

/* -------------------------------------------------------------------------- */
/* Runtime : plein écran sur vrai mobile (pas de cadre « téléphone dans téléphone ») */
/* >768px : preview centrée inchangée */
/* -------------------------------------------------------------------------- */

@media (max-width: 768px) {
  .runtime-hub-app {
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    min-height: 100dvh;
    background: #f8fafc;
  }

  .runtime-hub-shell {
    width: 100%;
    max-width: none;
    min-height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .runtime-hub-screen {
    min-height: 100dvh;
  }

  .runtime-mobile-app {
    align-items: stretch;
    justify-content: flex-start;
    padding: 0;
    min-height: 100dvh;
    background: #f8fafc;
  }

  .runtime-mobile-shell {
    width: 100%;
    max-width: none;
    height: auto;
    min-height: 100dvh;
    border-radius: 0;
    border: none;
    box-shadow: none;
  }

  .runtime-course-shell {
    max-width: none !important;
    height: auto !important;
    min-height: 100dvh !important;
  }

  .runtime-device-root {
    min-height: 100dvh !important;
    padding: 0 !important;
    align-items: stretch !important;
    justify-content: flex-start !important;
    background: #f8fafc !important;
  }

  .runtime-device-inner {
    width: 100% !important;
    max-width: none !important;
    min-height: 100dvh !important;
    border-radius: 0 !important;
    border-width: 0 !important;
    border-color: transparent !important;
    box-shadow: none !important;
  }

  .runtime-profile__shell {
    max-width: none;
    margin: 0;
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
  }

  .runtime-profile {
    padding-bottom: max(5.5rem, env(safe-area-inset-bottom));
  }

  .runtime-bottom-nav--floating {
    left: 0;
    right: 0;
    bottom: 0;
    transform: none;
    width: 100%;
    max-width: none;
    margin: 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
    padding-bottom: max(0.4rem, env(safe-area-inset-bottom));
  }
}

/* -------------------------------------------------------------------------- */
/* Bloc custom_canvas_animation — animation HTML/Canvas isolée en iframe      */
/* -------------------------------------------------------------------------- */

.cours-canvas-anim {
  margin: 1rem 0;
  width: 100%;
}

.cours-canvas-anim__title {
  font-size: 0.875rem;
  font-weight: 600;
  color: #475569;
  margin: 0 0 0.5rem;
  padding: 0;
}

.cours-canvas-anim iframe {
  width: 100%;
  border: none;
  display: block;
  border-radius: 12px;
  background: #fff;
  /* La hauteur est définie inline depuis block.data.height */
}

@media (max-width: 768px) {
  .cours-canvas-anim iframe {
    border-radius: 8px;
  }
}

