/* ==========================================================================
   MG4Control : explorateur (une seule maquette collée en haut, pilotée par la liste)
   ========================================================================== */

.hero { padding-bottom: 36px; }

/* Nouveautés 2.6.7 dans l'accueil */
.whatsnew {
  margin-top: 26px; padding: 14px 16px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid color-mix(in srgb, #7C3AED 30%, var(--line));
}
.wn-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 10px; }
.wn-head b { font-size: 0.9375rem; }
.wn-all {
  margin-left: auto; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  border-radius: 9px; padding: 5px 11px; font: 600 0.8125rem var(--font); cursor: pointer;
}
.wn-all:hover { border-color: #7C3AED; color: var(--ink); }
.wn-list { display: flex; flex-wrap: wrap; gap: 6px; }
.wn-list a {
  text-decoration: none; color: var(--ink-2); font-size: 0.8438rem; font-weight: 500;
  border: 1px solid var(--line); background: var(--surface-2); border-radius: 999px; padding: 4px 11px;
}
.wn-list a:hover { border-color: #7C3AED; color: var(--ink); }

/* ── Explorateur ───────────────────────────────────────────────────────── */
.x { border-top: 1px solid var(--line); padding-top: 40px; }
.x-intro { margin-bottom: 14px; }
.x-intro h2 { font-size: clamp(1.625rem, 3.6vw, 2.25rem); font-weight: 800; letter-spacing: -.03em; margin-bottom: 10px; }
.x-intro p { color: var(--ink-2); font-size: 1rem; max-width: 80ch; margin: 0; }
.x-intro .x-note { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: 0.875rem; color: var(--ink-3); }
.x-note svg { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 2px; }

/* Scène collée sous l'en-tête : barre de thèmes + maquette */
.x-stage {
  position: sticky; top: 64px; z-index: 40;
  background: var(--bg); padding: 10px 0 6px;
  border-bottom: 1px solid transparent; transition: border-color .15s, box-shadow .15s;
}
.x-stage.stuck { border-bottom-color: var(--line); box-shadow: 0 10px 24px -18px rgba(0,0,0,.35); }
html[data-unpinned] .x-stage { position: static; }

.x-tools { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.x-chips {
  display: flex; gap: 6px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
          mask-image: linear-gradient(to right, #000 calc(100% - 24px), transparent);
  padding-right: 24px;
}
.x-chips::-webkit-scrollbar { display: none; }
.x-chip {
  flex: 0 0 auto; white-space: nowrap; text-decoration: none; cursor: pointer;
  border: 1px solid var(--line-2); background: var(--surface); color: var(--ink-2);
  border-radius: 999px; padding: 5px 12px; font: 600 0.8125rem var(--font);
}
.x-chip:hover { color: var(--ink); border-color: var(--ink-3); }
.x-chip.on { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.x-chip-new { color: #7C3AED; border-color: color-mix(in srgb, #7C3AED 40%, transparent); }
.x-chip-new[aria-pressed="true"] { background: #7C3AED; color: #fff; border-color: #7C3AED; }
:root[data-theme="dark"] .x-chip-new:not([aria-pressed="true"]) { color: #C4B5FD; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .x-chip-new:not([aria-pressed="true"]) { color: #C4B5FD; } }

.x-fw { display: flex; align-items: center; gap: 6px; font-size: 0.8125rem; font-weight: 600; color: var(--ink-3); flex: 0 0 auto; }
.x-fw select {
  height: 32px; border: 1px solid var(--line-2); border-radius: 9px; background: var(--surface); color: var(--ink);
  font: 600 0.8125rem var(--mono); padding: 0 6px;
}
.x-pin { flex: 0 0 auto; width: 32px; height: 32px; }
.x-pin[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
@media (max-width: 699px) { .x-fw { display: none; } }

/* La maquette ne dépasse pas ~35 % de la hauteur de l'écran (ratio 1280 × 480). */
#sim { max-width: min(100%, 92vh); margin: 0 auto; }
html[data-unpinned] #sim { max-width: 100%; }

/* Une seule ligne, hauteur fixe : si la scène collée changeait de hauteur, tout le texte en dessous sauterait. */
.x-status { display: flex; align-items: center; gap: 10px; height: 26px; margin-top: 4px; font-size: 0.8125rem; color: var(--ink-3); white-space: nowrap; overflow: hidden; }
.x-status > span { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.x-hint { display: none; }
#sim.sim-scrolls ~ .x-status .x-hint { display: inline; }
.x-jump {
  margin-left: auto; border: 1px solid var(--accent); background: var(--accent-soft); color: var(--accent-ink);
  border-radius: 999px; padding: 3px 12px; font: 600 0.7812rem var(--font); cursor: pointer;
  min-width: 0; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.x-jump[hidden] { display: none; }

/* ── Plein écran : la maquette seule, le plus grand possible, pour « jouer avec » ── */
.x-full { flex: 0 0 auto; width: 32px; height: 32px; }
.x-full .i-exit, html[data-sim-full] .x-full .i-enter { display: none; }
html[data-sim-full] .x-full .i-exit { display: block; }
html[data-sim-full] .x-full { background: var(--accent-soft); color: var(--accent-ink); border-color: var(--accent); }
.x-fulltitle, .x-fullhint, .x-rotate { display: none; }

html[data-sim-full] { overflow: hidden; }
html[data-sim-full] .x-stage {
  position: fixed; inset: 0; z-index: 55;   /* sous le véhicule virtuel (60), au-dessus de l'en-tête (50) */
  display: flex; flex-direction: column; justify-content: center;
  padding: 12px 0; border: 0; box-shadow: none; overflow: auto;
}
html[data-sim-full] .x-stage > .wrap { max-width: none; width: 100%; }
html[data-sim-full] .x-chips, html[data-sim-full] .x-pin, html[data-sim-full] .x-jump, html[data-sim-full] .x-hint { display: none !important; }
html[data-sim-full] .x-fulltitle { display: block; flex: 1; min-width: 0; font-weight: 700; font-size: 0.9375rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
html[data-sim-full] .x-fulltitle .four { color: var(--red); }
html[data-sim-full] .x-fw { display: flex; }
html[data-sim-full] .x-fullhint { display: inline; }
/* Ratio 1280 × 480 : la largeur est bornée par la hauteur disponible (barre + marges retirées). */
html[data-sim-full] #sim { max-width: min(100%, calc((100vh - 120px) * 2.62)); max-width: min(100%, calc((100dvh - 120px) * 2.62)); }
@media (max-width: 699px) and (orientation: portrait) {
  html[data-sim-full] .x-rotate { display: inline; }
  html[data-sim-full] .x-fullhint { display: none; }
}

/* Liste des fonctionnalités, groupée par thème */
.x-list { padding-bottom: 56px; }
.grp { padding: 34px 0 6px; border-top: 1px solid var(--line); scroll-margin-top: var(--x-off, 84px); }
.grp:first-child { border-top: 0; padding-top: 18px; }
.grp-head { max-width: 51.25rem; }
.grp-head h2 { font-size: clamp(1.375rem, 2.8vw, 1.75rem); font-weight: 800; letter-spacing: -.025em; margin-bottom: 8px; }
.grp-head > p { color: var(--ink-2); font-size: 1rem; margin: 0; }
.grp .points { margin-top: 16px; }
.pt { scroll-margin-top: var(--x-off, 84px); }
.pt h3 { margin-bottom: 4px; }
.pt > p { margin-bottom: 0; }
.pt .fw-tags { margin-top: 8px; }

details.more { margin-top: 8px; }
details.more summary {
  cursor: pointer; font-size: 0.8438rem; font-weight: 600; color: var(--accent-ink); list-style: none; display: inline-flex; align-items: center; gap: 4px;
}
details.more summary::-webkit-details-marker { display: none; }
details.more summary::before { content: "›"; display: inline-block; transition: transform .15s; font-size: 1rem; line-height: 1; }
details.more[open] summary::before { transform: rotate(90deg); }
details.more[open] summary { margin-bottom: 6px; }
details.more p, details.more li { font-size: 0.9062rem; }
details.more ul { padding-left: 18px; }

details.fold { margin-top: 14px; }
details.fold > summary {
  cursor: pointer; font-size: 0.875rem; font-weight: 600; color: var(--ink-2);
  border: 1px dashed var(--line-2); border-radius: 10px; padding: 8px 12px; display: inline-block;
}
details.fold > summary:hover { color: var(--ink); border-color: var(--ink-3); }
details.fold[open] > summary { margin-bottom: 4px; }
details.fold .cols { margin-top: 14px; }

.grp .widget { margin-top: 16px; }
.grp .callout { margin-top: 14px; }
.note { color: var(--ink-3); font-size: 0.875rem; margin-top: 14px; max-width: 90ch; }
#compatibilite .sec-head h2, #installation .sec-head h2 { margin-bottom: 10px; }

/* Filtre « Nouveautés 2.6.7 » */
.x-list.only-new .pt:not(.has-new), .x-list.only-new .grp:not(.has-new),
.x-list.only-new .grp .widget, .x-list.only-new details.fold, .x-list.only-new .grp .callout { display: none; }
.x-chips.only-new .x-chip[data-grp]:not(.has-new) { display: none; }

/* Mobile : maquette plus compacte, tout tient dans la scène collée */
@media (max-width: 699px) {
  .x-stage { top: 64px; padding-top: 8px; }
  .x-intro p { font-size: 0.9375rem; }
}
