/* https://site.invalid/style/iot-narrated-tour.css */
@scope (html[data-site-styles~="3407a05ffa704b7a"]) {.iot-narrated-tour:where(:scope, *) {
  color: var(--iot-nudge-text);
  background: var(--iot-nudge-surface);
  border: 1px solid var(--iot-nudge-border);
  border-radius: 0.5rem;
  padding: 1rem;
}

.iot-narrated-tour__player:where(:scope, *) { color: var(--iot-text-dark); }
.iot-narrated-tour__mode:where(:scope, *),
.iot-narrated-tour__status:where(:scope, *) { color: var(--iot-muted); }
.iot-narrated-tour__caption:where(:scope, *) {
  color: var(--iot-nudge-text);
  font-size: max(1rem, 1em);
  line-height: 1.5;
}
.iot-narrated-tour__beats:where(:scope, *) {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.iot-narrated-tour__beats button:where(:scope, *) {
  min-height: 44px;
  padding: 0.5rem 0.75rem;
  color: var(--iot-nudge-text);
  background: var(--iot-nudge-surface-muted);
  border: 1px solid var(--iot-nudge-border-strong);
  border-radius: 0.25rem;
  cursor: pointer;
}
.iot-narrated-tour__beats:where(:scope, *) { margin: 0.75rem 0 0; padding: 0; list-style: none; }
.iot-narrated-tour__beats li:where(:scope, *) { min-width: 0; }
.iot-narrated-tour__motion:where(:scope, *) { display: inline-flex; align-items: center; gap: 0.4rem; margin: 0.75rem 0; }
.iot-narrated-tour__player input[type="range"]:where(:scope, *) { display: block; width: 100%; }
.iot-narrated-tour__beats button:focus-visible:where(:scope, *),
.iot-narrated-tour__motion input:focus-visible:where(:scope, *),
.iot-narrated-tour__player input[type="range"]:focus-visible:where(:scope, *) {
  outline: 3px solid var(--iot-nudge-muted);
  outline-offset: 2px;
}
.iot-narrated-tour__transcript:where(:scope, *) {
  margin-top: 1rem;
  padding: 0.75rem;
  color: var(--iot-nudge-text);
  background: var(--iot-depth-layer-bg);
  border: 1px solid var(--iot-depth-layer-border);
  border-radius: 0.25rem;
}
.iot-narrated-tour__transcript summary:where(:scope, *) { cursor: pointer; }
.iot-narrated-tour__transcript[open]:where(:scope, *) { border-color: var(--iot-border); }

.iot-embed-modal:has(.iot-narrated-tour__player--docked):where(:scope, *) {
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
  height: calc(100dvh - 2rem);
  max-height: calc(100dvh - 2rem);
  max-width: calc(100vw - 2rem);
  min-width: 0;
  overflow: hidden;
}
.iot-narrated-tour__player--docked:where(:scope, *) {
  box-sizing: border-box;
  flex: 0 1 auto;
  min-width: 0;
  min-height: 0;
  max-height: 38vh;
  padding: 0.5rem;
  overflow: auto;
  background: var(--iot-nudge-surface);
  border: 1px solid var(--iot-nudge-border);
  border-radius: 0.5rem;
  overflow-wrap: anywhere;
}
.iot-embed-modal:has(.iot-narrated-tour__player--docked) .iot-embed-frame-shell:where(:scope, *) {
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  width: 100%;
}
.iot-embed-modal:has(.iot-narrated-tour__player--docked) .iot-embed-frame-shell iframe:where(:scope, *) {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}
.iot-narrated-tour__player--docked .iot-narrated-tour__beats:where(:scope, *) {
  flex-wrap: nowrap;
  overflow-x: auto;
  padding: 0.25rem;
}
.iot-narrated-tour__player--docked .iot-narrated-tour__beats li:where(:scope, *) {
  flex: 0 0 auto;
}
.iot-narrated-tour__player--docked .iot-narrated-tour__beats button:where(:scope, *) {
  white-space: nowrap;
}
.iot-narrated-tour__player--docked .iot-narrated-tour__caption:where(:scope, *) {
  display: block;
  flex: 0 0 auto;
  min-height: 0;
  max-height: 16rem;
  overflow: auto;
  margin-block: 0.5rem;
}
.iot-narrated-tour__player--docked .iot-narrated-tour__beats button:where(:scope, *) {
  min-width: 44px;
}
.iot-narrated-tour__player--docked .iot-narrated-tour__motion:where(:scope, *),
.iot-narrated-tour__player--docked input[type="range"]:where(:scope, *) {
  min-height: 44px;
}
.iot-narrated-tour__player--docked :focus-visible:not(.iot-transport__button):where(:scope, *) {
  outline: 3px solid var(--iot-nudge-muted);
  outline-offset: 2px;
}
@media (min-width: 1024px) {
  .iot-embed-modal:has(.iot-narrated-tour__player--docked):where(:scope, *) {
    display: grid;
    grid-template-columns: 22rem minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    gap: 0.75rem;
  }
  .iot-embed-modal:has(.iot-narrated-tour__player--docked) > :not(.iot-narrated-tour__player--docked):not(.iot-embed-frame-shell):where(:scope, *) {
    grid-column: 1 / -1;
  }
  .iot-narrated-tour__player--docked:where(:scope, *) {
    grid-column: 1;
    grid-row: 2;
    max-height: none;
    height: 100%;
  }
  .iot-embed-modal:has(.iot-narrated-tour__player--docked) .iot-embed-frame-shell:where(:scope, *) {
    grid-column: 2;
    grid-row: 2;
    height: 100%;
  }
  .iot-narrated-tour__player--docked .iot-narrated-tour__beats:where(:scope, *) {
    flex-wrap: wrap;
    overflow-x: visible;
  }
  .iot-narrated-tour__player--docked .iot-narrated-tour__beats li:where(:scope, *) {
    flex: 0 1 auto;
  }
  .iot-narrated-tour__player--docked .iot-narrated-tour__beats button:where(:scope, *) {
    white-space: normal;
  }
  .iot-narrated-tour__player--docked .iot-narrated-tour__caption:where(:scope, *) {
    display: block;
    overflow: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  .iot-narrated-tour *:where(:scope, *),
  .iot-narrated-tour *:where(:scope, *)::before,
  .iot-narrated-tour *:where(:scope, *)::after { transition: none !important; animation: none !important; }
}
.iot-narrated-tour[data-reduced-motion="true"] *:where(:scope, *),
.iot-narrated-tour[data-reduced-motion="true"] *:where(:scope, *)::before,
.iot-narrated-tour[data-reduced-motion="true"] *:where(:scope, *)::after {
  transition: none !important;
  animation: none !important;
}
.iot-watchdog-anim:where(:scope, *) {
  width: 100%;
  min-width: 0;
}
.iot-watchdog-anim svg:where(:scope, *) {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
}
.iot-watchdog-anim .watchdog-frame:where(:scope, *) { fill: #334155; stroke: none; }
.iot-watchdog-anim :is(rect, line, path).wd-axis:where(:scope, *) { fill: none; stroke: #475569; }
.iot-watchdog-anim rect.wd-other:where(:scope, *) { fill: #64748b; stroke: #475569; }
.iot-watchdog-anim rect.wd-card:where(:scope, *) { fill: #fbbf24; stroke: #b45309; }
.iot-watchdog-anim line.wd-safe:where(:scope, *) { fill: none; stroke: #dc2626; stroke-dasharray: 6 4; }
.iot-watchdog-anim line.wd-candidate:where(:scope, *) { fill: none; stroke: #7e22ce; stroke-dasharray: 6 4; }
.iot-watchdog-anim path.wd-brace:where(:scope, *) { fill: none; stroke: #7c3aed; }
.iot-watchdog-anim :is(rect, line).wd-redesign:where(:scope, *) { fill: #99f6e4; stroke: #0f766e; stroke-width: 2; }
.iot-watchdog-anim rect.wd-queue:where(:scope, *) { fill: #94a3b8; stroke: #475569; }
.iot-watchdog-anim rect.wd-background:where(:scope, *) { fill: #99f6e4; stroke: #0f766e; }
.iot-watchdog-anim rect.wd-proof:where(:scope, *) { fill: #0f766e; stroke: #115e59; }
.iot-watchdog-anim line.wd-kick:where(:scope, *) { fill: none; stroke: #15803d; stroke-width: 2; }
.iot-watchdog-anim line.wd-playhead:where(:scope, *) { fill: none; stroke: #1f2937; stroke-width: 2; }
.iot-watchdog-anim rect.wd-progress:where(:scope, *) { fill: #2563eb; fill-opacity: 0.18; stroke: none; }
.iot-watchdog-anim text:where(:scope, *) {
  fill: #0f172a;
  stroke: none;
  stroke-dasharray: none;
  font-size: var(--wd-font-size, 14px);
}
.iot-watchdog-anim text.wd-title:where(:scope, *) { font-size: var(--wd-title-size, 15px); }
.iot-watchdog-anim text.wd-proof:where(:scope, *) { fill: #fff; }

/* FMCW tour: fixed light drawing surface preserves signal/text contrast in all themes. */
.iot-fmcw-anim:where(:scope, *) { width: 100%; min-width: 0; margin-block: 1rem; }
.iot-fmcw-anim svg:where(:scope, *) {
  display: block;
  width: 100%;
  height: auto;
  max-width: none;
  background: #f8fafc;
  border-radius: 0.5rem;
  font-family: system-ui, sans-serif;
}
.iot-fmcw-anim :is(path, line, rect, circle):where(:scope, *) {
  fill: none;
  stroke: #475569;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
}
.iot-fmcw-anim .fr-axis:where(:scope, *) { fill: none; stroke: #64748b; }
.iot-fmcw-anim .fr-bracket:where(:scope, *) { fill: none; stroke: #475569; }
.iot-fmcw-anim .fr-bay:where(:scope, *) { fill: #e2e8f0; stroke: #94a3b8; }
.iot-fmcw-anim .fr-floor:where(:scope, *) { fill: none; stroke: #ffffff; stroke-width: 5; }
.iot-fmcw-anim .fr-radar:where(:scope, *) { fill: #dbeafe; stroke: #1d4ed8; }
.iot-fmcw-anim .fr-reflector:where(:scope, *) { fill: #e2e8f0; stroke: #334155; }
.iot-fmcw-anim .fr-camera-body:where(:scope, *) { fill: #cbd5e1; stroke: #475569; }
.iot-fmcw-anim .fr-camera-lens:where(:scope, *) { fill: #f8fafc; stroke: #475569; }
.iot-fmcw-anim .fr-dust-cloud:where(:scope, *) { fill: #b8a68b; fill-opacity: 0.48; stroke: none; }
.iot-fmcw-anim .fr-tx:where(:scope, *) { fill: none; stroke: #1d4ed8; stroke-width: 3; }
.iot-fmcw-anim .fr-echo:where(:scope, *) { fill: none; stroke: #9a3412; stroke-width: 3; stroke-dasharray: 7 5; }
.iot-fmcw-anim .fr-gap:where(:scope, *) { fill: none; stroke: #7e22ce; stroke-width: 3; }
.iot-fmcw-anim .fr-mixer:where(:scope, *) { fill: #f1f5f9; stroke: #334155; }
.iot-fmcw-anim .fr-beat:where(:scope, *) { fill: none; stroke: #0f766e; stroke-width: 2.5; }
.iot-fmcw-anim .fr-sample:where(:scope, *) { fill: #0f172a; stroke: #f8fafc; stroke-width: 1; }
.iot-fmcw-anim .fr-bin:where(:scope, *) { fill: #e2e8f0; stroke: #64748b; }
.iot-fmcw-anim .fr-chosen-bin:where(:scope, *) { fill: #ccfbf1; stroke: #0f766e; stroke-width: 3; }
.iot-fmcw-anim .fr-phase:where(:scope, *) { fill: none; stroke: #0f172a; stroke-width: 3; }
.iot-fmcw-anim .fr-doppler:where(:scope, *) { fill: none; stroke: #7e22ce; }
.iot-fmcw-anim .fr-band:where(:scope, *) { fill: #ccfbf1; stroke: #0f766e; }
.iot-fmcw-anim .fr-outside:where(:scope, *) { fill: #f1f5f9; stroke: #64748b; stroke-dasharray: 4 4; }
.iot-fmcw-anim .fr-boundary:where(:scope, *) { fill: none; stroke: #334155; stroke-width: 3; }
.iot-fmcw-anim .fr-unsupported:where(:scope, *) { fill: none; stroke: #9f1239; }
.iot-fmcw-anim text:where(:scope, *) {
  fill: #0f172a;
  stroke: none;
  stroke-dasharray: none;
  font-size: var(--fr-font-size, 14px);
  font-weight: 400;
}
.iot-fmcw-anim text.fr-title:where(:scope, *) { font-size: var(--fr-title-size, 15px); font-weight: 650; }
.iot-fmcw-anim .fr-tx-legend text:where(:scope, *) { fill: #1d4ed8; }
.iot-fmcw-anim .fr-echo-legend text:where(:scope, *) { fill: #9a3412; }
.iot-fmcw-anim .fr-false-claim.is-crossed text:where(:scope, *) {
  text-decoration: line-through;
  text-decoration-thickness: 2px;
  fill: #9f1239;
}
@media (prefers-reduced-motion: reduce) {
  .iot-fmcw-anim *:where(:scope, *) { animation: none !important; transition: none !important; }
}
.iot-narrated-tour[data-reduced-motion="true"] .iot-fmcw-anim *:where(:scope, *) {
  animation: none !important;
  transition: none !important;
}
/* Clip paint is explicit too; this rectangle reveals the growing dashed echo. */
.iot-fmcw-anim .fr-echo-clip:where(:scope, *) { fill: #ffffff; stroke: none; }
.iot-fmcw-anim .fr-stage:where(:scope, *) { fill: #e0f2fe; stroke: #075985; }
.iot-fmcw-anim .fr-flow:where(:scope, *) { fill: none; stroke: #0f766e; stroke-dasharray: 3 4; }
.iot-fmcw-anim .fr-flow-dot:where(:scope, *) { fill: #0f766e; stroke: #f8fafc; }
.iot-fmcw-anim .fr-doppler-bin:where(:scope, *) { fill: #f3e8ff; stroke: #7e22ce; }

/* Acquisition timing: SVG text scales to 14px rendered; all paint is explicit. */
.iot-acq-anim:where(:scope, *) { width: 100%; min-width: 0; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 8px; }
.iot-acq-anim svg.iot-acq-diagram:where(:scope, *) { display: block; width: 100%; height: auto; max-width: none; font-family: system-ui, sans-serif; }
.iot-acq-anim text:where(:scope, *) { fill: #1e293b; stroke: none; font-size: var(--acq-font-size, 14px); font-weight: 400; }
.iot-acq-anim text.acq-title:where(:scope, *) { font-size: var(--acq-title-size, 15px); font-weight: 650; }
.iot-acq-anim .acq-axis:where(:scope, *) { fill: none; stroke: #64748b; stroke-width: 2; }
.iot-acq-anim .acq-signal:where(:scope, *) { fill: none; stroke: #075985; stroke-width: 3; }
.iot-acq-anim .acq-sample:where(:scope, *) { fill: #075985; stroke: #f8fafc; stroke-width: 1; }
.iot-acq-anim .acq-event:where(:scope, *) { fill: none; stroke: #9a3412; stroke-width: 3; }
.iot-acq-anim .acq-arrival:where(:scope, *) { fill: none; stroke: #075985; stroke-width: 3; stroke-dasharray: 5 4; }
.iot-acq-anim .acq-jolt:where(:scope, *) { fill: #9a3412; stroke: #f8fafc; stroke-width: 2; }
.iot-acq-anim .acq-receipt:where(:scope, *) { fill: #075985; stroke: #f8fafc; stroke-width: 2; }
.iot-acq-anim .acq-delay:where(:scope, *) { fill: none; stroke: #7e22ce; stroke-width: 2; }
.iot-acq-anim .acq-offline:where(:scope, *) { fill: none; stroke: #9f1239; stroke-width: 3; stroke-dasharray: 7 5; }
.iot-acq-anim .acq-loss:where(:scope, *) { fill: none; stroke: #9f1239; stroke-width: 3; }
.iot-acq-anim .acq-buffer:where(:scope, *) { fill: #e2e8f0; stroke: #475569; stroke-width: 2; }
.iot-acq-anim .acq-queue:where(:scope, *), .iot-acq-anim .acq-ingress-slot:where(:scope, *), .iot-acq-anim .acq-retained-slot:where(:scope, *) { fill: #0f766e; stroke: #115e59; }
.iot-acq-anim .acq-flow:where(:scope, *) { fill: none; stroke: #075985; stroke-width: 2; stroke-dasharray: 5 4; }
.iot-acq-anim .acq-incoming:where(:scope, *), .iot-acq-anim .acq-replay-packet:where(:scope, *) { fill: #075985; stroke: #f8fafc; }
.iot-acq-anim .acq-fill:where(:scope, *), .iot-acq-anim .acq-retained:where(:scope, *) { fill: #0f766e; stroke: #115e59; }
.iot-acq-anim .acq-demand:where(:scope, *) { fill: #ffe4e6; stroke: #9f1239; stroke-width: 2; }
.iot-acq-anim .acq-missing:where(:scope, *) { fill: #ffe4e6; stroke: #9f1239; stroke-width: 2; }
.iot-acq-anim .acq-hatch:where(:scope, *) { fill: none; stroke: #9f1239; stroke-width: 2; }
.iot-acq-anim .acq-evicted:where(:scope, *) { fill: #9f1239; stroke: #881337; }
.iot-acq-anim .acq-newest:where(:scope, *) { fill: #0f766e; stroke: #115e59; }
.iot-acq-anim .acq-urgent-line:where(:scope, *) { fill: none; stroke: #9a3412; stroke-width: 2; }
.iot-acq-anim .acq-urgent-packet:where(:scope, *) { fill: #9a3412; stroke: #f8fafc; }
.iot-acq-anim .acq-key-bg:where(:scope, *) { fill: #e0f2fe; stroke: #075985; }
@media (prefers-reduced-motion: reduce) {
  .iot-acq-anim *:where(:scope, *) { animation: none !important; transition: none !important; }
}
.iot-narrated-tour[data-reduced-motion="true"] .iot-acq-anim *:where(:scope, *) { animation: none !important; transition: none !important; }

/* Matter: viewBox units equal rendered pixels, including mobile text. */
.iot-matter-anim:where(:scope, *) { width: 100%; min-width: 0; margin-block: 1rem; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 8px; }
.iot-matter-anim svg.iot-matter-diagram:where(:scope, *) { display: block; width: 100%; height: auto; max-width: none; font-family: system-ui, sans-serif; }
.iot-matter-anim text:where(:scope, *) { stroke: none; }
.iot-matter-anim :is(path, line, rect, circle):where(:scope, *) { vector-effect: non-scaling-stroke; }
@media (prefers-reduced-motion: reduce) {
  .iot-matter-anim *:where(:scope, *) { animation: none !important; transition: none !important; }
}
.iot-narrated-tour[data-reduced-motion="true"] .iot-matter-anim *:where(:scope, *) { animation: none !important; transition: none !important; }
/* SDN failover: explicit SVG paint, 14px rendered type, clock-driven motion only. */
.iot-sdn-anim:where(:scope, *) { width: 100%; min-width: 0; background: #f8fafc; border: 1px solid #cbd5e1; border-radius: 8px; }
.iot-sdn-anim svg.iot-sdn-diagram:where(:scope, *) { display: block; width: 100%; height: auto; max-width: none; font-family: system-ui, sans-serif; }
.iot-sdn-anim text:where(:scope, *) { stroke: none; fill: #172b42; font-size: var(--sdn-font, 14px); font-weight: 400; }
.iot-sdn-anim text.sdn-title:where(:scope, *) { font-weight: 650; }
@media (prefers-reduced-motion: reduce) {
  .iot-sdn-anim *:where(:scope, *) { animation: none !important; transition: none !important; }
}
.iot-narrated-tour[data-reduced-motion="true"] .iot-sdn-anim *:where(:scope, *) { animation: none !important; transition: none !important; }
/* Nyquist tour: explicit light plotting surface and screen-sized SVG type. */
.iot-nyquist-anim:where(:scope, *) { width: 100%; min-width: 0; margin-block: 1rem; }
.iot-nyquist-anim svg:where(:scope, *) {
  display: block;
  width: 100%;
  height: auto;
  background: #ffffff;
  border-radius: 8px;
  font-family: system-ui, sans-serif;
}
.iot-nyquist-anim :is(path, line, rect, circle):where(:scope, *) { vector-effect: non-scaling-stroke; }
.iot-nyquist-anim text:where(:scope, *) { fill: #172b43; stroke: none; font-size: var(--ny-font-size, 14px); }
.iot-narrated-tour[data-reduced-motion="true"] .iot-nyquist-anim *:where(:scope, *) { animation: none !important; transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .iot-nyquist-anim *:where(:scope, *) { animation: none !important; transition: none !important; }
}

/* tour.css  (append to style/iot-narrated-tour.css; section B also to style/iot-technical-detail.css if the panel frame rules live there)
   Item 2: "Narrated animation" panel type + frame-first tour player.
   Platform tokens used (all real, quoted in DESIGN.md):
     green  #2E7D32 (--pc-main / module accent, panel left border)   dark green #1b5e20   tint #e0ece0 (--pc-light)
     ink    #1f2933 (dialog text)   muted #46545a   hairline #cdd7d3 / #d9e0dd   surface #f3f6f5   focus #165a99
     transport tokens --iot-transport-* (iot-transport.css) are re-pinned to their LIGHT values inside the always-white dialog.
   ------------------------------------------------------------------------------------------------------------------------- */

/* ===== A. Panel type: narrated-animation (card in the chapter + dialog frame) ===== */
.iot-side-panel[data-side-type="narrated-animation"]:where(:scope, *) {
  --lab-accent: #5d3fa8;                                    /* own accent: violet, 8.4:1 on white; every other panel type keeps the module colour */
  background: #fff; color: #1f2933; border: 1px solid #cdd7d3; border-left: 4px solid var(--lab-accent);
}
/* the card re-uses the technical-detail card rules by selector extension in iot-technical-detail.css (see MARKUP.md step 5) */
.iot-side-panel[data-side-type="narrated-animation"] .iot-side-panel__type:where(:scope, *),
.iot-td-dialog--animation .iot-td-dialog__eyebrow:where(:scope, *) { color: #5d3fa8; }
.iot-td-dialog--animation .iot-td-dialog__bar:where(:scope, *) { border-left-color: #5d3fa8; }
.iot-side-panel[data-side-type="narrated-animation"] .iot-side-panel__open:where(:scope, *) { background: #1f2933; color: #fff; }
.iot-td-dialog--animation .iot-td-dialog__body:where(:scope, *) { padding-top: 14px; }

/* ===== B. Always-light controls inside the white dialog (dark theme must not turn the buttons dark on a white sheet) ===== */
.iot-td-dialog .iot-narrated-tour:where(:scope, *) {
  --iot-transport-panel: #fff; --iot-transport-ink: #20343d; --iot-transport-primary: #0b6657; --iot-transport-primary-ink: #fff;
  --iot-transport-border: #b8c8cd; --iot-transport-secondary: #fff; --iot-transport-hover: #e5efed; --iot-transport-focus: #165a99;
  --iot-transport-disabled-fill: #e4eaed; --iot-transport-disabled-ink: #62727b; --iot-transport-disabled-border: #b8c8cd;
  border: 0; padding: 0; background: none; color: #1f2933;
}
/* The dialog title already names the tour: keep the h3 for the region's accessible name, hide it visually. */
.iot-td-dialog .iot-narrated-tour > h3:where(:scope, *) { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ===== C. Player layout: frame first ===== */
.iot-narrated-tour__player:where(:scope, *) { display: flex; flex-direction: column; gap: 12px; color: #1f2933; }
.iot-narrated-tour__player > *:where(:scope, *) { margin: 0; flex-shrink: 0; }                      /* the flow gap above replaces ad-hoc margins */
.iot-narrated-tour__stage:where(:scope, *) { order: 1; }
.iot-narrated-tour__caption:where(:scope, *) { order: 2; }
.iot-narrated-tour__progress-row:where(:scope, *) { order: 3; }                     /* wrapper around the range input, see MARKUP.md */
.iot-narrated-tour__controls:where(:scope, *) { order: 4; }
.iot-narrated-tour__beats:where(:scope, *) { order: 5; }
.iot-narrated-tour__motion:where(:scope, *) { order: 6; }
.iot-narrated-tour__status:where(:scope, *) { order: 7; }
.iot-narrated-tour__mode:where(:scope, *) { order: 0; }
.iot-narrated-tour__mode[hidden]:where(:scope, *) { display: none; }                /* suspended / no audio: no label at all */

/* The frame: the largest element, always at the top. */
.iot-narrated-tour__stage:where(:scope, *) {
  position: relative; margin: 0; padding: 12px; border: 1px solid #d9e0dd; border-radius: 12px; background: #f3f6f5;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
}
.iot-narrated-tour__frame:where(:scope, *) { display: block; width: 100%; height: auto; max-height: min(46vh, 420px); object-fit: contain; border-radius: 8px; background: #fff; }
.iot-narrated-tour__stage-label:where(:scope, *) {
  align-self: flex-start; display: inline-flex; align-items: center; gap: .5rem; margin: 0;
  font: 700 .8rem/1.2 inherit; letter-spacing: .04em; text-transform: uppercase; color: #46545a;
}
.iot-narrated-tour__stage-label b:where(:scope, *) { display: inline-grid; place-items: center; min-width: 1.6rem; height: 1.6rem; padding: 0 .35rem; border-radius: 999px; background: #2e7d32; color: #fff; letter-spacing: 0; }
/* Beats with no picture yet show a "title card" of the same size, so the layout never jumps between beats. */
.iot-narrated-tour__card:where(:scope, *) {
  box-sizing: border-box; width: 100%; min-height: 220px; padding: 20px; border-radius: 8px; background: #fff; border: 1px dashed #b8c8cd;
  display: grid; place-content: center; text-align: center; gap: 6px; color: #1f2933;
}
.iot-narrated-tour__card strong:where(:scope, *) { font-size: 1.25rem; line-height: 1.3; }
.iot-narrated-tour__card span:where(:scope, *) { color: #46545a; font-size: .95rem; }
.iot-narrated-tour__caption:where(:scope, *) { font-size: 1rem; line-height: 1.55; color: #1f2933; min-height: 4.7em; }  /* ~3 lines reserved: no jump on Step */

/* ===== D. Range slider, platform skin (progress is --fill, set from JS: style.setProperty('--fill', pct + '%')) ===== */
.iot-narrated-tour__progress-row:where(:scope, *) { display: flex; align-items: center; min-height: 44px; }
.iot-narrated-tour__player input[type="range"]:where(:scope, *) {
  --fill: 0%; -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 44px; margin: 0; padding: 0;
  background: transparent; cursor: pointer; border-radius: 8px;
}
.iot-narrated-tour__player input[type="range"]:where(:scope, *)::-webkit-slider-runnable-track {
  height: 8px; border-radius: 999px; background: linear-gradient(to right, #2e7d32 0 var(--fill), #d3dbd8 var(--fill) 100%);
}
.iot-narrated-tour__player input[type="range"]:where(:scope, *)::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 24px; height: 24px; margin-top: -8px; border-radius: 50%;
  background: #fff; border: 3px solid #2e7d32; box-shadow: 0 1px 3px rgb(31 41 51 / .25);
}
.iot-narrated-tour__player input[type="range"]:where(:scope, *)::-moz-range-track { height: 8px; border-radius: 999px; background: #d3dbd8; }
.iot-narrated-tour__player input[type="range"]:where(:scope, *)::-moz-range-progress { height: 8px; border-radius: 999px; background: #2e7d32; }
.iot-narrated-tour__player input[type="range"]:where(:scope, *)::-moz-range-thumb { box-sizing: border-box; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 3px solid #2e7d32; }
.iot-narrated-tour__player input[type="range"]:focus:where(:scope, *) { outline: none; }
.iot-narrated-tour__player input[type="range"]:focus-visible:where(:scope, *) { outline: 3px solid #165a99; outline-offset: 2px; }
.iot-narrated-tour__player input[type="range"]:hover:where(:scope, *)::-webkit-slider-thumb { border-color: #1b5e20; }

/* ===== E. Transport row: Play / Step / Reset are already the shared IoTTransport buttons (iot-transport.css). Only spacing here. ===== */
.iot-narrated-tour__controls .iot-transport:where(:scope, *) { padding: 0; }
.iot-narrated-tour__controls .iot-transport__status:where(:scope, *) { color: #46545a; font-weight: 600; }

/* ===== F. Beat chips (selected state = tint + green border + bold number; aria-current="step" carries the state for AT) ===== */
.iot-narrated-tour__beats:where(:scope, *) { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.iot-narrated-tour__beats button:where(:scope, *) {
  display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; padding: .35rem .9rem .35rem .45rem;
  border: 1px solid #c3cfca; border-radius: 999px; background: #f3f6f5; color: #1f2933;
  font: 600 .875rem/1.2 inherit; cursor: pointer; text-align: left;
}
.iot-narrated-tour__beat-n:where(:scope, *) {
  display: inline-grid; place-items: center; flex: none; width: 1.75rem; height: 1.75rem; border-radius: 50%;
  background: #fff; border: 1px solid #c3cfca; color: #46545a; font-size: .8rem; font-weight: 700;
}
.iot-narrated-tour__beats button:hover:where(:scope, *) { background: #e9efec; border-color: #9fb3aa; }
.iot-narrated-tour__beats button[aria-current="step"]:where(:scope, *) { background: #e0ece0; border-color: #2e7d32; color: #1b5e20; box-shadow: inset 0 0 0 1px #2e7d32; }
.iot-narrated-tour__beats button[aria-current="step"] .iot-narrated-tour__beat-n:where(:scope, *) { background: #2e7d32; border-color: #2e7d32; color: #fff; }
.iot-narrated-tour__beats button:focus-visible:where(:scope, *) { outline: 3px solid #165a99; outline-offset: 2px; }
.iot-narrated-tour__beats li:where(:scope, *) { min-width: 0; }
@media (max-width: 700px) {
  /* one scrolling strip instead of five wrapped rows; JS keeps the current chip in view */
  .iot-narrated-tour__beats:where(:scope, *) { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 4px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
  .iot-narrated-tour__beats li:where(:scope, *) { flex: none; scroll-snap-align: start; }
  .iot-narrated-tour__beats button:where(:scope, *) { white-space: nowrap; }
  .iot-narrated-tour__frame:where(:scope, *) { max-height: 34vh; }
  .iot-narrated-tour__card:where(:scope, *) { min-height: 150px; }
  .iot-narrated-tour__caption:where(:scope, *) { min-height: 0; }
}

/* ===== G. Reduced-motion switch + transcript: quiet, below the controls ===== */
.iot-narrated-tour__motion:where(:scope, *) { display: inline-flex; align-items: center; gap: .5rem; min-height: 44px; color: #46545a; font-size: .9rem; }
.iot-narrated-tour__motion input:where(:scope, *) { width: 20px; height: 20px; accent-color: #2e7d32; }
.iot-narrated-tour__motion input:focus-visible:where(:scope, *) { outline: 3px solid #165a99; outline-offset: 2px; }
.iot-narrated-tour__transcript:where(:scope, *) { margin-top: 16px; background: #f3f6f5; border: 1px solid #d9e0dd; border-radius: 8px; color: #1f2933; }
.iot-narrated-tour__transcript summary:where(:scope, *) { min-height: 44px; display: flex; align-items: center; font-weight: 600; color: #1f2933; }
.iot-narrated-tour__transcript summary:focus-visible:where(:scope, *) { outline: 3px solid #165a99; outline-offset: 2px; }

/* ===== H. Docked mode (player moved into the simulator overlay by syncTarget): the simulator IS the picture there. ===== */
.iot-narrated-tour__player--docked .iot-narrated-tour__stage:where(:scope, *),
.iot-narrated-tour__player--docked .iot-narrated-tour__beat-n:where(:scope, *) { display: none; }
.iot-narrated-tour__player--docked .iot-narrated-tour__beats button:where(:scope, *) { padding-left: .9rem; }

/* Center frame pictures and reserve a slot for fallback title cards. */
.iot-narrated-tour__stage > picture:where(:scope, *) { display: block; width: 100%; max-width: 480px; margin-inline: auto; }
.iot-narrated-tour__stage .iot-narrated-tour__frame:where(:scope, *),
.iot-narrated-tour__stage .iot-narrated-tour__card:where(:scope, *) { box-sizing: border-box; height: min(46vh, 420px); min-height: 0; }
@media (max-width: 700px) {
  .iot-narrated-tour__stage .iot-narrated-tour__frame:where(:scope, *),
  .iot-narrated-tour__stage .iot-narrated-tour__card:where(:scope, *) { height: 34vh; }
}

@media (max-width: 700px) {
  .iot-narrated-tour__stage > picture:where(:scope, *) { max-width: 320px; }
}

/* Preserve the SVG aspect ratio: height caps would shrink text in tall frames. */
.iot-narrated-tour__stage .iot-narrated-tour__frame:where(:scope, *) { height: auto; max-height: none; }

/* Contrast (master review): the status text must follow the transport panel it sits on. The fixed #46545a ink (line ~420) is dark-on-dark (1.81:1) where the dark-scheme transport panel is #1c2d35; use the panel's own ink token. */
.iot-narrated-tour .iot-transport__status:where(:scope, *) { color: var(--iot-transport-ink, #1f2933) !important; }
}
