/* support: manual-kit — the look shared by the tutorial presets. Tokens only (piece.css semantic vars over the
   resolver's --brand-color-*), shade + elevation instead of borders, no glow, no gradient, no blur.
   © Dudoxx UG / Acceleate Consulting - Walid Boudabbous <walid@acceleate.com> */

/* ---- screen frame: one real capture inside a quiet browser shell ---------------------------------------- */
.mk-frame { position: relative; flex: 0 0 auto; border-radius: 1.1cqw; background: var(--card); box-shadow: var(--lift); overflow: hidden; }
/* v6 laptop (owner 2026-10-29): dark bezel lid in 3D + porcelain base deck; replaces the macOS window chrome.
   Owner override for this device only: one faint glass reflection gradient on the lid. No borders: shade + shadow. */
.mk-frame.mk-laptop { overflow: visible; background: none; box-shadow: none; border-radius: 0; perspective: 75cqw; perspective-origin: 50% 35%; }
.mk-device { position: relative; transform-style: preserve-3d; }
.mk-lid { position: relative; padding: 0.8cqw 0.8cqw 1.3cqw; border-radius: 1.3cqw 1.3cqw 0.45cqw 0.45cqw;
  transform-origin: 50% 100%; transform: rotateX(3deg);
  /* v6.1 (owner 2026-10-31, iPhone: blank screen + flicker on every chapter): FLAT, never preserve-3d. In a 3D
     context iOS Safari depth-sorts the co-planar view / glass / camera dot (z-fight flicker) and keeps the capture
     as an untiled 3D layer that it drops when GPU memory runs short (blank screen). Flat = one plane, one layer. */
  transform-style: flat;
  background: color-mix(in oklch, var(--brand-color-dark-bg, #0b1020) 88%, black);
  box-shadow: 0 0 0 0.12cqw color-mix(in oklch, var(--brand-color-dark-fg, #f3f5fa) 14%, transparent) inset,
    0 0.4cqw 0.8cqw color-mix(in oklch, var(--brand-color-fg, #121a2b) 18%, transparent),
    0 2.2cqw 4.4cqw color-mix(in oklch, var(--brand-color-fg, #121a2b) 22%, transparent); }
.mk-lid > .mk-view { border-radius: 0.35cqw; }
.mk-cam { position: absolute; left: 50%; top: 0.28cqw; width: 0.3cqw; aspect-ratio: 1; translate: -50% 0; border-radius: 50%;
  background: color-mix(in oklch, var(--brand-color-dark-fg, #f3f5fa) 22%, var(--brand-color-dark-bg, #0b1020));
  box-shadow: 0 0 0 0.08cqw color-mix(in oklch, var(--accent) 35%, transparent); }
.mk-glass { position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  background: linear-gradient(118deg, color-mix(in oklch, white 9%, transparent) 0%, color-mix(in oklch, white 3%, transparent) 34%, transparent 35%); }
.mk-base { position: relative; display: block; height: 1.2cqw; margin: -0.05cqw -4.5% 0; border-radius: 0.2cqw 0.2cqw 1.6cqw 1.6cqw / 0.2cqw 0.2cqw 1cqw 1cqw;
  background: linear-gradient(180deg, var(--brand-color-bg, #f9fafd) 0%, color-mix(in oklch, var(--brand-color-bg, #f9fafd) 82%, var(--brand-color-fg, #121a2b)) 100%);
  box-shadow: 0 0.6cqw 1.4cqw color-mix(in oklch, var(--brand-color-fg, #121a2b) 22%, transparent),
    0 1.8cqw 3.6cqw -0.6cqw color-mix(in oklch, var(--brand-color-fg, #121a2b) 26%, transparent); }
.mk-base::before { content: ""; position: absolute; left: 50%; top: 0; width: 14%; height: 0.45cqw; translate: -50% 0; border-radius: 0 0 0.6cqw 0.6cqw;
  background: color-mix(in oklch, var(--brand-color-bg, #f9fafd) 70%, var(--brand-color-fg, #121a2b)); }
.mk-view { position: relative; overflow: hidden; background: var(--recess); }
/* v6.1: no will-change here — a forced layer under the 3D lid is the iOS blank-screen case (see .mk-lid) */
.mk-pan { position: absolute; inset: 0; transform-origin: 0 0; }
.mk-img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; user-select: none; }
.mk-layer { position: absolute; inset: 0; }

/* ---- hotspot ring + numbered pin (image-% placed) --------------------------------------------------------- */
.mk-spot { position: absolute; border-radius: 0.6cqw; opacity: 0; pointer-events: none;
  box-shadow: 0 0 0 0.22cqw var(--accent), 0 0 0 0.8cqw color-mix(in oklch, var(--accent) 18%, transparent); transition: none; }
.mk-spot.is-past { box-shadow: 0 0 0 0.16cqw color-mix(in oklch, var(--accent) 55%, transparent); }
.mk-pin { position: absolute; display: grid; place-items: center; width: 2.4cqw; aspect-ratio: 1; translate: -95% -95%; /* outside the ring's corner: never covers the control it names */ border-radius: 50%;
  background: var(--accent); color: var(--brand-color-primary-foreground); box-shadow: var(--lift);
  font-family: var(--face-head); font-weight: 700; font-size: var(--fs-label); line-height: 1; opacity: 0; }

/* ---- note list (ui-tour callouts, step-rail steps) -------------------------------------------------------- */
.mk-notes { display: grid; gap: 0.9cqw; margin: 1.6cqw 0 0; padding: 0; list-style: none; counter-reset: mk; }
.mk-note { position: relative; display: grid; grid-template-columns: 2.4cqw 1fr; gap: 0.2cqw 1cqw; align-items: start;
  padding: 0.8cqw 1cqw; border-radius: 0.8cqw; background: transparent; color: var(--muted); }
.mk-note > .mk-num { grid-row: span 2; display: grid; place-items: center; width: 2.4cqw; aspect-ratio: 1; border-radius: 50%;
  background: var(--recess); color: var(--ink); font-family: var(--face-head); font-weight: 700; font-size: var(--fs-label); }
.mk-note > b { font-family: var(--face-head); font-size: var(--fs-label); font-weight: 650; color: var(--ink); line-height: 1.2; }
.mk-note > span { font-size: var(--fs-label); line-height: 1.3; }
.mk-notes.is-dense { gap: 0.4cqw; }
.mk-notes.is-dense .mk-note { padding-block: 0.5cqw; }
.mk-notes.is-dense .mk-note > span { display: none; }
.mk-notes.is-dense .mk-note.is-on > span { display: block; }
.mk-note.is-on { background: color-mix(in oklch, var(--accent) 10%, var(--card)); box-shadow: var(--lift); color: var(--ink); }
.mk-note.is-on > .mk-num, .mk-note.is-done > .mk-num { background: var(--accent); color: var(--brand-color-primary-foreground); }

/* ---- label chip riding a cursor stop ---------------------------------------------------------------------- */
/* the offset sits in `transform` (applied INSIDE `scale`, origin 0 0), so the focus camera's counter-scale (click-path
   render sets `scale` = 1 / zoom) keeps the chip AND its offset from the click point at the designed size */
.mk-chip { position: absolute; transform-origin: 0 0; transform: translate(0.9cqw, -130%); padding: 0.35cqw 0.9cqw; border-radius: 0.6cqw; white-space: nowrap;
  background: var(--ink); color: var(--card); font-family: var(--face-head); font-size: var(--fs-label); font-weight: 600; opacity: 0; }
.mk-chip.is-left { transform: translate(calc(-100% - 0.9cqw), -130%); }
.mk-anchor { position: absolute; width: 0; height: 0; }
.mk-type { position: absolute; transform-origin: 0 0; transform: translate(0, -50%); padding: 0.25cqw 0.6cqw; border-radius: 0.4cqw; background: var(--card);
  box-shadow: 0 0 0 0.18cqw var(--accent); color: var(--ink); font-size: var(--fs-label); white-space: nowrap; opacity: 0; }

@media (prefers-reduced-motion: reduce) {
  .mk-spot, .mk-pin, .mk-chip { opacity: 1; }
}

/* v5.1 virtual cursor + click ripple (inside the capture layer; counter-scaled against the follow-zoom) */
.mk-cursor { position: absolute; width: 1.9cqw; aspect-ratio: 1; transform-origin: 0 0; opacity: 0; z-index: 6; pointer-events: none; }
.mk-cursor svg { width: 100%; height: 100%; display: block; }
.mk-cursor { overflow: visible; }
.mk-cursor svg { overflow: visible; }
/* 2026-11-05 (owner: "the arrow of the mouse click effects" was lost on dark captures and under a studio look): the
   arrow takes the LIGHT-set ink and ground tokens whatever the scene's look, so it is a dark arrow with a light outline
   over any capture; a solid offset shade (zero blur) lifts it off a busy UI. */
.mk-cursor path { fill: var(--brand-color-fg); stroke: var(--brand-color-bg); stroke-width: 2; stroke-linejoin: round; paint-order: stroke; }
.mk-cursor path.mk-cur-shade { fill: color-mix(in oklch, var(--brand-color-fg) 34%, transparent); stroke: none; }
/* click ripple: an accent ring with a light rim (both solid spreads, no blur) + a faint accent disc, counter-scaled */
.mk-click { position: absolute; width: 3.4cqw; aspect-ratio: 1; border-radius: 50%; translate: -50% -50%; z-index: 5; pointer-events: none;
  background: color-mix(in oklch, var(--accent) calc(var(--k, 0) * 22%), transparent);
  box-shadow: 0 0 0 0.3cqw var(--accent), 0 0 0 0.5cqw color-mix(in oklch, var(--brand-color-bg) 85%, transparent),
    inset 0 0 0 0.12cqw color-mix(in oklch, var(--brand-color-bg) 85%, transparent);
  opacity: var(--k, 0); transform: scale(calc(var(--z, 1) * (1.6 - var(--k, 0) * 0.9))); }

/* ---- frame "stage" (2026-11-05): the capture is the hero, no device ------------------------------------------
   Owner review: laptop captures were ~46cqw wide and unreadable, worst on a phone. The stage layout gives the capture
   the full safe height (16:9 -> ~62cqw wide at 16:10) beside a narrow 23cqw copy rail, and the full stage width on a
   portrait phone. Shade + layered elevation, one radius, no border, no glow, no gradient (D-017). */
.scene.mk-stage { --safe-top: 8cqw; --safe-bottom: 9cqw; --safe-h: calc(56.25cqw - var(--safe-top) - var(--safe-bottom)); gap: 3cqw; }
.scene.mk-stage .col-text { flex: 1 1 0; min-width: 21cqw; max-width: 27cqw; }
.scene.mk-stage .col-text .title { font-size: var(--fs-title-stage, 2.9cqw); line-height: 1.08; letter-spacing: -0.01em; text-wrap: balance; }
.scene.mk-stage .col-text .kicker { margin-bottom: 0.9cqw; }
.mk-stage-frame { flex: 0 0 auto; width: min(calc(100cqw - 2 * var(--safe-x) - 24cqw), calc(var(--safe-h) * var(--mk-ratio, 1.6)));
  border-radius: 1.2cqw; background: var(--card); overflow: hidden; transform-origin: 50% 100%;
  box-shadow: 0 0 0 0.07cqw color-mix(in oklch, var(--ink) 9%, transparent),
    0 0.25cqw 0.6cqw color-mix(in oklch, var(--ink) 7%, transparent),
    0 1.6cqw 3.6cqw -0.4cqw color-mix(in oklch, var(--ink) 16%, transparent),
    0 4cqw 8cqw -2cqw color-mix(in oklch, var(--accent) 10%, transparent); }
.mk-stage-frame > .mk-view { width: 100%; aspect-ratio: var(--mk-ratio, 1.6); }
/* notes in the narrow rail: number chip + label; the line of help text only for the active note */
.scene.mk-stage .mk-notes { gap: 0.5cqw; margin-top: 1.4cqw; }
.scene.mk-stage .mk-note { grid-template-columns: 2.2cqw 1fr; padding: 0.7cqw 0.9cqw; }
.scene.mk-stage .mk-note > span { display: none; }
.scene.mk-stage .mk-note.is-on > span { display: block; }
.scene.mk-stage .mk-pin { width: 2.1cqw; }

/* ---- device frames at stage size (2026-11-05): frame "laptop" | "display" | "phone" -------------------------------
   The shell is device-stage.css (.ds-device · .ds-front · .ds-screen · .ds-island · .ds-cam-dot · .ds-stand, ink | paper
   finish). Here only the SIZE and the static pose: the screen is as large as the safe height leaves after the device
   reserve (--mk-res = bezels + chin + deck / stand), capped by the width the copy rail leaves (--mk-avail). Flat shell
   (no preserve-3d under a capture, see .mk-lid), slab edges and back plate off, depth = zero-blur solid shade. */
.mk-frame.mk-dev-frame { --mk-avail: calc(100cqw - 2 * var(--safe-x) - 24cqw); --mk-hmax: var(--safe-h); --mk-bz: 0.8cqw; --mk-chin: 0cqw; --mk-res: 2cqw;
  --mk-sw: min(calc(var(--mk-avail) - 2 * var(--mk-bz)), calc((var(--mk-hmax) - var(--mk-res)) * var(--mk-ratio, 1.6)));
  flex: 0 0 auto; display: flex; flex-direction: column; align-items: center; overflow: visible; background: none; box-shadow: none; border-radius: 0; transform-origin: 50% 100%; }
.mk-dev-body { display: flex; flex-direction: column; align-items: center; transform-origin: 50% 100%; }
.mk-dev-frame .ds-device { --ds-bezel: var(--mk-bz);
  position: relative; left: auto; top: auto; flex: 0 0 auto; transform: none; transform-style: flat; aspect-ratio: auto;
  width: calc(var(--mk-sw) + 2 * var(--mk-bz)); height: calc(var(--mk-sw) / var(--mk-ratio, 1.6) + 2 * var(--mk-bz) + var(--mk-chin)); }
.mk-dev-frame .ds-device::after, .mk-dev-frame .ds-edge { display: none; }
.mk-dev-frame .ds-front { padding: var(--mk-bz) var(--mk-bz) calc(var(--mk-bz) + var(--mk-chin)); transform: none; backface-visibility: visible;
  box-shadow: 0 0 0 1px var(--rule), 0 0.35cqw 0 0 color-mix(in oklch, var(--ink) 18%, transparent), 0 0.9cqw 0 -0.3cqw color-mix(in oklch, var(--ink) 9%, transparent); }
.mk-dev-frame .ds-screen > .mk-view { position: absolute; inset: 0; }
/* laptop: a thin lid bezel with the camera dot + a solid base deck (10 % wider than the lid) with the finger notch */
.mk-frame.mk-dev-laptop { --mk-bz: 0.85cqw; --mk-chin: 0.45cqw; --mk-res: 3.9cqw; }
.mk-dev-laptop .ds-device, .mk-dev-laptop .ds-front { --ds-r: 1.2cqw; border-radius: var(--ds-r) var(--ds-r) 0.4cqw 0.4cqw; }
.mk-dev-laptop .ds-screen { border-radius: 0.35cqw; }
.mk-dev-deck { position: relative; display: block; flex: 0 0 auto; width: calc((var(--mk-sw) + 2 * var(--mk-bz)) * 1.1); height: 1.3cqw; margin-top: -0.05cqw;
  border-radius: 0.15cqw 0.15cqw 1.3cqw 1.3cqw / 0.15cqw 0.15cqw 0.9cqw 0.9cqw;
  background: color-mix(in oklch, var(--ink) 34%, var(--card));
  box-shadow: inset 0 -0.35cqw 0 color-mix(in oklch, var(--ink) 52%, var(--card)), 0 0.4cqw 0 -0.1cqw color-mix(in oklch, var(--ink) 14%, transparent); }
.mk-dev-deck::before { content: ""; position: absolute; left: 50%; top: 0; width: 13%; height: 0.42cqw; translate: -50% 0; border-radius: 0 0 0.6cqw 0.6cqw;
  background: color-mix(in oklch, var(--ink) 58%, var(--card)); }
/* display (iMac-like): even thin bezel, a deep chin in the shell finish, neck + foot stand */
.mk-frame.mk-dev-display { --mk-bz: 0.6cqw; --mk-chin: 2.1cqw; --mk-res: 7.2cqw; }
.mk-dev-display .ds-device { --ds-r: 0.8cqw; }
.mk-dev-display .ds-device .ds-cam-dot { display: block; }
/* the stand sits outside .ds-device, so it takes the finish's side tokens here (device-stage defines them on the body) */
.mk-dev-display .ds-stand { --ds-side: color-mix(in oklch, var(--ink) 70%, var(--card)); --ds-side-2: color-mix(in oklch, var(--ink) 82%, var(--card)); }
.mk-dev-display.mk-dev-paper .ds-stand { --ds-side: color-mix(in oklch, var(--ink) 16%, var(--card)); --ds-side-2: color-mix(in oklch, var(--ink) 26%, var(--card)); }
.mk-dev-display .ds-stand { position: relative; left: auto; top: auto; transform: none; flex: 0 0 auto; width: calc((var(--mk-sw) + 2 * var(--mk-bz)) * 0.26); height: 3.9cqw; margin-top: -0.1cqw; }
.mk-dev-display .ds-neck { left: 38%; width: 24%; height: 82%; border-radius: 0 0 0.3cqw 0.3cqw; }
.mk-dev-display .ds-foot { height: 0.55cqw; border-radius: 0.3cqw; }
/* phone (iPhone-like): rounded slab, a floating island (no notch); portrait by nature, a landscape capture turns it */
.mk-frame.mk-dev-phone { --mk-bz: 0.7cqw; --mk-res: 1.8cqw; }
.mk-dev-phone .ds-device { --ds-r: 2.8cqw; }
.mk-dev-phone .ds-screen { border-radius: calc(var(--ds-r) - var(--mk-bz)); }
.mk-dev-phone .ds-island { top: calc(var(--mk-bz) + 0.55cqw); width: min(24%, 5.1cqw); height: auto; aspect-ratio: 3.4; }
.mk-dev-land .ds-island { left: calc(var(--mk-bz) + 0.55cqw); top: 50%; width: auto; height: min(24%, 5.1cqw); aspect-ratio: 1 / 3.4; transform: translateY(-50%); }
/* a portrait phone leaves the copy rail wider: the frame is narrow, the scene keeps its gap */
.scene.mk-stage:has(.mk-dev-phone:not(.mk-dev-land)) .col-text { max-width: 34cqw; }
/* ---- piece.captureSize "large" (2026-11-09): the 16:9 stage scene (ui-tour, click-path) trades margin for screen --
   runtime.js puts .mk-size-large on #stage. Default laptop = 825/1633 px (0.505, height-bound by --safe-h + the 24cqw
   rail). Here: safe margins 5.6/7.4cqw (the device top clears the brand corner, the bottom clears the caption pill),
   a 2.4cqw gap + 18cqw copy rail, a slimmer laptop chrome (res = 2 bezels + chin + deck), --mk-hmax 0.6cqw over the
   safe height. The laptop width cap is divided by the deck's 1.1 so the deck never runs into the copy column.
   step-rail / form-fill keep their wider rails (they are width-bound, not height-bound). Phone portrait unchanged. */
@media (min-width: 601px), (orientation: landscape) {
  .stage.mk-size-large .scene.mk-stage { --safe-top: 5.6cqw; --safe-bottom: 7.4cqw; gap: 2.4cqw; }
  .stage.mk-size-large .scene.mk-stage .col-text { min-width: 18cqw; max-width: 22cqw; }
  .stage.mk-size-large .scene.mk-stage:has(.col-text) .mk-stage-frame { width: min(calc(100cqw - 2 * var(--safe-x) - 20.4cqw), calc(var(--safe-h) * var(--mk-ratio, 1.6))); }
  .stage.mk-size-large .scene.mk-stage .mk-frame.mk-dev-frame { --mk-hmax: calc(var(--safe-h) + 0.6cqw); }
  .stage.mk-size-large .scene.mk-stage:has(.col-text) .mk-frame.mk-dev-frame { --mk-avail: calc(100cqw - 2 * var(--safe-x) - 20.4cqw); }
  .stage.mk-size-large .scene.mk-stage:has(.col-text) .mk-frame.mk-dev-laptop { --mk-avail: calc((100cqw - 2 * var(--safe-x) - 20.4cqw) / 1.1); }
  .stage.mk-size-large .scene.mk-stage .mk-frame.mk-dev-laptop { --mk-bz: 0.6cqw; --mk-chin: 0.3cqw; --mk-res: 2.5cqw; }
  .stage.mk-size-large .scene.mk-stage .mk-dev-laptop .mk-dev-deck { height: 1cqw; }
}
/* per-preset rail widths (the space the copy column takes beside the device) */
.preset-step-rail .mk-frame.mk-dev-frame { --mk-avail: calc(100cqw - 2 * var(--safe-x) - 36cqw); }
.preset-click-path:not(:has(.col-text)) .mk-frame.mk-dev-frame { --mk-avail: calc(100cqw - 2 * var(--safe-x)); }
.preset-form-fill .mk-frame.mk-dev-frame { --mk-avail: calc(100cqw - 2 * var(--safe-x) - 31cqw); }
.preset-form-fill:not(:has(.col-text)) .mk-frame.mk-dev-frame { --mk-avail: calc(100cqw - 2 * var(--safe-x)); }

@media (max-width: 600px) and (orientation: portrait) {
  /* phone: copy on top, the capture at full stage width under it; only the active note shows (the pins carry the
     numbers on the capture), so the column never pushes the capture under the caption slot */
  .stage .scene.mk-stage { --safe-top: 13cqw; gap: 3.5cqw; }
  .stage .scene.mk-stage .col-text { max-width: none; min-width: 0; flex: 0 0 auto; }
  .stage .scene.mk-stage .col-text .title { font-size: var(--fs-headline); }
  .stage .scene.mk-stage .accent-rail { display: none; }
  .stage .scene.mk-stage .mk-notes { margin-top: 2.4cqw; min-height: 15cqw; }
  .stage .scene.mk-stage .mk-note { display: none; grid-template-columns: max(2.4cqw, 22px) 1fr; padding: 2cqw 2.6cqw; border-radius: 2.4cqw; }
  .stage .scene.mk-stage .mk-note.is-on { display: grid; }
  .stage .scene.mk-stage .mk-note > .mk-num { width: max(2.4cqw, 22px); }
  .stage .mk-stage-frame { width: 100%; border-radius: 2.6cqw; }
  .stage .scene.mk-stage .mk-pin { width: max(2.1cqw, 18px); font-size: max(1.4cqw, 11px); }
  .stage .scene.mk-stage .mk-chip, .stage .scene.mk-stage .mk-type { font-size: max(1.4cqw, 11px); }
}
@media (max-width: 600px) and (orientation: portrait) {
  .stage .scene.mk-stage .mk-notes { width: 100%; }
  .stage .scene.mk-stage .mk-note.is-on { width: 100%; box-sizing: border-box; }
}
@media (max-width: 600px) and (orientation: portrait) {
  /* device frames on a phone: the full stage width, the phone-portrait safe height; a portrait phone frame stays centred */
  .stage .mk-frame.mk-dev-frame { --mk-avail: calc(100cqw - 2 * var(--safe-x)); --mk-hmax: 62cqw; width: 100%; } /* the 3:4 phone stage, not the 16:9 mk-stage safe height */
  .stage .mk-frame.mk-dev-laptop { --mk-avail: calc((100cqw - 2 * var(--safe-x)) / 1.1); }
  .stage .mk-frame.mk-dev-laptop { --mk-bz: 1.3cqw; --mk-chin: 0.7cqw; --mk-res: 7cqw; }
  .stage .mk-dev-laptop > .mk-dev-deck { height: 2.2cqw; }
  .stage .mk-frame.mk-dev-display { --mk-bz: 1cqw; --mk-chin: 3.4cqw; --mk-res: 11cqw; }
  .stage .mk-dev-display .ds-stand { height: 6cqw; }
  .stage .mk-frame.mk-dev-phone { --mk-bz: 1.4cqw; --mk-res: 3cqw; }
  .stage .mk-dev-phone .ds-device { --ds-r: 5cqw; }
  .stage .mk-dev-phone .ds-island { top: calc(var(--mk-bz) + 1cqw); width: min(24%, 10cqw); }
  .stage .scene.mk-stage:has(.mk-dev-phone:not(.mk-dev-land)) .col-text { max-width: none; }
  .stage .mk-cursor { width: max(1.9cqw, 16px); }
  .stage .mk-click { width: max(3.4cqw, 28px); }
}
