/* Geant4 article — composants interactifs (brouillon blog IMPROBA) */

.page-article-geant4 .article-page > article {
  max-width: 72rem;
}

.page-article-geant4 .article-prose__body code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.88em;
  background: rgba(32, 61, 82, 0.07);
  padding: 0.12em 0.4em;
  border-radius: 0.35em;
}

/* ---- breakout panels (dark lab blocks inside white prose) ---- */
.g4-lab {
  --g4-navy: #203d52;
  --g4-navy2: #16303f;
  --g4-navy3: #0e2230;
  --g4-teal: #3ecfd9;
  --g4-yellow: #ffcc49;
  --g4-purple: #b077dd;
  --g4-ok: #5dd693;
  --g4-muted: #8aa0ae;
  --g4-em: #3ecfd9;
  --g4-had: #ff9f6b;
  --g4-trans: #b077dd;
  --g4-geo: #ffcc49;

  margin: 2.2em -0.5rem;
  padding: 1.75rem 1.5rem;
  border-radius: 1.125rem;
  background: linear-gradient(160deg, var(--g4-navy2), var(--g4-navy3));
  border: 1px solid rgba(62, 207, 217, 0.22);
  color: #e9eef2;
  font-size: 0.95rem;
  line-height: 1.55;
  box-shadow: 0 12px 40px rgba(14, 34, 48, 0.18);
}

.g4-lab__kicker {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--g4-yellow);
  margin: 0 0 0.35rem;
}

.g4-lab__title {
  margin: 0 0 0.65rem;
  font-size: 1.25rem;
  font-weight: 700;
  color: #fff;
}

.g4-lab__sub {
  margin: 0 0 1.25rem;
  color: #bcccd6;
  font-size: 0.9rem;
  max-width: 58rem;
}

/* ---- equation card ---- */
.g4-eq {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  padding: 1.35rem 1.25rem;
  border-radius: 0.9rem;
  background: linear-gradient(135deg, #1a3547, rgba(20, 41, 54, 0.55));
  border: 1px solid rgba(62, 207, 217, 0.28);
  margin: 1.5em 0;
}

.g4-eq__formula {
  flex: 1 1 18rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: clamp(0.85rem, 2vw, 1.05rem);
  color: #fff;
  line-height: 1.75;
}

.g4-eq__formula .t-mfp { color: var(--g4-teal); background: rgba(62, 207, 217, 0.14); padding: 0.1em 0.35em; border-radius: 0.35em; }
.g4-eq__formula .t-xs  { color: #d3b0f0; background: rgba(176, 119, 221, 0.16); padding: 0.1em 0.35em; border-radius: 0.35em; }
.g4-eq__formula .t-cut { color: var(--g4-yellow); background: rgba(255, 204, 73, 0.14); padding: 0.1em 0.35em; border-radius: 0.35em; }

.g4-eq__legend {
  flex: 1 1 14rem;
  font-size: 0.84rem;
  color: #bcccd6;
}

.g4-eq__legend li {
  display: flex;
  gap: 0.55rem;
  align-items: baseline;
  margin-bottom: 0.45rem;
  list-style: none;
}

.g4-eq__legend li::before { display: none; }

.g4-dot {
  width: 0.65rem;
  height: 0.65rem;
  border-radius: 50%;
  flex-shrink: 0;
  margin-top: 0.35rem;
}

/* ---- plain callout (inside prose, light) ---- */
.g4-plain {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin: 1.6em 0;
  padding: 1.1rem 1.25rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, rgba(93, 214, 147, 0.1), rgba(62, 207, 217, 0.05));
  border: 1px solid rgba(93, 214, 147, 0.28);
  border-left: 4px solid var(--g4-ok, #5dd693);
  color: #1e4a38;
  font-size: 0.95rem;
}

.g4-plain__icon {
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  border-radius: 0.55rem;
  background: rgba(93, 214, 147, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.g4-plain__label {
  margin: 0 0 0.25rem;
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #2a8f5c;
  font-weight: 700;
}

/* ---- module grid ---- */
.g4-modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9.5rem, 1fr));
  gap: 0.65rem;
  margin-top: 0.75rem;
}

.g4-mod {
  border-radius: 0.75rem;
  padding: 0.75rem 0.65rem;
  background: #16303f;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-top: 3px solid var(--c, var(--g4-teal));
  text-align: center;
  transition: transform 0.2s, box-shadow 0.2s, opacity 0.2s;
  opacity: 0.72;
  cursor: default;
}

.g4-mod.active {
  opacity: 1;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.28);
}

.g4-mod__name {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  font-weight: 600;
  color: #fff;
  margin-bottom: 0.2rem;
}

.g4-mod__desc {
  font-size: 0.68rem;
  color: var(--g4-muted);
  line-height: 1.35;
}

.g4-mod-detail-wrap {
  overflow: hidden;
  margin-top: 1rem;
}

.g4-mod-detail {
  min-height: 3.2rem;
  padding: 0.85rem 1rem;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.05);
  border-left: 3px solid var(--g4-teal);
  font-size: 0.88rem;
  color: #cfdae2;
}

.g4-mod-detail b { color: #fff; }

/* ---- pipeline / animation stage ---- */
.g4-stage {
  margin-top: 0.5rem;
  padding: 1.25rem 1rem 1.5rem;
  border-radius: 1rem;
  background: linear-gradient(180deg, #14293a, #102230);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

/* ---- pipeline beam (lifecycle) ---- */
.g4-pipeline {
  position: relative;
  padding: 0 0.15rem;
}

.g4-pipeline__rail {
  position: relative;
  height: 4px;
  margin: 0 0 0.15rem;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.06);
  overflow: visible;
}

.g4-pipeline__fill {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--g4-teal) 0%, var(--g4-yellow) 55%, var(--g4-purple) 100%);
  box-shadow: 0 0 14px rgba(62, 207, 217, 0.45);
}

.g4-pipeline__head {
  position: absolute;
  top: 50%;
  left: 0;
  width: 11px;
  height: 11px;
  margin: -5.5px 0 0 -5.5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 6px var(--g4-yellow), 0 0 18px var(--g4-teal);
  opacity: 0;
  pointer-events: none;
}

.g4-track-row {
  display: flex;
  align-items: stretch;
  gap: 0;
  overflow-x: auto;
  padding: 0.75rem 0 0.5rem;
  min-height: 7.5rem;
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.g4-track-row::-webkit-scrollbar { height: 6px; }
.g4-track-row::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.18); border-radius: 6px; }

.g4-step-col {
  flex: 0 0 8.6rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 0 0.25rem;
  position: relative;
}

.g4-step-col::after {
  content: '→';
  position: absolute;
  right: -0.35rem;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.25);
  font-size: 1rem;
  z-index: 0;
}

.g4-step-col:last-child::after { display: none; }

.g4-card {
  position: relative;
  z-index: 1;
  height: 5.5rem;
  border-radius: 0.75rem;
  padding: 0.65rem 0.6rem;
  background: #1b3340;
  border: 1px solid rgba(255, 255, 255, 0.12);
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.15rem;
  opacity: 0.5;
  will-change: transform, opacity;
}

.g4-card::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: inherit;
  border: 2px solid var(--ac, var(--g4-teal));
  opacity: 0;
  pointer-events: none;
}

.g4-card.active::after {
  opacity: 1;
  animation: g4-ring-breathe 2.2s ease-in-out infinite;
}

@keyframes g4-ring-breathe {
  0%, 100% { transform: scale(1); opacity: 0.85; }
  50% { transform: scale(1.05); opacity: 0.35; }
}

.g4-card__num {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.62rem;
  color: var(--g4-muted);
}

.g4-card__name {
  font-size: 0.78rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.g4-card__sub {
  font-size: 0.62rem;
  color: #9fb2bd;
  line-height: 1.25;
}

.g4-card.active {
  opacity: 1;
  border-color: var(--ac, var(--g4-teal));
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--ac, var(--g4-teal)) 55%, transparent),
              0 12px 32px color-mix(in srgb, var(--ac, var(--g4-teal)) 40%, transparent);
}

.g4-card.done {
  opacity: 0.78;
  border-color: color-mix(in srgb, var(--ac, var(--g4-teal)) 35%, transparent);
}

.g4-card--init { --ac: var(--g4-yellow); }
.g4-card--run  { --ac: var(--g4-teal); }
.g4-card--evt  { --ac: var(--g4-purple); }
.g4-card--step { --ac: var(--g4-em); }
.g4-card--had  { --ac: var(--g4-had); }

/* stepping loop — vertical sub-lanes */
.g4-stepping {
  position: relative;
  margin-top: 0.5rem;
}

.g4-stepping__lane {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  min-height: 3.4rem;
  margin-bottom: 0.35rem;
  padding: 0.35rem 0.5rem;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px dashed rgba(255, 255, 255, 0.1);
  transition: background 0.35s, border-color 0.35s, box-shadow 0.35s;
}

.g4-stepping__lane.is-hot[data-lane="proc"] {
  background: rgba(62, 207, 217, 0.1);
  border-color: rgba(62, 207, 217, 0.45);
  border-style: solid;
  box-shadow: inset 0 0 20px rgba(62, 207, 217, 0.08);
}

.g4-stepping__lane.is-hot[data-lane="geo"] {
  background: rgba(255, 204, 73, 0.1);
  border-color: rgba(255, 204, 73, 0.45);
  border-style: solid;
  box-shadow: inset 0 0 20px rgba(255, 204, 73, 0.08);
}

.g4-stepping__lane.is-hot[data-lane="user"] {
  background: rgba(176, 119, 221, 0.1);
  border-color: rgba(176, 119, 221, 0.45);
  border-style: solid;
  box-shadow: inset 0 0 20px rgba(176, 119, 221, 0.08);
}

.g4-stepping__scanner {
  position: absolute;
  pointer-events: none;
  z-index: 3;
  border-radius: 0.55rem;
  border: 2px solid var(--g4-teal);
  box-shadow: 0 0 18px rgba(62, 207, 217, 0.5), inset 0 0 14px rgba(62, 207, 217, 0.12);
  opacity: 0;
}

.g4-stepping__label {
  flex: 0 0 5.5rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.65rem;
  font-weight: 600;
  text-align: center;
  padding: 0.35rem 0.25rem;
  border-radius: 0.45rem;
}

.g4-stepping__label--proc { background: rgba(62, 207, 217, 0.14); color: var(--g4-teal); border: 1px solid rgba(62, 207, 217, 0.35); }
.g4-stepping__label--geo  { background: rgba(255, 204, 73, 0.12); color: var(--g4-yellow); border: 1px solid rgba(255, 204, 73, 0.35); }
.g4-stepping__label--user { background: rgba(176, 119, 221, 0.14); color: var(--g4-purple); border: 1px solid rgba(176, 119, 221, 0.35); }

.g4-stepping__cells {
  display: flex;
  flex: 1;
  gap: 0.25rem;
  overflow-x: auto;
}

.g4-mini {
  flex: 0 0 4.5rem;
  height: 2.4rem;
  border-radius: 0.5rem;
  padding: 0.3rem 0.35rem;
  background: #1b3340;
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 0.58rem;
  color: #cdd9e1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.2;
  opacity: 0.42;
  will-change: transform, opacity;
}

.g4-mini.active {
  opacity: 1;
  border-color: var(--g4-teal);
  color: #fff;
  box-shadow: 0 0 0 2px rgba(62, 207, 217, 0.6), 0 6px 20px rgba(62, 207, 217, 0.25);
}

/* controls */
.g4-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1.1rem;
}

.g4-btn {
  border: none;
  cursor: pointer;
  border-radius: 0.65rem;
  padding: 0.6rem 1.1rem;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  transition: filter 0.15s, transform 0.15s;
  touch-action: manipulation;
}

.g4-btn--play {
  background: var(--g4-yellow);
  color: var(--g4-navy3);
}

.g4-btn--play:hover { filter: brightness(1.06); transform: translateY(-1px); }

.g4-btn--ghost {
  background: rgba(255, 255, 255, 0.08);
  color: #dbe5ec;
}

.g4-btn--ghost:hover { background: rgba(255, 255, 255, 0.14); }

.g4-readout {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  color: #9fb2bd;
}

.g4-readout b { color: var(--g4-yellow); }

.g4-progress {
  position: relative;
  margin-top: 0.85rem;
  height: 0.45rem;
  border-radius: 0.35rem;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.g4-progress__fill {
  position: absolute;
  inset: 0;
  transform-origin: left center;
  transform: scaleX(0);
  background: linear-gradient(90deg, var(--g4-teal), var(--g4-purple));
  border-radius: inherit;
}

.g4-progress__shine {
  position: absolute;
  inset: 0;
  width: 40%;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.45), transparent);
  pointer-events: none;
  mix-blend-mode: overlay;
  transform: translateX(-100%);
}

/* legacy fallback */
.g4-progress > i {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--g4-teal), var(--g4-purple));
}

.g4-explain {
  margin-top: 0.85rem;
  min-height: 2.8rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.65rem;
  background: rgba(255, 255, 255, 0.04);
  font-size: 0.86rem;
  color: #cfdae2;
  will-change: transform, opacity;
}

.g4-explain b { color: var(--g4-yellow); }

.g4-math-link {
  margin: 0.85rem 0 0;
  border-radius: 0.75rem;
  overflow: hidden;
  border: 1px solid rgba(255, 204, 73, 0.28);
  background: linear-gradient(135deg, #1a3346, #12242f);
}

.g4-math-link__head {
  padding: 0.5rem 0.9rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.72rem;
  color: var(--g4-yellow);
  background: rgba(255, 204, 73, 0.08);
  border-bottom: 1px solid rgba(255, 204, 73, 0.15);
}

.g4-math-link__body {
  padding: 0.85rem 0.9rem;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.82rem;
  color: #e9eef2;
  line-height: 1.6;
}

/* ---- process category pills ---- */
.g4-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 1em 0;
}

.g4-pill {
  font-size: 0.75rem;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid rgba(32, 61, 82, 0.15);
  background: #fff;
  color: #203d52;
}

.g4-pill--em { border-color: rgba(62, 207, 217, 0.5); color: #0d8a94; }
.g4-pill--had { border-color: rgba(255, 159, 107, 0.55); color: #c45a20; }
.g4-pill--opt { border-color: rgba(176, 119, 221, 0.5); color: #7a4db0; }

/* ---- refs block ---- */
.g4-refs {
  font-size: 0.82rem;
  color: #5a7a94;
  line-height: 1.65;
}

.g4-refs li {
  margin-bottom: 0.55rem;
}

.g4-refs a {
  word-break: break-word;
}

/* ---- reading guide (dual audience) ---- */
.g4-audience {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.85rem;
  margin: 1.75em 0;
}

.g4-audience__card {
  border-radius: 0.85rem;
  padding: 1.1rem 1.15rem;
  font-size: 0.92rem;
  line-height: 1.55;
}

.g4-audience__card--novice {
  background: linear-gradient(135deg, rgba(93, 214, 147, 0.12), rgba(62, 207, 217, 0.06));
  border: 1px solid rgba(93, 214, 147, 0.35);
  color: #1a4a38;
}

.g4-audience__card--expert {
  background: linear-gradient(135deg, rgba(176, 119, 221, 0.1), rgba(32, 61, 82, 0.04));
  border: 1px solid rgba(176, 119, 221, 0.35);
  color: #203d52;
}

.g4-audience__label {
  margin: 0 0 0.4rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.g4-audience__card--novice .g4-audience__label { color: #2a8f5c; }
.g4-audience__card--expert .g4-audience__label { color: #7a4db0; }

.g4-audience__card ul {
  margin: 0.5rem 0 0;
  padding-left: 1.1rem;
}

.g4-audience__card li { margin-bottom: 0.25rem; }

/* ---- glossary ---- */
.g4-glossary {
  margin: 1.5em 0;
  padding: 1.1rem 1.25rem;
  border-radius: 0.85rem;
  background: rgba(32, 61, 82, 0.04);
  border: 1px solid rgba(32, 61, 82, 0.12);
  font-size: 0.9rem;
}

.g4-glossary__title {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 700;
  color: #203d52;
}

.g4-glossary dl {
  margin: 0;
  display: grid;
  gap: 0.55rem;
}

.g4-glossary dt {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  font-weight: 600;
  color: #0d8a94;
}

.g4-glossary dd {
  margin: 0.15rem 0 0;
  color: #3a5f78;
  line-height: 1.5;
}

/* ---- expert note (praticiens) ---- */
.g4-expert {
  margin: 1.4em 0;
  padding: 1rem 1.15rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, rgba(176, 119, 221, 0.08), rgba(32, 61, 82, 0.03));
  border: 1px solid rgba(176, 119, 221, 0.28);
  border-left: 4px solid #b077dd;
  font-size: 0.92rem;
  color: #203d52;
  line-height: 1.6;
}

.g4-expert__label {
  margin: 0 0 0.35rem;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #7a4db0;
}

/* ---- collapsible expert detail ---- */
.g4-details {
  margin: 1.25em 0;
  border: 1px solid rgba(32, 61, 82, 0.12);
  border-radius: 0.75rem;
  background: #fff;
  overflow: hidden;
}

.g4-details summary {
  cursor: pointer;
  padding: 0.85rem 1.1rem;
  font-weight: 700;
  font-size: 0.9rem;
  color: #203d52;
  list-style: none;
  user-select: none;
}

.g4-details summary::-webkit-details-marker { display: none; }

.g4-details summary::before {
  content: '▸ ';
  color: #0d8a94;
}

.g4-details[open] summary::before { content: '▾ '; }

.g4-details__body {
  padding: 0 1.1rem 1rem;
  font-size: 0.92rem;
  color: #3a5f78;
  border-top: 1px solid rgba(32, 61, 82, 0.08);
}

.g4-details__body ol,
.g4-details__body ul {
  margin: 0.75rem 0 0;
  padding-left: 1.25rem;
}

.g4-hierarchy {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.5rem;
  margin: 1.25em 0;
  text-align: center;
  font-size: 0.82rem;
}

.g4-hierarchy__item {
  padding: 0.65rem 0.4rem;
  border-radius: 0.65rem;
  background: #fff;
  border: 1px solid rgba(32, 61, 82, 0.12);
}

.g4-hierarchy__item strong {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 0.78rem;
  color: #0d8a94;
  margin-bottom: 0.2rem;
}

.g4-hierarchy__item span { color: #5a7a94; line-height: 1.35; }

.g4-hierarchy__arrow {
  grid-column: 1 / -1;
  text-align: center;
  color: #b077dd;
  font-size: 1.1rem;
  line-height: 1;
  margin: -0.15rem 0;
}

.g4-thread {
  margin: 1.5em 0;
  padding: 1.25rem 1.2rem;
  border-radius: 0.9rem;
  background: linear-gradient(160deg, rgba(32, 61, 82, 0.05), rgba(62, 207, 217, 0.06));
  border: 1px solid rgba(32, 61, 82, 0.12);
}

.g4-thread__title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: #203d52;
}

.g4-thread__sub {
  margin: 0 0 1rem;
  font-size: 0.88rem;
  color: #5a7a94;
}

.g4-thread ol {
  margin: 0;
  padding-left: 1.25rem;
  color: #3a5f78;
  font-size: 0.92rem;
  line-height: 1.65;
}

.g4-thread ol li { margin-bottom: 0.45rem; }

.g4-thread ol li strong { color: #203d52; }

.g4-duo-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.25em 0;
  font-size: 0.88rem;
}

.g4-duo-table th,
.g4-duo-table td {
  border: 1px solid rgba(32, 61, 82, 0.12);
  padding: 0.65rem 0.75rem;
  text-align: left;
  vertical-align: top;
}

.g4-duo-table th {
  background: rgba(32, 61, 82, 0.06);
  color: #203d52;
  font-weight: 700;
}

.g4-duo-table td code {
  font-size: 0.82em;
}

.g4-duo-table tbody tr:nth-child(even) td {
  background: rgba(32, 61, 82, 0.02);
}

@media (max-width: 768px) {
  .g4-duo-table {
    display: block;
    overflow-x: auto;
  }

  .g4-audience {
    grid-template-columns: 1fr;
  }

  .g4-hierarchy {
    grid-template-columns: 1fr 1fr;
  }

  .g4-lab {
    margin-left: 0;
    margin-right: 0;
    padding: 1.15rem 0.85rem;
    font-size: 0.92rem;
  }

  .g4-stage {
    padding: 0.85rem 0.55rem 1rem;
    overflow: visible;
  }

  .g4-pipeline {
    position: relative;
    margin-bottom: 0.15rem;
  }

  .g4-pipeline::after {
    content: '';
    position: absolute;
    right: -0.55rem;
    top: 0;
    width: 2rem;
    height: calc(100% + 7rem);
    background: linear-gradient(90deg, transparent, #14293a 88%);
    pointer-events: none;
    z-index: 2;
  }

  .g4-track-row {
    scroll-snap-type: x mandatory;
    scroll-padding-inline: 0.65rem;
    padding-bottom: 0.6rem;
    min-height: 6.75rem;
  }

  .g4-step-col {
    flex: 0 0 6.1rem;
    scroll-snap-align: center;
  }

  .g4-card {
    height: 4.75rem;
    padding: 0.5rem 0.4rem;
  }

  .g4-card__name {
    font-size: 0.7rem;
  }

  .g4-card__sub {
    font-size: 0.56rem;
  }

  .g4-card.active::after {
    animation-duration: 2.8s;
  }

  .g4-stepping__lane {
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    padding: 0.4rem 0.35rem;
  }

  .g4-stepping__label {
    flex: none;
    width: 100%;
    font-size: 0.6rem;
  }

  .g4-stepping__cells {
    overflow-x: visible;
    gap: 0.2rem;
  }

  .g4-mini {
    flex: 1 1 0;
    min-width: 0;
    flex-basis: 0;
    height: 2.7rem;
    font-size: 0.5rem;
    line-height: 1.12;
    padding: 0.22rem 0.12rem;
  }

  .g4-controls {
    gap: 0.45rem;
  }

  .g4-btn {
    min-height: 2.75rem;
    padding: 0.65rem 0.9rem;
    font-size: 0.86rem;
  }

  .g4-btn--play {
    flex: 1 1 100%;
  }

  .g4-controls .g4-btn--ghost {
    flex: 1 1 calc(50% - 0.25rem);
  }

  .g4-readout {
    flex: 1 1 100%;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.35rem 0.65rem;
  }

  .g4-readout label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    flex: 1 1 100%;
  }

  .g4-speed-input {
    flex: 1;
    min-width: 5.5rem;
    min-height: 2.25rem;
  }

  .g4-explain {
    font-size: 0.84rem;
    padding: 0.65rem 0.75rem;
  }

  .g4-math-link__body {
    font-size: 0.74rem;
    word-break: break-word;
  }

  .g4-mod {
    min-height: 3.2rem;
    padding: 0.6rem 0.45rem;
  }

  .g4-mod__name {
    font-size: 0.68rem;
  }

  .g4-mod-detail {
    font-size: 0.84rem;
    padding: 0.75rem 0.85rem;
  }

  .g4-modules {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.5rem;
  }
}

/* accessibilité clavier + reduced motion */
.g4-speed-input:focus-visible {
  outline: 2px solid var(--g4-teal);
  outline-offset: 1px;
}

.g4-btn:focus-visible,
.g4-mod:focus-visible {
  outline: 2px solid var(--g4-teal);
  outline-offset: 2px;
}

.g4-speed-input {
  vertical-align: middle;
  accent-color: var(--g4-teal);
  min-height: 1.75rem;
  touch-action: manipulation;
}

@media (prefers-reduced-motion: reduce) {
  .g4-card,
  .g4-mini,
  .g4-mod,
  .g4-progress__fill,
  .g4-progress > i,
  .g4-stepping__lane {
    transition: none;
  }

  .g4-card.active::after {
    animation: none;
    opacity: 0.7;
  }
}
