/* ============================================================================
   WIZARD-MOBILE.CSS — phone-first APP SHELL for the guided Re-Production Studio
   ----------------------------------------------------------------------------
   Loaded after flow.css. EVERY rule lives inside @media (max-width: 720px), so
   the desktop studio is byte-for-byte unchanged. On phones the studio becomes a
   clean app shell that matches the approved mobile mock:

     • a top app bar (back · step name · "Step N of 8" · info)
     • a slim 8-segment progress rail
     • a card-based single-column body
     • a bottom thumb-zone dock (ghost back · cyan primary action)
     • the long per-step copy tucked behind an "How this step works" row

   No engine behaviour changes: the 8 panels, gate(), VoiceGuide and the
   window.Wizard API are all untouched. Nothing is removed — the long copy is
   still in the DOM (just collapsed), and every control keeps working.
   ============================================================================ */

/* The app bar + disclosure row are created by wizard.js; hide them on desktop. */
.wz-appbar { display: none; }
.wz-info-toggle { display: none; }
.path-card-sub { display: none; }

@media (max-width: 720px) {

  /* ------------------------------------------------------------------ *
     0. Kill the marketing chrome — the mock is a pure app shell
     ------------------------------------------------------------------ */
  body.wizard-on .site-nav,
  body.wizard-on .account-bar,
  body.wizard-on .app-header { display: none !important; }

  body.wizard-on .wrap { max-width: none; padding: 0; }

  /* ------------------------------------------------------------------ *
     0b. Menu drawer — the app bar's ☰ reveals the site navigation
         (the mock has no nav; we keep it reachable so nothing is lost)
     ------------------------------------------------------------------ */
  body.wizard-on.wz-nav-open { overflow: hidden; }
  body.wizard-on.wz-nav-open .site-nav {
    display: block !important;
    position: fixed;
    inset: 0;
    z-index: 70;
    background: rgba(6, 8, 11, 0.66);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    border-bottom: none;
  }
  body.wizard-on.wz-nav-open .site-nav .wrap {
    position: absolute;
    top: 0; right: 0; bottom: 0;
    width: min(80vw, 320px);
    height: 100%;
    max-width: none;
    margin: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 18px 18px calc(18px + env(safe-area-inset-bottom, 0px));
    background: var(--panel);
    border-left: 1px solid var(--border);
    box-shadow: -24px 0 60px rgba(0, 0, 0, 0.55);
    overflow-y: auto;
  }
  body.wizard-on.wz-nav-open .site-nav .brand-lockup { margin-bottom: 10px; }
  body.wizard-on.wz-nav-open .site-nav .nav-toggle { display: none; }
  body.wizard-on.wz-nav-open .site-nav .nav-links {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 2px;
    width: 100%;
    margin: 6px 0 12px;
  }
  body.wizard-on.wz-nav-open .site-nav .nav-links a {
    width: 100%;
    padding: 12px;
    border-radius: 11px;
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
  }
  body.wizard-on.wz-nav-open .site-nav .nav-links a:hover,
  body.wizard-on.wz-nav-open .site-nav .nav-links a.active {
    background: var(--panel-2);
    color: var(--accent-2);
  }
  body.wizard-on.wz-nav-open .site-nav .nav-cta:not([hidden]) {
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
    border-top: 1px solid var(--border);
  }
  body.wizard-on.wz-nav-open .site-nav .nav-cta .nav-user { color: var(--text-dim); font-size: 13px; }

  /* ------------------------------------------------------------------ *
     1. Sticky app-shell header (app bar + progress rail)
     ------------------------------------------------------------------ */
  body.wizard-on .flow-progress {
    position: sticky;
    top: 0;
    margin: 0 0 14px;
    padding: 0;
    border: none;
    border-radius: 0;
    background: rgba(15, 17, 21, 0.94);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    box-shadow: 0 1px 0 var(--border), 0 12px 30px rgba(0, 0, 0, 0.5);
    z-index: 40;
  }
  body.wizard-on .flow-progress-head { display: none; }
  body.wizard-on .wz-progress { display: none; }

  /* --- app bar --- */
  body.wizard-on .wz-appbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px 9px;
  }
  body.wizard-on .wz-ab-back {
    width: 36px; height: 36px; flex: 0 0 auto;
    display: grid; place-items: center;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 11px; color: var(--text); font-size: 17px; line-height: 1;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  body.wizard-on .wz-ab-back:disabled { opacity: 0.35; }
  body.wizard-on .wz-ab-ttl { flex: 1 1 auto; min-width: 0; }
  body.wizard-on .wz-ab-ttl b {
    display: block; font-size: 15px; font-weight: 800; letter-spacing: -0.01em;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  body.wizard-on .wz-ab-ttl small { display: block; font-size: 11px; font-weight: 600; color: var(--text-dim); }
  body.wizard-on .wz-ab-info {
    width: 36px; height: 36px; flex: 0 0 auto;
    display: grid; place-items: center;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 50%; color: var(--accent-2); font-size: 15px; font-weight: 800;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  body.wizard-on .wz-ab-info.open {
    background: rgba(53, 194, 255, 0.14);
    border-color: rgba(53, 194, 255, 0.5);
  }
  body.wizard-on .wz-ab-menu {
    width: 36px; height: 36px; flex: 0 0 auto;
    display: grid; place-items: center;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 11px; color: var(--text); font-size: 15px; line-height: 1;
    cursor: pointer; -webkit-tap-highlight-color: transparent;
  }
  body.wizard-on .wz-ab-menu[aria-expanded="true"] {
    background: rgba(53, 194, 255, 0.14);
    border-color: rgba(53, 194, 255, 0.5);
    color: var(--accent-2);
  }

  /* --- slim 8-segment rail --- */
  body.wizard-on .flow-steps {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 5px;
    padding: 0 14px 12px;
    overflow: visible;
  }
  body.wizard-on .flow-step { flex: none; min-width: 0; padding: 0; gap: 0; }
  body.wizard-on .flow-step::before { display: none; }
  body.wizard-on .flow-step .flow-label { display: none; }
  body.wizard-on .flow-dot {
    width: 100%; height: 5px; border-radius: 999px;
    background: #1c212b; border: none; box-shadow: none;
    color: transparent; font-size: 0; line-height: 0;
    transition: background 0.2s ease, box-shadow 0.2s ease;
  }
  body.wizard-on .flow-step.done .flow-dot {
    background: linear-gradient(90deg, var(--accent-2), var(--accent-3));
  }
  body.wizard-on .flow-step.active .flow-dot {
    background: linear-gradient(90deg, var(--accent), #ffb37a);
    box-shadow: 0 0 10px rgba(255, 107, 53, 0.6);
  }

  /* ------------------------------------------------------------------ *
     2. Card-based single-column body
     ------------------------------------------------------------------ */
  body.wizard-on section.panel {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 2px 14px 158px;   /* room for the fixed dock */
    margin: 0;
  }
  /* The app bar already names the step — drop the duplicated in-body title. */
  body.wizard-on section.panel > h2 { display: none; }

  /* ------------------------------------------------------------------ *
     3. Progressive disclosure — the long intro copy collapses
     ------------------------------------------------------------------ */
  body.wizard-on .wz-info-toggle {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    margin: 18px 0 0;
    padding: 12px 13px;
    font: inherit;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    color: var(--text);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 13px;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  body.wizard-on .wz-info-toggle:active { background: #1e222b; }
  body.wizard-on .wz-info-toggle .wz-info-ico {
    width: 28px; height: 28px; flex: 0 0 auto;
    display: grid; place-items: center;
    background: rgba(53, 194, 255, 0.12);
    border: 1px solid rgba(53, 194, 255, 0.3);
    border-radius: 9px; color: var(--accent-2); font-size: 14px;
  }
  body.wizard-on .wz-info-toggle .wz-caret {
    margin-left: auto; color: var(--text-dim); font-size: 12px;
    transition: transform 0.18s ease;
  }
  body.wizard-on .wz-info-toggle.open .wz-caret { transform: rotate(180deg); }
  /* Every long-form block collapses on phones (hidden, still in the DOM). The
     class is removed to reveal, so each block keeps its own natural display. */
  body.wizard-on .wz-prose { display: none !important; }
  /* Step-3 path cards keep a terse one-line summary (the long copy collapses). */
  body.wizard-on .path-card-sub {
    display: block;
    margin: 3px 0 0;
    font-size: 12px;
    line-height: 1.35;
    color: var(--text-dim);
  }

  /* ------------------------------------------------------------------ *
     4. Thumb-zone dock
     ------------------------------------------------------------------ */
  body.wizard-on .wizard-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    margin: 0;
    border-radius: 0;
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
    gap: 10px;
    flex-wrap: wrap;
    background: linear-gradient(180deg, rgba(15, 17, 21, 0), rgba(15, 17, 21, 0.96) 38%);
    border-top: 1px solid var(--border);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    z-index: 50;
  }
  body.wizard-on .wz-center { order: -1; flex-basis: 100%; text-align: center; }
  body.wizard-on .wz-line { justify-content: center; }
  body.wizard-on .wz-step,
  body.wizard-on .wz-sep,
  body.wizard-on .wz-name { display: none; }
  body.wizard-on .wz-hint { font-size: 11.5px; margin-top: 0; }
  body.wizard-on .wz-back {
    flex: 0 0 54px;
    min-height: 50px;
    padding: 0;
    font-size: 0;
    border-radius: 15px;
    background: var(--panel);
    border: 1px solid var(--border);
    color: var(--text);
  }
  body.wizard-on .wz-back .wz-arrow { font-size: 19px; }
  body.wizard-on .wz-next {
    flex: 1 1 auto;
    min-height: 50px;
    border-radius: 15px;
    font-size: 15px;
    font-weight: 800;
    color: #08111c;
    background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
    border: none;
    box-shadow: 0 10px 24px rgba(53, 194, 255, 0.3);
  }
  body.wizard-on .wz-next:hover:not(:disabled) { box-shadow: 0 12px 28px rgba(53, 194, 255, 0.42); }
  body.wizard-on .wz-next:disabled { opacity: 0.4; }

  /* ------------------------------------------------------------------ *
     5. Mock-style cards & controls
     ------------------------------------------------------------------ */
  /* primary actions → cyan (the mock's "primary action" colour) */
  body.wizard-on section.panel button.primary,
  body.wizard-on section.panel .btn.primary {
    background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
    color: #08111c;
    border-color: transparent;
    border-radius: 14px;
    font-weight: 800;
    min-height: 48px;
  }
  body.wizard-on section.panel button.primary:hover:not(:disabled) { filter: brightness(1.06); }

  /* drop zone (step 1) */
  body.wizard-on .step1-drop {
    border: 1.5px dashed var(--border);
    border-radius: 18px;
    background: radial-gradient(120% 120% at 50% 0%, rgba(53, 194, 255, 0.08), transparent 70%), var(--panel);
    padding: 26px 16px;
  }
  body.wizard-on .step1-drop .big-icon { font-size: 44px; margin-bottom: 10px; }
  body.wizard-on .step1-drop .step1-name { font-size: 13px; }
  body.wizard-on .step1-meta {
    border-radius: 15px;
    background: var(--panel);
    padding: 14px;
  }

  /* path cards (step 3) — become the mock's big tappable cards */
  body.wizard-on .path-chooser { grid-template-columns: 1fr; gap: 10px; margin: 4px 0 6px; }
  body.wizard-on .path-card {
    border-radius: 15px;
    padding: 14px 14px 14px 46px;
    background: var(--panel);
  }
  body.wizard-on .path-card.is-active {
    border-color: var(--accent-2);
    background: rgba(53, 194, 255, 0.07);
    box-shadow: 0 0 0 1px rgba(53, 194, 255, 0.35);
  }
  body.wizard-on .path-card input[type="radio"] { accent-color: var(--accent-2); left: 15px; top: 16px; }
  body.wizard-on .path-card-head { font-size: 14.5px; }
  body.wizard-on .path-card-desc { font-size: 12px; }
  body.wizard-on .path-card-voice { margin-top: 10px; }
  body.wizard-on .path-voice-select { font-size: 13px; padding: 10px 30px 10px 12px; }

  /* stem lanes (step 2) */
  body.wizard-on .stem-grid { grid-template-columns: 1fr; gap: 10px; }
  body.wizard-on .stem-card { border-radius: 14px; }

  /* generic panels: give inner blocks the card look */
  body.wizard-on .advanced-standalone,
  body.wizard-on .turnkey-panel,
  body.wizard-on .mixer-panel { border-radius: 0; }

  /* action rows stack full-width */
  body.wizard-on .action-row { flex-direction: column; align-items: stretch; gap: 10px; }
  body.wizard-on .action-row > * { width: 100%; }

  /* ------------------------------------------------------------------ *
     6. Launch hero — match the mock's clean centred hero
     ------------------------------------------------------------------ */
  body.wizard-on .wz-icons { display: none; }
  body.wizard-on .wz-welcome-card { padding: 26px 20px; }
  body.wizard-on .wz-welcome-title { font-size: 27px; }
  body.wizard-on .wz-welcome-sub { font-size: 13.5px; }
  body.wizard-on .wz-launch {
    background: linear-gradient(135deg, var(--accent-2), var(--accent-3));
    color: #08111c;
    box-shadow: 0 14px 32px rgba(53, 194, 255, 0.32);
  }
  body.wizard-on .wz-launch:hover { box-shadow: 0 16px 36px rgba(53, 194, 255, 0.42); }
}

/* Very small phones — tighten a touch more. */
@media (max-width: 380px) {
  body.wizard-on .flow-steps { gap: 3px; }
  body.wizard-on .wz-next { font-size: 14px; }
  body.wizard-on .wz-ab-ttl b { font-size: 14px; }
}
