/* The phone pass, the forge flow: basics, build, pick, steps, character, dials, interview, review (owner, 25 Nov; mockups in docs/DESIGN_TWEAKS_2026-11-25.md, "Mobile pass").
   Every rule inside @media (max-width: 700px): nothing here touches the desktop. */
@media (max-width: 700px) {

  /* ═════ The basics (forge_quick) and Build a world (forge_vision): one slim, compact column ═════ */
  .wf-forge { padding-top: 6px !important; }
  .wf-forge-sub { flex: none !important; margin-top: 6px !important; font-size: 14px !important; line-height: 1.5 !important; }
  .wf-forge-scroll { padding-top: 12px !important; }
  .wf-basics .wf-group { margin-bottom: 14px !important; }
  .wf-basics .wf-kicker { margin-bottom: 6px; font-size: 10.5px !important; }

  /* the name: a full-width boxed field */
  .wf-basics .wf-title-input { width: 100%; box-sizing: border-box; min-height: 48px; padding: 10px 14px; font-size: 17px !important;
    border: 1px solid var(--bd-ctl, rgba(255, 255, 255, 0.22)) !important; border-radius: 14px; background: rgba(255, 255, 255, 0.04); }
  .wf-basics .wf-title-input:focus { border-color: var(--acc) !important; outline: none; }

  /* the sub-genre wheel: slim (118px), the handle stays on the right */
  .wf-group:has(#wf-subgenres) > .wf-kicker::after { content: "swipe, or drag the handle"; margin-left: 12px; letter-spacing: 0.06em; text-transform: none; color: var(--ink-faint, #7a7a88); font-size: 10px; }
  .wf-basics .wfu-drumrow { max-width: none; gap: 8px; margin-top: 10px; }
  .wf-basics .wfu-drum { height: 118px; border-radius: 12px; }
  .wf-basics .wfu-drum .it { height: 34px; font-size: 13px; letter-spacing: 0.12em; padding: 0 10px; }
  .wf-basics .wfu-window { height: 34px; left: 8px; right: 8px; }
  .wf-basics .wfu-lever { width: 46px; }
  .wf-basics .wfu-knob { width: 34px; height: 34px; margin: -17px 0 0 -17px; }
  .wf-basics .wfu-knob::before { content: ""; position: absolute; inset: -8px; border-radius: 50%; }   /* a finger-sized grab area around the small knob */

  /* tone, arc and the world-shape questions: one full-width row each; a tap opens a bottom sheet (wf-mobile-forge.js) */
  .wf-basics .wfu-pill, .wf-basics .wfu-stack .wfu-pill, .wf-basics #wf-rom-row .wfu-pill, .wf-basics #wf-era-row .wfu-pill,
  .wf-pm-start .wfu-pill { display: block !important; width: 100% !important; margin: 0 0 10px !important; }
  .wf-basics .wfu-pill-btn, .wf-pm-start .wfu-pill-btn { display: flex; width: 100%; box-sizing: border-box; min-height: 50px; padding: 8px 14px; border-radius: 14px; gap: 10px; }
  .wf-basics .wfu-pk, .wf-pm-start .wfu-pk { flex: none; }
  .wf-basics .wfu-pv, .wf-pm-start .wfu-pv { flex: 1; min-width: 0; text-align: right; font-size: 15px; line-height: 1.25; }
  .wf-pm-start .wfu-pv { text-align: left; }
  .wf-basics .wfu-list, .wf-pm-start .wfu-list { display: none !important; }
  .wf-basics .wfu-note, .wf-pm-start .wfu-note { margin: -4px 4px 8px; font-size: 12.5px; line-height: 1.4; }
  .wf-group.wfu-stack { margin-bottom: 8px !important; }

  /* the sheet that replaces the popover list */
  .wfm-pick .wfm-row { min-height: 52px; margin-bottom: 8px; }
  .wfm-pick .wfm-row-t { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
  .wfm-pick .wfm-row-l { font-size: 16px; color: var(--ink); }
  .wfm-pick .wfm-row-d { font-size: 12.5px; line-height: 1.35; color: var(--ink-dim); }
  .wfm-pick .wfm-row[aria-pressed="true"] { border-color: var(--acc); background: color-mix(in srgb, var(--acc) 12%, transparent); }
  .wfm-pick .wfm-row[aria-pressed="true"] .wfm-row-l { color: var(--acc); }
  .wfm-pick .wfm-row[aria-pressed="true"]::after { content: "\2713"; color: var(--acc); font-size: 18px; }

  /* Story / Game / Custom: the segmented control stays full width; the panel under it is compact */
  .wf-basics .wfu-seg { max-width: none; width: 100%; }
  .wf-basics .wfu-seg button { min-height: 44px; }
  .wf-basics .wfu-mode { margin-top: 10px; padding: 12px 14px 12px; border-radius: 12px; }
  .wf-basics .wfu-mode-head h3 { font-size: 21px; }
  .wf-basics .wfu-mode-desc { margin-top: 6px; font-size: 14px; line-height: 1.45; }
  .wf-basics .wfu-mode-rows { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin-top: 10px; padding-top: 10px; }
  .wf-basics .wfu-row { font-size: 13px; gap: 7px; }
  .wf-basics .wf-hp-custom { gap: 6px 10px; margin-top: 10px; }

  /* the content dials: full-width glow sliders, tight */
  .wf-basics .wf-dial { margin-bottom: 4px; }
  .wf-basics .wf-dial-top { margin-bottom: 0; }
  .wf-basics .wf-dial-name { font-size: 16px; }
  .wf-basics .wf-dial-desc { margin: 2px 0 0 !important; font-size: 12.5px !important; line-height: 1.35; }
  .wf-basics .wfu-sl { height: 40px; margin: 4px 8px 0; }
  .wf-basics .wfu-glowrow::before { display: none; }

  /* LitRPG and Isekai blocks: smaller */
  .wf-basics .wf-litrpg { margin-top: 14px; padding: 12px 14px; gap: 12px; }
  .wf-basics .wf-isekai { margin-top: 14px !important; }

  /* the pinned bar (Back + the main button + the status line above them) */
  .wf-forge .wfm-bar, .wf-stage .wfm-bar, body > .wfm-bar { flex-wrap: wrap; row-gap: 6px; }
  .wfm-bar .wfm-status { flex: 1 0 100%; order: -1; min-height: 0 !important; margin: 0; padding: 0 2px; font-size: 11px; letter-spacing: 0.1em; line-height: 1.4; text-align: center; text-transform: none; color: var(--ink-2); }
  .wfm-bar .wfm-status:empty { display: none; }
  .wfm-bar > a, .wfm-bar > button { display: flex; align-items: center; justify-content: center; box-sizing: border-box; margin: 0 !important; text-decoration: none; min-height: 48px; }
  .wfm-bar > .wfm-back { flex: 0 0 96px; }
  .wfm-bar > .wf-btn--primary, .wfm-bar > .btn-primary, .wfm-bar > #next-btn, .wfm-bar > #wf-go, .wfm-bar > #pm-go { flex: 1; width: auto !important; }
  .wfm-bar.is-idle > #pm-go { opacity: 0.4; }

  /* ═════ Pick a world (forge_premade): a swipeable carousel, one card per screen ═════ */
  .wf-pm-grid { display: flex !important; grid-template-columns: none; gap: 12px !important; overflow-x: auto; overflow-y: hidden; margin: 0 -16px; padding: 4px 16px 6px;
    scroll-snap-type: x mandatory; scroll-padding-left: 16px; -webkit-overflow-scrolling: touch; scrollbar-width: none; overscroll-behavior-x: contain; }
  .wf-pm-grid::-webkit-scrollbar { display: none; }
  .wf-pm-card { flex: 0 0 88%; aspect-ratio: auto !important; height: clamp(300px, 54vh, 460px); scroll-snap-align: start; scroll-snap-stop: always; }
  .wf-pm-card[aria-pressed="true"] { border-color: var(--acc); box-shadow: 0 0 0 2px var(--acc), 0 0 36px color-mix(in srgb, var(--acc) 26%, transparent); }
  .wf-pm-body { padding: 16px 16px 18px; gap: 6px; }
  .wf-pm-name { font-size: 26px; }
  .wf-pm-desc { max-height: none !important; opacity: 1 !important; font-size: 15px; line-height: 1.5; color: var(--ink); }
  .wf-pm-desc strong { color: var(--ink); font-weight: 600; }
  .wfm-pmhint { margin: 0 0 6px; font-size: 12.5px; color: var(--ink-dim); }
  .wfm-dots { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 28px; padding: 6px 0 4px; font-family: var(--fm); font-size: 12px; letter-spacing: 0.12em; color: var(--ink-dim); }
  .wfm-dot { position: relative; flex: none; width: 8px; height: 8px; padding: 0; min-height: 0 !important; border: 0; border-radius: 4px; background: #3a3a48; transition: width 200ms, background 200ms; }
  .wfm-dot::before { content: ""; position: absolute; inset: -16px -6px; }
  .wfm-dot.is-on { width: 22px; background: var(--acc); }
  .wf-pm-start { margin-top: 12px; }
  .wf-pm-start .wf-kicker { margin-bottom: 4px; }
  .wf-pm-start-title { font-size: 22px !important; margin: 2px 0 10px !important; }
  .wf-pm-start .wf-litrpg { margin-top: 14px; padding: 12px 14px; }
  .wf-pm-start .wf-isekai { margin-top: 14px !important; }

  /* ═════ Build steps (forge_build_step) and the one-page build (forge_build) ═════ */
  .wf-stage .forge-container:has(#step-input) { display: flex; flex-direction: column; margin-top: 0; padding-top: 6px; }
  .wf-stage .forge-container:has(#step-input) .forge-subtitle { order: -3; margin: 0 0 8px; font-size: 12px; letter-spacing: 0.18em; color: var(--acc); text-transform: uppercase; }
  .wf-stage .forge-container:has(#step-input) .step-progress { order: -2; gap: 3px; margin-bottom: 14px; }
  .wf-stage .forge-container:has(#step-input) .step-dot { height: 4px; border-radius: 2px; }
  .wf-stage .forge-container:has(#step-input) .forge-title { order: -1; margin: 0 0 4px; }
  .wf-stage .forge-container:has(#step-input) .step-label { margin: 0 0 12px; font-size: 14px; letter-spacing: 0.01em; line-height: 1.45; text-transform: none; color: var(--ink-dim); }
  .wf-stage .forge-container:has(#step-input) .form-group { margin-bottom: 10px; }
  .wf-stage .forge-container:has(#step-input) textarea.world-input { min-height: 34vh; }
  .wf-stage .forge-container:has(#step-input) .btn-row { order: 3; margin-top: 0; }
  .wf-stage .forge-container:has(#step-input) .btn-row .spacer { display: none; }
  .wf-stage .forge-container:has(#step-input) .suggest-chips { order: 4; margin-top: 10px; }
  .wf-stage .forge-container:has(#step-input) .people-builder { order: 5; }
  .wf-stage .forge-container:has(#step-input) .skip-hint { order: 6; }
  .wf-stage .forge-container:has(#step-input) .btn-row .oracle-btn,
  .wf-stage .forge-container:has(#step-input) .btn-row .suggest-btn { flex: 1 1 0; min-height: 44px; font-size: 12px; letter-spacing: 0.04em; white-space: nowrap; }
  .wf-stage .forge-container:has(#step-input) .btn-row .suggest-toggle { flex: 1 0 auto; }

  .wf-stage .forge-container:has(#world-input) { padding-top: 6px; }
  .wf-stage .forge-container:has(#world-input) .oracle-row { flex-direction: column; gap: 8px; }
  .wf-stage .forge-container:has(#world-input) .form-textarea { min-height: 34vh; font-size: 16px; }
  .wf-stage .forge-container:has(#world-input) .btn-oracle { width: 100%; min-height: 44px; }
  .wf-stage .forge-container:has(#world-input) .vision-preview { max-height: 72px; }
  .wf-stage .forge-container:has(#world-input) .form-actions.wfm-bar { margin: 0; justify-content: flex-start; }
  .wf-stage .forge-container:has(#world-input) .form-actions.wfm-bar > .btn { flex: 1; }
  .wf-stage .forge-container:has(#world-input) .form-actions.wfm-bar > .wfm-back { flex: 0 0 96px; }

  /* the header wrapper of the two build pages has an inline 40px side padding: a phone gets the 16px gutter */
  .wf-stage > div[style*="840px"]:has(+ .forge-container) { padding: 12px 16px 0 !important; }
  /* a button that moves into the pinned bar leaves the container's styles behind, so the bar styles it itself */
  .wfm-bar > #next-btn, .wfm-bar > #generate-btn { background: var(--acc); color: #0b0a10; border: 0; border-radius: 12px; cursor: pointer;
    font-family: var(--fm); font-size: 12px; font-weight: 600; letter-spacing: 0.18em; text-transform: uppercase; }
  .wfm-bar > a.wfm-back.btn, .wfm-bar > a.wfm-back.btn-secondary { background: transparent; color: var(--ink-2); border: 1px solid var(--bd-ctl, rgba(255, 255, 255, 0.22)); border-radius: 12px;
    font-family: var(--fm); font-size: 12px; letter-spacing: 0.18em; text-transform: uppercase; }
  .wfm-bar > #next-btn:disabled, .wfm-bar > #generate-btn:disabled { opacity: 0.5; }
}
