/* 3.9.1 | Responsive correction only for thematic Studio pages.
   Keeps header, desktop geometry and generation/data flows unchanged. */
@media (max-width: 1024px) {
  html body .ggt34-theme-page,
  html body .ggw-v21-studio-theme .ggt34-theme-page {
    box-sizing: border-box !important;
    width: calc(100% - 20px) !important;
    max-width: 1280px !important;
    min-width: 0 !important;
    margin-right: auto !important;
    margin-left: auto !important;
  }

  html body .ggt34-theme-page .gg34-editor-workspace,
  html body .ggw-v21-studio-theme .ggt34-theme-page .gg34-editor-workspace {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 18px !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-inline: 0 !important;
    padding-inline: 0 !important;
    box-sizing: border-box !important;
  }

  /* Form and right-hand preview must respect the same inner margins. */
  html body .ggt34-theme-page .gg34-editor-workspace > form.ggw-quick-generator,
  html body .ggt34-theme-page .gg34-editor-workspace > .gg34-poem-preview {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-inline: 0 !important;
    padding: 24px !important;
  }
  html body .ggt34-theme-page .gg34-editor-workspace > .gg34-poem-preview {
    position: static !important;
    top: auto !important;
    transform: none !important;
    align-self: stretch !important;
  }
  html body .ggt34-theme-page .gg34-poem-preview :is(.gg34-poem-preview__top, .gg34-poem-preview__paper, .gg34-poem-preview__bottom, .gg34-sample-stanza) {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin-inline: 0 !important;
  }
  html body .ggt34-theme-page .gg34-poem-preview__paper {
    padding: 22px 18px 28px !important;
    min-height: 0 !important;
    overflow-wrap: anywhere !important;
  }
  html body .ggt34-theme-page .gg34-poem-preview__paper :is(h2, h3, p),
  html body .ggt34-theme-page .gg34-poem-preview__top :is(h2, h3, p) {
    max-width: 100% !important;
    overflow-wrap: anywhere !important;
  }
  /* The same protection for the embedded/thematic shortcode route. */
  html body main.ggt34-page-shell :is(.ggtheme-shortcode-studio, .ggt34-shortcode, .gg490-journey--shortcode) {
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
  }
}

/* Landscape phones and tablets: equal rectangular step cards, not circles. */
@media (max-width: 1024px) {
  html body .ggt34-theme-page .gg490-journey,
  html body main.ggt34-page-shell .gg490-journey--shortcode {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    padding: 20px !important;
  }
  html body .ggt34-theme-page .gg490-journey :is(.ggtheme-studio-steps,.ggtheme-shortcode-steps),
  html body main.ggt34-page-shell .gg490-journey--shortcode .ggtheme-shortcode-steps {
    display: grid !important;
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    gap: 10px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    margin: 14px 0 0 !important;
    padding: 0 !important;
    background: transparent !important;
    border: 0 !important;
    border-radius: 0 !important;
  }
  html body .ggt34-theme-page .gg490-journey :is(.ggtheme-studio-steps,.ggtheme-shortcode-steps) > span,
  html body main.ggt34-page-shell .gg490-journey--shortcode .ggtheme-shortcode-steps > span {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: flex-start !important;
    text-align: left !important;
    gap: 9px !important;
    box-sizing: border-box !important;
    width: 100% !important;
    height: auto !important;
    aspect-ratio: auto !important;
    min-width: 0 !important;
    min-height: 62px !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 12px 14px !important;
    border: 1px solid #ead9ce !important;
    border-radius: 13px !important;
    background: #fffdfa !important;
    box-shadow: none !important;
    color: #56443a !important;
    font: 650 13px/1.4 'Plus Jakarta Sans', Arial, sans-serif !important;
    overflow-wrap: anywhere !important;
  }
  html body .ggt34-theme-page .gg490-journey :is(.ggtheme-studio-steps,.ggtheme-shortcode-steps) > span:first-child,
  html body main.ggt34-page-shell .gg490-journey--shortcode .ggtheme-shortcode-steps > span:first-child {
    background: #f9efe6 !important;
    border-color: #ddc3af !important;
  }
  html body .ggt34-theme-page .gg490-journey :is(.ggtheme-studio-steps,.ggtheme-shortcode-steps) > span > b,
  html body main.ggt34-page-shell .gg490-journey--shortcode .ggtheme-shortcode-steps > span > b {
    display: inline-grid !important;
    place-items: center !important;
    flex: 0 0 32px !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    border-radius: 9px !important;
    font: 750 12px/1 'Plus Jakarta Sans', Arial, sans-serif !important;
  }
  html body .ggt34-theme-page .gg490-journey :is(.ggtheme-studio-steps,.ggtheme-shortcode-steps) > i,
  html body main.ggt34-page-shell .gg490-journey--shortcode .ggtheme-shortcode-steps > i {display:none !important}
}
@media (max-width: 720px) {
  html body .ggt34-theme-page .gg490-journey :is(.ggtheme-studio-steps,.ggtheme-shortcode-steps),
  html body main.ggt34-page-shell .gg490-journey--shortcode .ggtheme-shortcode-steps {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 9px !important;
  }
  html body .ggt34-theme-page .gg490-journey :is(.ggtheme-studio-steps,.ggtheme-shortcode-steps) > span,
  html body main.ggt34-page-shell .gg490-journey--shortcode .ggtheme-shortcode-steps > span {
    min-height: 54px !important;
    padding: 10px 13px !important;
    font-size: 13px !important;
    text-align: left !important;
  }
  html body .ggt34-theme-page .gg34-editor-workspace > form.ggw-quick-generator,
  html body .ggt34-theme-page .gg34-editor-workspace > .gg34-poem-preview {padding: 19px 16px !important}
  html body .ggt34-theme-page .gg34-poem-preview__paper {padding: 20px 14px 26px !important}
  html body .ggt34-theme-page .gg34-poem-preview__top {
    gap: 12px !important;
    flex-wrap: wrap !important;
  }
  html body .ggt34-theme-page .gg34-poem-preview__top h2 {font-size: clamp(24px, 6vw, 31px) !important}
  html body .ggt34-theme-page .gg34-poem-preview__paper h3 {font-size: clamp(25px, 6vw, 32px) !important}
  html body .ggt34-theme-page .gg34-sample-stanza p {font-size: 16px !important;line-height: 1.65 !important}
  html body .ggt34-theme-page :is(textarea, input, select) {max-width:100% !important;min-width:0 !important;box-sizing:border-box !important}
}

/* Final specificity correction: some older theme styles target #ggw-site and
   otherwise overrule the mobile grid/margins above. */
@media (max-width:1024px) {
  html body #ggw-site main .ggt34-theme-page,
  html body.gg-helder #ggw-site main .ggt34-theme-page,
  html body.ggw-theme #ggw-site main .ggt34-theme-page {
    display:block !important;
    width:calc(100% - 20px) !important;
    max-width:1280px !important;
    min-width:0 !important;
    box-sizing:border-box !important;
    margin-left:auto !important;
    margin-right:auto !important;
  }
  html body #ggw-site main .ggt34-theme-page .gg490-journey {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    width:100% !important;
    padding:20px !important;
    margin-inline:0 !important;
  }
  html body #ggw-site main .ggt34-theme-page .gg490-journey .ggtheme-studio-steps {
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    width:100% !important;
    max-width:100% !important;
    padding:0 !important;
    gap:10px !important;
    margin:14px 0 0 !important;
  }
  html body #ggw-site main .ggt34-theme-page .gg490-journey .ggtheme-studio-steps > span {
    display:flex !important;
    flex-direction:row !important;
    align-items:center !important;
    justify-content:flex-start !important;
    width:100% !important;
    height:auto !important;
    max-width:100% !important;
    min-width:0 !important;
    min-height:62px !important;
    aspect-ratio:auto !important;
    border-radius:13px !important;
    padding:11px 13px !important;
    text-align:left !important;
  }
  html body #ggw-site main .ggt34-theme-page .gg34-editor-workspace {
    display:grid !important;
    grid-template-columns:minmax(0,1fr) !important;
    width:100% !important;
    padding:0 !important;
    margin-inline:0 !important;
  }
  html body #ggw-site main .ggt34-theme-page .gg34-editor-workspace > form.ggw-quick-generator,
  html body #ggw-site main .ggt34-theme-page .gg34-editor-workspace > aside.gg34-poem-preview {
    box-sizing:border-box !important;
    width:100% !important;
    max-width:100% !important;
    min-width:0 !important;
    margin-inline:0 !important;
    padding:24px !important;
  }
  html body #ggw-site main .ggt34-theme-page .gg34-editor-workspace > aside.gg34-poem-preview {
    position:static !important;
    top:auto !important;
  }
}
@media (max-width:720px) {
  html body #ggw-site main .ggt34-theme-page .gg490-journey .ggtheme-studio-steps {
    grid-template-columns:minmax(0,1fr) !important;
    gap:9px !important;
  }
  html body #ggw-site main .ggt34-theme-page .gg490-journey .ggtheme-studio-steps > span {
    min-height:54px !important;
    padding:10px 13px !important;
  }
  html body #ggw-site main .ggt34-theme-page .gg34-editor-workspace > form.ggw-quick-generator,
  html body #ggw-site main .ggt34-theme-page .gg34-editor-workspace > aside.gg34-poem-preview {
    padding:20px 16px !important;
  }
  html body #ggw-site main .ggt34-theme-page .gg34-poem-preview__paper {
    padding:22px 16px 28px !important;
  }
}
