.mobile-copy { display: none; }
.section-heading { display: contents; }
.section-info { display: none; }

/* Use the same portrait breakpoint as the swipe interface, including on first paint. */
@media (max-width: 720px) and (orientation: portrait) {
  .desktop-copy { display: none; }
  .mobile-copy { display: inline; }

  .chapter .section-heading {
    position: relative;
    display: block;
  }

  .chapter .section-heading h2[data-step-number] {
    min-block-size: 44px;
    margin-block: 0;
    padding-inline-end: 48px;
    align-content: center;
  }

  .section-info { display: block; }
  .section-info summary {
    position: absolute;
    inset-block-start: 0;
    inset-inline-end: 0;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    color: var(--ink);
    border-radius: var(--glass-radius);
    list-style: none;
    cursor: pointer;
  }
  .section-info summary::-webkit-details-marker { display: none; }
  .section-info[open] summary,
  #pricing .pricing-preset-details[open] summary { color: var(--mobile-control-on, #ffad6c); }
  .section-info summary:focus-visible { outline: 2px solid currentColor; outline-offset: -3px; }
  .chapter .section-info p {
    margin: .05rem 0 .35rem;
    font-size: .85rem;
    line-height: 1.45;
    text-wrap: pretty;
  }

  /* The selected card already signals the choice visually. Keep the live announcement. */
  #floorplan #layout-message {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
}

.spatial-mobile{
  --mobile-edge:clamp(1.05rem,5vw,1.75rem);
  --mobile-top:env(safe-area-inset-top,0px);
  --mobile-bottom:max(.85rem,env(safe-area-inset-bottom,0px));
  --spatial-nav-height:calc(max(46px, 2.875rem) + var(--mobile-top));
  --spatial-floor:var(--mobile-bottom);
  --feature-panel-gap:clamp(.65rem,2svh,1.25rem);
  --van-zone:min(42svh,100vw);
}
.spatial-mobile body{touch-action:pinch-zoom}
.spatial-mobile :is(.hero-copy,.offer-grid,.spatial-contact-inner){touch-action:pan-y pinch-zoom}
.mobile-header{
  position:fixed;z-index:20;inset:0 0 auto;
  height:var(--spatial-nav-height);padding:var(--mobile-top) var(--mobile-edge) 0;
  display:flex;align-items:center;gap:.65rem;
  color:#f7f3e8;background:#121917ee;
  border-bottom:1px solid #f7f3e828;
}
.mobile-header::after{
  content:"";position:absolute;bottom:-1px;left:0;width:var(--scene-progress,0%);
  height:1px;background:#ff985a;pointer-events:none;
}
#mobile-header .wordmark {
  display: inline-grid;
  place-items: center;
  min-inline-size: 44px;
  min-block-size: 44px;
  margin-inline-end: auto;
}
#mobile-header .wordmark .cela-mark { inline-size: 1.45rem; margin: 0; }
#mobile-header .step-menu summary { min-inline-size: 44px; min-block-size: 44px; }
@media (max-width: 650px) and (orientation: landscape) {
  html.spatial { --spatial-nav-height: calc(max(46px, 2.875rem) + env(safe-area-inset-top, 0px)); }
}
@media (max-width: 650px), (max-width: 720px) and (orientation: portrait) {
  /* Keep the full step count in reading order while using one compact heading on screen. */
  .chapter .step-eyebrow {
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
  }
  .chapter h2[data-step-number]::before {
    content: attr(data-step-number);
    content: attr(data-step-number) / "";
    margin-inline-end: .34em;
    color: #e5ecae;
    font-weight: 550;
    font-variant-numeric: tabular-nums;
  }

  .spatial #snapshot-dock { top: calc(env(safe-area-inset-top, 0px) + .06rem); }
}
.mobile-offer{font-size:.73rem;text-decoration:none;white-space:nowrap;color:#ffb583}
.spatial-mobile :is(.stage-bar,.stage-progress,.spatial-navigation,.guided-camera){display:none}

.spatial-mobile .viewer{
  top:calc((100svh - var(--van-zone)) / 2);bottom:auto;height:var(--van-zone);
}
/* The camera reads the normal mobile framing height even while its floor-plan viewport is cropped. */
.spatial-mobile .viewer::before {
  content: "";
  position: absolute;
  width: 0;
  height: var(--van-zone);
  pointer-events: none;
}
.spatial-mobile[data-spatial-scene="floorplan"]:not([data-viewer-only]) #viewer[data-render-mode="live"]:not([data-plan-travel]) {
  top: var(--plan-view-top, calc((100svh - var(--van-zone)) / 2));
  height: var(--plan-view-height, var(--van-zone));
}
/* Moving between camera positions needs room for the entire animated silhouette. */
.spatial-mobile:not([data-viewer-only]) #viewer[data-plan-travel] {
  top: 0;
  height: 100%;
}
.spatial-mobile .stage-background{position:fixed;inset:0}
.spatial-mobile .stage-background::after{
  background:linear-gradient(180deg,#1e2523 0%,#242822be 17%,transparent 35%,transparent 62%,#2a2b23 80%,#1e2521);
}
.spatial-mobile .viewer[data-loaded] canvas{touch-action:pinch-zoom}
.spatial-mobile .viewer-status{bottom:1rem}

.spatial-mobile .spatial-photo-frame{
  right:auto;left:50%;top:50%;
  transform:translate(-61%,-50%);
}
.spatial-mobile .spatial-hero-backdrop .spatial-photo-frame{
  transform:translate(-61%,calc(-50% + var(--portrait-scenery-y,0px)));
}
.spatial-mobile .spatial-hero-backdrop::after{
  background:linear-gradient(180deg,#111b1b50,transparent 18%,transparent calc(var(--portrait-copy-top,58%) - 4.5rem),#101817de var(--portrait-copy-top,58%),#101817 var(--portrait-plate-bottom,78%));
}
.spatial-mobile .hero-copy{
  width:100%;display:grid;align-items:end;
  padding:calc(var(--mobile-top) + 1rem) var(--mobile-edge) calc(var(--mobile-bottom) + 1.2rem);
}
.spatial-mobile .hero-copy h1{font-size:clamp(1.8rem,7.4vw,2.65rem);line-height:1.1;text-wrap:balance}
.spatial-mobile .hero-description{max-width:39ch;font-size:.86rem;margin-bottom:.45rem}
.spatial-mobile #hero-proceed-slot{
  visibility:visible;color:#ffab73;text-decoration:none;font-size:.82rem;
}
.spatial-mobile #hero-proceed-slot::after{
  content:"";display:inline-block;width:.45rem;height:.45rem;margin-left:.7rem;
  border:solid currentColor;border-width:0 1px 1px 0;transform:rotate(135deg);
}

.spatial-mobile .chapter{padding:0}
.spatial-mobile .chapter .chapter-card{display:contents}
.spatial-mobile .chapter :is(.spatial-copy,.spatial-actions){
  position:absolute;inset-inline:var(--mobile-edge);
  overflow-y:auto;overscroll-behavior:contain;scrollbar-width:none;touch-action:pan-y pinch-zoom;
}
.spatial-mobile .chapter .spatial-copy{
  top:calc(var(--spatial-nav-height) + var(--feature-panel-gap));
  max-height:calc((100svh - var(--van-zone)) / 2 - var(--spatial-nav-height) - .8rem);
}
.spatial-mobile .chapter .spatial-copy h2{font-size:clamp(1.47rem,6.5vw,2.05rem);line-height:1.08;text-wrap:balance}
.spatial-mobile .chapter .spatial-copy p:last-child{margin:0;max-width:41ch}
.spatial-mobile .chapter .spatial-actions{
  bottom:var(--mobile-bottom);
  max-height:calc((100svh - var(--van-zone)) / 2 - var(--mobile-bottom) + .5rem);
  padding:.25rem .1rem .25rem;
}
.spatial-mobile .text-action{min-height:2.6rem}
.spatial-mobile #floorplan .floor-options{grid-template-columns:1fr 1fr;gap:.25rem .7rem}
.spatial-mobile #floorplan .floor-options button{
  grid-template-columns:auto minmax(0,1fr); align-content:start; gap:.15rem .3rem; min-width:0;
  padding:.38rem .43rem;
}
.spatial-mobile #floorplan .floor-options button > span{display:contents}
.spatial-mobile #floorplan .floor-options strong{line-height:1.25}
.spatial-mobile #floorplan .floor-options small{grid-column:1 / -1;line-height:1.35;text-wrap:balance}
.spatial-mobile #floorplan .floor-thumb{width:1.55rem;height:1.35rem}
/* The editor grows from the dock upward. The middle row is the space left for the van. */
.spatial-mobile #floorplan {
  padding: calc(var(--spatial-nav-height) + var(--feature-panel-gap)) var(--mobile-edge)
    calc(var(--mobile-bottom) + var(--control-dock-space, 0px));
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: max-content minmax(min(18svh, 24vw), 1fr) minmax(0, max-content);
  justify-items: stretch;
}
.spatial-mobile #floorplan :is(.spatial-copy, .spatial-actions) {
  position: static;
  min-height: 0;
}
.spatial-mobile #floorplan .spatial-copy { grid-row: 1; }
.spatial-mobile #floorplan .spatial-actions {
  grid-row: 3;
  align-self: stretch;
  max-height: none;
}
.spatial-mobile .plan-editor{width:min(100%,17rem);margin-top:.2rem}
@media (max-height: 620px) {
  .spatial-mobile #floorplan .spatial-copy h2 { margin-block: 0; }
  .spatial-mobile #floorplan .plan-editor:has(#adjust-plan[aria-expanded="true"]) {
    display: grid;
    width: 100%;
    grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    column-gap: .45rem;
  }
  .spatial-mobile #floorplan #adjust-plan { grid-area: 1 / 1; align-self: end; }
  .spatial-mobile #floorplan #adjust-plan[aria-expanded="true"] + #plan-content { display: contents; }
  .spatial-mobile #floorplan #plan-help { grid-area: 2 / 1; align-self: start; margin: 0; }
  .spatial-mobile #floorplan #plan-map { grid-area: 1 / 2 / span 2; align-self: center; }
}
.spatial-mobile .quote-options{grid-template-columns:1fr 1fr;gap:.2rem .65rem}
.spatial-mobile #pricing .quote-options label{min-height:2.2rem;column-gap:.25rem}
.spatial-mobile #pricing .quote-options strong{font-size:.66rem}
.spatial-mobile .quote-actions{flex-wrap:wrap}
.spatial-mobile .cutaway-switches{margin:0}
.spatial-mobile .cutaway-annotations button{font-size:.68rem;min-height:2rem}

.spatial-mobile :is(.offer,.contact){
  padding:calc(var(--spatial-nav-height) + 1rem) var(--mobile-edge) var(--mobile-bottom);
}
/* The sales pages have no viewer dock. Give their swipe cue a separate touch target. */
:is(#proof, #offer) > .swipe-up-cue { display: none; }

.spatial-mobile :is(#proof, #offer) {
  --swipe-cue-size: 44px;
  padding-block-end: calc(var(--mobile-bottom) + var(--swipe-cue-size) + .25rem);
}

.spatial-mobile :is(#proof, #offer)[data-spatial-ready="true"] > .swipe-up-cue {
  position: absolute;
  inset-inline: 0;
  bottom: var(--mobile-bottom);
  display: grid;
  place-items: center;
  width: var(--swipe-cue-size);
  height: var(--swipe-cue-size);
  margin: 0 auto;
  color: var(--swipe-cue-ink, var(--acid));
  border-radius: .4rem;
  pointer-events: auto;
}

.spatial-mobile #offer { --swipe-cue-ink: var(--offer-glass-accent); }
.swipe-up-cue svg { width: 28px; height: 28px; }

@media (prefers-reduced-motion: no-preference) {
  .swipe-up-cue svg { animation: swipe-up-gesture 2.6s ease-in-out infinite; }
}
@keyframes swipe-up-gesture {
  0%, 12%, 100% { transform: translateY(3px); opacity: .65; }
  46%, 66% { transform: translateY(-4px); opacity: 1; }
  84% { transform: translateY(-4px); opacity: .45; }
}

.spatial-mobile .contact{align-items:start}
.spatial-mobile :is(.offer-grid,.spatial-contact-inner){gap:1.25rem;padding:.2rem 0}
.spatial-mobile .contact .spatial-contact-inner{height:100%;align-content:start}
.spatial-mobile .contact form{padding:0 0 .5rem}
.spatial-mobile .contact ul{margin-block:.6rem 0}
