/* Klantenservice: the phone call example (src/support-calls.mjs, behaviour in assets/support-calls.js).
   Colours come from tokens.css. A regular section: the shared head, then the call on its stage beside what it does,
   in the proportions of the step lists (sims.css .sim-flow), mirrored so the two blue stages on the page alternate.
   Every step keeps its place: parts that are not there yet are covered, not removed, and both states of a label share
   one cell, so the card never changes height. Without JavaScript or with reduced motion the finished, approved call
   shows. */
.calls-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 400px); align-items: center; gap: 16px 32px; }
.calls-copy { display: grid; justify-items: start; gap: 16px; }
.calls-points { display: grid; gap: 14px; }
.calls-points li { display: grid; grid-template-columns: 28px minmax(0, 1fr); align-items: start; gap: 12px; }
.calls-points li > span:last-child { display: grid; gap: 2px; color: var(--ink-muted); font-size: 15px; line-height: 1.5; }
.calls-points b { color: var(--ink); font-weight: 500; }
.calls-point-icon { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 8px; background: var(--blue-soft); color: var(--blue); }
.calls-note { display: flex; align-items: flex-start; gap: 10px; margin-top: 8px; padding-top: 16px; border-top: 1px solid var(--line); color: var(--ink-muted); font-size: 13.5px; line-height: 1.5; }
.calls-note .i { flex: none; margin-top: 2px; color: var(--ink-subtle); }

.calls-demo { position: relative; display: grid; gap: 14px; min-width: 0; }
.vc-stage { display: grid; place-items: center; min-width: 0; padding: 28px; border: 1px solid var(--line-soft); border-radius: var(--r-card); background: var(--hue-soft); }
.vc-window { container-type: inline-size; width: 100%; max-width: 440px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r-card); background: var(--canvas); box-shadow: var(--shadow-sim); color: var(--ink); font-size: 14px; line-height: 1.4; text-align: left; }
.vc-top { display: flex; align-items: center; gap: 10px; min-height: 56px; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.vc-av { display: grid; flex: none; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--hue-soft); color: var(--hue); }
.vc-who { display: grid; min-width: 0; line-height: 1.3; }
.vc-who b { font-weight: 500; }
.vc-who small { color: var(--ink-muted); font-size: 12.5px; }
.vc-state { display: inline-grid; flex: none; margin-left: auto; }
.vc-state > em { grid-area: 1 / 1; justify-self: end; display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--r-pill); font-size: 12.5px; font-weight: 500; white-space: nowrap; }
.vc-live { background: var(--accent-soft); color: var(--accent); visibility: hidden; }
.vc-live i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.vc-ended { background: var(--green-soft); color: var(--green); }
.is-calling .vc-live { visibility: visible; }
.is-calling .vc-ended { visibility: hidden; }

.vc-body { display: grid; gap: 10px; padding: 14px 16px 16px; }
.vc-wave { display: flex; align-items: center; gap: 3px; height: 32px; }
.vc-wave i { flex: 1; height: calc(var(--h) * 1%); border-radius: 2px; background: var(--hue); opacity: .3; transform-origin: center; }
.is-calling .vc-wave i { opacity: .6; }
.is-running.is-calling .vc-wave i { animation: vc-wave .9s ease-in-out infinite alternate; animation-delay: calc(var(--i) * -70ms); }
@keyframes vc-wave { from { transform: scaleY(.35); } }
.vc-lines { display: grid; gap: 6px; }
.vc-lines li { display: grid; grid-template-columns: 76px minmax(0, 1fr); gap: 8px; font-size: 13.5px; line-height: 1.45; }
.vc-lines b { color: var(--ink-muted); font-weight: 500; }
.vc-summary { display: grid; gap: 4px; padding: 10px 12px; border-radius: 12px; background: var(--hue-soft); }
.vc-summary small, .vc-label { color: var(--ink-muted); font-size: 12.5px; font-weight: 500; }
.vc-summary small { color: var(--hue); }
.vc-summary p { font-size: 13.5px; line-height: 1.45; }
.vc-actions { display: grid; gap: 6px; }
.vc-actions ul { display: grid; gap: 5px; }
.vc-actions li { display: grid; grid-template-columns: 20px minmax(0, 1fr); align-items: center; gap: 8px; font-size: 13.5px; }
.vc-ok { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--green-soft); color: var(--green); }
.vc-approve { display: grid; gap: 8px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.vc-pending { display: grid; grid-template-columns: 18px minmax(0, 1fr) auto; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 500; }
.vc-tag { display: inline-grid; }
.vc-tag > span { grid-area: 1 / 1; justify-self: end; display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: var(--r-pill); font-size: 12px; font-weight: 500; white-space: nowrap; }
.vc-tag-wait { background: var(--ochre-soft); color: var(--ochre); }
.vc-tag-done { background: var(--green-soft); color: var(--green); visibility: hidden; }
.vc-approve:has(.crew-go.is-clicked) .vc-tag-wait { visibility: hidden; }
.vc-approve:has(.crew-go.is-clicked) .vc-tag-done { visibility: visible; }

/* Steps that have not happened yet keep their place under a cover in the card's own colour, so the card is calm and
   nothing moves. Only the step that comes next waits as a soft block in its own shape. A cover fades away when its
   step happens, and fades back in when the scene starts again. */
.is-armed [data-at] { position: relative; }
.is-armed [data-at]::after {
  content: ""; position: absolute; inset: 0; z-index: 1; border-radius: 10px; pointer-events: none; background: var(--canvas);
  opacity: 0; visibility: hidden; transition: opacity .4s var(--enter), visibility 0s linear .4s;
}
.is-armed [data-at].is-next::after {
  background: linear-gradient(100deg, transparent 35%, var(--glass-strong) 50%, transparent 65%) 0 0 / 250% 100% no-repeat, linear-gradient(var(--wash), var(--wash)), var(--canvas);
}
.is-armed .vc-lines [data-at]::after { inset: 1px 0; border-radius: 6px; }
/* The go-ahead block's cover also hides its top rule (a cover spans the padding box, not the border). */
.is-armed .vc-approve[data-at]::after { inset: -1px 0 0; }
/* A little wider than the row itself, so no tick or letter edge shows past the block. */
.is-armed .vc-actions li[data-at]::after, .is-armed .vc-label[data-at]::after { inset: -2px -3px; border-radius: 8px; }
.is-armed [data-at]:not(.is-on)::after { opacity: 1; visibility: visible; transition: opacity .3s var(--enter); }
.is-armed.is-running [data-at].is-next:not(.is-on)::after { animation: vc-shimmer 1.4s linear infinite; }
@keyframes vc-shimmer { from { background-position: 100% 0, 0 0, 0 0; } to { background-position: 0 0, 0 0, 0 0; } }

.calls-foot { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.calls-foot .sim-caption { margin-top: 0; }
.calls-pause {
  display: grid; place-items: center; flex: none; width: 44px; height: 44px; border: 1px solid var(--line-ink); border-radius: 50%;
  background: var(--canvas); color: var(--ink); cursor: pointer; transition: border-color var(--fast);
}
.calls-pause:hover { border-color: var(--ink-subtle); }
.calls-pause:focus-visible { outline: none; box-shadow: var(--focus); }
.calls-pause .i-resume, .calls-pause[aria-pressed="true"] .i-pause { display: none; }
.calls-pause[aria-pressed="true"] .i-resume { display: block; }

@container (max-width: 380px) {
  .vc-top { display: grid; grid-template-columns: 32px minmax(0, 1fr); gap: 4px 10px; }
  .vc-state { grid-column: 2; margin-left: 0; }
  .vc-state > em { justify-self: start; }
}
@container (max-width: 360px) {
  .vc-lines li { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .vc-pending { grid-template-columns: 18px minmax(0, 1fr); }
  .vc-pending .vc-tag { grid-column: 2; }
  .vc-pending .vc-tag > span { justify-self: start; }
}
@media (max-width: 899px) {
  .calls-grid { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
@media (max-width: 640px) {
  .vc-stage { padding: 12px; }
  .vc-top { padding-inline: 14px; }
  .vc-body { padding: 12px 14px 14px; }
}
@media (prefers-reduced-motion: reduce) {
  .is-armed [data-at]::after { transition: none; animation: none; }
  .vc-wave i { animation: none; }
  .vc-tag-wait { visibility: hidden; }
  .vc-tag-done { visibility: visible; }
}
