/* CollabQuiz - Pages de contenu : accueil, aide, documentation et informations legales.
 * Ordre des feuilles : style, creator, content, game, results, autonomous.
 * Conserver les surcharges et les media queries dans leur ordre relatif.
 */


/* ===== Bandeau accueil ===== */
.course-header {
  position: sticky;
  z-index: 20;
  top: 0;
  display: flex;
  width: 100%;
  max-width: none;
  min-height: 48px;
  margin: 0;
  padding: 6px clamp(10px, 2.5vw, 28px);
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #172554;
  background: rgba(255, 255, 255, .94);
  border-bottom: 1px solid rgba(37, 99, 235, .16);
  box-shadow: 0 4px 14px rgba(15, 23, 42, .08);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.course-flag-icon {
  display: block;
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  object-fit: contain;
}

.course-flag {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
  place-items: center;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  font-size: 1rem;
}

.course-view-label {
  min-width: 0;
  margin-inline: auto;
  overflow: hidden;
  color: #1e3a8a;
  font-size: .9rem;
  text-align: center;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.course-header-button {
  display: inline-flex;
  min-height: 34px;
  margin: 0;
  padding: 6px 10px;
  align-items: center;
  justify-content: center;
  gap: 5px;
  color: #1e3a8a;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 10px;
  box-shadow: none;
  font-size: .84rem;
  line-height: 1;
  text-decoration: none;
}

.course-header-button:hover {
  background: #dbeafe;
  transform: none;
}

.course-icon-button {
  width: 34px;
  padding: 0;
  font-size: 1.15rem;
}

.course-close-button {
  color: #991b1b;
  background: #fff7f7;
  border-color: #fecaca;
}

.course-close-button:hover {
  background: #fee2e2;
}

.home-banner {
  background: #1e3a8a;
  color: white;
  border-radius: 18px;
  padding: 16px 24px;
  box-shadow: 0 8px 24px rgba(30, 58, 138, .25);
}

.home-banner-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

.home-banner h1 {
  margin: 0;
  font-size: 1.6rem;
  color: white;
}

.home-banner p {
  margin: 4px 0 0;
  color: white;
}

.home-banner-actions {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 10px;
}

.home-banner .btn {
  background: white;
  color: #2563eb;
}

.home-nav-icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  padding: 0;
  place-items: center;
}

.home-nav-icon {
  width: 23px;
  height: 23px;
}

.home-banner .btn[aria-current="page"] {
  background: #dbeafe;
  color: #1e3a8a;
  box-shadow: inset 0 0 0 2px #93c5fd;
}

/* ===== Documentation issue du README ===== */
.documentation-layout {
  display: grid;
  grid-template-columns: minmax(190px, 235px) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

.documentation-sidebar {
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 18px;
  border-radius: 18px;
  background: rgba(255, 255, 255, .9);
  box-shadow: 0 10px 30px #10204018;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.documentation-sidebar h2 {
  margin-bottom: 14px;
  font-size: 1.2rem;
}

.documentation-sidebar nav {
  display: grid;
  border-left: 2px solid #dbeafe;
}

.documentation-sidebar nav a,
.documentation-loading-label {
  padding: 6px 8px 6px 12px;
  color: #475569;
  font-size: .86rem;
  font-weight: 700;
  line-height: 1.3;
  text-decoration: none;
}

.documentation-sidebar nav a:hover,
.documentation-sidebar nav a:focus-visible {
  color: #1d4ed8;
  background: #eff6ff;
}

.documentation-sidebar nav .toc-level-3 {
  padding-left: 24px;
  font-size: .79rem;
}

.documentation-source-link {
  display: inline-block;
  margin-top: 16px;
  color: #2563eb;
  font-size: .86rem;
  font-weight: 700;
}

.markdown-body {
  min-width: 0;
  padding: clamp(24px, 5vw, 52px);
}

.markdown-body > :first-child {
  margin-top: 0;
}

.markdown-body > :last-child {
  margin-bottom: 0;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3 {
  scroll-margin-top: 20px;
}

.markdown-body h1 {
  margin-bottom: 24px;
  font-size: clamp(2rem, 5vw, 3.25rem);
}

.markdown-body h2 {
  margin: 42px 0 18px;
  padding-top: 18px;
  border-top: 1px solid #dbe3ef;
  font-size: clamp(1.55rem, 4vw, 2rem);
}

.markdown-body h3 {
  margin: 30px 0 12px;
  font-size: 1.28rem;
}

.markdown-body p,
.markdown-body li {
  line-height: 1.65;
}

.markdown-body p {
  margin: 0 0 16px;
  color: #334155;
}

.markdown-body ul,
.markdown-body ol {
  margin: 0 0 22px;
  padding-left: 25px;
  color: #334155;
}

.markdown-body li {
  margin: 6px 0;
}

.markdown-body a {
  color: #1d4ed8;
  font-weight: 700;
  text-underline-offset: 3px;
}

.markdown-body code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #eaf0f8;
  color: #1e3a8a;
  font: .9em ui-monospace, SFMono-Regular, Consolas, monospace;
}

.markdown-body pre {
  overflow: auto;
  margin: 22px 0;
  padding: 18px;
  border-radius: 13px;
  background: #172033;
  color: #f8fafc;
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
  color: inherit;
  line-height: 1.6;
}

.markdown-table-scroll {
  width: 100%;
  max-width: 100%;
  margin: 22px 0;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  scrollbar-width: thin;
}

.markdown-table-scroll:focus-visible {
  outline: 3px solid rgb(37 99 235 / 28%);
  outline-offset: 2px;
}

.markdown-body table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: #fff;
  color: #334155;
  font-size: .9rem;
  line-height: 1.45;
}

.markdown-body th,
.markdown-body td {
  padding: 10px 12px;
  border-right: 1px solid #dbe3ef;
  border-bottom: 1px solid #dbe3ef;
  vertical-align: top;
  text-align: left;
  overflow-wrap: anywhere;
}

.markdown-body th:last-child,
.markdown-body td:last-child {
  border-right: 0;
}

.markdown-body tbody tr:last-child td {
  border-bottom: 0;
}

.markdown-body th {
  background: #eff6ff;
  color: #1e3a8a;
  font-weight: 800;
}

.markdown-body hr {
  margin: 30px 0;
  border: 0;
  border-top: 1px solid #dbe3ef;
}

.documentation-loading {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 60px 20px;
  text-align: center;
}

.documentation-loading span {
  font-size: 2.5rem;
}

.documentation-error {
  padding: 20px;
  border: 1px solid #fecaca;
  border-radius: 14px;
  background: #fef2f2;
}

/* ===== Aide utilisateur ===== */
.help-content {
  display: grid;
  gap: 18px;
}

.help-introduction {
  text-align: center;
}

.help-introduction > p:not(.help-eyebrow) {
  max-width: 760px;
  margin-inline: auto;
  color: #475569;
  line-height: 1.6;
}

.help-eyebrow {
  margin: 0 0 6px;
  color: #2563eb;
  font-size: .82rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.help-shortcuts {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.help-shortcuts a {
  padding: 7px 11px;
  border: 1px solid #bfdbfe;
  border-radius: 999px;
  background: #eff6ff;
  color: #1e40af;
  font-size: .86rem;
  font-weight: 700;
  text-decoration: none;
}

.help-shortcuts a:hover,
.help-shortcuts a:focus-visible {
  background: #dbeafe;
}

.help-sections {
  display: grid;
  gap: 12px;
}

.help-section {
  scroll-margin-top: 18px;
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: 18px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 8px 24px #10204012;
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}

.help-section:target {
  border-color: #60a5fa;
  box-shadow: 0 0 0 3px rgb(96 165 250 / 20%), 0 8px 24px #10204012;
}

.help-section > summary {
  position: relative;
  padding: 17px 52px 17px 20px;
  color: #172033;
  cursor: pointer;
  font-size: 1.08rem;
  font-weight: 800;
  list-style: none;
}

.help-section > summary::-webkit-details-marker {
  display: none;
}

.help-section > summary::after {
  content: "+";
  position: absolute;
  top: 50%;
  right: 20px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 1.2rem;
  transform: translateY(-50%);
}

.help-section[open] > summary {
  color: #1e3a8a;
  background: #eff6ff;
}

.help-section[open] > summary::after {
  content: "−";
}

.help-section-content {
  padding: 20px;
  border-top: 1px solid #dbe3ef;
}

.help-section-content > :first-child {
  margin-top: 0;
}

.help-section-content > :last-child {
  margin-bottom: 0;
}

.help-section-content p,
.help-section-content li {
  line-height: 1.6;
}

.help-section-content ul,
.help-section-content ol {
  padding-left: 24px;
}

.help-section-content li + li {
  margin-top: 7px;
}

.help-section-content h3 {
  margin: 24px 0 8px;
  color: #1e3a8a;
  font-size: 1rem;
}

.help-callout {
  padding: 13px 15px;
  border-left: 4px solid #60a5fa;
  border-radius: 4px 12px 12px 4px;
  background: #eff6ff;
  color: #334155;
}

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

.help-mode-grid article {
  padding: 14px;
  border: 1px solid #dbeafe;
  border-radius: 14px;
  background: #f8fafc;
}

.help-mode-grid article h3,
.help-mode-grid article p {
  margin: 0;
}

.help-mode-grid article p {
  margin-top: 7px;
  color: #475569;
}

.help-mode-note {
  grid-column: 1 / -1;
  margin: 0;
}

.help-faq-list {
  display: grid;
  gap: 10px;
}

.help-faq-list > details {
  padding: 12px 14px;
  border: 1px solid #dbe3ef;
  border-radius: 12px;
  background: #f8fafc;
}

.help-faq-list summary {
  cursor: pointer;
  font-weight: 750;
}

.help-faq-list p {
  margin: 10px 0 0;
  color: #475569;
}

.help-more {
  text-align: center;
}

.help-more p {
  color: #475569;
}

.context-help-actions {
  display: flex;
  justify-content: flex-end;
  margin: 8px 0 12px;
}

.home-section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

#mainContent,
#mainContent > .panel,
.mode-gallery {
  min-width: 0;
}

.home-section-heading h2,
.home-section-heading p,
.mode-card h3,
.mode-card p,
.home-feature-grid h3,
.home-feature-grid p {
  margin: 0;
}

.home-section-heading p {
  margin-top: 5px;
  color: #475569;
}

.home-steps {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: home-step;
}

.home-steps li {
  position: relative;
  min-width: 0;
  padding: 14px 13px 14px 50px;
  border: 1px solid #dbeafe;
  border-radius: 15px;
  background: rgb(239 246 255 / 78%);
  counter-increment: home-step;
}

.home-steps li::before {
  content: counter(home-step);
  position: absolute;
  top: 13px;
  left: 13px;
  display: grid;
  place-items: center;
  width: 27px;
  height: 27px;
  border-radius: 9px;
  background: #1e40af;
  color: #fff;
  font-weight: 900;
}

.home-steps strong,
.home-steps span {
  display: block;
}

.home-steps span {
  margin-top: 4px;
  color: #475569;
  font-size: .92rem;
  line-height: 1.4;
}

.mode-gallery {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.mode-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #dbe5f4;
  border-radius: 17px;
  background: rgb(255 255 255 / 78%);
  box-shadow: 0 6px 18px rgb(15 23 42 / 8%);
}

.mode-preview {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #eff6ff;
  color: #1e3a8a;
  text-decoration: none;
}

.mode-preview img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #0f172a;
  transition: transform .2s ease;
}

.mode-preview.has-capture > span {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 5px 8px;
  border-radius: 9px;
  background: rgb(15 23 42 / 78%);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
}

.mode-preview.has-capture:hover img,
.mode-preview.has-capture:focus-visible img {
  transform: scale(1.025);
}

.mode-preview.is-placeholder {
  gap: 3px;
  align-content: center;
  border-bottom: 1px dashed #93c5fd;
  background:
    radial-gradient(circle at 30% 22%, rgb(14 165 233 / 14%), transparent 34%),
    linear-gradient(145deg, #eff6ff, #dbeafe);
}

.mode-preview.is-placeholder > span {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
}

.mode-preview.is-placeholder small {
  font-weight: 800;
}

.mode-preview.is-space {
  background: radial-gradient(circle at 30% 25%, #4338ca, #172554 68%);
  color: #e0e7ff;
}

.mode-preview.is-maze {
  background:
    linear-gradient(90deg, transparent 46%, rgb(30 64 175 / 35%) 47% 53%, transparent 54%),
    linear-gradient(#eff6ff, #dbeafe);
}

.mode-card-copy {
  padding: 13px;
}

.mode-card-copy h3 {
  font-size: 1rem;
}

.mode-card-copy p {
  margin-top: 5px;
  color: #475569;
  font-size: .88rem;
  line-height: 1.4;
}

.home-feature-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
}

.home-feature-grid section {
  padding: 13px 14px;
  border-left: 4px solid #60a5fa;
  border-radius: 4px 13px 13px 4px;
  background: rgb(248 250 252 / 82%);
}

.home-feature-grid h3 {
  font-size: 1rem;
}

.home-feature-grid p {
  margin-top: 4px;
  color: #475569;
  line-height: 1.4;
}

@media (max-width: 900px) {
  .home-steps,
  .mode-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .documentation-layout {
    grid-template-columns: 1fr;
  }

  .documentation-sidebar {
    position: static;
    max-height: none;
  }

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

@media (max-width: 640px) {
  .home-steps,
  .home-feature-grid {
    grid-template-columns: 1fr;
  }

  .mode-gallery {
    display: flex;
    justify-content: start;
    max-width: 100%;
    overflow-x: auto;
    padding: 2px 2px 10px;
    scroll-snap-type: x proximity;
    scrollbar-width: thin;
  }

  .mode-card {
    flex: 0 0 min(82vw, 300px);
    scroll-snap-align: start;
  }

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

  .help-mode-grid {
    grid-template-columns: 1fr;
  }

  .help-mode-note {
    grid-column: auto;
  }

  .help-section > summary,
  .help-section-content {
    padding-left: 15px;
  }
}

@media(max-width:700px) {
  .course-header {
    gap: 8px;
    padding-inline: 9px;
  }




  .course-header-button {
    min-width: 32px;
    padding-inline: 8px;
  }




  .home-banner-content {
    flex-direction: column;
    align-items: flex-start;
  }

  .home-banner-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media(max-width:390px) {
  .course-view-label {
    font-size: .76rem;
  }




  .course-flag-icon {
    width: 22px;
    height: 22px;
    flex-basis: 22px;
  }
}

/* ===== Accueil : déclinaison de l'identité de la page Créer ===== */
.cq-home-page #mainContent {
  gap: 22px;
}

.cq-home-page #mainContent > .panel {
  padding: 22px;
  border: 1px solid rgba(203, 217, 239, .82);
  border-radius: 24px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--cq-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.cq-home-page .home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(390px, .88fr);
  align-items: center;
  gap: clamp(24px, 4vw, 58px);
  overflow: hidden;
  min-height: 250px;
  padding: clamp(28px, 4vw, 48px) !important;
  text-align: left;
  background:
    radial-gradient(circle at 98% 0%, rgba(92, 202, 245, .23) 0 105px, transparent 106px),
    radial-gradient(circle at 4% 118%, rgba(13, 148, 136, .16) 0 125px, transparent 126px),
    linear-gradient(120deg, #fff 0%, #f5faff 64%, #eaf5ff 100%) !important;
}

.cq-home-page .home-hero-copy { min-width: 0; }

.cq-home-page .home-eyebrow {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 7px 11px;
  border-radius: 999px;
  background: #e8f2ff;
  color: #1756bc;
  font-size: .78rem;
  font-weight: 850;
  letter-spacing: .035em;
  text-transform: uppercase;
}

.cq-home-page .home-hero h1 {
  margin: 0;
  color: #0d2057;
  font-size: clamp(2rem, 4.4vw, 3.4rem);
  line-height: 1.02;
  letter-spacing: -.045em;
}

.cq-home-page .home-hero-copy > p {
  max-width: 670px;
  margin: 16px 0 0;
  color: #405476;
  font-size: clamp(1rem, 1.7vw, 1.18rem);
  line-height: 1.55;
}

.cq-home-page .home-primary-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 11px;
  margin: 0;
}

.cq-home-page .home-primary-actions .btn {
  display: inline-flex;
  min-width: 0;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1px solid #d6e4f7;
  border-radius: 14px;
  background: rgba(255, 255, 255, .9);
  color: #18305e;
  box-shadow: 0 7px 16px rgba(23, 54, 113, .08);
  text-align: center;
}

.cq-home-page .home-primary-actions .btn:first-child {
  grid-column: 1 / -1;
  min-height: 62px;
  border-color: #1d61d1;
  background: linear-gradient(135deg, #2875eb, #1557c8);
  color: #fff;
  box-shadow: 0 12px 24px rgba(28, 87, 194, .22);
  font-size: 1.08rem;
}

.cq-home-page .home-primary-actions .btn:hover,
.cq-home-page .home-primary-actions .btn:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 11px 22px rgba(23, 54, 113, .15);
}

.cq-home-page .home-primary-actions img {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  filter: invert(27%) sepia(53%) saturate(1225%) hue-rotate(182deg);
}

.cq-home-page .home-primary-actions .btn:first-child img {
  filter: brightness(0) invert(1);
}

.cq-home-page #mainContent > .panel > h2,
.cq-home-page .home-section-heading h2 {
  color: #0e2055;
  font-size: clamp(1.3rem, 2.2vw, 1.7rem);
}

.cq-home-page .home-title-with-icon {
  display: flex;
  align-items: center;
  gap: 11px;
}

.cq-home-page .home-title-with-icon > span,
.cq-home-page .home-title-with-icon > img {
  display: inline-grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  padding: 9px;
  border-radius: 12px;
  background: #e8f2ff;
  color: #1756bc;
  font-size: 1rem;
  font-weight: 900;
}

.cq-home-page .home-title-with-icon > img {
  filter: invert(27%) sepia(53%) saturate(1225%) hue-rotate(182deg);
}

.cq-home-page .home-steps {
  gap: 13px;
  margin-top: 18px;
}

.cq-home-page .home-steps li {
  min-height: 118px;
  padding: 18px 15px 16px 60px;
  border-color: rgba(187, 205, 232, .6);
  border-radius: 16px;
  background: linear-gradient(145deg, #f5f9ff, #edf5ff);
}

.cq-home-page .home-steps li:nth-child(2) { background: linear-gradient(145deg, #f0fcfa, #e4f8f4); }
.cq-home-page .home-steps li:nth-child(3) { background: linear-gradient(145deg, #fff8ec, #fff0dc); }
.cq-home-page .home-steps li:nth-child(4) { background: linear-gradient(145deg, #f7f1ff, #eee7ff); }

.cq-home-page .home-steps li::before {
  top: 17px;
  left: 16px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(145deg, #367af0, #1357cf);
  box-shadow: 0 7px 14px rgba(40, 100, 216, .18);
}

.cq-home-page .home-steps strong { color: #10204e; font-size: 1rem; }
.cq-home-page .home-steps span { color: #405476; }

.cq-home-page .home-section-heading { margin-bottom: 18px; }
.cq-home-page .home-section-heading p { color: #405476; }

.cq-home-page .mode-gallery { gap: 14px; }

.cq-home-page .mode-card {
  display: flex;
  min-height: 100%;
  flex-direction: column;
  border-color: rgba(187, 205, 232, .62);
  border-radius: 17px;
  background: #edf7ff;
  box-shadow: 0 8px 20px rgba(23, 54, 113, .08);
  transition: transform .18s ease, box-shadow .18s ease;
}

.cq-home-page .mode-card:nth-child(2) { background: #fff6e8; }
.cq-home-page .mode-card:nth-child(3) { background: #f3edff; }
.cq-home-page .mode-card:nth-child(4) { background: #e9faf7; }

.cq-home-page .mode-card:hover,
.cq-home-page .mode-card:focus-within {
  transform: translateY(-3px);
  box-shadow: 0 13px 26px rgba(23, 54, 113, .13);
}

.cq-home-page .mode-preview {
  aspect-ratio: 1.45 / 1;
  background: transparent;
}

.cq-home-page .mode-preview img {
  object-fit: cover;
  background: transparent;
}

.cq-home-page .mode-preview.has-capture > span {
  right: 10px;
  bottom: 9px;
  background: rgba(14, 32, 85, .82);
}

.cq-home-page .mode-card-copy {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 15px 16px 17px;
}

.cq-home-page .mode-card-copy h3 { color: #10204e; font-size: 1.04rem; }
.cq-home-page .mode-card-copy p { color: #405476; font-size: .9rem; }

.cq-home-page .home-features > h2 { margin-bottom: 18px; }

.cq-home-page .home-feature-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.cq-home-page .home-feature-grid section {
  min-width: 0;
  padding: 16px;
  border: 1px solid #dfe9f7;
  border-left: 1px solid #dfe9f7;
  border-radius: 15px;
  background: #f8fbff;
}

.cq-home-page .home-feature-grid section:nth-child(2),
.cq-home-page .home-feature-grid section:nth-child(6) { background: #f0fbf9; }
.cq-home-page .home-feature-grid section:nth-child(3) { background: #fff8ed; }
.cq-home-page .home-feature-grid section:nth-child(4) { background: #f7f2ff; }
.cq-home-page .home-feature-grid section:nth-child(5) { background: #fff3f6; }

.cq-home-page .home-feature-grid h3 {
  display: flex;
  align-items: center;
  gap: 9px;
  color: #10204e;
}

.cq-home-page .home-feature-icon {
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  filter: invert(27%) sepia(53%) saturate(1225%) hue-rotate(182deg);
}

.cq-home-page .home-feature-grid p { margin-top: 8px; color: #405476; }

.cq-home-page .footer-link-icon {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  vertical-align: -.18em;
  filter: invert(38%) sepia(74%) saturate(991%) hue-rotate(185deg);
}

@media (max-width: 1050px) {
  .cq-home-page .home-hero { grid-template-columns: 1fr; min-height: 0; }
  .cq-home-page .home-primary-actions { width: min(680px, 100%); }
  .cq-home-page .home-feature-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 620px) {
  .cq-home-page #mainContent { gap: 16px; }
  .cq-home-page #mainContent > .panel { padding: 17px; border-radius: 18px; }
  .cq-home-page .home-hero { padding: 24px 18px !important; gap: 24px; }
  .cq-home-page .home-hero h1 { font-size: clamp(2rem, 12vw, 2.7rem); }
  .cq-home-page .home-primary-actions { grid-template-columns: 1fr; }
  .cq-home-page .home-primary-actions .btn:first-child { grid-column: auto; }
  .cq-home-page .home-steps,
  .cq-home-page .home-feature-grid { grid-template-columns: 1fr; }
  .cq-home-page .mode-gallery {
    display: grid;
    grid-template-columns: 1fr;
    overflow: visible;
    padding: 0;
  }
  .cq-home-page .mode-card { width: 100%; }
  .cq-home-page .home-section-heading { align-items: flex-start; }
}

/* ===== Aide et Documentation : déclinaison de l'identité validée ===== */
.cq-help-page #mainContent,
.cq-documentation-page #mainContent {
  position: relative;
  z-index: 1;
}

.cq-help-page .site-footer,
.cq-documentation-page .site-footer {
  position: relative;
  z-index: 1;
}

.cq-help-page .footer-link-icon,
.cq-documentation-page .footer-link-icon {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  vertical-align: -.18em;
  filter: invert(38%) sepia(74%) saturate(991%) hue-rotate(185deg);
}

/* Aide : parcours courts, accordéons et repères de lecture. */
.cq-help-page .help-content {
  width: min(1080px, 100%);
  margin-inline: auto;
  gap: 18px;
}

.cq-help-page .help-introduction,
.cq-help-page .help-more {
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid rgba(203, 217, 239, .82);
  border-radius: 24px;
  background:
    radial-gradient(circle at 96% -16%, rgba(92, 202, 245, .2) 0 105px, transparent 106px),
    radial-gradient(circle at 2% 124%, rgba(13, 148, 136, .14) 0 105px, transparent 106px),
    rgba(255, 255, 255, .95);
  box-shadow: var(--cq-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.cq-help-page .help-introduction h1,
.cq-help-page .help-more h2 {
  color: #10204e;
}

.cq-help-page .help-introduction h1 {
  margin: 0;
  font-size: clamp(1.65rem, 4vw, 2.35rem);
}

.cq-help-page .help-eyebrow {
  color: var(--cq-action);
  letter-spacing: .1em;
}

.cq-help-page .help-shortcuts {
  gap: 9px;
  margin-top: 22px;
}

.cq-help-page .help-shortcuts a {
  padding: 9px 14px;
  border-color: #cbdcf6;
  background: #f0f6ff;
  color: #174caa;
  transition: border-color .18s ease, background .18s ease, transform .18s ease;
}

.cq-help-page .help-shortcuts a:hover,
.cq-help-page .help-shortcuts a:focus-visible {
  border-color: #83acee;
  background: #e2efff;
  transform: translateY(-1px);
}

.cq-help-page .help-sections {
  gap: 13px;
}

.cq-help-page .help-section {
  border-color: rgba(187, 205, 232, .72);
  border-radius: 20px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 8px 24px rgba(23, 54, 113, .07);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.cq-help-page .help-section:target {
  border-color: #75a5ef;
  box-shadow: 0 0 0 3px rgba(40, 100, 216, .14), 0 10px 26px rgba(23, 54, 113, .1);
}

.cq-help-page .help-section > summary {
  padding: 19px 58px 19px 22px;
  color: #10204e;
  font-size: 1.08rem;
}

.cq-help-page .help-section > summary::after {
  right: 20px;
  background: #e8f2ff;
  color: #1756bc;
}

.cq-help-page .help-section[open] > summary {
  background: linear-gradient(90deg, #edf5ff, #f7fbff);
  color: #123b87;
}

.cq-help-page .help-section > summary:focus-visible,
.cq-help-page .help-faq-list summary:focus-visible {
  outline: 3px solid rgba(40, 100, 216, .35);
  outline-offset: -3px;
}

.cq-help-page .help-section-content {
  padding: 22px;
  border-top-color: #dce7f6;
  color: #263b5d;
}

.cq-help-page .help-section-content h3 {
  color: #153e8d;
}

.cq-help-page .help-section-content code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #eaf0f8;
  color: #1e3a8a;
}

.cq-help-page .help-callout {
  border-left-color: var(--cq-teal);
  border-radius: 5px 13px 13px 5px;
  background: #ebfaf7;
  color: #23423f;
}

.cq-help-page .help-mode-grid article {
  border-color: #dbe7f7;
  border-radius: 15px;
  background: #edf7ff;
}

.cq-help-page .help-mode-grid article:nth-child(2) { background: #fff6e8; }
.cq-help-page .help-mode-grid article:nth-child(3) { background: #f3edff; }
.cq-help-page .help-mode-grid article:nth-child(4) { background: #e9faf7; }

.cq-help-page .help-faq-list > details {
  border-color: #dbe7f7;
  border-radius: 13px;
  background: #f7faff;
}

.cq-help-page .help-more .btn {
  border-color: transparent;
  background: linear-gradient(135deg, #2f7bf1, #1763d8);
  color: #fff;
  box-shadow: 0 9px 20px rgba(22, 65, 154, .18);
}

/* Documentation : sommaire stable et colonne de lecture confortable. */
.cq-documentation-page .documentation-layout {
  width: min(1240px, 100%);
  margin-inline: auto;
  grid-template-columns: minmax(220px, 260px) minmax(0, 860px);
  justify-content: center;
  gap: clamp(18px, 3vw, 30px);
}

.cq-documentation-page .documentation-sidebar,
.cq-documentation-page .markdown-body {
  border: 1px solid rgba(203, 217, 239, .82);
  background: rgba(255, 255, 255, .96);
  box-shadow: var(--cq-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.cq-documentation-page .documentation-sidebar {
  top: 18px;
  padding: 20px;
  border-radius: 20px;
}

.cq-documentation-page .documentation-sidebar h2 {
  margin-top: 0;
  color: #10204e;
}

.cq-documentation-page .documentation-sidebar nav {
  border-left-color: #bfd6f7;
}

.cq-documentation-page .documentation-sidebar nav a {
  border-radius: 0 8px 8px 0;
  color: #405476;
}

.cq-documentation-page .documentation-sidebar nav a:hover,
.cq-documentation-page .documentation-sidebar nav a:focus-visible {
  background: #eaf3ff;
  color: #174caa;
}

.cq-documentation-page .documentation-source-link {
  color: #1756bc;
}

.cq-documentation-page .markdown-body {
  width: 100%;
  padding: clamp(24px, 4vw, 48px);
  border-radius: 24px;
}

.cq-documentation-page .markdown-body h1,
.cq-documentation-page .markdown-body h2,
.cq-documentation-page .markdown-body h3 {
  color: #10204e;
}

.cq-documentation-page .markdown-body h1 {
  font-size: clamp(2rem, 5vw, 3rem);
  letter-spacing: -.035em;
}

.cq-documentation-page .markdown-body h2 {
  border-top-color: #dce7f6;
  color: #123b87;
}

.cq-documentation-page .markdown-body p,
.cq-documentation-page .markdown-body li {
  color: #334a6b;
}

.cq-documentation-page .markdown-body a {
  color: #1756bc;
}

.cq-documentation-page .markdown-body pre {
  border: 1px solid #29436d;
  background: #13213a;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
}

.cq-documentation-page .markdown-table-scroll {
  border-color: #cfdef2;
  border-radius: 14px;
}

.cq-documentation-page .markdown-body th {
  background: #eaf3ff;
  color: #123b87;
}

.cq-documentation-page .documentation-loading {
  color: #405476;
}

@media (max-width: 900px) {
  .cq-documentation-page .documentation-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .cq-documentation-page .documentation-sidebar {
    position: static;
    max-height: none;
  }

  .cq-documentation-page .documentation-sidebar nav {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .cq-help-page .help-content,
  .cq-documentation-page .documentation-layout {
    gap: 14px;
  }

  .cq-help-page .help-introduction,
  .cq-help-page .help-more,
  .cq-documentation-page .markdown-body {
    padding: 18px;
    border-radius: 18px;
  }

  .cq-help-page .help-shortcuts {
    justify-content: flex-start;
  }

  .cq-help-page .help-shortcuts a {
    flex: 1 1 calc(50% - 9px);
    text-align: center;
  }

  .cq-help-page .help-section {
    border-radius: 16px;
  }

  .cq-help-page .help-section > summary {
    padding: 16px 50px 16px 16px;
  }

  .cq-help-page .help-section > summary::after {
    right: 14px;
  }

  .cq-help-page .help-section-content {
    padding: 17px 16px;
  }

  .cq-documentation-page .documentation-sidebar {
    padding: 17px;
    border-radius: 18px;
  }

  .cq-documentation-page .documentation-sidebar nav {
    grid-template-columns: 1fr;
  }

  .cq-documentation-page .markdown-body h2 {
    margin-top: 34px;
  }
}

@media (max-width: 400px) {
  .cq-help-page .help-shortcuts a {
    flex-basis: 100%;
  }
}

/* ===== Pictogrammes de la Documentation ===== */
.cq-documentation-page .markdown-body .has-documentation-icon {
  display: flex;
  align-items: center;
  gap: 11px;
}

.cq-documentation-page .documentation-heading-icon {
  width: 1.15em;
  height: 1.15em;
  flex: 0 0 1.15em;
  filter: invert(29%) sepia(79%) saturate(1311%) hue-rotate(196deg);
}

.cq-documentation-page .documentation-sidebar nav a {
  display: flex;
  align-items: flex-start;
  gap: 7px;
}

.cq-documentation-page .documentation-toc-icon {
  width: 16px;
  height: 16px;
  flex: 0 0 16px;
  margin-top: 1px;
  filter: invert(37%) sepia(30%) saturate(897%) hue-rotate(178deg);
}

.cq-documentation-page .documentation-loading-icon {
  width: 42px;
  height: 42px;
  filter: invert(29%) sepia(79%) saturate(1311%) hue-rotate(196deg);
}

/* ===== Crédits et Mentions légales ===== */
.cq-institutional-page #mainContent,
.cq-institutional-page .site-footer {
  position: relative;
  z-index: 1;
}

.cq-institutional-page .institutional-content {
  width: min(940px, 100%);
  margin-inline: auto;
}

.cq-institutional-page .institutional-card {
  padding: clamp(24px, 4vw, 46px);
  border: 1px solid rgba(203, 217, 239, .82);
  border-radius: 24px;
  background:
    radial-gradient(circle at 102% -5%, rgba(92, 202, 245, .14) 0 105px, transparent 106px),
    rgba(255, 255, 255, .97);
  box-shadow: var(--cq-shadow);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.cq-institutional-page .institutional-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 24px;
  color: #10204e;
  font-size: clamp(1.7rem, 4vw, 2.35rem);
  letter-spacing: -.025em;
}

.cq-institutional-page .institutional-title img {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  padding: 10px;
  border-radius: 13px;
  background: #e8f2ff;
  filter: invert(29%) sepia(79%) saturate(1311%) hue-rotate(196deg);
}

.cq-institutional-page .institutional-card h2 {
  margin: 30px 0 10px;
  padding-top: 22px;
  border-top: 1px solid #dce7f6;
  color: #153e8d;
  font-size: 1.16rem;
}

.cq-institutional-page .institutional-subtitle {
  display: flex;
  align-items: center;
  gap: 9px;
}

.cq-institutional-page .institutional-subtitle img {
  width: 24px;
  height: 24px;
  flex: 0 0 24px;
  filter: invert(37%) sepia(67%) saturate(849%) hue-rotate(127deg);
}

.cq-institutional-page .institutional-card p,
.cq-institutional-page .institutional-card li {
  color: #334a6b;
  line-height: 1.68;
}

.cq-institutional-page .institutional-card ul {
  padding-left: 24px;
}

.cq-institutional-page .institutional-card a {
  color: #1756bc;
  font-weight: 700;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
}

.cq-institutional-page .institutional-card code {
  padding: 2px 6px;
  border-radius: 6px;
  background: #eaf0f8;
  color: #1e3a8a;
}

.cq-institutional-page .help-tip {
  margin-top: 28px;
  padding: 15px 17px;
  border: 1px solid #cae5df;
  border-left: 4px solid var(--cq-teal);
  border-radius: 5px 13px 13px 5px;
  background: #ebfaf7;
  color: #23423f;
}

.cq-institutional-page .footer-link-icon {
  width: 16px;
  height: 16px;
  margin-right: 4px;
  vertical-align: -.18em;
  filter: invert(38%) sepia(74%) saturate(991%) hue-rotate(185deg);
}

@media (max-width: 620px) {
  .cq-institutional-page .institutional-card {
    padding: 19px 17px;
    border-radius: 18px;
  }

  .cq-institutional-page .institutional-title {
    align-items: flex-start;
    font-size: 1.65rem;
  }

  .cq-institutional-page .institutional-title img {
    width: 39px;
    height: 39px;
    flex-basis: 39px;
  }

  .cq-institutional-page .institutional-card h2 {
    margin-top: 25px;
    padding-top: 18px;
  }
}

/* ==========================================
   ACCUEIL — DISPOSITION DES 4 BOUTONS
   ========================================== */

.cq-home-page .home-primary-actions {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 10px !important;
  width: 100% !important;
}

/* Créer une partie : pleine largeur */
.cq-home-page .home-primary-actions>.btn.primary {
  grid-column: 1 / -1 !important;
  width: 100% !important;
  box-sizing: border-box !important;
}

/* Jouer en direct / autonomie / Attribuer */
.cq-home-page .home-primary-actions>.btn:not(.primary) {
  grid-column: auto !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  width: 100% !important;
  min-width: 0 !important;
  box-sizing: border-box !important;
  padding: 12px 8px !important;
  font-size: 0.9rem !important;
  text-align: center !important;
}

/* Adaptation smartphone */
@media (max-width: 600px) {
  .cq-home-page .home-primary-actions {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 6px !important;
  }

  .cq-home-page .home-primary-actions>.btn:not(.primary) {
    flex-direction: column !important;
    gap: 5px !important;
    padding: 10px 3px !important;
    font-size: 0.72rem !important;
    line-height: 1.2 !important;
    white-space: normal !important;
  }

  .cq-home-page .home-primary-actions>.btn:not(.primary) img {
    width: 22px !important;
    height: 22px !important;
    flex-shrink: 0 !important;
  }
}
/* Conserver la présentation des titres de rubriques dans les accordéons. */
.cq-help-page .help-section > summary > h2 {
  display: inline;
  margin: 0;
  font: inherit;
  color: inherit;
}
