/* Événements AQM : cadre de décollement dans Intervalles et popup de rejeu sagittal.
   Planche : Docs/refs/aqm-events-design.html. Jetons de tokens.css ; infobulles MuUI. */
.gev-scrim, .gev-chip {
  --gev-left-soft: rgba(232,95,90,.16); --gev-right-soft: rgba(43,127,196,.14);
  --gev-skel: #4a5e48; --gev-skel-far: #a9b8a6;
}
:root[data-theme="dark"] .gev-scrim, :root[data-theme="dark"] .gev-chip {
  --gev-left-soft: rgba(232,97,90,.2); --gev-right-soft: rgba(86,167,232,.2);
  --gev-skel: #eef2ec; --gev-skel-far: #55627a;
}

/* ── ligne d'Intervalles ── */
.gev-chip { flex: none; display: inline-flex; align-items: center; gap: 3px; height: 18px; padding: 0 5px; border-radius: 6px;
  font: 10.5px var(--font-mono); border: 1px solid currentColor; background: transparent; cursor: pointer; white-space: nowrap; }
.gev-chip.det { border-style: dashed; }
.gev-chip.rev { background: var(--bg-sunken); }
.gev-chip.rev::before { content: '✓'; font-family: var(--font); }
.gev-chip.none { color: var(--ink-muted); border-color: var(--border); }
.gev-chip:hover { background: var(--bg-active); }

/* ── popup ── */
.gev-scrim { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 16px;
  background: rgba(12,20,30,.55); outline: none; overflow: auto; }
.gev-dlg, .gev-confirm { color: var(--ink); background: var(--bg-surface); border-radius: var(--r-lg); box-shadow: var(--shadow-lg); }
.gev-dlg { width: min(880px, 100%); overflow: hidden; font-size: var(--fs-sm); }
.gev-confirm { max-width: 420px; padding: 18px 20px; }
.gev-confirm p { margin: 0 0 14px; font-size: var(--fs-base); }
.gev-actions { display: flex; justify-content: flex-end; gap: 8px; }
.gev-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 12px 16px; border-bottom: 1px solid var(--border-soft); }
.gev-head h3 { margin: 0; font-size: 15px; font-weight: 600; white-space: nowrap; }
.gev-sub { color: var(--ink-2); }
.gev-sp { flex: 1; }
.gev-x { width: 28px; height: 28px; border: 0; border-radius: 8px; background: transparent; font-size: 18px; color: var(--ink-2); cursor: pointer; }
.gev-x:hover { background: var(--bg-hover); }
.gev-help { display: inline-grid; place-items: center; width: 20px; height: 20px; padding: 0; border-radius: 50%;
  border: 1px solid var(--border); background: var(--bg-surface); color: var(--ink-muted); font: 600 11px var(--font); cursor: help; }
.gev-help:hover { color: var(--ink); background: var(--bg-hover); }
.gev-cycles { display: flex; flex-wrap: wrap; gap: 4px; padding: 8px 16px; border-bottom: 1px solid var(--border-soft); }
.gev-cyc { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border-radius: var(--r-pill);
  border: 1px solid var(--border); background: var(--bg-surface); font-size: var(--fs-xs); cursor: pointer; }
.gev-cyc .d { width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; }
.gev-cyc.rev .d { background: currentColor; }
.gev-cyc.det .d { border-style: dotted; }
.gev-cyc.s1 { color: var(--side-left); } .gev-cyc.s2 { color: var(--side-right); }
.gev-cyc.off { opacity: .5; }
.gev-cyc[aria-current="true"] { background: var(--bg-active); border-color: currentColor; font-weight: 600; }
.gev-body { display: grid; grid-template-columns: minmax(0, 1fr) 210px; }
.gev-view { position: relative; background: var(--viewport-bg); min-height: 300px; }
.gev-view svg { display: block; width: 100%; height: 300px; }
.gev-tag, .gev-phase { position: absolute; top: 8px; font-size: var(--fs-xs); padding: 2px 8px; border-radius: var(--r-pill); background: var(--bg-surface); }
.gev-tag { left: 10px; color: var(--ink-2); opacity: .92; }
.gev-phase { right: 10px; font-weight: 600; }
.gev-side { padding: 12px 14px; border-left: 1px solid var(--border-soft); display: flex; flex-direction: column; gap: 10px; }
.gev-who { font-weight: 600; }
.gev-ev { display: grid; grid-template-columns: auto 1fr auto; gap: 0 8px; align-items: baseline; border-radius: 6px; margin: -2px -4px; padding: 2px 4px; }
.gev-ev:hover { background: var(--bg-hover); }
.gev-ev b { font-weight: 600; }
.gev-ev .v { font-family: var(--font-mono); font-size: var(--fs-xs); text-align: right; }
.gev-ev .s { grid-column: 2 / 4; font-size: var(--fs-xs); }
.gev-ev .ic { width: 12px; text-align: center; color: var(--ink-muted); }
.gev-ev .st-det { color: var(--warn); } .gev-ev .st-rev { color: var(--primary-hi); } .gev-ev .st-seg { color: var(--ink-muted); }
.gev-kpi { display: flex; gap: 10px; padding-top: 8px; border-top: 1px solid var(--border-soft); }
.gev-kpi div { flex: 1; }
.gev-kpi small { display: block; font-size: 10.5px; color: var(--ink-muted); }
.gev-kpi b { font: 600 var(--fs-md, 13px) var(--font-mono); }
.gev-transport { display: flex; align-items: center; gap: 6px; padding: 8px 16px 0; }
.gev-tb { height: 28px; min-width: 28px; padding: 0 8px; border: 1px solid var(--border); border-radius: var(--r-btn);
  background: var(--bg-surface); color: var(--ink); font-size: var(--fs-sm); cursor: pointer; white-space: nowrap; }
.gev-tb:hover { background: var(--bg-hover); }
.gev-tb.primary { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
:root[data-theme="dark"] .gev-tb.primary { color: #151e2d; }
.gev-tb.primary:hover { background: var(--primary-hi); }
.gev-tb[aria-pressed="true"] { background: var(--bg-active); font-weight: 600; }
.gev-time { font-family: var(--font-mono); font-size: var(--fs-xs); color: var(--ink-2); margin-left: 6px; white-space: nowrap; }
.gev-speed { display: inline-flex; gap: 2px; }
.gev-ruler-wrap { position: relative; padding: 16px 16px 10px; }
.gev-ruler-wrap .gev-help { position: absolute; left: 14px; bottom: 12px; }
.gev-ruler { position: relative; height: 118px; user-select: none; touch-action: none; }
.gev-ruler svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.gev-mk { cursor: ew-resize; }
.gev-mk text { font: 600 10px var(--font); pointer-events: none; }
.gev-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 10px 16px; border-top: 1px solid var(--border-soft); background: var(--bg-sunken); }
.gev-msg { font-size: var(--fs-xs); color: var(--ink-2); flex: 1; min-width: 120px; }
.gev-lnk { border: 0; background: transparent; color: var(--ink-2); text-decoration: underline; font-size: var(--fs-sm); padding: 0 4px; cursor: pointer; }
@media (max-height: 820px) {
  .gev-view { min-height: 0; }
  .gev-view svg { height: min(300px, calc(100vh - 470px)); min-height: 150px; }
}
@media (max-width: 760px) {
  .gev-body { grid-template-columns: 1fr; }
  .gev-side { border-left: 0; border-top: 1px solid var(--border-soft); }
  .gev-view svg { height: 240px; }
  .gev-speed { display: none; }
  .gev-scrim { padding: 8px; }
}

/* Une ligne d'Intervalles avec son cadre reste sur une ligne : le titre garde sa place,
   la plage d'images s'efface d'abord (colonne étroite de l'espace AQM). */
.seg-row:has(.gev-chip) .n { min-width: 4em; }
.seg-row:has(.gev-chip) .sp { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
