/* 2P Studio — order form on phones (≤ 760 px). Loaded LAST, after every older form stylesheet.
   Layout like an app: compact header, one question at a time using the full width,
   "Avanti" always visible at the bottom, the panel follows the keyboard (--p2-vh from studio-mobile.js).
   The older stylesheets stack padding and add a big phone preview: here they are reset on purpose. */
@media (max-width: 760px){
  body.trial-studio-open{overflow:hidden!important}

  /* ---- the panel fills the visible screen (the keyboard shrinks it) ---- */
  .trial-studio .trial-studio__panel{
    position:fixed!important;inset:auto 0 auto 0!important;top:var(--p2-vtop,0px)!important;
    width:100%!important;max-width:none!important;height:var(--p2-vh,100dvh)!important;max-height:none!important;
    margin:0!important;padding:0!important;border:0!important;border-radius:0!important;
    display:flex!important;flex-direction:column!important;overflow:hidden!important;background:#05080e!important;
    transform:none!important;   /* the desktop open/depth effect scales the panel: on a phone it only pushes things off screen */
  }
  .trial-studio .trial-studio__topbar{
    flex:0 0 auto!important;display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;
    margin:0!important;padding:calc(8px + env(safe-area-inset-top)) 16px 8px!important;border-radius:0!important;
    border-bottom:1px solid rgba(255,255,255,.08)!important;background:#05080e!important;min-height:0!important;
  }
  .trial-studio .trial-studio__identity{gap:10px!important;min-width:0!important}
  .trial-studio .trial-studio__logo{height:28px!important;width:auto!important}
  .trial-studio .trial-studio__identity small{display:none!important}
  .trial-studio .trial-studio__identity span{font-size:.62rem!important;letter-spacing:.14em!important}
  .trial-studio .trial-studio__identity strong{font-size:.95rem!important}
  .trial-studio .trial-studio__close{width:40px!important;height:40px!important;min-width:40px!important;border-radius:12px!important}

  /* ---- the only scrolling area ---- */
  .trial-studio .trial-studio__scroll{
    flex:1 1 auto!important;min-height:0!important;height:auto!important;max-height:none!important;
    overflow-x:hidden!important;overflow-y:auto!important;overscroll-behavior:contain;-webkit-overflow-scrolling:touch;
    padding:0!important;margin:0!important;scroll-padding-bottom:96px;
  }
  .trial-studio .v3-form{display:block!important;padding:0 16px!important;margin:0!important;width:100%!important;max-width:100%!important;box-sizing:border-box!important}
  .trial-studio .v3-form *{box-sizing:border-box}
  .trial-studio .v3-layout{display:block!important;width:100%!important;max-width:100%!important;padding:0!important;margin:0!important;gap:0!important}
  .trial-studio .v3-questions{width:100%!important;max-width:100%!important;padding:0!important;margin:0!important}

  /* ---- the Reel preview becomes the full-screen background (no small phone) ----
     your clips play behind the questions, dimmed, with the business name in the chosen style:
     you glimpse the Reel taking shape while you answer. Content sits above it (z-index). */
  .trial-studio .v3-live{
    display:block!important;position:fixed!important;inset:0!important;z-index:0!important;pointer-events:none!important;
    width:auto!important;height:auto!important;margin:0!important;padding:0!important;transform:none!important;
  }
  .trial-studio .v3-live__phone,.trial-studio .v3-live__screen{
    position:absolute!important;inset:0!important;width:100%!important;height:100%!important;max-width:none!important;max-height:none!important;
    margin:0!important;padding:0!important;border:0!important;border-radius:0!important;box-shadow:none!important;
    aspect-ratio:auto!important;transform:none!important;background:#05080e!important;overflow:hidden!important;
  }
  .trial-studio .v3-live__island,.trial-studio .v3-live__info,.trial-studio .v3-live__platform,
  .trial-studio .v3-live__up,.trial-studio .v3-live__music,.trial-studio .v3-live__empty{display:none!important}
  .trial-studio .v3-live__media{position:absolute!important;inset:0!important;opacity:.55!important}
  .trial-studio .v3-live__media .v3-clip{width:100%!important;height:100%!important;object-fit:cover!important;border-radius:0!important}
  .trial-studio .v3-live__cap{
    position:absolute!important;left:20px!important;right:20px!important;top:auto!important;bottom:calc(96px + env(safe-area-inset-bottom))!important;
    transform:none!important;opacity:.32!important;text-align:center!important;
  }
  .trial-studio.p2-kb .v3-live__cap{display:none!important}
  /* long steps (files, email + details, review): the name would sit under the text */
  .trial-studio .v3-live[data-v3-step="1"] .v3-live__cap,
  .trial-studio .v3-live[data-v3-step="6"] .v3-live__cap,
  .trial-studio .v3-live[data-v3-step="7"] .v3-live__cap{display:none!important}
  @media (max-height:560px){.trial-studio .v3-live__cap{display:none!important}}
  .trial-studio .v3-live__cap .v3-cap__main{font-size:2.2rem!important;line-height:1.05!important}
  /* dark veil on top of the clips so the questions stay easy to read */
  .trial-studio .v3-live__screen::after{
    content:""!important;position:absolute!important;inset:0!important;
    background:linear-gradient(to bottom,rgba(5,8,14,.86) 0%,rgba(5,8,14,.72) 45%,rgba(5,8,14,.6) 70%,rgba(5,8,14,.9) 100%)!important;
  }
  /* everything else above the background */
  .trial-studio .trial-studio__topbar{position:relative!important;z-index:3!important;background:rgba(5,8,14,.82)!important;-webkit-backdrop-filter:blur(10px);backdrop-filter:blur(10px)}
  .trial-studio .v3-questions{position:relative!important;z-index:1!important}
  .trial-studio .trial-studio__scroll,.trial-studio .v3-form,.trial-studio .v3-layout{background:transparent!important}
  .trial-studio .v3-steps{background:linear-gradient(to bottom,rgba(5,8,14,.9),rgba(5,8,14,.6))!important}

  /* ---- progress: thin bar that stays at the top while scrolling ---- */
  .trial-studio .v3-steps{
    position:sticky!important;top:0!important;z-index:6!important;
    display:flex!important;align-items:center!important;gap:4px!important;
    margin:0 -16px!important;padding:10px 16px!important;background:#05080e!important;border:0!important;
  }
  .trial-studio .v3-steps i{flex:1 1 0!important;height:3px!important;min-width:0!important;border-radius:3px!important}
  .trial-studio .v3-steps span{flex:0 0 auto!important;margin-left:8px!important;font-size:.72rem!important;white-space:nowrap!important}

  /* ---- one question ---- */
  .trial-studio .trial-form-step{
    display:block!important;width:100%!important;max-width:100%!important;min-height:0!important;
    padding:6px 0 0!important;margin:0!important;border:0!important;background:none!important;box-shadow:none!important;
  }
  .trial-studio .trial-form-step[hidden]{display:none!important}
  .trial-studio .trial-question-wrap{display:block!important;width:100%!important;max-width:100%!important;padding:0!important;margin:0!important;min-height:0!important}
  .trial-studio .trial-step-heading{margin:4px 0 14px!important;padding:0!important;text-align:left!important}
  .trial-studio .trial-step-heading span{display:block!important;margin:0 0 6px!important;font-size:.68rem!important;letter-spacing:.16em!important}
  .trial-studio .trial-step-heading h3{margin:0!important;font-size:1.45rem!important;line-height:1.18!important;text-align:left!important}
  .trial-studio .v3-form .trial-question-screen .trial-step-heading p{display:block!important;margin:6px 0 0!important;font-size:.88rem!important;line-height:1.45!important;text-align:left!important}

  .trial-studio .trial-question-input{display:block!important;margin:0 0 14px!important;width:100%!important}
  .trial-studio .trial-question-input > span{display:block!important;margin:0 0 6px!important;font-size:.82rem!important}
  .trial-studio .trial-form input[type=text],.trial-studio .trial-form input[type=email],.trial-studio .trial-form textarea{
    width:100%!important;max-width:100%!important;font-size:16px!important;padding:13px 14px!important;border-radius:14px!important;
  }
  .trial-studio .trial-question-input textarea{min-height:110px!important;max-height:34vh!important;resize:none!important;line-height:1.5!important}
  .trial-studio .v3-form .v3-idea textarea{min-height:130px!important;max-height:38vh!important}
  .trial-studio .v3-error{margin:-8px 0 12px!important;font-size:.84rem!important}

  /* idea starters: one row that slides sideways instead of a tall stack */
  .trial-studio .v3-sparks{flex-wrap:nowrap!important;overflow-x:auto!important;margin:-4px -16px 16px!important;padding:2px 16px 4px!important;scrollbar-width:none}
  .trial-studio .v3-sparks::-webkit-scrollbar{display:none}
  .trial-studio .v3-sparks button{flex:0 0 auto!important;white-space:nowrap!important;width:auto!important}

  /* upload */
  .trial-studio .trial-dropzone{width:100%!important;min-height:0!important;padding:22px 16px!important;margin:0!important}
  .trial-studio .trial-upload-scroll{max-height:none!important;overflow:visible!important;padding:0!important}
  .trial-studio .trial-file-list{max-height:none!important}

  /* video type: compact rows */
  .trial-studio .v3-form .v3-tiers{grid-template-columns:1fr!important;gap:8px!important;margin:0 0 16px!important}
  .trial-studio .v3-form .v3-tiers label>span{display:grid!important;grid-template-columns:1fr auto!important;align-items:baseline!important;column-gap:10px!important;row-gap:2px!important;padding:12px 14px!important}
  .trial-studio .v3-form .v3-tiers label>span>b{grid-column:1!important;grid-row:1!important}
  .trial-studio .v3-form .v3-tiers label>span>em{grid-column:2!important;grid-row:1!important;font-size:1.1rem!important;text-align:right!important}
  .trial-studio .v3-form .v3-tiers label>span>small{grid-column:1 / -1!important;grid-row:2!important}

  /* choice cards (where to post, style, music): two per row, never wider than the screen */
  .trial-studio .trial-choice-grid{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important;width:100%!important;margin:0 0 8px!important;padding:0!important;border:0!important}
  .trial-studio .trial-choice-grid label{min-width:0!important;margin:0!important}
  .trial-studio .trial-choice-grid label>span{min-height:0!important;height:100%!important;padding:12px 10px!important;font-size:.88rem!important;overflow-wrap:anywhere}
  .trial-studio .v3-dest-title{margin:4px 0 8px!important}

  /* "tell us more" */
  .trial-studio .v3-more{margin:4px 0 8px!important}
  .trial-studio .v3-more__body{padding:0 14px 14px!important}
  .trial-studio .v3-pills{gap:6px!important}

  /* review */
  .trial-studio .trial-finish-grid{display:block!important}
  .trial-studio .trial-review-card,.trial-studio .trial-delivery-card,.trial-studio .v3-upload{width:100%!important;margin:0 0 10px!important;padding:14px!important}
  .trial-studio .v3-form .trial-review-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important}
  .trial-studio .trial-consent{margin:12px 0 0!important;font-size:.86rem!important}

  /* ---- "Avanti" always at the bottom of the screen ----
     each level stretches to the full height of the scrolling area, the bar is pushed down with margin-top:auto
     and stays stuck to the bottom when the question is longer than the screen */
  .trial-studio .trial-studio__scroll{display:flex!important;flex-direction:column!important}
  .trial-studio .trial-studio__scroll > .v3-form{flex:1 0 auto!important;display:flex!important;flex-direction:column!important}
  .trial-studio .v3-form > .v3-layout{flex:1 0 auto!important;display:flex!important;flex-direction:column!important}
  .trial-studio .v3-layout > .v3-questions{flex:1 0 auto!important;display:flex!important;flex-direction:column!important}
  .trial-studio .v3-questions > .trial-form-step:not([hidden]){flex:1 0 auto!important;display:flex!important;flex-direction:column!important}
  .trial-studio .v3-questions > .trial-form-step > .trial-question-wrap{flex:1 0 auto!important;display:flex!important;flex-direction:column!important}
  .trial-studio .trial-question-wrap--upload > .trial-upload-scroll{flex:1 0 auto!important;display:flex!important;flex-direction:column!important}

  .trial-studio .v3-form .trial-form-step .trial-step-actions,
  .trial-studio .v3-form .trial-form-step .trial-step-actions.trial-step-actions--end{
    position:sticky!important;bottom:0!important;z-index:7!important;
    display:flex!important;align-items:center!important;justify-content:space-between!important;gap:10px!important;
    width:auto!important;max-width:none!important;
    margin:auto -16px 0!important;padding:14px 16px calc(14px + env(safe-area-inset-bottom))!important;
    background:linear-gradient(to bottom,rgba(5,8,14,0),rgba(5,8,14,.94) 30%)!important;border:0!important;box-shadow:none!important;
  }
  .trial-studio .v3-form .trial-form-step .trial-step-actions{flex-wrap:nowrap!important;flex-direction:row!important}
  .trial-studio .v3-form .trial-form-step .trial-step-actions > *{order:0!important}
  .trial-studio .v3-form .trial-form-step .trial-step-actions .trial-submit{flex:1 1 0!important;width:auto!important;min-width:0!important;line-height:1.2!important;padding:10px 14px!important;text-align:center!important}
  .trial-studio .v3-form .trial-form-step .trial-step-actions .trial-back{flex:0 0 auto!important;width:auto!important;padding:12px 4px!important;font-size:.9rem!important;background:none!important;border:0!important;min-height:0!important}
  .trial-studio .v3-form .trial-form-step .trial-step-actions .btn{flex:1 1 auto!important;width:auto!important;max-width:none!important;min-height:52px!important;margin:0!important;border-radius:16px!important;font-size:1rem!important;display:flex!important;align-items:center!important;justify-content:center!important;gap:6px!important}

  /* messages sit just above the bottom bar, never on top of it */
  .trial-studio .trial-status{
    position:sticky!important;bottom:84px!important;z-index:8!important;display:block!important;
    margin:10px 0 0!important;width:100%!important;max-width:100%!important;
  }
  .trial-studio .trial-status:empty{display:none!important}

  /* the floating "Prova" button of the page must not cover the form */
  body.trial-studio-open .studio-mobile-dock{display:none!important}
  .trial-studio .trial-preview-note{display:none!important}

  /* when the keyboard is open: smaller headings, more room for the field */
  .trial-studio.p2-kb .trial-step-heading{margin:0 0 8px!important}
  .trial-studio.p2-kb .trial-step-heading h3{font-size:1.1rem!important}
  .trial-studio.p2-kb .trial-step-heading p,.trial-studio.p2-kb .trial-step-heading span{display:none!important}
  .trial-studio.p2-kb .v3-steps{padding:6px 16px!important}
  .trial-studio.p2-kb .v3-form .trial-form-step .trial-step-actions{padding-top:8px!important;padding-bottom:8px!important}
  .trial-studio.p2-kb .v3-form .trial-form-step .trial-step-actions .btn{min-height:44px!important}
}
