/* Phone layouts for the existing process, content and services sections. */
@media (max-width: 760px), (max-width: 1000px) and (max-height: 540px) {
  html.gifs-refined #root :is(#ai, #approach, #services) {
    padding: 36px max(16px, env(safe-area-inset-left)) 44px max(16px, env(safe-area-inset-right)) !important;
  }
  html.gifs-refined #root :is(#ai, #approach, #services) :is(h1, h2, h3, p, a, summary) {
    overflow-wrap: anywhere;
  }
  html.gifs-refined #root :is(#ai, #approach) .section-intro h1,
  html.gifs-refined #root #services .guide-intro h1 {
    font-size: clamp(32px, 8.6vw, 48px) !important;
    line-height: 1.18 !important;
    max-width: 100%;
  }
  html.gifs-refined #root :is(#ai, #approach) .section-intro .lede {
    font-size: 16px !important;
    line-height: 1.65 !important;
  }
  html.gifs-refined #root #ai .service-composition { grid-template-columns: minmax(0, 1fr); gap: 32px; }
  html.gifs-refined #root #ai .service-composition > * { min-width: 0; }
  html.gifs-refined #root #ai .process-art { padding: 24px 20px !important; }
  html.gifs-refined #root #ai .process-chain :is(span, small),
  html.gifs-refined #root #ai .detail-row p { font-size: 16px; line-height: 1.6; }
  html.gifs-refined #root #ai .service-text h2 { font-size: clamp(29px, 7.5vw, 39px) !important; }
  html.gifs-refined #root #ai .detail-row { grid-template-columns: 24px minmax(0, 1fr); gap: 12px; }
  html.gifs-refined #root #ai .detail-row h3 { font-size: 20px; line-height: 1.35; }
  html.gifs-refined #root :is(#ai, #approach) .text-action { min-height: 48px; display: inline-flex; align-items: center; font-size: 16px !important; line-height: 1.5 !important; }
  html.gifs-refined #root #ai .next-chapter { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; padding-block: 24px; }
  html.gifs-refined #root #ai .next-chapter span { font-size: 13px; line-height: 1.5; }
  html.gifs-refined #root #ai .next-chapter strong { font-size: 26px; line-height: 1.3; }

  :is(.mp-ai, .mp-approach) { margin: 30px auto 44px; }
  :is(.mp-ai, .mp-approach) .mp-heading { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-bottom: 24px; }
  :is(.mp-ai, .mp-approach) .mp-heading h2 { font-size: clamp(29px, 7.8vw, 40px); line-height: 1.18; overflow-wrap: anywhere; }
  :is(.mp-ai, .mp-approach) .mp-heading > p { font-size: 16px; line-height: 1.65; }
  :is(.mp-ai, .mp-approach) .mp-kicker { font-size: 12px; line-height: 1.5; letter-spacing: .08em; }
  :is(.mp-ai, .mp-approach) .mp-workbench { padding: 0 14px 18px; }
  :is(.mp-ai, .mp-approach) .mp-bench-head { flex-wrap: wrap; gap: 6px 12px; padding-block: 14px; }
  :is(.mp-ai, .mp-approach) .mp-scheme-label { font-size: 13px; }
  :is(.mp-ai, .mp-approach) .mp-edition { font-size: 10px; }
  :is(.mp-ai, .mp-approach) .mp-options { gap: 8px; }
  :is(.mp-ai, .mp-approach) .mp-options button { flex: 1 1 90px; min-width: 0; min-height: 48px; padding: 10px 9px; font-size: 14px; line-height: 1.4; }
  .mp-ai .mp-nodes { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-areas: 'one two' 'four three'; gap: 62px 18px; }
  .mp-ai .mp-node:nth-child(1) { grid-area: one; }
  .mp-ai .mp-node:nth-child(2) { grid-area: two; }
  .mp-ai .mp-node:nth-child(3) { grid-area: three; }
  .mp-ai .mp-node:nth-child(4) { grid-area: four; }
  .mp-ai .mp-node-paper { height: calc(100% - 34px); min-height: 230px; padding: 16px 12px; }
  .mp-ai .mp-node-head { min-height: 34px; padding: 8px 10px; }
  .mp-ai .mp-node-head span { font-size: 12px; }
  .mp-ai .mp-node-head small { font-size: 11px; }
  .mp-ai .mp-node h3 { font-size: 18px; line-height: 1.3; }
  .mp-ai .mp-node p { font-size: 16px; line-height: 1.55; }
  .mp-ai .mp-stage-colophon { font-size: 11px; letter-spacing: .01em; }
  :is(.mp-ai, .mp-approach) .mp-caption { align-items: flex-start; gap: 12px; }
  :is(.mp-ai, .mp-approach) .mp-caption p { font-size: 16px; line-height: 1.6; }
  :is(.mp-ai, .mp-approach) .mp-counter { font-size: 12px; flex-shrink: 0; }
  :is(.mp-ai, .mp-approach) .mp-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  :is(.mp-ai, .mp-approach) .mp-controls button { min-height: 48px; min-width: 0; padding: 10px 8px; font-size: 14px; line-height: 1.4; }
  :is(.mp-ai, .mp-approach) .mp-start { grid-column: 1 / -1; }
  :is(.mp-ai, .mp-approach) .mp-status { grid-column: 1 / -1; margin: 4px 0 0; max-width: none; font-size: 13px; line-height: 1.5; }
  :is(.mp-ai, .mp-approach) .mp-demo-note { font-size: 13px; line-height: 1.5; }
  .mp-approach .mp-stage { padding: 22px 0 12px; }
  /* All sheets share one grid cell; the tallest text sets the deck height. */
  .mp-approach .mp-print-deck { display: grid; min-height: 0; margin: 0 21px 0 0; padding-bottom: 23px; }
  .mp-approach .mp-print-sheet { position: relative; inset: auto; grid-area: 1 / 1; min-height: 380px; padding: 18px 16px 22px; }
  .mp-approach .mp-sheet-drawing { height: 145px; max-width: 100%; }
  .mp-approach .mp-print-sheet h3 { font-size: 27px; line-height: 1.2; overflow-wrap: anywhere; }
  .mp-approach .mp-print-sheet p { font-size: 16px; line-height: 1.6; }
  .mp-approach .mp-sheet-edition { font-size: 11px; line-height: 1.5; }
  html.gifs-refined #root #approach .flight-chapter { grid-template-columns: minmax(0, 1fr); min-height: 0 !important; padding: 28px 0 32px !important; }
  html.gifs-refined #root #approach .approach-step-art { grid-column: 1; grid-row: 2; height: 190px; margin-bottom: 18px; }
  html.gifs-refined #root #approach .flight-chapter h2 { font-size: clamp(29px, 7.6vw, 38px) !important; line-height: 1.25 !important; }
  html.gifs-refined #root #approach .flight-chapter > p:not(.eyebrow) { font-size: 16px !important; }
  html.gifs-refined #root #approach .flight-chapter > .chapter-result { font-size: 15px !important; }

  .mc-cinema { width: calc(100% - 32px); padding-top: 32px; }
  .mc-cinema :is(h1, h2, h3, p, a, button) { overflow-wrap: anywhere; }
  .mc-intro > div, .mc-story { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .mc-intro p:not(.mc-kicker), .mc-mini-intro > p:last-child, .mc-description, .mc-delivery article p { font-size: 16px; line-height: 1.65; }
  .mc-kicker { font-size: 12px !important; letter-spacing: .08em; }
  .mc-text-link { font-size: 15px; min-height: 48px; }
  .mc-workbench { padding: 12px 10px 0; }
  .mc-toolbar { flex-wrap: wrap; gap: 10px; padding-inline: 0; }
  .mc-studio-mark b span { font-size: 10px; line-height: 1.5; }
  .mc-formats button { min-height: 44px; min-width: 50px; font-size: 14px; }
  .mc-transport { display: grid; grid-template-columns: minmax(0, 1fr) 48px; gap: 10px; padding: 14px 0; }
  .mc-play { min-width: 0; min-height: 48px; justify-content: center; padding: 10px; font-size: 15px !important; white-space: normal; }
  .mc-restart { grid-column: 2; grid-row: 1; width: 48px; height: 48px; }
  .mc-scrub { grid-column: 1 / -1; grid-row: 2; margin-top: 0; }
  .mc-scrub > span { font-size: 13px; line-height: 1.5; }
  .mc-scrub input { height: 44px; }
  .mc-motion-note { font-size: 13px !important; line-height: 1.6 !important; padding: 13px 0 !important; }
  .mc-scenes { grid-template-columns: minmax(0, 1fr); }
  .mc-scenes > button { gap: 14px; min-height: 80px; padding: 18px 10px; border-right: 0; border-bottom: 1px solid var(--mc-line); }
  .mc-scenes > button > span:nth-child(2) { display: block; min-width: 0; width: auto; }
  .mc-scenes strong { font-size: 24px; line-height: 1.3; }
  .mc-scenes small { font-size: 14px; line-height: 1.5; margin-top: 5px; }
  .mc-scene-index { font-size: 12px; }
  .mc-story { padding: 36px 0; }
  .mc-story > *, .mc-delivery article { min-width: 0; }
  .mc-story h2 { font-size: clamp(29px, 7.8vw, 38px); }
  .mc-explicit, .mc-tip { font-size: 13px !important; line-height: 1.6 !important; }
  .mc-beat-head { font-size: 12px; line-height: 1.5; flex-wrap: wrap; }
  .mc-beats button { grid-template-columns: 22px 36px minmax(0, 1fr); gap: 10px; min-height: 70px; }
  .mc-beats button > span { font-size: 12px; }
  .mc-beats i { width: 32px; height: 24px; }
  .mc-beats strong { font-size: 16px; line-height: 1.5; }
  .mc-delivery { padding-top: 36px; }
  .mc-delivery > div { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .mc-delivery article > span { font-size: 12px; }
  .mc-cta { font-size: 17px; line-height: 1.5; min-height: 60px; }
  .mc-caption { font-size: 12px; line-height: 1.5; }
  .mc-stage-top { font-size: 10px; letter-spacing: .04em; }
  .mc-stage-title small { font-size: 11px; line-height: 1.4; }
  .mc-workbench[data-frame=wide] .mc-caption { font-size: 11px; left: 12px; right: 12px; bottom: 10px; }
  .mc-workbench[data-frame=wide] .mc-stage-top { font-size: 9px; top: 10px; left: 12px; right: 12px; }

  html.gifs-refined #root #content .sg-width { width: 100%; padding-inline: max(16px, env(safe-area-inset-left)) max(16px, env(safe-area-inset-right)); box-sizing: border-box; }
  html.gifs-refined #root #content .sg-magazine-mast { flex-wrap: wrap; gap: 8px 18px; font-size: 11px; line-height: 1.5; padding-block: 16px; }
  /* Every style remains a separate, fully visible link on a phone. */
  html.gifs-refined #root #content .sg-gallery { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 10px; height: auto; margin: 0; }
  html.gifs-refined #root #content .sg-gallery > [aria-hidden=true] { display: none; }
  html.gifs-refined #root #content .sg-gallery .sg-piece { position: relative; inset: auto; width: 100%; height: auto; min-width: 0; padding: 8px 6px 12px; transform: none !important; display: flex; flex-direction: column; align-items: center; background: #e7dfcc; box-shadow: none; cursor: pointer; touch-action: pan-y !important; }
  html.gifs-refined #root #content .sg-piece::before { display: none; }
  html.gifs-refined #root #content .sg-piece img { display: block; width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; transform: none; }
  html.gifs-refined #root #content .sg-piece span { position: static; inset: auto; transform: none; max-width: 100%; margin-top: 8px; padding: 7px 5px; white-space: normal; overflow-wrap: anywhere; text-align: center; font-size: 13px; line-height: 1.4; clip-path: none; box-shadow: none; }
  html.gifs-refined #root #content .sg-piece small { font-size: 11px; }
  html.gifs-refined #root #content .sg-drag-mode { display: none; }
  html.gifs-refined #root #content .sg-gallery-note { font-size: 14px; line-height: 1.5; }
  html.gifs-refined #root #content .sg-collage-controls button { font-size: 14px; min-height: 48px; }
  html.gifs-refined #root #content .sg-filter { font-size: 14px; min-height: 48px; padding: 10px 12px; }
  html.gifs-refined #root #content .sg-style-dossier { grid-template-columns: minmax(0, 1fr); gap: 18px; padding-block: 30px; min-height: 0; }
  html.gifs-refined #root #content .sg-style-dossier > div:last-child { grid-column: auto; }
  html.gifs-refined #root #content .sg-style-dossier .sg-eyebrow { max-width: none; font-size: 12px !important; }
  html.gifs-refined #root #content .sg-focus-tags { font-size: 12px; line-height: 1.5; letter-spacing: .03em; }
  #root[data-static] #content .sg-static-styles { grid-template-columns: minmax(0, 1fr); margin-top: 4px; padding-bottom: 22px; }
  #root[data-static] #content .sg-static-styles details { min-width: 0; scroll-margin-top: 96px; }
  #root[data-static] #content .sg-static-styles summary { display: flex; align-items: center; min-height: 48px; font-size: 28px; line-height: 1.3; }
  #root[data-static] #content .sg-static-styles p { font-size: 16px; line-height: 1.65; }
  #root[data-static] #content .sg-static-styles small { font-size: 14px; line-height: 1.6; }
  #root[data-static] #content .sg-static-cta { box-sizing: border-box; max-width: 100%; min-height: 52px; padding: 14px 18px; font-size: 17px; line-height: 1.5; overflow-wrap: anywhere; }
  html.gifs-refined #root #content .sg-brief { padding-block: 36px; }
  html.gifs-refined #root #content .sg-brief h2 { font-size: clamp(33px, 8.5vw, 45px) !important; }
  html.gifs-refined #root #content .sg-brief-grid { grid-template-columns: minmax(0, 1fr); gap: 30px; }
  html.gifs-refined #root #content .sg-brief-paper { min-width: 0; padding: 24px 18px; transform: none; }
  html.gifs-refined #root #content .sg-brief label { font-size: 13px; line-height: 1.5; }
  html.gifs-refined #root #content .sg-format { min-height: 48px; font-size: 14px; line-height: 1.4; }
  html.gifs-refined #root #content .sg-brief input { box-sizing: border-box; min-width: 0; min-height: 52px; font-size: 16px; }
  html.gifs-refined #root #content .sg-brief-result { font-size: 25px; line-height: 1.4; overflow-wrap: anywhere; }
  html.gifs-refined #root #content .sg-brief-actions { flex-direction: column; align-items: stretch; gap: 12px; }
  html.gifs-refined #root #content :is(.sg-project, .sg-copy) { min-height: 50px; font-size: 15px; line-height: 1.5; white-space: normal; }
  html.gifs-refined #root #content .sg-copy-status { font-size: 13px; line-height: 1.5; }
  html.gifs-refined #root #content .sg-next a { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; min-height: 48px; }
  html.gifs-refined #root #content .sg-next small { font-size: 12px; line-height: 1.5; }
  html.gifs-refined #root #content .sg-next strong { font-size: 28px; line-height: 1.3; margin: 0; }

  html.gifs-refined #root #services :is(.guide-intro, .guide-services, .guide-case, .guide-faq) { display: grid; grid-template-columns: minmax(0, 1fr); gap: 26px; }
  html.gifs-refined #root #services .guide-intro { padding-bottom: 30px; }
  html.gifs-refined #root #services .guide-intro-copy { margin-top: 0; }
  html.gifs-refined #root #services :is(.guide-intro-copy p, .guide-case p, .guide-faq details p, .guide-process ol p, .guide-budget p, .guide-footer p:not(.guide-eyebrow)) { font-size: 16px !important; line-height: 1.65 !important; }
  html.gifs-refined #root #services .guide-services { margin-block: 28px 36px; padding: 0; }
  html.gifs-refined #root #services .guide-options { grid-template-columns: minmax(0, 1fr); gap: 0; margin-top: 20px; }
  html.gifs-refined #root #services .guide-options > button { grid-template-columns: minmax(0, 1fr) 18px; min-height: 82px; padding: 18px 12px !important; gap: 12px; align-items: center; }
  html.gifs-refined #root #services .guide-options .guide-number { display: none; }
  html.gifs-refined #root #services .guide-options button strong { font-size: 21px; line-height: 1.3; }
  html.gifs-refined #root #services .guide-options button small { font-size: 15px; line-height: 1.5; margin-top: 5px; }
  html.gifs-refined #root #services .guide-explanation { margin-top: 0; padding: 24px 20px !important; }
  html.gifs-refined #root #services .guide-explanation :is(p, li) { font-size: 16px; line-height: 1.6; }
  html.gifs-refined #root #services .guide-explanation h2 { font-size: clamp(28px, 7.5vw, 36px) !important; }
  html.gifs-refined #root #services .guide-example li { gap: 10px; }
  html.gifs-refined #root #services .guide-example li span { font-size: 12px; flex-shrink: 0; }
  html.gifs-refined #root #services .guide-case { padding-block: 32px 40px; }
  html.gifs-refined #root #services .guide-case-image { margin-top: 0; min-width: 0; }
  html.gifs-refined #root #services .guide-case-image > span { font-size: 12px; line-height: 1.5; padding: 14px; }
  html.gifs-refined #root #services :is(.guide-case h2, .guide-process > h2, .guide-faq h2, .guide-footer h2) { font-size: clamp(30px, 8vw, 40px) !important; }
  html.gifs-refined #root #services .guide-process { padding-block: 36px; }
  html.gifs-refined #root #services .guide-process > ol { grid-template-columns: minmax(0, 1fr); gap: 22px; margin-block: 28px; }
  html.gifs-refined #root #services .guide-budget { flex-direction: column; align-items: stretch; gap: 14px; padding: 24px 20px; }
  html.gifs-refined #root #services .guide-faq { padding-block: 32px; }
  html.gifs-refined #root #services .guide-faq summary { min-height: 48px; padding: 18px 0; font-size: 17px; gap: 15px; }
  html.gifs-refined #root #services .guide-faq summary > span { flex-shrink: 0; }
  html.gifs-refined #root #services .guide-link { min-height: 48px; font-size: 16px; line-height: 1.5; gap: 16px; }
  html.gifs-refined #root #services .guide-contact { box-sizing: border-box; max-width: 100%; min-height: 52px; font-size: 16px; line-height: 1.5; }
  html.gifs-refined #root #services .guide-home { font-size: 15px; min-height: 48px; }
  html.gifs-refined #root #services .national-services { margin-bottom: 28px; padding-block: 24px; font-size: 16px; }
  html.gifs-refined #root #services .national-services nav { display: grid; grid-template-columns: minmax(0, 1fr); gap: 4px; }
  html.gifs-refined #root #services .national-services a { display: flex; align-items: center; min-height: 48px; color: #702e3b; font-size: 16px; }
}

@media (max-width: 520px) {
  /* The live connector geometry already supports vertical nodes. */
  .mp-ai .mp-stage { padding: 20px 0 48px 28px; }
  .mp-ai .mp-nodes { grid-template-columns: minmax(0, 1fr); grid-template-areas: none; gap: 22px; }
  .mp-ai .mp-node:nth-child(n) { grid-area: auto; }
  .mp-ai .mp-node-paper { min-height: 0; height: auto; padding: 16px 14px 20px; }
  .mp-ai .mp-node-symbol { height: 38px; margin-bottom: 10px; }
  .mp-ai .mp-port { left: -18px; bottom: 50%; transform: translateX(-50%); }
  .mp-ai .mp-port::before { display: none; }
  .mp-ai .mp-stage-colophon { left: 0; right: 0; bottom: 12px; text-align: center; white-space: normal; line-height: 1.5; }
  .mp-ai .mp-ticket { width: 34px; font-size: 6px; }
  :is(.mp-ai, .mp-approach) .mp-caption { flex-direction: column; gap: 8px; }
}

@media (prefers-reduced-motion: reduce) {
  html.gifs-refined #root #content .sg-piece { transition: none !important; }
}
