/* ============================================================================
   zz_studio_mobile_shell.css — the Post studio mobile shell: ONE scrolling
   column (plan stage C-6c-ii; decision C3 in docs/design/builder_v6_decisions.md;
   docs/design/new_content_screen.md §6 "one scrolling tool surface below the
   preview" + §4 sticky CTA; map §C4 in docs/new_content/studio_control_map.md).
   Stage D-2 (docs/new_content/studio_final_phase_plan.md, 2026-08-30): the
   experience-redesign stage-B1 band this file used to override
   (zz_new_content.css, the FIXED bottom unit — TabsList as a bottom tool bar,
   the active TabsPanel as a bottom sheet, the `sp-mob-sheet-open` open state
   written by the retired assets/new_content_mobile_shell.js) and the sheet's
   portaled-dropdown lift are DELETED; this file now carries the column's own
   rules instead of counter-rules. Nothing in the studio's mobile geometry
   changed with D-2 (verified 1:1 against a HEAD worktree, see the plan note).

   The column (≤640): the global app header (visible since Band S stage
   S-1a, decision S2) → the studio topbar (C-1) → canvas + canvas toolbar
   (C-6b) → the Setup panel's cards TEXT / OUTPUT / LOOK / FINE-TUNING
   (C-2..C-5c), in flow, page scroll → the sticky Export CTA (C-6a) above
   the app's bottom nav.
   Since C-6c-i every selection root maps to `setup` and every other tab is
   parked, so the column shows exactly the Setup panel.

   Scope: #new-content-shell, inside ONE `@media (max-width: 640px)` block.
   Desktop (≥1181, the fixed right panel) and tablet (641–1180, the stacked
   panels with the tab strip) are untouched. Nothing in styles.css or the
   other zz_studio_*.css files is edited.

   What each rule answers (the older rule it overrides, at the overridden
   rule's specificity or above — this file sorts after zz_new_content.css and
   zz_studio_export_cta.css, so equal-specificity ties come here; !important
   ONLY where the overridden rule is !important):
   * #workspace-right-panel: in the ≤1180 column flow (the :1568 `order: 2`
     puts it under the canvas); the base :1202 panel ground / :1573 top
     border / `overflow: auto` are dropped — the cards carry their own
     chrome and the column must not be a scroll box. The callback-owned
     inline signals (`_sync_workspace_panel_visibility`: opacity /
     transform / pointer-events) stay respected: the hidden state
     (`opacity: 0` before the visual stage and in fullscreen) takes no space.
     The same callback writes `overflow: auto` + `resize: horizontal` INLINE
     for the visible state (its desktop resize grip) — the two !important
     here answer that inline style, as the B1 band's did.
   * the app's mobile bottom nav (`.sp-bottom-nav`, styles.css:11323, fixed
     z 1200 at ≤767): VISIBLE on the studio since Band S stage S-1a
     (decision S2 supersedes D5; docs/new_content/studio_entry_plan.md §3) —
     no rule here any more; the Export CTA sits above it through
     `--sp-bottom-nav-h` in zz_studio_export_cta.css (≤767).
   * the panel wrappers (.sp-editor-panel-stack :1231 `padding: 16px`, the
     .sp-guided-creator-panel / main-settings Stack gaps): zeroed — the Setup
     panel's own 12px sides are the column's gutters.
   * .sp-guided-main-settings (a Mantine Paper, radius md; :4776 `padding:
     10px !important`): flat and transparent, no padding.
   * the Inspector / Pro header row: hidden — the FINE-TUNING card's unlock
     label (`htmlFor=inspector-pro-toggle`, C-5a) drives the same switch.
   * #config-step-wrapper / #config-card (the :915 / :3980 card chrome and
     styles.css:5275 `padding: 14px`, all !important): flattened.
   * .sp-config-root-tabs-list (the tab strip, :2365 `display: grid
     !important`): hidden — one visible tab (Setup), nothing to switch to.
   * .mantine-Tabs-panel: 12px side gutters (the top is :2387's 0, the bottom
     is the CTA clearance zz_studio_export_cta.css:150). Mantine's own inline
     `display: none` keeps the six parked panels hidden; the active Setup
     panel needs no rule.
   * the CTA's bottom offset: S-1a replaced the retired B1 bar height this
     file used to zero (`--sp-studio-mobile-bar-h`) with the nav height
     `--sp-bottom-nav-h`, owned and applied by zz_studio_export_cta.css at
     ≤767 — nothing to zero here. UX 4.3 / D-63 (2026-09-15) then took the
     band off the phone's bottom edge entirely: at ≤640 it is a static pill
     in the studio topbar's actions cluster, so the `z-index: 50` rule below
     is a no-op kept for the record, and the ≤640 CTA clearances it used to
     answer are gone from zz_studio_export_cta.css. #builder-preview-shell's
     `padding-bottom: 8px` below is all the canvas column reserves now; the
     app's bottom nav keeps its own clearance (styles.css:11371).
   * UX backlog 3.2 (decision D-8, 2026-09-14) — the preview stage is scaled
     AS A WHOLE on a phone (at most ~50 % of the viewport height):
     `assets/studio_preview_scale.js` measures and writes the custom properties,
     the transform + wrap clamp rules live in `assets/zz_studio_preview_scale.css`
     since 3.4 stage 4 (2026-09-15, finding F-3.4-2: the same mechanism fits the
     build-sized stage into the column on every width), no longer in this file.
     The drag / hit-test maths of the layout editors is scale-invariant
     (docs/ux/analysis/chart_screen.md §4) and untouched.
   * UX backlog 4.4 (2026-09-15) — the phone stage grows into the air around it:
     the canvas column's top padding (14px) and #preview-surface's 8px stack gap
     (spent twice) and the transport's 6px margin-top are trimmed here, and the
     matching half — `--sp-preview-height-reserve` 140px → 130px, the budget the
     scale script caps the stage against — in zz_studio_preview_scale.css. No
     geometry rule is added: the stage is still sized by that one cap. An
     explore-born post's EMPTY #preview-action-panel (the chip strip is Chart's
     there) stops taking a gap on the phone too — that collapse lives with the
     ≥641 one it mirrors, in zz_studio_data_scope.css.
   Nothing here sets `display` on the `.sp-config-root-tab` triggers; the Tabs
   component, its values and the `config-root-accordion` writers are
   untouched (their retirement is stage D-1a).
   ========================================================================== */

@media (max-width: 640px) {
  /* the inspector column in flow under the canvas: no panel ground, no top
     border, no scroll box (the page scrolls) */
  #new-content-shell #workspace-right-panel {
    position: static;
    overflow: visible !important;
    resize: none !important;
    background: transparent;
    border: 0;
  }

  /* the callback-written hidden state (before the visual stage, fullscreen)
     must take no space in flow */
  #new-content-shell #workspace-right-panel[style*="opacity: 0"] {
    display: none;
  }

  /* the desktop panel wrappers carry no padding or gaps in the column */
  #new-content-shell #workspace-right-panel .sp-editor-panel-stack,
  #new-content-shell #workspace-right-panel .sp-guided-creator-panel {
    padding: 0;
    margin: 0;
    gap: 0;
  }

  /* no sheet chrome: the settings cards carry their own */
  #new-content-shell #workspace-right-panel .sp-guided-main-settings {
    padding: 0 !important;
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  #new-content-shell #workspace-right-panel .sp-guided-main-settings > .mantine-Stack-root {
    gap: 0;
  }

  /* the Inspector / Pro header row: the FINE-TUNING card's unlock label
     drives the same switch */
  #new-content-shell #workspace-right-panel .sp-guided-main-settings .mantine-Group-root:has(.sp-inspector-pro-switch) {
    display: none;
  }

  /* the config card and its scroll wrapper are flat surfaces in the column */
  #new-content-shell #workspace-right-panel #config-step-wrapper,
  #new-content-shell #workspace-right-panel #config-card {
    padding: 0 !important;
    margin: 0;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  /* the tab strip — one tab, nothing to switch to */
  #new-content-shell #config-card .sp-config-root-tabs-list {
    display: none !important;
  }

  /* the Setup panel = the v6 cards; its sides are the column's gutters */
  #new-content-shell #config-card .sp-config-root-tabs .mantine-Tabs-panel {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* the canvas column no longer keeps clear of a fixed bar — the cards follow.
     UX 4.4 (2026-09-15): the top padding joins it here. The winner above the stage
     was zz_new_content.css's ≤720 shorthand `padding: 14px 12px 80px !important`
     (the ≤640 `padding-top: 6px !important` there carries one id less and loses);
     14px of dead band between the studio topbar and the canvas card, measured
     tmp/ux_4_4/probe.py `ux44_before`. 4px is the whole separation the card needs —
     it draws no chrome of its own on the phone (zz_new_content.css:5211 strips the
     border/background). The bottom stays 8px: that is the canvas column's gap to the
     Setup cards below it, not stage chrome. */
  #new-content-shell #builder-preview-shell.sp-builder-preview-shell {
    padding-top: 4px !important;
    padding-bottom: 8px !important;
  }

  /* the preview surface's own stack gap (8px, zz_new_content.css:#preview-surface):
     it is spent twice on the first screen — above the figure card and again between
     the card and the transport — and the transport adds a 6px margin-top on top of
     the second one (zz_new_content.css:4149). Both are stage height on a phone. */
  #new-content-shell #preview-surface {
    gap: 4px;
  }

  #new-content-shell #preview-surface > .sp-transport-bar {
    margin-top: 0;
  }

  /* the CTA is above in-flow content only: desktop stacking again */
  #new-content-shell .sp-studio-export-cta {
    z-index: 50;
  }
}
