/* SSV v0.9.6 — mobile / iPad chrome: canvas is the hero, no overlay buttons,
   one slim dock + bottom sheet, no overlapping tab rows, no horizontal scroll. */

html, body { overflow-x: hidden; }
body.m-ui { --m-bar-h: calc(52px + env(safe-area-inset-top, 0px));
  --m-dock-h: calc(148px + env(safe-area-inset-bottom, 0px)); }

/* ---- Landing: compact header, no 3D hero ---- */
.lp-hero { display: none !important; }
.lp-nav { position: sticky; top: 0; z-index: 30; display: flex; align-items: center;
  gap: 12px; padding: 8px 16px; padding-top: calc(8px + env(safe-area-inset-top, 0px));
  background: #fff; border-bottom: 1px solid #eee; }
.lp-brand img { height: 36px; width: auto; max-width: 160px; display: block; object-fit: contain; }
.lp-top { font-size: 12px; padding: 6px 16px; }
.lp-sec { padding: 24px 16px; }
.lp-sec h2, .lp-cats h2 { font-size: 28px; }
#lpTools { padding-top: 20px; }

@media (max-width: 1024px) {
  .lp-top { display: none; }
  .lp-nav { flex-wrap: nowrap; gap: 10px; padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top, 0px)); }
  .lp-nav a.lp-link { display: none; }
  .lp-nav .lp-cta-s { margin-left: auto; height: 36px; padding: 6px 14px; font-size: 13px; }
  .lp-brand img { height: 32px; }
  .lp-catgrid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .lp-cat-bd b { font-size: 16px; }
  .lp-sec { padding: 18px 14px calc(24px + env(safe-area-inset-bottom, 0px)); }
  .lp-sec h2, .lp-cats h2 { font-size: 24px; text-align: left; }
  .lp-sec .lp-lead { text-align: left; margin-bottom: 16px; }
}

@media (max-width: 480px) {
  .lp-catgrid { grid-template-columns: 1fr; }
}

/* ---- App chrome at phone + iPad widths ---- */
@media (max-width: 1024px) {
  body.m-ui, body.m-ui #portal, body.m-ui #portalCol,
  body.m-ui #portalCol > main {
    height: 100%; min-height: 0; overflow: hidden;
  }
  body.m-ui #portalCol > main > section { display: none; height: 100%; min-height: 0; overflow: hidden; }
  body.m-ui #portalCol > main > section.on { display: flex; flex-direction: column; }
  body.m-ui #portalCol > main > section > h1,
  body.m-ui #portalCol > main > section > .sub { display: none !important; }

  /* Hide the left sidebar — it caused a skinny unreadable tab column and ate canvas. */
  body.m-ui #sidebar { display: none !important; }

  /* Compact header replaces portal bar + double tool rows */
  body.m-ui #portalBar {
    position: sticky; top: 0; z-index: 40;
    min-height: var(--m-bar-h);
    padding: calc(8px + env(safe-area-inset-top, 0px)) 10px 8px 10px;
    gap: 8px;
  }
  body.m-ui #portalBar .crumbs { font-size: 16px; font-weight: 800; min-width: 0;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  body.m-ui #portalBar #ver { display: none; }
  body.m-ui #mHomeBtn, body.m-ui #mMoreBtn {
    flex: 0 0 auto; min-width: 44px; min-height: 44px; border: 1px solid #e5e5ea;
    background: #fff; border-radius: 12px; font-weight: 800; font-size: 16px; cursor: pointer;
  }
  body.m-ui #mHomeBtn { font-size: 14px; padding: 0 10px; }

  /* Hide every overlapping toolbar / overlay that sat on the canvas */
  body.m-ui .acw-tools,
  body.m-ui #carTools,
  body.m-ui #csmTools,
  body.m-ui .csm-tools,
  body.m-ui #labTools,
  body.m-ui #battTools,
  body.m-ui #xoTools,
  body.m-ui .mic-bar,
  body.m-ui #c3FieldToggle,
  body.m-ui #c3CtrlOv,
  body.m-ui #c3Hint,
  body.m-ui .csm-ov,
  body.m-ui .acw-ov,
  body.m-ui .car-ov,
  body.m-ui .vt,
  body.m-ui .vnote,
  body.m-ui #prog { display: none !important; }

  /* Badge lives in the header, not as a canvas overlay we can't move? Keep it
     off interactive canvases by parking it in the bar via JS; hide the on-canvas one. */
  body.m-ui #c3Badge { display: none !important; }

  /* Slim bottom dock */
  #mDock {
    display: none;
  }
  body.m-ui #mDock {
    display: flex; flex-direction: column; flex: 0 0 auto;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 45;
    background: #fff; border-top: 1px solid #e5e5ea;
    padding: 8px 12px calc(8px + env(safe-area-inset-bottom, 0px));
    gap: 6px;
    box-shadow: 0 -8px 24px rgba(0,0,0,.08);
  }
  body.m-ui #mDock .m-step {
    font-size: 13px; font-weight: 700; color: #036888; letter-spacing: .02em;
    text-transform: uppercase;
  }
  body.m-ui #mDock .m-hint {
    font-size: 16px; font-weight: 700; line-height: 1.3; color: #111;
  }
  body.m-ui #mDock .m-seats { display: flex; gap: 6px; flex-wrap: wrap; }
  body.m-ui #mDock .m-seats .chip {
    padding: 4px 8px; border-radius: 999px; background: #eef0f5; font-size: 12px; font-weight: 800;
  }
  body.m-ui #mDock .m-seats .chip.done { background: #e1f5ea; color: #0f9d58; }
  body.m-ui #mDock .m-seats .chip.cur { background: #039cdb; color: #fff; }
  body.m-ui #mDock .m-row { display: flex; gap: 8px; align-items: stretch; }
  body.m-ui #mPrimary {
    flex: 1; min-height: 52px; border: 0; border-radius: 14px;
    background: #039cdb; color: #fff; font-weight: 800; font-size: 18px; cursor: pointer;
  }
  body.m-ui #mPrimary:disabled { opacity: .45; }
  body.m-ui #mMoreDock {
    flex: 0 0 52px; min-height: 52px; border: 1px solid #e5e5ea; background: #fff;
    border-radius: 14px; font-weight: 900; font-size: 22px; cursor: pointer;
  }

  /* Bottom sheet — closed by default */
  #mSheet { display: none; }
  body.m-ui #mSheet.open {
    display: flex; flex-direction: column;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    max-height: min(78vh, 720px);
    background: #fff; border-radius: 18px 18px 0 0;
    box-shadow: 0 -16px 48px rgba(0,0,0,.28);
    padding-bottom: env(safe-area-inset-bottom, 0px);
  }
  body.m-ui #mSheetScrim {
    display: none; position: fixed; inset: 0; background: rgba(17,24,39,.4); z-index: 55;
  }
  body.m-ui #mSheetScrim.open { display: block; }
  body.m-ui #mSheet .m-sheet-h {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid #eee; font-weight: 800; font-size: 17px;
    position: sticky; top: 0; background: #fff;
  }
  body.m-ui #mSheet .m-sheet-body { overflow: auto; padding: 12px 16px 24px; -webkit-overflow-scrolling: touch; }
  body.m-ui #mSheet .m-nav { display: flex; flex-direction: column; gap: 4px; margin-bottom: 16px; }
  body.m-ui #mSheet .m-nav button {
    text-align: left; min-height: 48px; border: 1px solid #e5e5ea; background: #fff;
    border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 16px; cursor: pointer;
  }
  body.m-ui #mSheet .m-nav button.on { background: #039cdb; color: #fff; border-color: #039cdb; }
  body.m-ui #mSheet h3 { font-size: 14px; text-transform: uppercase; letter-spacing: .06em; color: #666; margin: 16px 0 8px; }
  body.m-ui #mSheetClose { min-height: 44px; min-width: 44px; border-radius: 12px; border: 1px solid #e5e5ea; background: #fff; font-weight: 700; cursor: pointer; }

  /* Canvas / stage fills the leftover viewport */
  body.m-ui #carHost, body.m-ui #cabinHost,
  body.m-ui #systemHost, body.m-ui #boxHost,
  body.m-ui #labHost, body.m-ui #battHost {
    flex: 1 1 auto; min-height: 0; height: auto !important;
  }
  body.m-ui #carHost { display: flex !important; flex-direction: column; }
  body.m-ui #carHost.inside #cabinHost { display: flex !important; }
  body.m-ui #stage, body.m-ui #cabinHost .csm-workspace, body.m-ui #c3Stage {
    position: absolute; inset: 0; height: auto !important; min-height: 0; border-radius: 0;
  }
  /* Leave room for the dock so the canvas is not hidden under it */
  body.m-ui #portalCol > main { padding-bottom: var(--m-dock-h); }
  body.m-ui .acw-workspace, body.m-ui #carWorkspace, body.m-ui #cabinHost .csm-workspace {
    flex: 1 1 auto; min-height: 0; position: relative;
  }

  /* Measure / RTA / Sonar / In-Car pages: canvas is the only hero, cards go to the sheet */
  body.m-ui #csmPages {
    position: absolute; inset: 0; z-index: 3; overflow: hidden;
    background: #f5f6fa; padding: 0 !important; display: none;
  }
  body.m-ui #csmPages.open { display: flex !important; flex-direction: column; }
  body.m-ui #csmPages section {
    display: none; flex: 1 1 auto; min-height: 0; max-width: none !important;
    margin: 0 !important; flex-direction: column; overflow: hidden;
  }
  body.m-ui #csmPages section.on { display: flex !important; }
  /* Hide dense instruction cards on the live canvases — they live in the sheet */
  body.m-ui #s-rta > .use-mic-btn,
  body.m-ui #s-rta > button#rtaBack,
  body.m-ui #s-rta .card:not(:has(canvas)),
  body.m-ui #s-measure > .use-mic-btn,
  body.m-ui #s-measure > button.pri,
  body.m-ui #s-measure > .row,
  body.m-ui #s-measure > button.big,
  body.m-ui #s-measure .card:first-child,
  body.m-ui #s-sonar > .card,
  body.m-ui #s-sonar > button,
  body.m-ui #s-sonar > .row,
  body.m-ui #s-setup > .card h2,
  body.m-ui #s-home .card:nth-child(n+2) { /* keep session start? hide extras */ }

  body.m-ui #s-rta .card:has(canvas),
  body.m-ui #s-measure .card:has(canvas),
  body.m-ui #s-sonar .card:has(canvas) {
    flex: 1 1 auto; min-height: 0; margin: 0; border: 0; border-radius: 0;
    padding: 0; display: flex; flex-direction: column; background: #111214;
  }
  body.m-ui #s-rta canvas#rta,
  body.m-ui #s-measure canvas#miniCar,
  body.m-ui #s-sonar canvas#snMini,
  body.m-ui #s-sonar canvas#snEcho,
  body.m-ui #s-rta canvas.g,
  body.m-ui #s-measure canvas.g,
  body.m-ui #s-sonar canvas.g {
    flex: 1 1 auto; width: 100% !important; max-width: none !important;
    height: 100% !important; min-height: 0; border: 0; border-radius: 0;
    background: #111214;
  }
  /* SPL / result numbers sit UNDER the canvas, never on top */
  body.m-ui #flowSummary, body.m-ui #mSummary {
    flex: 0 0 auto; background: #fff; padding: 10px 14px;
    font-size: 16px; line-height: 1.4; max-height: 16vh; overflow: auto;
    border-top: 1px solid #e5e5ea;
  }
  body.m-ui #s-rta .card:has(#splNum) {
    flex: 0 0 auto; margin: 0; border: 0; border-radius: 0; padding: 8px 12px;
    text-align: center;
  }
  body.m-ui #s-rta .big { font-size: 36px; }
  body.m-ui #s-rta .card:has(canvas) { flex: 1 1 auto; }
  /* row of A/C/Z etc moves to the sheet — hide on the canvas card */
  body.m-ui #s-rta .card .row, body.m-ui #s-rta .card .seg,
  body.m-ui #s-rta #pinkBtn, body.m-ui #s-rta .card p.mute { display: none !important; }

  body.m-ui #s-measure #measResult, body.m-ui #s-sonar #snResult,
  body.m-ui #s-measure #measStatus, body.m-ui #s-sonar #snStatus {
    flex: 0 0 auto; max-height: 16vh; overflow: auto; padding: 8px 12px; background: #fff;
    margin: 0;
  }
  body.m-ui #s-measure #measResult .card, body.m-ui #s-sonar #snResult .card {
    border: 0; margin: 0; padding: 0; height: auto; flex: 0 0 auto; background: transparent;
  }
  body.m-ui #s-sonar #snResult canvas#snEcho {
    min-height: 16vh; flex: 0 0 auto; height: 16vh !important; background: #111;
  }
  /* When a result exists, promote the echo canvas into the hero if JS sets .is-result */
  body.m-ui #s-sonar.is-result canvas#snMini { display: none; }
  body.m-ui #s-sonar.is-result #snResult { flex: 1 1 auto; display: flex; flex-direction: column; min-height: 0; }
  body.m-ui #s-sonar.is-result #snResult canvas#snEcho {
    flex: 1 1 auto !important; height: auto !important; min-height: 0; max-height: none;
  }

  body.m-ui #s-measure #holdTxt, body.m-ui #s-measure .meter,
  body.m-ui #s-measure #lvlTxt, body.m-ui #s-sonar #snHold,
  body.m-ui #s-sonar .meter, body.m-ui #s-sonar #snLvl { display: none !important; }

  /* In-car 3D: full bleed stage, no field overlay */
  body.m-ui #cabinHost.c3wide .csm-workspace { inset: 0; }
  body.m-ui #cabinHost #c3Stage { inset: 0; }

  /* Generic tool canvases (box, lab, battery, xo, sheet, system) */
  body.m-ui canvas, body.m-ui .stage, body.m-ui #stage, body.m-ui .acw-workspace {
    max-width: 100%;
  }
  body.m-ui #system, body.m-ui #xo, body.m-ui #lab, body.m-ui #battery,
  body.m-ui #box, body.m-ui #comp, body.m-ui #library, body.m-ui #sheet {
    overflow: hidden;
  }
  body.m-ui #system .ds, body.m-ui #box, body.m-ui #lab, body.m-ui #battery,
  body.m-ui #xo, body.m-ui #library, body.m-ui #sheet, body.m-ui #comp {
    flex: 1 1 auto; min-height: 0; overflow: auto; -webkit-overflow-scrolling: touch;
    padding-bottom: 8px;
  }
  /* If a tool has a dedicated stage/canvas, make it fill */
  body.m-ui #system canvas, body.m-ui #xo canvas, body.m-ui #lab canvas,
  body.m-ui #battery canvas, body.m-ui #box canvas, body.m-ui #comp canvas,
  body.m-ui #sheet canvas {
    max-width: 100%;
  }

  /* No horizontal scroll anywhere in the app shell */
  body.m-ui #portal, body.m-ui #portalCol, body.m-ui #portalCol > main,
  body.m-ui #carHost, body.m-ui #cabinHost, body.m-ui #tune, body.m-ui #tuneHost, body.m-ui .tn-root { overflow-x: hidden !important; max-width: 100%; }

  /* What's new stays on landing only */
  body.m-ui .whats { max-width: 100%; }
}

/* Desktop: dock/sheet hidden */
@media (min-width: 1025px) {
  #mDock, #mSheet, #mSheetScrim, #mHomeBtn, #mMoreBtn { display: none !important; }
}


/* Home: no dock, allow page scroll */
body.m-ui[data-view="home"] {
  height: auto !important;
  overflow: auto !important;
  overflow-x: hidden !important;
}
body.m-ui[data-view="home"] #mDock,
body.m-ui[data-view="home"] #mSheet,
body.m-ui[data-view="home"] #mSheetScrim { display: none !important; }

@media (max-width: 1024px) {
  body.m-ui .bl-tools,
  body.m-ui #blTools,
  body.m-ui .bl-tone, body.m-ui #blPlay, body.m-ui #blTone, body.m-ui #blToneV,
  body.m-ui .bl-hint, body.m-ui .bl-legend, body.m-ui .bl-hud,
  body.m-ui .bl-bar,
  body.m-ui .bt-bar,
  body.m-ui .lab-bar,
  body.m-ui #sysTools,
  body.m-ui #incarTools,
  body.m-ui #compTools,
  body.m-ui #libraryTools,
  body.m-ui #sheetTools,
  body.m-ui #xoTools,
  body.m-ui #placeHint,
  body.m-ui #csmFieldTabs,
  body.m-ui #prog,
  body.m-ui #about:not(.on) { display: none !important; }

  body.m-ui #s-home,
  body.m-ui #s-setup,
  body.m-ui #s-field { overflow: auto !important; -webkit-overflow-scrolling: touch; }

  body.m-ui #s-field canvas#map,
  body.m-ui #s-field canvas#curves {
    width: 100% !important; max-width: none !important;
    flex: 1 1 auto; min-height: 50vh;
  }

  /* Box / lab / battery / xo canvases fill the leftover column */
  body.m-ui #boxHost, body.m-ui #labHost, body.m-ui #battHost,
  body.m-ui .bl-workspace, body.m-ui .lab-workspace, body.m-ui .bt-workspace {
    flex: 1 1 auto; min-height: 0; position: relative;
  }
  body.m-ui .bl-workspace canvas, body.m-ui #box canvas,
  body.m-ui #lab canvas, body.m-ui #battery canvas, body.m-ui #xo canvas {
    max-width: 100% !important;
  }

  body.m-ui #mPrimary { min-height: 48px; font-size: 17px; }
  body.m-ui #mMoreDock { flex: 0 0 48px; min-height: 48px; }
  body.m-ui #mDock { padding: 6px 10px calc(6px + env(safe-area-inset-bottom, 0px)); }
  body.m-ui #mDock .m-hint { font-size: 15px; }
}


  body.m-ui #csmPages.open {
    display: flex !important; flex-direction: column;
    background: #f5f6fa !important; pointer-events: auto !important; z-index: 4;
  }
  body.m-ui #cabinHost.c3wide #csmPages.open { background: #f5f6fa !important; pointer-events: auto !important; }
  body.m-ui #cabinHost.c3wide #csmPages.open section.on { display: flex !important; }
  /* When pages are open, park the 3D stage so it cannot show through */
  body.m-ui #cabinHost:not(.c3wide) #c3Stage { visibility: hidden; }
  body.m-ui #c3Stage canvas.c3cv,
  body.m-ui #c3Stage canvas,
  body.m-ui #stage canvas {
    width: 100% !important; height: 100% !important; display: block;
  }

/* ===== v0.9.7.1 hotfix: in-flow hero, scrollable page, tappable sheet ===== */

@media (max-width: 1024px) {
  /* Unlock the 100vh / overflow:hidden scroll trap. Page + sheet must scroll on iPhone. */
  html, body.m-ui {
    height: auto !important;
    min-height: 100dvh;
    max-height: none !important;
    overflow-x: hidden !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    position: static !important;
    touch-action: pan-y;
  }
  body.m-ui #portal, body.m-ui #portalCol,
  body.m-ui #portalCol > main,
  body.m-ui #portalCol > main > section,
  body.m-ui #portalCol > main > section.on,
  body.m-ui #carHost, body.m-ui #carHost.inside,
  body.m-ui #cabinHost, body.m-ui #cabinHost .csm-workspace,
  body.m-ui #carWorkspace {
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    overflow: visible !important;
    overflow-x: hidden !important;
    position: relative !important;
    inset: auto !important;
  }
  body.m-ui #portalCol > main > section.on {
    display: flex !important;
    flex-direction: column;
    overflow: visible !important;
    padding-bottom: calc(var(--m-dock-h, 148px) + env(safe-area-inset-bottom, 0px)) !important;
  }
}

/* Hero canvas lives in NORMAL FLOW above the form — never position:absolute/fixed over content. */
body.m-ui #carHost.inside,
body.m-ui #carHost.inside #cabinHost,
body.m-ui #cabinHost .csm-workspace {
  display: flex !important;
  flex-direction: column;
  position: relative !important;
  inset: auto !important;
  flex: 0 1 auto !important;
  width: 100% !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}
body.m-ui #cabinHost #c3Stage,
body.m-ui #cabinHost.c3wide #c3Stage,
body.m-ui #cabinHost:not(.c3wide) #c3Stage,
body.m-ui #c3Stage {
  position: relative !important;
  inset: auto !important;
  flex: 0 0 auto !important;
  width: 100% !important;
  height: min(52dvh, 480px) !important;
  min-height: 240px !important;
  max-height: 52dvh !important;
  visibility: visible !important;
  pointer-events: auto !important;
  z-index: 1;
  background-color: #15171b;
  background-image: url('assets/hero/poster.jpg');
  background-size: cover;
  background-position: center;
  border-radius: 0;
  overflow: hidden !important;
  touch-action: none;
}
body.m-ui #c3Stage canvas.c3cv,
body.m-ui #c3Stage canvas {
  position: relative !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 240px;
  display: block !important;
  visibility: visible !important;
  touch-action: none;
}
body.m-ui #cabinHost .c3labels,
body.m-ui #cabinHost .c3l { pointer-events: none !important; }
body.m-ui #c3Stage .c3l.sys,
body.m-ui #c3Demo { display: none !important; }
body.m-ui #c3Load { pointer-events: none !important; }

/* Form / measure pages sit BELOW the hero, in flow, and can scroll. */
body.m-ui #csmPages,
body.m-ui #csmPages.open {
  position: relative !important;
  inset: auto !important;
  flex: 1 1 auto !important;
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  overflow: visible !important;
  z-index: 2;
  pointer-events: auto !important;
  background: #f5f6fa !important;
  display: flex !important;
  flex-direction: column !important;
}
body.m-ui #csmPages section,
body.m-ui #csmPages section.on {
  position: relative !important;
  inset: auto !important;
  height: auto !important;
  max-height: none !important;
  overflow: visible !important;
  pointer-events: auto !important;
}
body.m-ui #csmPages section.on { display: flex !important; flex-direction: column !important; }

/* Parked design-mode stage must not cover the cabin or eat taps. */
body.m-ui #carHost.inside #stage {
  position: absolute !important;
  inset: auto !important;
  width: 0 !important;
  height: 0 !important;
  overflow: hidden !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

/* Dock + sheet always above the canvas; tappable on iOS. */
body.m-ui #mDock {
  position: fixed !important;
  left: 0; right: 0; bottom: 0;
  z-index: 9000 !important;
  pointer-events: auto !important;
  touch-action: manipulation;
  -webkit-user-select: none !important;
  user-select: none !important;
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
}
body.m-ui #mSheet {
  z-index: 10000 !important;
  pointer-events: auto !important;
  touch-action: pan-y;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body.m-ui #mSheet.open {
  display: flex !important;
  flex-direction: column !important;
  position: fixed !important;
  left: 0; right: 0; bottom: 0;
  z-index: 10000 !important;
  max-height: min(85dvh, 720px) !important;
  height: auto;
  pointer-events: auto !important;
}
body.m-ui #mSheet.expanded { max-height: 92dvh !important; height: 92dvh !important; }
body.m-ui #mSheetScrim { z-index: 9990 !important; pointer-events: auto !important; }
body.m-ui #mSheetScrim.open { display: block !important; z-index: 9990 !important; }
body.m-ui #mSheet .m-sheet-handle {
  flex: 0 0 auto;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
  touch-action: none;
}
body.m-ui #mSheet .m-sheet-handle::after {
  content: '';
  width: 40px; height: 4px; border-radius: 4px; background: #c5c7ce;
}
body.m-ui #mSheet .m-sheet-body {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  max-height: calc(85dvh - 80px);
  pointer-events: auto !important;
  touch-action: pan-y;
}
body.m-ui #mPrimary, body.m-ui #mMoreDock, body.m-ui #mMoreBtn, body.m-ui #mHomeBtn,
body.m-ui #mSheetClose, body.m-ui #mSheet button {
  touch-action: manipulation;
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none;
  pointer-events: auto !important;
}

/* Controls must not go into iOS text-selection (Copy / Find Selection). */
body.m-ui #portalBar,
body.m-ui #portalBar *,
body.m-ui #mDock,
body.m-ui #mDock *,
body.m-ui button, body.m-ui .btn, body.m-ui .pri, body.m-ui .chip,
body.m-ui #c3Stage, body.m-ui #c3Stage *,
body.m-ui .c3l, body.m-ui label, body.m-ui .m-hint, body.m-ui .m-step {
  -webkit-user-select: none !important;
  user-select: none !important;
  -webkit-touch-callout: none;
}
body.m-ui input, body.m-ui textarea, body.m-ui select, body.m-ui [contenteditable] {
  -webkit-user-select: text !important;
  user-select: text !important;
  -webkit-touch-callout: default;
}

/* Sheet + tool lists can scroll. */
body.m-ui #library, body.m-ui #comp, body.m-ui #sheet,
body.m-ui #system .ds, body.m-ui #box, body.m-ui #lab, body.m-ui #battery, body.m-ui #xo {
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  pointer-events: auto;
}

/* Hide leftover on-canvas instruction cards, but KEEP the New car / Car name form. */
body.m-ui #s-rta > .use-mic-btn,
body.m-ui #s-rta > button#rtaBack,
body.m-ui #s-rta .card:not(:has(canvas)),
body.m-ui #s-measure > .use-mic-btn,
body.m-ui #s-measure > button.pri,
body.m-ui #s-measure > button.big,
body.m-ui #s-sonar > button,
body.m-ui #s-sonar > .row,
body.m-ui #s-setup > .card h2 {
  display: none !important;
}

/* Poster fallback when WebGL or the GLB fails — never a black empty stage. */
#c3Stage .c3-poster, #loading.is-poster, #stage .c3-poster {
  position: absolute; inset: 0; display: flex; flex-direction: column;
  align-items: center; justify-content: flex-end; background: #15171b; z-index: 2;
  pointer-events: none;
}
#c3Stage .c3-poster img, #loading.is-poster img {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
}
#c3Stage .c3-poster p, #loading.is-poster span {
  position: relative; z-index: 1; margin: 0; padding: 10px 14px;
  background: rgba(17,24,39,.78); color: #fff; font-size: 13px; width: 100%;
  box-sizing: border-box;
}

body.m-ui #carHost.inside .acw-label,
body.m-ui #carHost.inside #stage .hotspot,
body.m-ui #carHost.inside #stage .marker,
body.m-ui #carHost.inside #stage [class*="label"] { display: none !important; pointer-events: none !important; }

/* v0.9.7.1b asset */


/* ===== v0.9.8: taller in-flow hero (≥60dvh) + live-sonar overlay (never covers the form) ===== */
body.m-ui #cabinHost #c3Stage,
body.m-ui #cabinHost.c3wide #c3Stage,
body.m-ui #cabinHost:not(.c3wide) #c3Stage,
body.m-ui #c3Stage {
  height: min(60dvh, 640px) !important;
  min-height: 60dvh !important;
  max-height: 70dvh !important;
  position: relative !important;
  inset: auto !important;
}
/* The live-sonar canvas is an overlay INSIDE the in-flow hero only. pointer-events none so the sheet and form still work. */
body.m-ui #c3Stage canvas#lsHero,
#lsHero,
body.m-ui #lsHero {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  max-height: none !important;
  pointer-events: none !important;
  z-index: 5;
  display: none;
  touch-action: none;
  background: transparent;
}
#lsHero.on,
body.m-ui #c3Stage canvas#lsHero.on,
body.m-ui #lsHero.on {
  display: block !important;
}
body.m-ui #tnCanvas {
  min-height: 60dvh !important;
}
body.m-ui #tuneHost,
body.m-ui .tn-root {
  position: relative !important;
}
/* v0.9.8 asset */
