/* Mobile form refinements; the existing desktop layout remains unchanged. */
.mobile-form-heading,
.mobile-form-jump {
  display: none;
}

@media (max-width: 760px) {
  body.public-editorial main .mobile-form-heading {
    display: block;
    font-family: inherit;
    font-size: 22px;
    line-height: 1.3;
    margin: 4px 0 24px;
    scroll-margin-top: 24px;
  }

  body.public-editorial main .mobile-form-jump {
    display: inline-flex;
    align-items: center;
    min-height: 48px;
    margin-block: 8px;
    font-size: 16px;
    line-height: 1.5;
    text-underline-offset: 4px;
  }

  body.public-editorial.customizer-page #customizer-form.mobile-preview-inline > .preview-jump {
    display: none;
  }

  body.public-editorial.customizer-page #customizer-form.mobile-preview-inline > .preview-sticky {
    margin-block: 28px 36px;
    padding: 0;
  }

  body.public-editorial.customizer-page #customizer-form.mobile-preview-inline .cad-viewport {
    height: clamp(280px, 85vw, 360px);
  }

  body.public-editorial main form.panel :is(p, .field):has(> input[type="checkbox"]) {
    display: grid;
    grid-template-columns: 24px minmax(0, 1fr);
    column-gap: 12px;
    row-gap: 8px;
    align-items: start;
  }

  body.public-editorial main form.panel :is(p, .field):has(> input[type="checkbox"]) > input[type="checkbox"] {
    grid-column: 1;
    grid-row: 1;
    width: 24px;
    height: 24px;
    min-width: 24px;
    min-height: 24px;
    margin: 10px 0 0;
    padding: 0;
  }

  body.public-editorial main form.panel :is(p, .field):has(> input[type="checkbox"]) > label {
    grid-column: 2;
    grid-row: 1;
    min-width: 0;
    min-height: 44px;
    margin: 0;
    padding-block: 10px;
    overflow-wrap: anywhere;
    cursor: pointer;
  }

  body.public-editorial main form.panel :is(p, .field):has(> input[type="checkbox"]) > :is(.helptext, .errorlist) {
    grid-column: 2;
    min-width: 0;
    margin-block: 0;
  }

  /* The parent must allow the same gestures as the canvas inside it. */
  body.public-editorial.customizer-page .customizer .preview-sticky .cad-viewport,
  body.public-editorial.customizer-page .customizer .preview-sticky .cad-viewport canvas {
    touch-action: pan-y pinch-zoom !important;
  }

  body.public-editorial.customizer-page .customizer .preview-sticky .cad-controls button {
    min-height: 48px;
    max-width: 100%;
    padding: 12px 18px;
    font-size: 16px;
    line-height: 1.4;
    white-space: normal;
  }
}

@media (max-width: 480px) {
  body.public-editorial main .narrow form.panel,
  body.public-editorial.customizer-page #customizer-form.panel {
    padding: 18px 14px;
  }
}
