/* Phone layout: a true single-column story with comfortable touch targets. */
@media (max-width: 780px) {
  html,
  body {
    width: 100%;
    max-width: 100%;
    overflow-x: clip;
  }

  .topbar {
    min-width: 0;
    padding-inline: 12px;
    gap: 8px;
  }

  .cdc-brand {
    min-width: 0;
    gap: 7px;
  }

  .cdc-brand img { width: 39px; }
  .cdc-brand b { font-size: 18px; }

  .header-cta {
    min-height: 40px;
    margin-left: auto;
    padding-inline: 11px;
    white-space: nowrap;
  }

  main {
    width: calc(100% - 24px);
    max-width: 640px;
    padding: 0;
  }

  .storyboard-hero {
    width: 100%;
    gap: 22px;
    padding-top: 28px;
  }

  .storyboard-hero h1 {
    max-width: 100%;
    font-size: clamp(38px, 12.5vw, 50px);
    line-height: 1.04;
    white-space: normal;
  }

  .storyboard-hero .lead {
    font-size: 15px;
  }

  .sketch-callout {
    margin-left: min(42%, 145px);
  }

  .hero-step {
    width: 100%;
    min-height: 0;
    padding: 15px;
  }

  .hero-step h2 { font-size: 16px; }
  .gift-select select { min-height: 44px; font-size: 13px; }
  .upload-step { min-height: 265px; }
  .drop-sketch { min-height: 94px; }
  .result-step .showcase-video { height: min(67vw, 270px); }
  .showcase-download { min-height: 44px; }

  .story-process {
    margin-inline: calc(50% - 50vw);
    padding: 18px 12px 34px;
  }

  .story-heading {
    display: block;
    margin-bottom: 18px;
  }

  .story-heading h2 {
    width: fit-content;
    max-width: 100%;
    margin-bottom: 14px;
    font-size: clamp(34px, 11vw, 44px);
    line-height: 1.12;
  }

  .story-heading p {
    margin: 0;
    font-size: 13px;
    line-height: 1.45;
  }

  .story-scroll {
    margin: 0;
    padding: 8px 3px 10px;
    overflow: visible;
  }

  .story-flow {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 38px;
    width: 100%;
    min-width: 0;
  }

  .story-card,
  .secure-zone .story-card {
    width: 100%;
    min-width: 0;
    min-height: 215px;
    padding: 20px 18px 18px;
  }

  .story-card h3,
  .secure-zone .story-card h3 {
    min-height: 0;
    margin-bottom: 16px;
    font-size: 16px;
  }

  .story-card p {
    font-size: 13px;
    line-height: 1.5;
  }

  .story-card ul {
    font-size: 12px;
    line-height: 1.75;
  }

  .story-card::after,
  .secure-zone .story-card::after {
    content: "↓";
    left: 50%;
    right: auto;
    top: auto;
    bottom: -36px;
    transform: translateX(-50%);
    animation: mobile-arrow 1.8s ease-in-out infinite;
  }

  .secure-zone {
    width: 100%;
    min-width: 0;
    padding: 18px 12px 20px;
    border-radius: 22px 18px 25px 20px;
  }

  .secure-label {
    position: static;
    width: fit-content;
    max-width: calc(100% - 8px);
    margin: -34px auto 18px;
    padding: 6px 10px;
    white-space: normal;
    line-height: 1.4;
    text-align: center;
    transform: none;
  }

  .secure-zone > ol {
    grid-template-columns: minmax(0, 1fr);
    gap: 38px;
    height: auto;
  }

  .secure-zone .approval::after { display: block; }
  .retry-loop { display: none; }

  .mini-choice span {
    width: 76px;
    height: 94px;
  }

  .line-portrait { margin-block: 14px; }
  .line-portrait i { top: 121px; }
  .laptop { margin-block: 10px; }
  .frames { justify-content: center; margin-block: 22px 14px; }
  .frames img { width: 31%; height: auto; aspect-ratio: 512 / 656; }
  .llm-bot { margin-block: 12px 6px; }
  .approval-mark { height: 88px; margin-block: 10px 20px; }

  .final-card img {
    width: min(100%, 230px);
    height: auto;
    aspect-ratio: 512 / 656;
    margin-inline: auto;
    object-fit: contain;
  }

  .final-card::after { display: none; }

  .section-heading {
    align-items: flex-end;
    gap: 10px;
  }

  .section-heading h2 {
    font-size: clamp(34px, 11vw, 44px);
    line-height: 1.2;
  }

  .section-heading .ghost {
    min-height: 44px;
    padding-inline: 14px;
  }

  .reel-strip {
    width: calc(100vw - 12px);
    margin-left: calc(50% - 50vw + 6px);
    padding-inline: 8px;
    scroll-padding-inline: 8px;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
    scroll-snap-type: x mandatory;
  }

  .reel-strip .showcase-thumb { scroll-snap-align: start; }

  .empty-state {
    min-height: 230px;
    padding: 28px 18px;
  }

  footer {
    padding: 28px 18px;
    align-items: center;
  }

  footer p { margin: 0; }
  footer nav { flex-wrap: wrap; justify-content: center; }

  dialog {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    overflow: auto;
    border-radius: 19px;
    box-shadow: 6px 7px 0 #e30a18, 0 24px 70px rgba(0,38,104,.28);
  }

  #create-form,
  .job-panel {
    padding: 58px 14px 22px;
  }

  dialog h2 {
    font-size: clamp(25px, 8vw, 31px);
    line-height: 1.12;
  }

  .close {
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
  }

  .upload-grid.multi { gap: 8px; }
  .upload-zone { min-width: 0; min-height: 116px; }
  .upload-zone.upload-primary { min-height: 175px; }
  .consent { font-size: 12px; }
  .consent input { width: 22px; height: 22px; }
  .full { min-height: 48px; }
}

@media (max-width: 350px) {
  .cdc-brand img { width: 36px; }
  .cdc-brand b { font-size: 16px; }
  .header-cta { padding-inline: 8px; font-size: 8px; }
  .storyboard-hero h1 { font-size: 38px; }
  .choice-photos { grid-template-columns: repeat(2, minmax(0, 92px)); }
  .choice-photos img { width: 92px; }
  .section-heading { display: block; }
  .section-heading .ghost { margin-top: 14px; }
}

@keyframes mobile-arrow {
  0%, 100% { transform: translate(-50%, -3px); }
  50% { transform: translate(-50%, 6px); }
}

@media (max-width: 780px) and (prefers-reduced-motion: reduce) {
  .story-card::after,
  .secure-zone .story-card::after { animation: none; }
}
