/* phone.css: Concepts on phones (plan: Visuallizer V3 docs/concepts-mobile/CONCEPTS_MOBILE_MASTER_PLAN.md).
   Loaded right after styles.css. Section 1 is global and identical on desktop; every other rule sits
   behind the phone query (max-width: 640px), (pointer: coarse) and (max-height: 500px), the compact-nav
   query, (hover: none), or a phone-only class. Edit only inside your own block. */

/* ---- 1. Global guardrails (identical on desktop) ---- */
html,
body {
  overflow-x: clip;
}

/* The decorative glow (.hero::before, 800x800, pulse scale 1.2) is the main
   layout-viewport expander. Clip it to the hero; vertical stays visible. */
.hero {
  overflow-x: clip;
}

/* ---- 2. Phone layer ---- */
@media (max-width: 640px), (pointer: coarse) and (max-height: 500px) {

  /* Hero: exactly one small viewport tall, content below the fixed nav. */
  .hero {
    margin-top: 0;
    min-height: 0;
  }
  .hero-sticky-wrapper {
    min-height: 100vh;
    min-height: 100svh;
    padding-top: var(--nav-h, 60px);
  }
  .hero > .section-new-tag {
    top: calc(var(--nav-h, 60px) + 12px);
  }
  .hero-content {
    padding: 0 16px;
    max-width: 100%;
  }
  /* Author size (hero_title_size, e.g. 3.5rem = 56px) is written inline by
     fitHeroTitle(); it also writes --hero-title-base (script.js edit), so the
     phone cap can never enlarge a smaller author size. Nowrap titles keep
     fitHeroTitle()'s own shrink-to-fit. */
  .hero-title:not(.hero-title-nowrap) {
    font-size: min(var(--hero-title-base, 3rem), 10.5vw, 11vh) !important;
  }
  .hero-title:not(.hero-title-nowrap) #edit-hero-title {
    overflow-wrap: break-word;
  }

  /* A section is display:flex (styles.css .section); its .container is a
     flex item with min-width:auto, so a wide min-content (the video_collage
     grid: repeat(auto-fit,minmax(280px,1fr)) inside max-width:1400px = 880px)
     forces the container wider than the screen and centres it at left -267. */
  .section > .container,
  .section > .container-full {
    min-width: 0;
  }
  .section {
    scroll-margin-top: calc(var(--nav-h, 60px) + 8px);
  }

  /* Custom-section titles: the renderers' inline font-size clamp(3rem, 6vw, 6rem)
     (script.js 2168 wrapperStart, 2496, 2638, 3047, 3158, 3203, 3831, 4757, 4943,
     5063, 5189) is 48 px minimum, too wide for one word on a 320-360 px screen. */
  .dynamic-custom-section h2[style*="clamp(3rem, 6vw, 6rem)"] {
    font-size: clamp(1.75rem, 8.5vw, 3rem) !important;
    overflow-wrap: break-word;
  }

  /* The section number above each title at 12 px (styles.css
     h2[data-section-num]::before is 0.72rem), with a tighter gap. */
  h2[data-section-num]::before {
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
  }

  /* video_collage (side_by_side / side_by_side_3): contained snap row, ~85% cards + peek. */
  .video-collage-row {
    --vc-bleed: var(--space-md); /* = .container side padding at <=768px (styles.css) */
    display: flex !important;
    gap: 12px !important;
    align-self: stretch;
    width: auto !important;
    max-width: none !important;
    margin: 0 calc(-1 * var(--vc-bleed)) !important;
    padding: 0 var(--vc-bleed) 4px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--vc-bleed);
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  .video-collage-row::-webkit-scrollbar {
    display: none;
  }
  .video-collage-row > * {
    flex: 0 0 min(85%, 440px);
    min-width: 0;
    scroll-snap-align: start;
  }
  .video-collage-row > .scale-in {
    opacity: 1;
    transform: none;
  }

  /* vertical-points zigzag (and every slide-in): rise instead of sliding sideways. */
  .slide-in-left,
  .slide-in-right {
    transform: translateY(24px);
  }
  .slide-in-left.visible,
  .slide-in-right.visible {
    transform: none;
  }
}

/* Landscape phones: keep text clear of the notch (viewport-fit=cover). */
@media (pointer: coarse) and (max-height: 500px) {
  .container {
    padding-left: max(var(--space-md), env(safe-area-inset-left, 0px));
    padding-right: max(var(--space-md), env(safe-area-inset-right, 0px));
  }
  /* Hero in one landscape screen: a harder title cap than portrait's 11vh (43 px at
     393 px tall) and tighter gaps between title, subtitle and button. */
  .hero-title:not(.hero-title-nowrap) {
    font-size: min(var(--hero-title-base, 3rem), 6.5vw, 9vh) !important;
  }
  .hero-title {
    margin-bottom: 16px;
    /* Collapse the author's leading line breaks (fitHeroTitle counts them; each empty
       line is one line-height, 1.15em in styles.css .hero-title). */
    margin-top: calc(var(--hero-lead-br, 0) * -1.15em);
  }
  .hero-subtitle {
    margin-bottom: 20px;
    font-size: 1rem;
  }
}
/* Landscape phones wider than 768px keep the desktop .container padding (--space-lg). */
@media (min-width: 769px) and (pointer: coarse) and (max-height: 500px) {
  .container {
    padding-left: max(var(--space-lg), env(safe-area-inset-left, 0px));
    padding-right: max(var(--space-lg), env(safe-area-inset-right, 0px));
  }
  .video-collage-row {
    --vc-bleed: var(--space-lg);
  }
}

/* ---- 2b. Narrow windows and touch tablets (the compact-nav range, 641-1024 px):
   the same two expanders as on phones, without the phone layout. A video_collage
   side_by_side_3 grid has an 880 px min-content, so its flex-item .container
   (min-width:auto) runs past a 768/834 px iPad on both sides; unrevealed slide-ins
   sit 60 px past the edge. A mouse desktop at 1024 px and up never matches. ---- */
@media (max-width: 1023px), (pointer: coarse) and (max-width: 1024px) {
  .section > .container,
  .section > .container-full {
    min-width: 0;
  }
  /* The "New in" badge (styles.css .section-new-tag, 0.62rem = 9.9 px) at 12 px. */
  .section-new-tag {
    font-size: 0.75rem;
    letter-spacing: 0.12em;
  }
  .slide-in-left,
  .slide-in-right {
    transform: translateY(24px);
  }
  .slide-in-left.visible,
  .slide-in-right.visible {
    transform: none;
  }
}

/* ==== M2 SHELL MENU ==== */

/* ---- 3. Menu chrome defaults (all sizes): hidden unless the compact query matches ---- */
:root {
  --nav-vis-h: var(--nav-h, 0px);
}
html.vis-nav-hidden {
  --nav-vis-h: 0px;
}
.vis-pnav-btn {
  display: none;
}
.vis-pnav-sheet[hidden] {
  display: none !important;
}

/* ---- 4. Compact nav: phones, landscape phones, touch tablets (owner D1, D2) ---- */
@media (max-width: 1023px), (pointer: coarse) and (max-width: 1024px) {
  .nav {
    padding: env(safe-area-inset-top, 0px) 0 0;
    border-bottom: 0;
    transition: background 0.4s var(--nav-ease);  /* no padding transition: --nav-h must settle at once */
  }
  .nav-container,
  .nav-shell {
    padding: 0;
    gap: 0;
  }
  .nav-row-top {
    display: none;
  }
  .nav-row-client {
    position: static;
    transform: none;
    height: 52px;
    padding: 0 56px 0 max(16px, env(safe-area-inset-left, 0px));
    justify-content: flex-start;
    min-width: 0;
  }
  .nav-logo {
    display: block;
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.8125rem;
    line-height: 52px;
  }
  /* The version pill after the client name (script.js sets 0.65rem = 10.4 px inline): 12 px label. */
  .nav-logo .version-badge {
    font-size: 0.75rem !important;
  }
  .vis-pnav-btn {
    position: absolute;
    top: 4px;
    right: max(4px, env(safe-area-inset-right, 0px));
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .vis-pnav-btn[hidden] {
    display: none;
  }
  .vis-pnav-btn:active {
    background: rgba(255, 255, 255, 0.08);
  }
  .vis-pnav-btn:focus-visible {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: -2px;
  }

  /* Section strip = the existing #nav-sub-container, one sideways row. */
  #nav-sub-container {
    height: auto !important;          /* updateNavUI writes an inline px height */
    transition: none;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 16px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }
  #nav-sub-container::-webkit-scrollbar {
    display: none;
  }
  .nav-sub-links {
    flex-wrap: nowrap;
    width: max-content;
    min-width: 100%;
    margin: 0;
    padding: 0 max(12px, env(safe-area-inset-right, 0px)) 4px max(12px, env(safe-area-inset-left, 0px));
    gap: 2px !important;              /* adjustNavSize() writes an inline em gap above 768 px */
  }
  .nav-sub-links > li:not(.nav-active-pill) {
    flex: none;
    scroll-snap-align: center;
  }
  .nav-sub-links li a.nav-link {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    font-size: 0.875rem;
    line-height: 1.2;
    -webkit-tap-highlight-color: transparent;
  }
  .nav-sub-links li a.nav-link:hover {
    transform: none;
  }
  .nav-sub-links li a.nav-link.nav-link-new {
    box-shadow: inset 0 0 0 1px rgba(52, 199, 89, 0.30);
  }
  .nav-sub-links li a.nav-link,
  .nav-active-pill {
    border-radius: 8px;
  }
  .nav-active-pill {
    border-color: transparent;
    box-shadow: none;
  }
  .nav-active-pill.is-new {
    border-color: transparent;
  }

  /* The menu sheet */
  .vis-pnav-sheet {
    position: fixed;
    inset: 0;
    z-index: 10050;                  /* above feedback (9999) and made-by (10000); below Story (99999) */
    display: flex;
    flex-direction: column;
    height: 100vh;
    height: 100dvh;
    padding: env(safe-area-inset-top, 0px) env(safe-area-inset-right, 0px) 0 env(safe-area-inset-left, 0px);
    background: var(--color-near-black, #0a0a0a);
    color: rgba(255, 255, 255, 0.92);
    font-family: var(--font-primary);
    overscroll-behavior: contain;
  }
  .vis-pnav-head {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    height: 52px;
    padding: 0 4px 0 16px;
    background: rgba(255, 255, 255, 0.04);
  }
  .vis-pnav-client {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
  }
  .vis-pnav-client-name {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .vis-pnav-ver {
    flex: none;
    padding: 2px 7px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.10);
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
  }
  .vis-pnav-close {
    flex: none;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    cursor: pointer;
  }
  .vis-pnav-close:active {
    background: rgba(255, 255, 255, 0.08);
  }
  .vis-pnav-list {
    flex: 1 1 auto;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0 calc(24px + env(safe-area-inset-bottom, 0px));
  }
  .vis-pnav-group + .vis-pnav-group {
    margin-top: 12px;
  }
  .vis-pnav-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 16px 6px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.3;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.5);
  }
  .vis-pnav-group-title.is-active {
    color: rgba(255, 255, 255, 0.8);
  }
  .vis-pnav-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34c759;
  }
  .vis-pnav-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .vis-pnav-rows {
    list-style: none;
    margin: 0;
    padding: 0;
  }
  .vis-pnav-row {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 10px 16px;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: rgba(255, 255, 255, 0.82);
    font: 500 1rem/1.3 var(--font-primary);
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .vis-pnav-row-label {
    min-width: 0;
    overflow-wrap: anywhere;
  }
  .vis-pnav-row:active {
    background: rgba(255, 255, 255, 0.08);
  }
  .vis-pnav-row:focus-visible,
  .vis-pnav-close:focus-visible {
    outline: 2px solid var(--color-accent-primary);
    outline-offset: -2px;
  }
  .vis-pnav-row[aria-current] {
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 3px 0 0 var(--color-accent-primary);
  }
  .vis-pnav-row.is-soon {
    color: rgba(255, 255, 255, 0.42);
    cursor: default;
  }
  .vis-pnav-tag {
    flex: none;
    margin-left: auto;
    padding: 3px 7px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.6875rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }
  .vis-pnav-tag.is-new {
    background: rgba(52, 199, 89, 0.16);
    color: rgba(187, 247, 208, 0.95);
  }

  /* Review HUD sits under the compact bar instead of on it. */
  body.concept-review-mode .crv-hud {
    top: calc(var(--nav-h, 0px) + 8px);
  }
  body.concept-review-mode .crv-hud-hint {
    top: calc(var(--nav-h, 0px) + 52px);
  }
  /* The menu sheet and Story are modal: the review layer (HUD, hint, section tabs and
     boxes, pins, popover) and the go-live viewer's tile, hint and presenter cues
     (z 2147481800-2147483200) would draw over them. visibility, not display, so
     review_mode.js reposition() still measures the HUD. */
  html.vis-pnav-open #crv-overlay,
  body.vis-story-open #crv-overlay,
  html.vis-pnav-open #glv-tile,
  html.vis-pnav-open .glv-hint,
  html.vis-pnav-open .glv-ptr,
  html.vis-pnav-open .glv-ptr-edge,
  html.vis-pnav-open .glv-spotlight,
  html.vis-pnav-open .glv-sidenote {
    visibility: hidden;
  }

  /* Concepts without groups: only the grouped path of updateNavUI writes an inline
     opacity, so the flat strip kept styles.css opacity 0 (a 48 px band of invisible,
     tappable links). An inline '0' for an empty group still wins. */
  html.vis-compact-nav .nav-sub-links {
    opacity: 1;
  }
}

/* ---- 4b. Landscape phones: one 48 px row (strip + menu button); the sheet shows the client name ---- */
@media (pointer: coarse) and (max-height: 500px) {
  .nav-row-client {
    display: none;
  }
  /* The strip ends left of the menu button (44 px at right max(4px, inset)): width auto
     so the column-flex .nav-shell stretches it to the container minus this margin
     (styles.css width:100% only let the margin overflow). The links' right padding no
     longer needs the notch inset, which the margin already holds. */
  #nav-sub-container {
    width: auto;
    margin-right: max(52px, calc(env(safe-area-inset-right, 0px) + 48px));
  }
  .nav-sub-links {
    padding-right: 12px;
  }
  .vis-pnav-btn {
    top: 2px;
  }
  .vis-pnav-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
    align-content: start;
  }
  .vis-pnav-group + .vis-pnav-group {
    margin-top: 0;
  }
}

/* ---- 5. Phones only: hide on scroll (D4), floating chrome (D3), access screen ---- */
@media (max-width: 640px), (pointer: coarse) and (max-height: 500px) {
  .nav {
    transition: transform 0.3s var(--nav-ease), background 0.4s var(--nav-ease);
  }
  html.vis-nav-hidden .nav {
    transform: translate3d(0, -100%, 0);
    box-shadow: none !important;      /* initNavbarScroll writes it inline on every scroll; it painted ~20 px into the screen */
  }

  /* D3: the made-by badge ends the page instead of floating over content. */
  .made-by-logo {
    position: static;
    width: max-content;
    margin: 32px auto calc(24px + env(safe-area-inset-bottom, 0px));
    border-color: transparent;
    box-shadow: none;
  }
  .made-by-logo:hover {
    transform: none;
    border-color: transparent;
    box-shadow: none;
  }

  /* D3: section comment bubble keeps its 32 px look, gets a 44 px hit area. */
  .section-comment-btn {
    top: 8px;
    right: 8px;
  }
  .section-comment-btn::before {
    content: '';
    position: absolute;
    inset: -7px; /* 30 px padding box (32 px with its 1 px border) + 2 x 7 = 44 (was -6: 42) */
  }
  .section-comment-btn:hover {
    transform: none;
  }
  .comment-textarea,
  #global-feedback-text {
    font-size: 16px;                  /* iOS zooms inputs under 16 px */
  }
  /* Feedback popup (DoD 5): the 'About' select at 16 px and 44 px tall; the round close
     buttons and the remove-recording button keep their look and get a 44 px hit area;
     the action buttons at least 44 px tall. */
  #global-feedback-section {
    font-size: 16px;
    min-height: 44px;
  }
  .global-feedback-close,
  .feedback-viewer-close,
  .audio-remove-btn {
    position: relative;
  }
  .global-feedback-close::before,
  .feedback-viewer-close::before,
  .audio-remove-btn::before {
    content: '';
    position: absolute;
    inset: -8px;                      /* 28 + 16 = 44 */
  }
  .feedback-viewer-close::before {
    inset: -9px;                      /* 26 + 18 = 44 */
  }
  .audio-remove-btn::before {
    inset: -7px;                      /* 30 px padding box (32 with its 1 px border) + 14 = 44; the row gap is 10 */
  }
  .audio-record-btn,
  .global-feedback-submit,
  .view-feedback-btn,
  .global-feedback-cancel {
    min-height: 44px;
  }

  /* D3: global feedback button: 48 px icon button in the thumb corner. */
  .global-feedback-btn {
    right: max(16px, env(safe-area-inset-right, 0px));
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    width: 48px;
    height: 48px;
    padding: 0;
    justify-content: center;
    border-radius: 14px;
  }
  .global-feedback-btn > span {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .global-feedback-btn:hover {
    transform: none;
  }
  .global-feedback-popup {
    left: 12px;
    right: 12px;
    width: auto;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px));
    max-height: calc(100dvh - var(--nav-vis-h, 0px) - 100px);
    overflow-y: auto;
  }

  /* Access-code screen and loading overlay. */
  #access-overlay {
    padding: 24px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  }
  #access-overlay > h1 {
    max-width: 100%;
    font-size: clamp(2rem, 10vw, 3rem);
    text-align: center;
    overflow-wrap: break-word;
  }
  #project-id-input {
    width: min(250px, 100%) !important;
    min-height: 44px;
    font-size: 16px !important;
  }
  #access-btn {
    min-height: 44px;
  }
  #preloader-ui {
    width: min(300px, 100%) !important;
  }
}

@media print {
  .vis-pnav-btn,
  .vis-pnav-sheet {
    display: none !important;
  }
}
/* ?printMode=true adds body.print-mode on screen before window.print(); the
   styles.css block "@media print, .print-mode" only matches in print, so the
   menu chrome is hidden for print-mode explicitly. */
body.print-mode .vis-pnav-btn,
body.print-mode .vis-pnav-sheet {
  display: none !important;
}

/* ==== M3 STORYBOARD (edit only between these markers) ==== */
/* Unit G (Grid, bar, dock). The new phone-only elements are display:none by
   default; every other rule sits behind the phone query, (hover:none) /
   (pointer:coarse), the touch-tablet query, print or body.print-mode.
   Colours follow the section's LIVE colours (inherit), never its stored theme. */
.vis-phone-bar,
.vis-density,
.vis-board-open,
.vis-pb-hint:empty {
  display: none;
}

@media (max-width: 640px), (pointer: coarse) and (max-height: 500px) {
  .vis-scene-dock {
    display: none !important;
  }
  .vis-sb-section .vis-grouping-controls {
    display: none !important;
  }

  /* SB-21: header spacing and 16 px gutters (the h2 is only resized here, at the
     size of the other section titles, capped at 2.5rem). The h2 also carries the
     section number (h2[data-section-num]::before), so the header is kept tight:
     the first board sits within 260 px of the section top, the first scene's tag
     row included. */
  .vis-sb-section {
    padding-top: 28px !important;
  }
  /* A 'New in' tag (top 14 px, 24 px tall, appended to the section at runtime) needs
     room above the title. */
  .vis-sb-section:has(> .section-new-tag) {
    padding-top: 48px !important;
  }
  .vis-sb-head {
    margin-bottom: 12px !important;
  }
  .vis-sb-section > .vis-sb-head > h2 {
    font-size: clamp(1.75rem, 8.5vw, 2.5rem) !important;
  }
  .vis-board-wrap {
    padding: 0 max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)) !important;
  }

  /* Proposal 2: the bar, stuck under the nav while the section scrolls */
  .vis-phone-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    box-sizing: border-box;
    position: sticky;
    top: max(var(--nav-h, var(--vis-pb-top, 0px)), env(safe-area-inset-top, 0px));
    z-index: 30;
    align-self: stretch;
    height: 48px;
    margin: 0 0 8px;
    padding: 0 max(8px, env(safe-area-inset-right, 0px)) 0 max(8px, env(safe-area-inset-left, 0px));
    background-color: inherit;
    color: inherit;
    box-shadow: 0 8px 16px -12px rgba(0, 0, 0, 0.45);
    -webkit-tap-highlight-color: transparent;
    transition: top 0.3s var(--nav-ease);   /* follows the nav's slide (section 5), no gap on reveal */
  }
  html.vis-nav-hidden .vis-phone-bar {
    top: env(safe-area-inset-top, 0px);
  }
  /* Review mode: the review HUD (44 px tall, fixed at --nav-h + 8, see the shell
     block above) floats over the page, so the stuck bar sits just below it
     instead of under it. Hide-on-scroll is off in review mode. */
  body.concept-review-mode .vis-phone-bar {
    top: calc(max(var(--nav-h, var(--vis-pb-top, 0px)), env(safe-area-inset-top, 0px)) + 60px);
  }
  .vis-pb-seg {
    display: flex;
    flex: 0 0 auto;
    gap: 2px;
  }
  .vis-pb-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-width: 44px;
    height: 44px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.72;
    cursor: pointer;
  }
  .vis-pb-btn[aria-pressed="true"] {
    opacity: 1;
    background: rgba(127, 127, 127, 0.18);
    background: color-mix(in srgb, currentColor 12%, transparent);
  }
  .vis-pb-btn svg {
    flex-shrink: 0;
  }
  .vis-pb-label {
    display: none;
  }
  .vis-phone-bar:not(.has-chips) .vis-pb-btn[aria-pressed="true"] .vis-pb-label {
    display: inline;
  }
  .vis-pb-chips {
    flex: 1 1 auto;
    min-width: 0;
    height: 44px;
    padding: 4px 0;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    gap: 6px;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 14px;
    scrollbar-width: none;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 14px, #000 calc(100% - 14px), transparent 100%);
  }
  .vis-pb-chips::-webkit-scrollbar {
    display: none;
  }
  .vis-pb-chips[hidden] {
    display: none;
  }
  .vis-pb-chip {
    position: relative;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    min-height: 36px;
    padding: 0 10px;
    border: 0;
    border-radius: 6px;
    scroll-snap-align: start;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.8125rem;
    line-height: 1.2;
    opacity: 0.78;
    cursor: pointer;
  }
  /* 44 px hit area, inside the list's padding box */
  .vis-pb-chip::before {
    content: '';
    position: absolute;
    top: -4px;
    bottom: -4px;
    left: 0;
    right: 0;
  }
  .vis-pb-chip.is-current {
    opacity: 1;
    background: rgba(127, 127, 127, 0.18);
    background: color-mix(in srgb, currentColor 12%, transparent);
  }
  .vis-pb-chip-no {
    font-weight: 800;
    font-variant-numeric: tabular-nums;
  }
  .vis-pb-chip-name {
    max-width: 4.5em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
  }
  .vis-pb-chip.is-current .vis-pb-chip-name {
    font-weight: 700;
  }
  .vis-pb-count {
    flex: 1 1 auto;
    text-align: right;
    padding-right: 4px;
    font-size: 0.875rem;
    font-variant-numeric: tabular-nums;
    opacity: 0.8;
    white-space: nowrap;
  }
  .vis-phone-bar.has-chips .vis-pb-count {
    display: none;
  }
  .vis-pb-hint {
    position: absolute;
    top: 4px;
    bottom: 4px;
    right: max(8px, env(safe-area-inset-right, 0px));
    max-width: calc(100% - 170px);
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 0 10px;
    border-radius: 6px;
    background-color: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }
  .vis-pb-hint svg {
    flex-shrink: 0;
  }
  .vis-pb-hint.is-shown {
    opacity: 1;
  }

  /* Proposal 5: the density control (in the header, not the bar) */
  .vis-density {
    display: inline-flex;
    gap: 2px;
    margin-top: 6px;
    padding: 0;
    border-radius: 8px;
    background: rgba(127, 127, 127, 0.12);
  }
  .vis-density button {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    min-height: 36px;
    min-width: 44px;
    padding: 0 12px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: inherit;
    font: inherit;
    font-size: 0.8125rem;
    font-weight: 600;
    opacity: 0.72;
    cursor: pointer;
  }
  /* 44 px hit area around the 36 px buttons */
  .vis-density button::before {
    content: '';
    position: absolute;
    top: -4px;
    bottom: -4px;
    left: 0;
    right: 0;
  }
  .vis-density button[aria-pressed="true"] {
    opacity: 1;
    background: rgba(127, 127, 127, 0.18);
    background: color-mix(in srgb, currentColor 12%, transparent);
  }

  /* SB-11a: corner open button (18 px glyph, 44 px hit area) */
  .visuallizer-embedded-container .vis-board-open {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
  }
  .visuallizer-embedded-container .vis-board-open::before {
    content: '';
    position: absolute;
    top: -6px;
    bottom: -6px;
    left: -6px;
    right: -6px;
  }
  body.edit-mode-active .vis-board-open,
  body.concept-review-mode .vis-board-open,
  .visuallizer-embedded-container.vis-density-sheet .vis-board-open {
    display: none !important;
  }

  /* SB-11c + SB-12: type and spacing (three-class selectors keep the paper colours under Auto B/W) */
  .visuallizer-embedded-container .visuallizer-board-content {
    padding: 14px 14px 16px;
  }
  .visuallizer-embedded-container .visuallizer-board-content .visuallizer-board-text {
    font-size: 0.9375rem;
    line-height: 1.5;
  }
  .visuallizer-embedded-container .visuallizer-board-content .visuallizer-board-narration .vis-narr-text {
    font-size: 0.9375rem;
  }
  .visuallizer-embedded-container .visuallizer-board-content .vis-narr-label {
    font-size: 0.75rem;
  }
  .visuallizer-embedded-container .visuallizer-scene-number {
    font-size: 0.75rem;
    opacity: 0.62;
  }
  .visuallizer-embedded-container .visuallizer-scene-tag {
    font-size: 0.75rem;
  }
  .visuallizer-embedded-container .vis-scene-chip {
    font-size: 0.75rem;
  }
  .visuallizer-embedded-container .vis-scene-marker-name {
    font-size: 0.75rem;
  }
  .visuallizer-embedded-container .vis-plan-scene-count {
    font-size: 0.75rem;
    opacity: 0.6;
  }
  .visuallizer-embedded-container .vis-plan-scene-cont {
    font-size: 0.75rem;
  }
  .visuallizer-embedded-container .vis-scene-group-header > span:last-child {
    margin-left: auto;
    font-size: 0.75rem !important;
    opacity: 0.6 !important;
  }
  /* With a scene plan each scene's tag is its own full-width grid row (script.js
     renders it so on phones): a scene starts on a new row, 8 px above its first
     board (the -12 px offsets the grid's 20 px row gap); the first one sits right
     under the bar. */
  .visuallizer-embedded-container .vis-scene-marker-row {
    grid-column: 1 / -1;
    position: static;
    width: auto;
    justify-content: flex-start;
    margin: 16px 0 -12px;
  }
  .visuallizer-embedded-container .vis-scene-marker-row:first-child {
    margin-top: 0;
  }
  .visuallizer-embedded-container .vis-scene-marker-row .vis-scene-marker-inner {
    writing-mode: horizontal-tb;
    /* Integration M4-M7: a long scene title wraps instead of setting the one-column
       grid's 1fr track to its nowrap width (One Runway Ahead V3 at 320: track 311 px
       in a 288 px grid, every board cut 7 px at the right edge). */
    white-space: normal;
    min-width: 0;
  }
  .visuallizer-embedded-container .vis-scene-marker-row .vis-scene-marker-name {
    min-width: 0;
    overflow-wrap: anywhere;
  }

  /* SB-15: By Scene headers: chip and count on one line, the title below at full width, no left indent */
  .visuallizer-embedded-container .vis-plan-scene {
    padding-left: 0;
    border-left: 0;
    padding-top: 14px;
    border-top: 2px solid var(--vis-accent-line, #5a5a5a);
  }
  .vis-plan-scene-header {
    flex-wrap: wrap;
    row-gap: 6px;
  }
  .visuallizer-embedded-container .vis-plan-scene-title {
    flex: 1 1 100%;
    order: 2;
    font-size: 1.25rem;
  }
  .vis-plan-scene-rule {
    display: none;
  }
  .vis-plan-scene-count {
    margin-left: auto;
  }
  .visuallizer-embedded-container .vis-scene-group {
    padding-left: 0 !important;
    border-left: 0 !important;
  }
  /* By Scene without a plan: no hairline between the tag and the count */
  .visuallizer-embedded-container .vis-scene-group-header > div {
    display: none !important;
  }

  /* Proposal 5: Sheet (two columns, picture and keyword line only) */
  .visuallizer-embedded-container.vis-density-sheet,
  .visuallizer-embedded-container.vis-density-sheet .vis-scene-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }
  .visuallizer-embedded-container.vis-scene-grid.vis-density-sheet {
    column-gap: 10px !important;
    padding-left: 0;
    padding-right: 0;
  }
  .vis-density-sheet .visuallizer-board-card {
    border-radius: 8px;
  }
  .visuallizer-embedded-container.vis-density-sheet .visuallizer-board-content {
    padding: 6px 8px 8px;
    gap: 0;
  }
  .vis-density-sheet .visuallizer-board-content > :not(.vis-board-keyword) {
    display: none;
  }
  .vis-density-sheet .vis-board-keyword .visuallizer-scene-number,
  .vis-density-sheet .vis-board-keyword .visuallizer-scene-tag {
    font-size: 0.75rem;
    line-height: 16px;
  }
  .vis-density-sheet .vis-board-keyword .visuallizer-scene-tag {
    padding: 1px 6px;
  }
  .vis-density-sheet .visuallizer-board-card {
    cursor: pointer;
  }
  .visuallizer-embedded-container.vis-density-sheet .vis-scene-marker-row {
    margin: 14px 0 2px;
  }
  .visuallizer-embedded-container.vis-density-sheet .vis-scene-marker-row:first-child {
    margin-top: 0;
  }

  /* SB-16c: long storyboards render only what is near the screen */
  .visuallizer-embedded-container.vis-cv .visuallizer-board-card {
    content-visibility: auto;
    contain-intrinsic-size: auto 420px;
  }
  .visuallizer-embedded-container.vis-cv.vis-density-sheet .visuallizer-board-card {
    contain-intrinsic-size: auto 140px;
  }
}
@media (min-width: 400px) and (max-width: 640px) {
  .vis-pb-chip-name {
    max-width: 6.5em;
  }
}
@media (min-width: 641px) and (pointer: coarse) and (max-height: 500px) {
  .vis-pb-chip-name {
    max-width: 12em;
  }
}

/* SB-2: a one-off ring after a scene tap on touch (the class is only ever added for touch) */
@media (hover: none), (pointer: coarse) {
  .visuallizer-embedded-container .visuallizer-board-card.is-scene-flash {
    box-shadow: 0 0 0 2px var(--vis-scene-ring, #8a8a8a);
  }
  /* SB-8: touch tablets keep the dock; readable scene numbers */
  .vis-scene-dock .vis-dock-no {
    color: color-mix(in srgb, var(--color-accent-primary, #FF6B35) 55%, #ffffff);
  }
}

/* SB-20: landscape phones (2 columns, horizontal scene tags; Sheet 3 columns) */
@media (pointer: coarse) and (max-height: 500px) {
  .vis-phone-bar {
    height: 44px;
    margin-bottom: 8px;
  }
  .visuallizer-embedded-container:not([data-cols="1"]),
  .visuallizer-embedded-container:not([data-cols="1"]) .vis-scene-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .visuallizer-embedded-container.vis-density-sheet:not([data-cols="0"]),
  .visuallizer-embedded-container.vis-density-sheet:not([data-cols="0"]) .vis-scene-group-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
  .visuallizer-embedded-container.vis-scene-grid {
    column-gap: 20px !important;
    padding-left: 0;
    padding-right: 0;
  }
  .vis-board-cell {
    flex-direction: column;
  }
  .vis-scene-marker {
    position: static;
    width: auto;
    justify-content: flex-start;
    margin: 18px 0 12px;
  }
  .vis-scene-marker-inner {
    writing-mode: horizontal-tb;
  }
}

/* SB-20, D11: touch tablets keep the dock; the grid is capped at 2 columns */
@media (min-width: 641px) and (max-width: 1024px) and (pointer: coarse) {
  .visuallizer-embedded-container:not([data-cols="1"]),
  .visuallizer-embedded-container:not([data-cols="1"]) .vis-scene-group-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  /* SB-11c / SB-12 on touch tablets too: the switcher buttons get a 44 px
     height and the boards the phone type sizes (labels 12 px, text 15 px). */
  .vis-sb-section .vis-grouping-btn {
    min-height: 44px;
  }
  .visuallizer-embedded-container .visuallizer-board-content .visuallizer-board-text {
    font-size: 0.9375rem;
    line-height: 1.5;
  }
  .visuallizer-embedded-container .visuallizer-board-content .visuallizer-board-narration .vis-narr-text {
    font-size: 0.9375rem;
  }
  .visuallizer-embedded-container .visuallizer-board-content .vis-narr-label,
  .visuallizer-embedded-container .visuallizer-scene-number,
  .visuallizer-embedded-container .visuallizer-scene-tag,
  .visuallizer-embedded-container .vis-scene-chip,
  .visuallizer-embedded-container .vis-scene-marker-name,
  .visuallizer-embedded-container .vis-plan-scene-count,
  .visuallizer-embedded-container .vis-plan-scene-cont {
    font-size: 0.75rem;
  }
  .visuallizer-embedded-container .vis-scene-group-header > span:last-child {
    font-size: 0.75rem !important;
  }
}

@media print {
  .vis-phone-bar,
  .vis-density,
  .vis-board-open,
  .vis-pb-hint {
    display: none !important;
  }
  .visuallizer-embedded-container .visuallizer-board-card {
    content-visibility: visible !important;
  }
}
body.print-mode .vis-phone-bar,
body.print-mode .vis-density,
body.print-mode .vis-board-open,
body.print-mode .vis-scene-dock {
  display: none !important;
}
body.print-mode .visuallizer-embedded-container .visuallizer-board-card {
  content-visibility: visible !important;
}
/* ==== END M3 STORYBOARD ==== */

/* ==== M4-M7 SECTION TYPES (one sub-block per slice; edit only inside your own sub-block) ==== */
/* ---- M4 horizontal + collage ---- */
/* Audit: Visuallizer V3 docs/concepts-mobile/evidence/audits/B1-horizontal.md (B1-n ids).
   Player-owned rules (animated_timeline, card_gallery, shot_deck, video_bento, bento_grid)
   live in each player's injected CSS, behind the same query. */
@media (max-width: 640px), (pointer: coarse) and (max-height: 500px) {

  /* video_collage: the reference badge at 12 px (B1-3; the swipe row is in section 2). */
  .vc-badge {
    font-size: 0.75rem !important;
  }

  /* visual_storyline (B1-6): a contained snap row with 16 px gutters; cards sized to
     the screen so the next one peeks; scene text wraps inside the screen. */
  .visual-storyline-container {
    padding-left: 16px;
    padding-right: 16px;
    scroll-padding-inline: 16px;
    scroll-snap-type: x mandatory;
    overscroll-behavior-x: contain;
    scroll-behavior: auto;
  }
  .visual-storyline-track {
    gap: 24px;
  }
  .visual-storyline-track .storyline-card {
    width: min(320px, calc(100vw - 72px));
    min-height: 0;
    scroll-snap-align: start;
  }
  .visual-storyline-track .scene-header {
    padding-right: 0;
    max-width: calc(100vw - 32px);
  }
  /* visual_storyline text (B1-7): labels 12 px, reading text 15 px. */
  .visual-storyline-track .storyline-card-tag {
    font-size: 0.75rem;
  }
  .storyline-card-screen-title-section > div:first-child,
  .storyline-card-screen-title-section .screen-titles-view-mode > div {
    font-size: 0.75rem !important;
  }
  .visual-storyline-track .storyline-card-text,
  .visual-storyline-track .scene-description {
    font-size: 0.9375rem;
  }

  /* row_slices (B1-18b): the questions use the whole card width. */
  .row-slices-wrap {
    padding: 0 !important;
  }
  .row-slices-wrap .row-slice-card {
    padding: 20px !important;
  }

  /* timeline Gantt (B1-15): a few ticks with years instead of one per week, bar dates
     with the year; the 800 px chart scrolls inside its own box. */
  .timeline-visualization {
    overscroll-behavior-x: contain;
  }
  .timeline-visualization .tl-grid-desk {
    display: none !important;
  }
  .timeline-visualization .tl-grid-phone {
    display: block !important;
  }
  .timeline-visualization .tl-d-phone {
    display: inline !important;
  }
  .timeline-visualization .tl-d-desk:has(+ .tl-d-phone) {
    display: none;
  }

  /* horizontal_gallery (B1-4): cards sized to the screen with the next one peeking.
     --hg-w / --hg-ar come from the renderer; vh first as the fallback for svh. */
  .hg-section .hg-card-upper {
    width: min(var(--hg-w, 853px), 80vw, calc(60vh * var(--hg-ar, 1.7778))) !important;
    width: min(var(--hg-w, 853px), 80vw, calc(60svh * var(--hg-ar, 1.7778))) !important;
    height: auto !important;
    aspect-ratio: var(--hg-ar, 1.7778);
  }
  .hg-section .hg-card-lower {
    width: min(var(--hg-w, 284px), 56vw, calc(36vh * var(--hg-ar, 1.7778))) !important;
    width: min(var(--hg-w, 284px), 56vw, calc(36svh * var(--hg-ar, 1.7778))) !important;
    height: auto !important;
    aspect-ratio: var(--hg-ar, 1.7778);
  }
  .hg-section h2 {
    font-size: clamp(2rem, 9vw, 2.6rem) !important;
    overflow-wrap: break-word;
  }
  /* The 'No media' placeholder (centred, inline style) ran into the title overlay on
     the screen-sized cards (177 / 124 px tall): with a title or caption it becomes a
     small label in the top-right corner. */
  .hg-section .hg-card > div[style*="color: #555"]:not(:last-child) {
    align-items: flex-start !important;
    justify-content: flex-end !important;
    padding: 8px 12px;
    font-size: 0.75rem !important;
    line-height: 16px;
  }

  /* look_compare (B1-8): mosaic, then one sideways row of 44 px look chips right
     under it, then the look's title and text. */
  .look-compare-wrapper {
    display: flex;
    flex-direction: column;
  }
  .look-compare-mosaic {
    order: 0;
  }
  .look-compare-wrapper .look-compare-nav {
    order: 1;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    overflow-x: auto;
    overflow-y: hidden;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding: 0 0 4px;
    margin: 0 0 12px;
  }
  .look-compare-wrapper .look-compare-nav::-webkit-scrollbar {
    display: none;
  }
  .look-compare-title-bar {
    order: 2;
  }
  .look-compare-title-bar p {
    font-size: 0.9375rem !important;
  }
  .look-compare-nav .look-nav-btn {
    flex: 0 0 auto;
    min-height: 44px;
    scroll-snap-align: center;
  }
  /* Dots keep their 14 px look; a 44 px hit area (inset from the padding box, inside the
     2 px border), spaced so neighbours never overlap, inside the row so the scroller
     does not clip it. */
  .look-compare-nav .look-nav-btn.look-nav-dot {
    min-height: 0;
    padding: 0 !important;
    margin: 15px;
  }
  .look-compare-nav .look-nav-btn.look-nav-dot::after {
    content: "";
    position: absolute;
    inset: -17px;
  }
  /* Inactive label chips on a white section had no visible edge. */
  .bg-white .look-compare-nav .look-nav-label:not(.active) {
    background: rgba(0, 0, 0, 0.06) !important;
  }
}

/* animated_timeline, portrait phones: one small-viewport tall (URL bar aware). */
@media (max-width: 640px), (pointer: coarse) and (max-height: 500px) {
  .atl-section[style*="height:100vh"] {
    height: 100svh !important;
    min-height: 100svh !important;
  }
}
/* animated_timeline, landscape phones (B1-9): a 600 px band the reader scrolls past,
   so the header, the cards above and below the spine and the scrubber never collide. */
@media (pointer: coarse) and (max-height: 500px) {
  .atl-section.atl-section[data-animated-timeline] {
    height: 600px !important;
    min-height: 600px !important;
  }
  .atl-section .atl-intro {
    display: none;
  }
}
/* ---- end M4 ---- */
/* ---- M5 media + gallery ---- */
/* Audit: Visuallizer V3 docs/concepts-mobile/evidence/audits/B2-media.md (B2-n ids).
   Player-owned phone rules live with their players: stem_player_logic.js (B2-4/5),
   reference_video_player.js (hover gating, dark-card edges), phone_viewer.js (the shared
   viewer, the play / full-screen buttons and the autoplay observer, B2-9 / B2-26).
   The section min-height (D-B2e) is M6's global rule; vsp_* media sections are below. */

@media (max-width: 640px), (pointer: coarse) and (max-height: 500px) {

  /* D-B2e: vsp_* media sections (not the hero) are as tall as their content. */
  .section.vsp-section:has(> .vsp-video-wrap, > .vsp-collage, > .vsp-glass-btns) {
    min-height: 0;
  }
  /* vsp_video: the decorative glows (460 px) reach past the screen edge. */
  .section.vsp-section {
    overflow-x: clip;
  }

  /* B2-12: pinned stages and heroes use the small viewport (the Safari toolbar). */
  .fs-parallax-sticky,
  .ps-sticky,
  .jpgseq-sticky,
  .fwv-box[data-sizing="full_screen"] {
    height: 100vh !important;
    height: 100svh !important;
  }
  .vsp-hero:not(.vsp-hero--short) {
    min-height: 100svh;
  }
  .specs-gallery {
    max-height: 88svh !important;
  }

  /* B2-7: product_gallery cards with a 12 px pad (60 px left the picture 0-12 px wide). */
  .pg-section > .container {
    padding: 0 16px !important;
  }
  .pg-section .pg-card {
    padding: 12px !important;
  }
  .pg-section .pg-grid {
    gap: 10px !important;
  }

  /* B2-6: the breakdown card stacks inside the screen; the segment chips scroll in their row. */
  .video-ref-card.wide-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }
  .video-ref-player-side {
    min-width: 0;
  }
  .breakdown-bubbles {
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-inline: 24px;
  }
  .video-breakdown-bubble {
    flex: 0 0 auto;
    scroll-snap-align: start;
  }

  /* B2-8: reference_video_tags controls at 44 px and labels at 12 px. The seek marks stay
     visual (the 44 px track seeks; the chips below play a tag). */
  .ref-tags-section .reference-tag {
    min-height: 44px;
    padding: 10px 14px;
    font-size: 0.9375rem;
  }
  .ref-tags-section .tag-time,
  .ref-seek-time,
  .ref-seek-tip {
    font-size: 0.75rem !important;
  }
  .ref-frontend-mute-btn,
  .ref-seek-play {
    width: 44px !important;
    height: 44px !important;
  }
  .ref-seek-track {
    height: 44px;
    touch-action: pan-y;
  }
  .ref-tags-section .ref-seek-mark {
    pointer-events: none;
  }
  /* The full-screen button sits top-right in the bezel (the mute button is bottom-right). */
  .liquid-glass-bezel > .vis-fs-btn {
    top: 8px;
    bottom: auto;
  }

  /* B2-17: labels at 12 px, captions at 15 px. */
  .vis-media-badge,
  .sg-ref-tag,
  .sg-chip-eyebrow,
  .sg-chip-footnote,
  .sg-sound-hint,
  .gdb-cap,
  .vsp-label,
  .vsp-glass-btn-text,
  .rvf-eyebrow {
    font-size: 12px !important;
  }
  .gdb-title {
    font-size: 14px !important;
  }
  .fwv-tag-cap,
  .product-spin-section .ps-sticky p,
  #music-references .glass-card p {
    font-size: 15px !important;
  }

  /* B2-19: media controls at 44 px. */
  .vsp-btn {
    min-height: 44px;
    padding: 12px 18px;
  }
  .breakdown-mute-btn {
    width: 44px !important;
    height: 44px !important;
    justify-content: center !important;
    flex: none;
  }
  .video-timeline-container::before {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    top: -18px;
    bottom: -18px;
  }
  .rvf-btn {
    height: 44px !important;
  }
  .rvf-seg {
    width: 44px !important;
    height: 44px !important;
  }
  .product-spin-section .ps-label a[href] {
    display: inline-flex !important;
    align-items: center;
    min-height: 44px;
  }

  /* B2-24: the built-in video-references tag no longer covers the top of the picture. */
  #video-references .ref-tag {
    top: 10px;
    right: 10px;
    padding: 6px 10px;
    font-size: 0.75rem;
  }
  /* B2-23 (D-B2c: keep the placeholders): the static reference cards' labels and play
     icon are readable on their black cards. */
  #references .video-card {
    color: #fff;
  }
  /* B2-23 fallback: the music "play" circle keeps its 60 px circle (it squashed to an oval). */
  #music-references .glass-card > div:first-child {
    flex-shrink: 0;
  }
}

/* Portrait phones and narrow windows. */
@media (max-width: 640px) {

  /* B2-1: specs_gallery split - the media on top at full width (16:9), the chips below it. */
  .specs-gallery[data-layout="split"] {
    height: auto !important;
    max-height: none !important;
    padding: 12px !important;
  }
  .specs-gallery[data-layout="split"] > div {
    display: flex !important;
    flex-direction: column;
    gap: 12px !important;
    height: auto !important;
  }
  .specs-gallery[data-layout="split"] .sg-stage {
    order: -1;
    width: 100%;
    aspect-ratio: 16 / 9;
    flex: none;
  }
  .specs-gallery[data-layout="split"] .sg-rail {
    height: auto !important;
  }
  .specs-gallery[data-layout="split"] .sg-chips {
    max-height: none !important;
    overflow: visible !important;
    padding-right: 0 !important;
  }

  /* B2-18: the overlay and fill layouts read the same way. */
  .specs-gallery[data-layout="overlay"],
  .specs-gallery[data-layout="fill"] {
    height: auto !important;
    max-height: none !important;
  }
  .specs-gallery[data-layout="overlay"] > div,
  .specs-gallery[data-layout="fill"] > div {
    position: relative !important;
    display: flex !important;
    flex-direction: column;
  }
  .specs-gallery[data-layout="overlay"] .sg-stage,
  .specs-gallery[data-layout="fill"] .sg-stage {
    position: relative !important;
    inset: auto !important;
    width: 100%;
    aspect-ratio: 16 / 9;
    flex: none !important;
  }
  .specs-gallery[data-layout="overlay"] .sg-rail-overlay {
    position: static !important;
    width: auto !important;
    margin: 12px;
  }
  .specs-gallery[data-layout="fill"] .sg-chips {
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory !important;
  }
  .specs-gallery[data-layout="fill"] .sg-chip {
    flex: 0 0 min(85%, 320px);
    scroll-snap-align: start;
  }

  /* B2-10 (D-B2b): gallery and gallery_database in two columns. */
  .gal-grid,
  [id^="gdb-grid-"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  /* B2-7: product_gallery in two columns; wider cards span the row. */
  .pg-section .pg-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .pg-section .pg-grid > [style*="grid-column: span"]:not([style*="span 1;"]) {
    grid-column: span 2 !important;
  }

  /* B2-13 (D-B2a): full_width_video "full screen" letterboxes to 16:9 on a portrait
     phone, with the title and caption under the film in the section's own colours. */
  .fwv-box[data-sizing="full_screen"] {
    display: block !important;
    height: auto !important;
  }
  .fwv-box[data-sizing="full_screen"] > video,
  .fwv-box[data-sizing="full_screen"] > iframe {
    position: relative !important;
    display: block !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9;
    object-fit: contain !important;
    background: #000;
  }
  .fwv-box[data-sizing="full_screen"] > .fwv-overlay {
    display: none !important;
  }
  .fwv-box[data-sizing="full_screen"] > .fwv-text {
    position: static !important;
    inset: auto !important;
    transform: none !important;
    width: auto !important;
    max-width: none !important;
    padding: 16px var(--space-md, 16px) 24px !important;
    color: inherit !important;
  }
  .fwv-box[data-sizing="full_screen"] > .fwv-text > div:not(:has(> span)) {
    background: transparent !important;
    border-color: transparent !important;
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    box-shadow: none !important;
    padding: 0 !important;
    color: inherit !important;
  }
  .fwv-box[data-sizing="full_screen"] > .fwv-text p {
    color: inherit !important;
  }
  .fwv-box[data-sizing="full_screen"] .fwv-tag span[style*="height: 1px"] {
    background: currentColor !important;
    opacity: 0.5;
  }
  .fwv-box[data-sizing="full_screen"] > .vis-fs-btn {
    top: 8px;
    bottom: auto;
  }
  .fwv-box[data-sizing="full_screen"] > .vis-play-badge {
    top: calc(100vw * 9 / 32);
  }
}

/* Landscape phones: specs_gallery chips left (40%), media right (60%), under the nav. */
@media (pointer: coarse) and (max-height: 500px) {
  .specs-gallery[data-layout="split"] {
    height: calc(100vh - var(--nav-h, 56px) - 24px) !important;
    height: calc(100svh - var(--nav-h, 56px) - 24px) !important;
  }
  .specs-gallery[data-layout="split"] > div {
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr) !important;
    grid-template-rows: minmax(0, 100%);
  }
  .specs-gallery[data-layout="split"] .sg-rail {
    min-height: 0;
  }
  .specs-gallery .sg-chips {
    overscroll-behavior: contain;
  }
  /* The 70vw desktop width (inline) leaves the stage 277 px wide on an 852 px phone. */
  .specs-gallery-section .sg-outer {
    width: 100% !important;
  }
}

/* B2-15: touch screens - no hover-only affordances, no effect left stuck after a tap. */
@media (hover: none) {
  .gdb-link-icon {
    opacity: 1 !important;
  }
  [id^="gdb-grid-"] img,
  .gal-grid img,
  .pg-card,
  .pg-card img {
    transform: none !important;
  }
  .reference-tag:hover,
  .video-ref-card:hover,
  .highlight-nav-item:hover,
  .video-breakdown-bubble:hover,
  .vsp-btn:hover,
  .ref-frontend-mute-btn:hover {
    transform: none !important;
  }
  .video-breakdown-bubble.active:hover {
    transform: scale(1.05) !important;
  }
  .ref-master-play-btn:hover {
    transform: translate(-50%, -50%) !important;
    background: rgba(255, 255, 255, 0.8) !important;
  }
  .ref-seek-knob {
    transform: translate(-50%, -50%) scale(1);
  }
  .video-card:hover .play-icon {
    transform: none;
  }
}
/* ---- end M5 ---- */
/* ---- M6 built-ins + text ---- */
/* Audit: Visuallizer V3 docs/concepts-mobile/evidence/audits/B3-builtins-text.md (B3-n ids).
   M6 owns the global phone .section min-height rule (D18, also D-B2e for media sections).
   Player-owned rules: the script type's phone reading mode (D21) is in script_player.js. */

/* Phone-only control that script.js creates for wide owner diagrams (B3-8 / D17). */
.vis-diagram-open {
  display: none;
}

@media (max-width: 640px), (pointer: coarse) and (max-height: 500px) {

  /* D18 / B3-19 (and D-B2e): sections are as tall as their content. The hero, Key Scene
     and the scroll-driven immersive sections keep their heights. :where() keeps this at
     the specificity of styles.css .section, so any type's own min-height still wins. */
  .section:where(:not(.hero, .scene-section, .frozen-glass-container, .fs-parallax-container, .product-spin-section, .jpg-sequence-section, .vsp-section, .atl-section)) {
    min-height: 0;
  }
  #experience {
    min-height: 60vh !important;
    min-height: 60svh !important;
  }
  /* Integration M4-M7: the section number above the centred Experience title is a
     centred shrink-wrapped box (same pixels). As a full-width block inside the
     scale-in wrapper (scale 0.9 until revealed), the probe added its unscaled width
     to the scaled title's left edge and reported a 2-4 px overflow at 375-430 px. */
  #experience h2[data-section-num]::before {
    display: table;
    margin-left: auto;
    margin-right: auto;
  }

  /* B3-24: no load-time stagger (index x 0.1 s) on sections revealed by scrolling. */
  .dynamic-custom-section > .container > .fade-in,
  .multi-choice-section > .mc-outer > .fade-in {
    transition-delay: 0s !important;
  }

  /* B3-2: a long word, URL or indented-text <pre> wraps instead of widening the section
     (.section > .container min-width: 0 is in section 2). */
  section.section :is(h1, h2, h3, h4, h5, h6, p, li, blockquote, dd, td, th, figcaption) {
    overflow-wrap: break-word;
  }
  section.section pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-width: 100%;
  }

  /* B3-17: built-in titles at the custom-title size; text/markdown headings that
     authors use for whole paragraphs at reading sizes. */
  :is(#rationale, #vertical-points, #script, #deliverables, #series, #audience, #channels, #experience, #key-scene) h2 {
    font-size: clamp(1.75rem, 8.5vw, 3rem) !important;
    line-height: 1.1;
  }
  .vis-md-body h1 {
    font-size: 1.75rem;
    line-height: 1.2;
  }
  .vis-md-body h2 {
    font-size: 1.5rem;
    line-height: 1.25;
  }
  .vis-md-body h3 {
    font-size: 1.25rem;
    line-height: 1.3;
  }

  /* B3-7: owner HTML (custom_html) and text bodies stay inside the screen. :where()
     keeps the owner's own class rules in charge; a wide table scrolls in its own box. */
  .dynamic-custom-section .view-mode-only[data-hl-target],
  .vis-md-body {
    max-width: 100%;
    overflow-wrap: break-word;
  }
  :where(.dynamic-custom-section .view-mode-only[data-hl-target]) :where(img, video, canvas, svg, iframe, embed, object) {
    max-width: 100% !important;
  }
  :where(.dynamic-custom-section .view-mode-only[data-hl-target]) :where(img, video, svg[viewBox]) {
    height: auto;
  }
  :where(.dynamic-custom-section .view-mode-only[data-hl-target]) table {
    display: block;
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }
  :where(.dynamic-custom-section .view-mode-only[data-hl-target]) pre {
    white-space: pre-wrap;
    overflow-wrap: anywhere;
  }
  :where(.dynamic-custom-section .view-mode-only[data-hl-target]) [style*="width"] {
    max-width: 100%;
  }

  /* B3-8 / D17: wide diagrams open full screen (script.js adds the button and the tap). */
  .vis-chtml svg[data-vis-diagram] {
    cursor: zoom-in;
  }
  .vis-diagram-open {
    display: flex;
    align-items: center;
    gap: 8px;
    width: max-content;
    min-height: 44px;
    margin: 8px 0 0 auto;
    padding: 0 14px;
    border: 0;
    border-radius: 8px;
    background: rgba(127, 127, 127, 0.16);
    color: inherit;
    font: inherit;
    font-size: 15px;
    font-weight: 500;
    line-height: 1.2;
    cursor: pointer;
  }

  /* B3-9: enhanced_markdown keeps its dark card with a usable text column. */
  .enhanced-md-box {
    padding: 28px 20px !important;
    border-radius: 12px !important;
  }
  .enhanced-snippets-container {
    max-width: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
  }

  /* B3-18: 16 px gutters (safe areas kept in landscape) and lighter card padding in the
     built-in sections. Custom sections keep the shared .container gutter, which the
     collage and storyboard rows are built against. */
  :is(#rationale, #vertical-points, #script, #deliverables, #series, #audience, #channels, #experience) > .container,
  #key-scene > .container {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .persona-card,
  .deliverable-card {
    padding: 24px 20px;
  }
  #series .timeline-content {
    padding: 20px;
  }
  .markup-magazine {
    gap: 16px;
  }

  /* B3-3: Key Scene grows with its text instead of clipping it at 100vh. */
  #key-scene.scene-section {
    height: auto;
    min-height: 100vh;
    min-height: 100svh;
    padding: calc(var(--nav-h, 60px) + 24px) 0 32px;
  }
  #key-scene .scene-content {
    max-width: none;
    width: 100%;
    padding: 24px 20px;
  }

  /* B3-4: the built-in Script page uses the screen width at 16 px. */
  #script .script-container {
    width: 100%;
    max-width: 100%;
    padding: 28px 18px;
    font-size: 1rem;
    line-height: 1.7;
  }
  #script .script-container::before {
    display: none;
  }

  /* B3-11: landscape phones stack Deliverables and the Series timeline as portrait does. */
  #deliverables .grid-3 {
    grid-template-columns: 1fr;
  }
  #series .timeline-steps {
    flex-direction: column;
    gap: var(--space-xl);
  }
  #series .timeline-line {
    width: 2px;
    height: 100%;
    left: 50%;
    top: 0;
    transform: translateX(-50%);
  }
  #series .timeline-marker {
    margin-bottom: var(--space-md);
  }

  /* B3-13: the comment box submit button is a full touch target (textarea 16 px: M2). */
  .comment-submit-btn {
    min-height: 44px;
  }

  /* B3-5: multi_choice uses the full width (its 70vw width left the media stage 0 px wide).
     Landscape phones keep the desktop split / overlay (the stage is about 400 px there);
     portrait phones stack, below. */
  .multi-choice-section .mc-outer {
    width: 100% !important;
    padding: 0 max(16px, env(safe-area-inset-left, 0px)) !important;
  }
  .multi-choice[data-layout="fill"] .mc-options {
    overscroll-behavior-x: contain;
  }
  /* B3-25 + B3-22: URL-bar-aware band; Back / Restart are full targets. */
  .multi-choice {
    max-height: 88vh !important;
    max-height: 88svh !important;
  }
  .multi-choice :is(.mc-back, .mc-restart) {
    min-height: 44px;
    font-size: 15px !important;
  }

  /* B3-14: the MultiChoice page menu sits above the home indicator; 44 px chips. */
  #mc-menu {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px)) !important;
    overscroll-behavior-x: contain;
  }
  #mc-menu .mc-chip {
    min-height: 44px !important;
    font-size: 15px !important;
    padding: 10px 18px !important;
  }

  /* B3-15: an HTML asset_highlight shows in full; 16 px gutters; the empty state fits. */
  .asset-highlight-section.ah-type-html .liquid-glass-bezel {
    aspect-ratio: auto;
    min-height: calc((100vw - 32px) * 9 / 16);
  }
  .asset-highlight-section .ah-html {
    height: auto;
  }
  .asset-highlight-section .vh-section-inner {
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .asset-highlight-section .liquid-glass-bezel > div[style*="padding: 100px"] {
    padding: 48px 16px !important;
  }

  /* B3-16: card_of_questions in one full-width column at every phone width. */
  .coq-wrap {
    padding: 0 !important;
  }
  .coq-grid {
    grid-template-columns: 1fr !important;
    gap: 24px !important;
  }

  /* B3-20: long words break inside the self-contained players instead of being cut. */
  .long-section .long-block-heading h2,
  .ghl-headline,
  .ghl-heading,
  .frozen-glass-block,
  .checklist-modern-text {
    overflow-wrap: anywhere;
    hyphens: auto;
  }
  .pcl-sec .pcl-gtag {
    white-space: normal;
    font-size: 12px;
    line-height: 1.3;
  }

  /* B3-22: reading text 15 px, labels 12 px, no dead "View Specs" links. */
  .checklist-modern-text {
    font-size: 15px;
  }
  .checklist-modern-note {
    font-size: 13px;
    opacity: 0.7;
  }
  .checklist-modern-badge {
    font-size: 12px;
  }
  #series .timeline-content p {
    font-size: 15px !important;
  }
  .deliverable-link[href="#"] {
    display: none;
  }
  #experience p a,
  .vis-md-body a {
    padding: 10px 0;
  }

  /* B3-25: sticky stages fit the visible viewport under the iOS URL bar. */
  .frozen-glass-sticky,
  .lseq-sticky {
    height: 100vh !important;
    height: 100svh !important;
  }

  /* long_section image captions at 15 px (inline 0.9rem = 14.4 px). */
  .long-section .long-block-image > p {
    font-size: 0.9375rem !important;
  }

  /* vertical-points: landscape phones (769-932 px) stack like portrait (the stacking
     rule in styles.css is keyed to max-width: 768px). */
  #vertical-points .zigzag-item,
  #vertical-points .zigzag-item:nth-child(even) {
    flex-direction: column;
    gap: var(--space-lg);
  }

  /* B3-26: the pitch-deck button is one full-width line (only while it is shown). */
  #pitch-deck-container[style*="inline-block"] {
    display: block !important;
    padding: 0;
    background: none;
    border: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  #pitch-deck-btn {
    display: block;
    width: 100%;
    padding: 14px 20px;
  }
}

/* B3-5, portrait phones: multi_choice split and overlay stack: the picture first at the
   full width, then the prompt, the option chips and Back / Restart. Fill keeps its band. */
@media (max-width: 640px) {
  .multi-choice:is([data-layout="split"], [data-layout="overlay"]) {
    height: auto !important;
    max-height: none !important;
  }
  .multi-choice:is([data-layout="split"], [data-layout="overlay"]) > div {
    display: flex !important;
    flex-direction: column;
    gap: 16px;
    position: static !important;
    height: auto !important;
  }
  .multi-choice:is([data-layout="split"], [data-layout="overlay"]) .mc-stage {
    order: -1;
    position: relative !important;
    inset: auto !important;
    flex: 0 0 auto;
    width: 100%;
    aspect-ratio: 4 / 3;
  }
  .multi-choice .mc-rail-overlay {
    position: static !important;
    width: auto !important;
  }
  .multi-choice:is([data-layout="split"], [data-layout="overlay"]) .mc-rail {
    height: auto !important;
  }
  .multi-choice:is([data-layout="split"], [data-layout="overlay"]) .mc-options {
    overflow: visible !important;
  }
}

@media print {
  .vis-diagram-open {
    display: none !important;
  }
}
body.print-mode .vis-diagram-open {
  display: none !important;
}
/* Integration M4-M7: the viewer never opens in Edit Mode, review mode or a framed Splice
   embed (phone_viewer.js), so the button is not shown there either (it did nothing). */
body.edit-mode-active .vis-diagram-open,
body.concept-review-mode .vis-diagram-open,
html.splice-embed .vis-diagram-open {
  display: none !important;
}
/* ---- end M6 ---- */
/* ---- M7a immersive: gfx_*, 3D, maps, digital twin, process map ---- */
/* Audit B4 (IM-*). Player styles are injected after this file, so every rule here is
   prefixed with .dynamic-custom-section to out-rank the player's own (equal) selectors;
   !important only where a player writes the value inline (fit() transforms, inline px).
   IM-8: no img/svg/canvas max-width rule may reach .pm-viewport, .dt-viewport or the gfx
   stages (it erased every process-map connector); the guard below keeps them unclamped. */
@media (max-width: 640px), (pointer: coarse) and (max-height: 500px) {

  /* IM-8 guard: player-sized vector/canvas layers keep their own width. */
  .pm-viewport svg.pm-edges,
  .dt-viewport svg,
  .dt-viewport canvas {
    max-width: none !important;
  }

  /* ---- IM-1 / IM-2 / IM-3: stage decks reflow out of the scaled 1920x1080 stage ---- */
  .dynamic-custom-section :is(.gfxg, .gfxl, .gfxf, .gfxo, .gfxs, .gfxc:not(.gfxc--hero)) {
    aspect-ratio: auto !important;
    height: auto;
  }
  .dynamic-custom-section :is(.gfxg, .gfxl, .gfxf, .gfxo, .gfxs, .gfxc:not(.gfxc--hero)) > .stage {
    position: relative;
    z-index: 1;
    width: auto;
    height: auto;
    transform: none !important;
    padding: 32px 16px 36px;
  }
  .dynamic-custom-section :is(.gfxg, .gfxl, .gfxf, .gfxo, .gfxs) .stage > .head {
    position: static;
    margin-bottom: 20px;
  }
  .dynamic-custom-section :is(.gfxg, .gfxl, .gfxf, .gfxo, .gfxs) .head h2 {
    font-size: clamp(26px, 7.5vw, 34px);
    line-height: 1.1;
    overflow-wrap: anywhere;
  }
  .dynamic-custom-section :is(.gfxg, .gfxl, .gfxf, .gfxo, .gfxs) .head p {
    margin-top: 8px;
    max-width: none;
    font-size: 15px;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  /* gfx_grid: two columns of tiles */
  .dynamic-custom-section .gfxg .pa-grid {
    position: static;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)) !important;
    grid-auto-rows: auto !important;
    gap: 10px;
  }
  .dynamic-custom-section .gfxg .pa-tile {
    min-height: 104px;
    padding: 14px;
    gap: 14px;
    border-radius: 16px;
  }
  .dynamic-custom-section .gfxg .pa-tile .orb {
    width: 16px;
    height: 16px;
  }
  .dynamic-custom-section .gfxg .pa-tile h4 {
    font-size: 15px;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .dynamic-custom-section .gfxg .pa-tile .cue {
    top: 10px;
    right: 10px;
  }

  /* gfx_levels: group labels as a list, level cards stacked */
  .dynamic-custom-section .gfxl .levels-grid {
    position: static;
    gap: 14px;
  }
  .dynamic-custom-section .gfxl .groups-row {
    flex-direction: column;
    gap: 8px;
  }
  .dynamic-custom-section .gfxl .group {
    flex: none !important;
    font-size: 12px;
    gap: 12px;
  }
  .dynamic-custom-section .gfxl .group span {
    white-space: normal;
  }
  .dynamic-custom-section .gfxl .lvls-row {
    flex-direction: column;
    gap: 12px;
  }
  .dynamic-custom-section .gfxl .lvl {
    flex: none !important;
    padding: 16px 14px;
    border-radius: 16px;
  }
  .dynamic-custom-section .gfxl .lvl.expanded {
    transform: none;
  }
  .dynamic-custom-section .gfxl .lvl-head {
    min-height: 0;
    padding: 0 40px 12px;
    margin-bottom: 12px;
  }
  .dynamic-custom-section .gfxl .lvl-head h3 {
    font-size: 17px;
    overflow-wrap: anywhere;
  }
  .dynamic-custom-section .gfxl .feats {
    gap: 6px;
  }
  .dynamic-custom-section .gfxl .feats li {
    font-size: 15px;
    padding: 9px 10px;
    border-radius: 10px;
  }
  .dynamic-custom-section .gfxl .lvl-monitor {
    border-radius: 16px;
  }
  .dynamic-custom-section .gfxl .lvl-close {
    top: 6px;
    right: 6px;
    width: 44px;
    height: 44px;
  }

  /* gfx_flow: sources stacked, then hub and output */
  .dynamic-custom-section .gfxf .cd-flow {
    position: static;
  }
  .dynamic-custom-section .gfxf .inputs {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .dynamic-custom-section .gfxf .in-col {
    gap: 8px;
  }
  .dynamic-custom-section .gfxf .src {
    min-height: 64px;
    padding: 12px 14px;
  }
  .dynamic-custom-section .gfxf .src-chips {
    gap: 8px;
  }
  .dynamic-custom-section .gfxf .src-chips span {
    font-size: 13px;
    padding: 5px 10px;
  }
  .dynamic-custom-section .gfxf .eq {
    height: 36px;
  }
  .dynamic-custom-section .gfxf .src.equip .eq {
    width: 130px;
  }
  .dynamic-custom-section .gfxf .src.people .eq {
    width: 100px;
  }
  .dynamic-custom-section .gfxf .meta {
    min-height: 0;
    padding: 12px 14px;
    font-size: 15px;
  }
  .dynamic-custom-section .gfxf .chev svg {
    width: 22px;
  }
  .dynamic-custom-section .gfxf .chev.big svg {
    width: 30px;
  }
  .dynamic-custom-section .gfxf .hub {
    margin-top: 14px;
    padding: 20px 16px;
    border-radius: 16px;
  }
  .dynamic-custom-section .gfxf .hub h3 {
    font-size: 32px;
    overflow-wrap: anywhere;
  }
  .dynamic-custom-section .gfxf .hub p {
    margin-top: 8px;
    font-size: 15px;
    letter-spacing: .08em;
  }
  .dynamic-custom-section .gfxf .out {
    margin-top: 14px;
    padding: 16px;
    border-radius: 16px;
  }
  .dynamic-custom-section .gfxf .out h4 {
    font-size: 18px;
  }
  .dynamic-custom-section .gfxf .out p {
    font-size: 15px;
  }
  .dynamic-custom-section .gfxf .gfx-lb .lb-frame {
    width: calc(100% - 24px);
    max-height: 70%;
    border-radius: 16px;
  }
  .dynamic-custom-section .gfxf .gfx-lb .lb-cap {
    padding: 28px 16px 14px;
    font-size: 15px;
  }

  /* gfx_outbound (IM-3): the cards stacked, one down-chevron, then the dock. The curved
     arrows and particles are drawn in stage coordinates, so they are hidden. */
  .dynamic-custom-section .gfxo .ls-arrows,
  .dynamic-custom-section .gfxo .ls-flow {
    display: none;
  }
  .dynamic-custom-section .gfxo .ls-cards {
    position: static;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .dynamic-custom-section .gfxo .ls-cards::after {
    content: "";
    display: block;
    width: 32px;
    height: 32px;
    margin: 0 auto;
    background: var(--green-bright);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") center / contain no-repeat;
  }
  .dynamic-custom-section .gfxo .ls-card {
    width: auto;
    height: auto;
    padding: 18px 16px;
    border-radius: 16px;
  }
  .dynamic-custom-section .gfxo .ls-card h3 {
    font-size: 18px;
    overflow-wrap: anywhere;
  }
  .dynamic-custom-section .gfxo .ls-icons {
    margin: 12px 0;
    gap: 14px;
  }
  .dynamic-custom-section .gfxo .ls-icons svg {
    height: 44px;
  }
  .dynamic-custom-section .gfxo .ls-icons svg.fork {
    height: 40px;
  }
  .dynamic-custom-section .gfxo .ls-tag {
    padding: 6px 14px;
    font-size: 12px;
  }
  .dynamic-custom-section .gfxo .ls-dock {
    position: relative;
    left: auto;
    top: auto;
    width: auto;
    margin-top: 4px;
    padding: 18px 16px;
    border-radius: 16px;
  }
  .dynamic-custom-section .gfxo .ls-dock svg {
    height: 40px;
  }
  .dynamic-custom-section .gfxo .ls-dock h3 {
    font-size: 20px;
    overflow-wrap: anywhere;
  }

  /* gfx_swimlane (IM-3): the stage diagram is geometry-bound; the player's phone ladder
     (.wf-phone, the same columns as a list) replaces it. */
  .dynamic-custom-section .gfxs .wf-legend,
  .dynamic-custom-section .gfxs .wf-panel,
  .dynamic-custom-section .gfxs .wf-stage {
    display: none;
  }
  .dynamic-custom-section .gfxs .wf-phone {
    display: block;
  }

  /* gfx_cover (IM-1 hero, IM-2 band): copy at phone sizes over the same background */
  .dynamic-custom-section .gfxc--hero .stage {
    position: absolute;
    inset: 0;
    width: auto;
    height: auto;
    transform: none !important;
  }
  .dynamic-custom-section .gfxc--hero .cover-body {
    left: 16px;
    right: 16px;
    top: calc(var(--nav-h, 0px) + 24px);
    bottom: 24px;
    max-width: none;
  }
  .dynamic-custom-section .gfxc:not(.gfxc--hero) .cover-body {
    position: static;
    max-width: none;
  }
  .dynamic-custom-section .gfxc .eyebrow {
    margin-bottom: 14px;
    font-size: 12px;
    letter-spacing: .24em;
  }
  .dynamic-custom-section .gfxc .cover-body h1 {
    font-size: clamp(40px, 12vw, 64px);
    overflow-wrap: anywhere;
  }
  .dynamic-custom-section .gfxc .cover-lede {
    margin-top: 18px;
    max-width: none;
    font-size: 16px;
  }
  .dynamic-custom-section .gfxc .cover-chips {
    gap: 10px;
    margin-top: 22px;
  }
  .dynamic-custom-section .gfxc .chip {
    min-height: 44px;
    padding: 12px 16px;
    font-size: 14px;
  }

  /* gfx_frame (IM-2): the footage as a 16:9 band, the editorial card under it */
  .dynamic-custom-section .gfxfr {
    aspect-ratio: auto !important;
  }
  .dynamic-custom-section .gfxfr .stage {
    position: relative;
    width: auto;
    height: auto;
    transform: none !important;
  }
  .dynamic-custom-section .gfxfr .l-bg {
    position: relative;
    inset: auto;
    aspect-ratio: 16 / 9;
  }
  .dynamic-custom-section .gfxfr .gfx-bgmedia {
    inset: 0;
    width: 100%;
    height: 100%;
  }
  .dynamic-custom-section .gfxfr .gfx-scrim,
  .dynamic-custom-section .gfxfr .gfx-frame,
  .dynamic-custom-section .gfxfr .gfx-blinds,
  .dynamic-custom-section .gfxfr .gfx-cover {
    display: none;
  }
  .dynamic-custom-section .gfxfr .l-panel {
    position: relative;
    inset: auto;
    padding: 16px 16px 28px;
  }
  .dynamic-custom-section .gfxfr .gfx-panel {
    position: relative;
    top: auto;
    bottom: auto;
    left: auto !important;
    right: auto !important;
    width: auto;
    padding: 24px 20px;
    border-radius: 16px;
  }
  .dynamic-custom-section .gfxfr .gfx-eyebrow {
    gap: 10px;
    margin-bottom: 16px;
    font-size: 12px;
  }
  .dynamic-custom-section .gfxfr .gfx-eyebrow .tx {
    white-space: normal;
  }
  .dynamic-custom-section .gfxfr .gfx-title {
    font-size: clamp(26px, 8vw, 36px);
    overflow-wrap: anywhere;
  }
  .dynamic-custom-section .gfxfr .gfx-body {
    margin-top: 14px;
    font-size: 15px;
    overflow-wrap: anywhere;
  }
  .dynamic-custom-section .gfxfr .gfx-cta {
    min-height: 44px;
    margin-top: 20px;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 15px;
  }
  .dynamic-custom-section .gfxfr .gfx-knockvid {
    height: auto !important;
    aspect-ratio: var(--kar, auto);
  }

  /* ---- IM-4: gfx_console, the console out of its 1280x800 scale ---- */
  .dynamic-custom-section .gfxk .console-fit {
    height: auto !important;
    margin-top: 32px;
  }
  .dynamic-custom-section .gfxk .console {
    position: relative;
    display: flex;
    flex-direction: column;
    width: auto;
    height: auto;
    transform: none !important;
    font-size: 14px;
  }
  .dynamic-custom-section .gfxk .sb {
    padding: 10px 10px 0;
    border-right: 0;
  }
  .dynamic-custom-section .gfxk .sb-brand {
    padding: 4px 6px 10px;
  }
  .dynamic-custom-section .gfxk .sb-menu {
    flex-direction: row;
    gap: 6px;
    padding-bottom: 10px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
  }
  .dynamic-custom-section .gfxk .sb-menu::-webkit-scrollbar {
    display: none;
  }
  .dynamic-custom-section .gfxk .sb-item {
    flex: 0 0 auto;
    width: auto;
    min-height: 44px;
    padding: 0 14px;
    white-space: nowrap;
    font-size: 14px;
    scroll-snap-align: start;
  }
  .dynamic-custom-section .gfxk .sb-foot {
    display: none;
  }
  .dynamic-custom-section .gfxk .mn {
    padding: 14px 12px 16px;
    overflow: visible;
  }
  .dynamic-custom-section .gfxk .panel {
    padding: 16px 14px;
  }
  .dynamic-custom-section .gfxk .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
  .dynamic-custom-section .gfxk .c-plot {
    min-height: 180px;
  }
  .dynamic-custom-section .gfxk .lede {
    font-size: 15px;
  }
  .dynamic-custom-section .gfxk .cta,
  .dynamic-custom-section .gfxk .mbtn {
    min-height: 44px;
  }
  .dynamic-custom-section .gfxk :is(.tb-cta, .cta, .badge, .m-l, .mbtn, .s-top, .s-sub, .c-y span, .c-tip, .c-x, .c-legend) {
    font-size: 12px;
  }
  .dynamic-custom-section .gfxk .c-x span {
    white-space: nowrap;
  }
  .dynamic-custom-section .gfxk .c-x span:nth-child(even) {
    visibility: hidden;
  }

  /* ---- IM-18: gfx_suite strip under the phone bar; labels and body sizes ---- */
  .dynamic-custom-section .gfxsu .gfxs-rail-sticky {
    top: max(var(--nav-h, 0px), env(safe-area-inset-top, 0px));
    /* the player's own background fade, plus top following the nav's slide (no gap on reveal) */
    transition: background-color 0.6s ease, top 0.3s var(--nav-ease);
  }
  html.vis-nav-hidden .dynamic-custom-section .gfxsu .gfxs-rail-sticky {
    top: env(safe-area-inset-top, 0px);
  }
  .dynamic-custom-section .gfxsu .gfxs-panel {
    scroll-margin-top: calc(var(--nav-h, 0px) + 56px);
  }
  .dynamic-custom-section .gfxsu .gfxs-menu {
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
  }
  .dynamic-custom-section .gfxsu .gfxs-mi {
    min-height: 44px;
    font-size: 12px;
    scroll-snap-align: start;
  }
  .dynamic-custom-section .gfxsu :is(.gfxs-eyebrow, .gfxs-cta, .gfxs-learn, .gfxs-feat-t, .gfxs-q-label) {
    font-size: 12px;
  }
  .dynamic-custom-section .gfxsu :is(.gfxs-cta, .gfxs-learn) {
    min-height: 44px;
  }
  .dynamic-custom-section .gfxsu :is(.gfxs-p-body, .gfxs-checks li) {
    font-size: 15px;
  }
  .dynamic-custom-section .gfxsu :is(.gfxs-hero-title, .gfxs-p-head, .gfxs-p-body, .gfxs-hero-body, .gfxs-q-text) {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  /* ---- IM-19: gfx_matrix, gfx_process, gfx_loop ---- */
  .dynamic-custom-section .gfxm .scroller {
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    scroll-padding-left: 132px;
  }
  .dynamic-custom-section .gfxm th.proc {
    width: 104px;
    min-width: 104px;
    padding: 14px 6px 12px;
    scroll-snap-align: start;
  }
  .dynamic-custom-section .gfxm th.proc .pname {
    max-width: 92px;
  }
  /* Content-sized columns (the desktop table is stretched to 840 px): two process
     columns fit beside the module names on a 393 px phone. */
  .dynamic-custom-section .gfxm table.matrix {
    width: max-content;
    min-width: 100%;
  }
  .dynamic-custom-section .gfxm th.corner {
    width: 132px;
    min-width: 132px;
    padding-left: 14px;
  }
  .dynamic-custom-section .gfxm tbody th.mod {
    padding-left: 14px;
  }
  .dynamic-custom-section .gfxm :is(th.corner, th.proc .pidx, tbody th.mod .allbadge, .hint .tip, .footer .clear, h1 .mod) {
    font-size: 12px;
  }
  .dynamic-custom-section .gfxm .footer .clear {
    min-height: 44px;
  }
  .dynamic-custom-section :is(.gfxm, .gfxp, .gfxlp) .sub {
    font-size: 15px;
  }
  .dynamic-custom-section .gfxp .journey {
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
  }
  .dynamic-custom-section .gfxp .nav-arrow {
    width: 44px;
    height: 44px;
  }
  .dynamic-custom-section .gfxp :is(.ends, .ends span, .col-tag) {
    font-size: 12px;
  }
  .dynamic-custom-section .gfxlp .dots i {
    position: relative;
    width: 10px;
    height: 10px;
  }
  .dynamic-custom-section .gfxlp .dots i::before {
    content: "";
    position: absolute;
    inset: -17px;
  }
  .dynamic-custom-section .gfxlp :is(.op-eyebrow, .op-loop, .pnode .ni, .frow .fl, .fconnect .ct, .outcome .otxt span, h1 .mod) {
    font-size: 12px;
  }

  /* gfx_stack labels */
  .dynamic-custom-section .gfxst :is(.eyebrow, .phead, .linkzone .api, .ihead .ititle, .choose) {
    font-size: 12px;
  }

  /* ---- IM-20: gfx_beat ---- */
  .dynamic-custom-section .gfxb .beat-points li {
    font-size: 15px;
  }
  /* The width-matched definition under BEAT was squeezed to 10 px; on phones it is a
     normal 12 px caption line (fitTag writes inline styles, hence !important). */
  .dynamic-custom-section .gfxb .beat-tag-def {
    display: block !important;
    width: auto !important;
    margin-top: 8px;
    transform: none !important;
    font-size: 12px;
    line-height: 1.3;
    letter-spacing: .06em !important;
    white-space: normal !important;
    text-align: left !important;
    text-align-last: auto !important;
  }

  /* ---- IM-11 / IM-24: model_poi (doubled class: the player's own styles load later) ---- */
  .model-poi.model-poi .mpoi-hotspot {
    position: relative;
  }
  .model-poi.model-poi .mpoi-hotspot.mpoi-numbered {
    width: 20px;
    height: 20px;
    font-size: 12px;
  }
  .model-poi.model-poi .mpoi-hotspot::before {
    content: "";
    position: absolute;
    inset: -17px;
    border-radius: 50%;
  }
  .model-poi.model-poi .mpoi-card-close {
    top: 4px;
    right: 4px;
    width: 44px;
    height: 44px;
  }
  .model-poi.model-poi .mpoi-card-title {
    padding-right: 36px;
  }
  .model-poi.model-poi .mpoi-card-index {
    font-size: 12px;
  }
  .model-poi.model-poi .mpoi-card-body {
    font-size: 15px;
  }
  .model-poi.model-poi .mpoi-card-toggle {
    min-height: 44px;
    font-size: 14px;
  }
  .model-poi.model-poi .mpoi-narrate-btn {
    min-height: 44px;
  }

  /* ---- IM-14 / IM-15: process map and digital twin ---- */
  /* Full-bleed sections: the title becomes a header above the map instead of an
     overlay, so it no longer collides with the legend, clock and mode toggle, and it
     clears the fixed phone bar. The map takes the rest of the 100svh section. */
  .dynamic-custom-section:has(> :is(.pm-viewport[data-pm-fullbleed], .dt-viewport[data-dt-fullbleed])) {
    display: flex !important;
    flex-direction: column;
  }
  .dynamic-custom-section > :is(.pm-viewport[data-pm-fullbleed], .dt-viewport[data-dt-fullbleed]) {
    flex: 1 1 auto;
    height: auto !important;
    min-height: 0;
  }
  .dynamic-custom-section > :is(.pm-overlay-title, .dt-overlay-title) {
    position: relative !important;
    order: -1;
    flex: none;
  }
  .pm-overlay-title,
  .dt-overlay-title {
    padding: calc(var(--nav-h, 0px) + 16px) 16px 12px !important;
  }
  .pm-overlay-title h2,
  .dt-overlay-title h2 {
    font-size: clamp(22px, 6.5vw, 30px) !important;
    overflow-wrap: anywhere;
  }
  .pm-overlay-title p,
  .dt-overlay-title p {
    font-size: 15px !important;
  }
  .pm-ctrl-btn,
  .dt-ctrl-btn,
  .dt-card-x {
    width: 44px !important;
    height: 44px !important;
  }
  .dt-card-x {
    top: 8px !important;
    right: 8px !important;
  }
  .pm-zoom,
  .dt-zoom {
    display: none;
  }
  .pm-hint,
  .dt-hint {
    max-width: calc(100vw - 100px);
    font-size: 12px !important;
  }
  .pm-viewport :is(.pm-tag, .pm-hubtag),
  .dt-viewport :is(.dt-tk, .dt-legend-row, .dt-clock-l) {
    font-size: 12px !important;
  }
  /* World-space text (scaled with the map): 14.5 px reads as 12 px at the 85% start view. */
  .pm-viewport :is(.pm-sub, .pm-glabel, .pm-badge),
  .dt-viewport :is(.dt-zk, .dt-zsub) {
    font-size: 14.5px !important;
  }
  .pm-viewport .pm-node:has(> .pm-badge) {
    padding-bottom: 34px !important;
  }
  .pm-mode-toggle {
    top: 12px !important;
    right: auto !important;
    left: 12px !important;
  }
  .pm-mode-toggle > button {
    min-height: 44px;
  }
  .pm-preso-bar > button {
    width: 44px !important;
    height: 44px !important;
  }
  .pm-preso-bar > div > div:first-child,
  .pm-preso-bar > div > div:last-child > span {
    font-size: 12px !important;
  }
  .pm-preso-bar > div > div:last-child > span:last-child {
    display: none;
  }
}

/* Landscape phones: picture and copy side by side again (gfx_beat), and the cover
   hero's copy fits the short screen. */
@media (pointer: coarse) and (max-height: 500px) {
  .dynamic-custom-section .gfxb .beat-wrap {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    gap: 24px;
  }
  .dynamic-custom-section .gfxb .beat-media {
    max-height: 70svh;
  }
  .dynamic-custom-section .gfxc--hero .cover-body {
    top: calc(var(--nav-h, 0px) + 12px);
    bottom: 12px;
  }
  .dynamic-custom-section .gfxc--hero .cover-body h1 {
    font-size: clamp(30px, 11vh, 44px);
  }
  .dynamic-custom-section .gfxc--hero .cover-lede {
    margin-top: 10px;
    max-width: 640px;
    font-size: 15px;
  }
  .dynamic-custom-section .gfxc--hero .cover-chips {
    margin-top: 12px;
  }
}

/* IM-17: touch has no hover. Media cues always show; hover lifts do not stick. */
@media (hover: none) {
  .dynamic-custom-section .gfxg .pa-tile.hot .cue {
    opacity: 1;
    transform: none;
  }
  .dynamic-custom-section .gfxg .pa-tile.revealed .cue {
    opacity: 0;
  }
  .dynamic-custom-section .gfxg .pa-tile.hot:hover,
  .dynamic-custom-section .gfxo .ls-card.hot:hover {
    transform: none;
  }
  .dynamic-custom-section .gfxf .box.hot:hover:not(.active) {
    transform: none;
  }
  .dynamic-custom-section .gfxc .chip:hover {
    transform: none;
  }
  .model-poi .mpoi-hotspot:hover:not(.is-active) {
    transform: none;
  }
}
/* ---- end M7a ---- */
/* ---- M7b portfolio + modes: portfolio_*, embed, go-live, review, highlighter, voice, edit ---- */
/* Audit: Visuallizer V3 docs/concepts-mobile/evidence/audits/B4-immersive-modes.md (IM-n ids).
   The portfolio players append their styles to <head> after this file, so a rule that meets
   a player rule carries the wrapper class for the extra specificity. Review mode, go-live
   and the portfolio lightbox keep their phone rules in their own files. */

/* IM-12: portfolio copy rendered white on white, because styles.css `p` (white) beats the
   colour the players set on their wrappers. Phones, narrow windows and touch devices; the
   same fix for a desktop with a mouse is left to the owner (desktop stays as it is). */
@media (max-width: 1023px), (pointer: coarse) and (max-width: 1024px), (hover: none) {
  .pa-wrap p,
  .pcsp-wrap p,
  .pct-wrap p,
  .pts-wrap p {
    color: inherit;
  }
}

@media (max-width: 640px), (pointer: coarse) and (max-height: 500px) {

  /* Portfolio: a long word (a compound, a URL, an e-mail) wraps instead of widening its
     column, and grid columns may shrink below their content. `anywhere` (not break-word)
     so the word stops setting the column's min-content width; the text elements are named
     because the section-wide break-word rule (B3-2, M6 block) sets them directly. */
  .pa-wrap,
  .pcsp-wrap,
  .pct-wrap,
  .ppg-wrap,
  .psv-wrap,
  .pts-wrap,
  .php-wrap,
  section.section :is(.pa-wrap, .pcsp-wrap, .pct-wrap, .ppg-wrap, .psv-wrap, .pts-wrap, .php-wrap) :is(h1, h2, h3, h4, h5, h6, p, li, blockquote) {
    overflow-wrap: anywhere;
  }
  .pa-wrap .pa-grid > *,
  .pct-wrap .pct-inner > *,
  .psv-wrap .psv-grid > *,
  .ppg-wrap .ppg-grid > * {
    min-width: 0;
  }

  /* portfolio_contact (IM-25): 16 px fields (iOS does not zoom on focus); 44 px links,
     pills and button; the note under the button at 15 px. */
  .pct-wrap .pct-field input,
  .pct-wrap .pct-field textarea {
    font-size: 16px;
    min-height: 44px;
  }
  .pct-wrap .pct-details {
    gap: 4px;
  }
  .pct-wrap .pct-detail a {
    display: inline-block;
    padding: 12px 0;
  }
  .pct-wrap .pct-social,
  .pct-wrap .pct-submit {
    min-height: 44px;
  }
  .pct-wrap .pct-note {
    font-size: 15px;
  }

  /* portfolio_testimonials (IM-26): the rail swipes inside itself (the drag handler is
     mouse-only now); 44 px arrows; the role line at 15 px. */
  .pts-wrap .pts-rail {
    overscroll-behavior-x: contain;
  }
  .pts-wrap .pts-navbtn {
    width: 44px;
    height: 44px;
  }
  .pts-wrap .pts-card__role {
    font-size: 15px;
  }

  /* Edit Mode on a phone (IM-31): the toggle and Save sit bottom-left, clear of the
     feedback button in the bottom-right corner; 44 px hit areas, same look. */
  .edit-mode-toggle-container {
    left: max(12px, env(safe-area-inset-left, 0px));
    right: auto;
    bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  }
  .edit-mode-toggle-container:hover {
    transform: none;
  }
  .edit-mode-toggle-container .switch::after {
    content: "";
    position: absolute;
    inset: -8px -6px;
  }
  .edit-mode-toggle-container a[href="dashboard.html"] {
    position: relative;
  }
  .edit-mode-toggle-container a[href="dashboard.html"]::after {
    content: "";
    position: absolute;
    inset: -7px;
  }
  #admin-save-btn {
    left: max(12px, env(safe-area-inset-left, 0px));
    right: auto !important;
    bottom: calc(76px + env(safe-area-inset-bottom, 0px)) !important;
    min-height: 44px;
  }

  /* voice.js mic and run buttons in Edit Mode (IM-32): 36 px buttons, 44 px hit areas. */
  .voice-controls-container .voice-mic-btn,
  .voice-controls-container .voice-run-btn {
    min-width: 36px;
    min-height: 36px;
  }
  .voice-controls-container .voice-mic-btn::before,
  .voice-controls-container .voice-run-btn::before {
    content: "";
    position: absolute;
    inset: -4px;
  }

  /* Go-live viewer video modal (script.js openVideoPlayer, driven by the presenter):
     a 44 px close button and a modal that fits the phone's safe area (integration). */
  .video-modal {
    padding: max(12px, env(safe-area-inset-top, 0px)) max(12px, env(safe-area-inset-right, 0px)) max(12px, env(safe-area-inset-bottom, 0px)) max(12px, env(safe-area-inset-left, 0px));
    overscroll-behavior: contain;
  }
  .video-modal .video-modal-close {
    width: 44px;
    height: 44px;
  }
}

/* portfolio_testimonials, portrait phones (D5): cards sized to the screen with the next
   one peeking; landscape keeps the 360 px cards. */
@media (max-width: 640px) {
  .pts-wrap .pts-card {
    width: auto;
    flex: 0 0 85%;
    padding: 24px;
  }
  .pts-wrap .pts-card__quote {
    font-size: 18px;
  }
}

/* Highlighter pill in Edit Mode on touch screens (IM-32): 44 px chips. */
@media (hover: none) {
  .vs-hl-pill-btn {
    width: 44px;
    height: 44px;
  }
  .vs-hl-pill-btn:hover {
    transform: none;
  }
}
/* ---- end M7b ---- */
/* ==== END M4-M7 SECTION TYPES ==== */
