/*
  Mobile editor usability pass.
  UI-only overrides: do not change editor IDs, API calls, save/export logic, or database behavior.
*/

@media (max-width: 760px) {
  body.maker-active,
  body.mobile-maker-open {
    overflow: auto;
    padding-bottom: 82px;
  }

  body.maker-active .maker.open,
  body.mobile-maker-open .maker.open {
    height: auto;
    min-height: 100vh;
    overflow: visible;
  }

  body.maker-active .maker-grid,
  body.mobile-maker-open .maker-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.maker-active .preview-shell,
  body.mobile-maker-open .preview-shell {
    flex: 0 0 auto !important;
    min-height: 46vh !important;
    height: auto !important;
    padding: 10px 8px 12px !important;
    overflow: hidden !important;
  }

  body.maker-active .canvas-stage canvas,
  body.mobile-maker-open .canvas-stage canvas {
    max-width: calc(100vw - 24px) !important;
    max-height: 45vh !important;
  }

  body.maker-active .maker.mobile-preview .controls,
  body.maker-active .maker.mobile-edit .controls,
  body.maker-active .controls,
  body.mobile-maker-open .maker.mobile-preview .controls,
  body.mobile-maker-open .maker.mobile-edit .controls,
  body.mobile-maker-open .controls {
    display: block !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    top: auto !important;
    z-index: 1 !important;
    flex: 0 0 auto !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    margin: 0 !important;
    border: 1px solid var(--line) !important;
    border-left: 1px solid var(--line) !important;
    border-radius: 12px 12px 0 0 !important;
    padding: 12px !important;
    background: #0d100d !important;
    box-shadow: none !important;
  }

  body.maker-active .maker.customization-open::after,
  body.maker-active .controls-close,
  body.maker-active .mobile-customize-toggle,
  body.maker-active .maker-mobile-tabs,
  body.mobile-maker-open .maker.customization-open::after,
  body.mobile-maker-open .controls-close,
  body.mobile-maker-open .mobile-customize-toggle,
  body.mobile-maker-open .maker-mobile-tabs {
    display: none !important;
  }

  body.maker-active .control-section,
  body.mobile-maker-open .control-section {
    padding-top: 10px;
    margin-top: 10px;
  }

  body.maker-active .field-grid,
  body.maker-active .team-fields,
  body.mobile-maker-open .field-grid,
  body.mobile-maker-open .team-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  body.maker-active input,
  body.maker-active select,
  body.maker-active textarea,
  body.mobile-maker-open input,
  body.mobile-maker-open select,
  body.mobile-maker-open textarea {
    font-size: 13px;
  }

  body.maker-active .maker-mobile-bar,
  body.mobile-maker-open .maker-mobile-bar {
    z-index: 60;
  }
}

@media (max-width: 420px) {
  body.maker-active .field-grid,
  body.maker-active .team-fields,
  body.mobile-maker-open .field-grid,
  body.mobile-maker-open .team-fields {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 820px) {
  body.stream-overlay-page .maker-grid,
  .stream-overlay-page .maker-grid {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    min-height: 0 !important;
    padding: 10px !important;
  }

  body.stream-overlay-page .canvas-wrap,
  .stream-overlay-page .canvas-wrap {
    min-height: 0;
    max-height: 52vh;
  }

  body.stream-overlay-page .controls,
  .stream-overlay-page .controls {
    position: relative !important;
    top: auto !important;
    max-height: none !important;
    overflow: visible !important;
    padding: 10px !important;
  }

  body.stream-overlay-page .edit-modal,
  .stream-overlay-page .edit-modal {
    max-height: min(70vh, 560px);
  }
}
