/* Harthwyn 26.01.303 — Mobile / Smart Device Form Field Authority
   Final responsive safety layer for Harthwyn-controlled front-end and admin forms.
   Purpose: prevent small, thin, strip-like, clipped, or hard-to-tap fields on phones/tablets. */

@media (max-width: 782px), (pointer: coarse) {
  body.harthwyn-managed-page,
  body.harthwyn-plugin-owned-document,
  body[class*="harthwyn-managed-page"],
  .harthwyn-admin,
  .toplevel_page_harthwyn,
  [class*="harthwyn_page_harthwyn"] {
    --harthwyn-mobile-form-field-min-height-260303: 48px;
    --harthwyn-mobile-form-select-min-height-260303: 52px;
    --harthwyn-mobile-form-textarea-min-height-260303: 120px;
    --harthwyn-mobile-form-radius-260303: 14px;
    --harthwyn-mobile-form-padding-y-260303: 12px;
    --harthwyn-mobile-form-padding-x-260303: 14px;
    --harthwyn-mobile-form-font-size-260303: 16px;
    --harthwyn-mobile-form-line-height-260303: 1.35;
  }

  body.harthwyn-managed-page :where(
    .harthwyn-page-shell,
    .harthwyn-managed-page-shell,
    .harthwyn-dashboard,
    .harthwyn-events-hub,
    .harthwyn-event-editor,
    .harthwyn-message-center,
    .harthwyn-profile-edit,
    .harthwyn-profile-page,
    .harthwyn-i-am-page,
    .harthwyn-search,
    .harthwyn-support,
    .harthwyn-care,
    .harthwyn-request-access,
    .harthwyn-portrait-studio,
    .harthwyn-moments,
    .harthwyn-auth-panel,
    .harthwyn-login-panel
  ) :where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]), select, textarea),
  body.harthwyn-plugin-owned-document :where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]), select, textarea),
  .harthwyn-admin :where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]), select, textarea),
  .toplevel_page_harthwyn :where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]), select, textarea),
  [class*="harthwyn_page_harthwyn"] :where(input:not([type="hidden"]):not([type="checkbox"]):not([type="radio"]):not([type="submit"]):not([type="button"]):not([type="reset"]), select, textarea) {
    box-sizing: border-box !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    min-height: var(--harthwyn-mobile-form-field-min-height-260303) !important;
    padding: var(--harthwyn-mobile-form-padding-y-260303) var(--harthwyn-mobile-form-padding-x-260303) !important;
    font-size: var(--harthwyn-mobile-form-font-size-260303) !important;
    line-height: var(--harthwyn-mobile-form-line-height-260303) !important;
    border-radius: var(--harthwyn-mobile-form-radius-260303) !important;
    overflow: visible !important;
    text-overflow: clip !important;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  body.harthwyn-managed-page :where(input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"], select),
  body.harthwyn-plugin-owned-document :where(input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"], select),
  .harthwyn-admin :where(input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"], select),
  .toplevel_page_harthwyn :where(input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"], select),
  [class*="harthwyn_page_harthwyn"] :where(input[type="date"], input[type="time"], input[type="datetime-local"], input[type="month"], select) {
    min-height: var(--harthwyn-mobile-form-select-min-height-260303) !important;
    height: auto !important;
  }

  body.harthwyn-managed-page textarea,
  body.harthwyn-plugin-owned-document textarea,
  .harthwyn-admin textarea,
  .toplevel_page_harthwyn textarea,
  [class*="harthwyn_page_harthwyn"] textarea {
    min-height: var(--harthwyn-mobile-form-textarea-min-height-260303) !important;
    resize: vertical;
  }

  body.harthwyn-managed-page :where(input[type="file"]),
  body.harthwyn-plugin-owned-document :where(input[type="file"]),
  .harthwyn-admin :where(input[type="file"]),
  .toplevel_page_harthwyn :where(input[type="file"]),
  [class*="harthwyn_page_harthwyn"] :where(input[type="file"]) {
    min-height: var(--harthwyn-mobile-form-select-min-height-260303) !important;
    padding: 10px 12px !important;
    line-height: 1.35 !important;
  }

  body.harthwyn-managed-page :where(input[type="checkbox"], input[type="radio"]),
  body.harthwyn-plugin-owned-document :where(input[type="checkbox"], input[type="radio"]),
  .harthwyn-admin :where(input[type="checkbox"], input[type="radio"]),
  .toplevel_page_harthwyn :where(input[type="checkbox"], input[type="radio"]),
  [class*="harthwyn_page_harthwyn"] :where(input[type="checkbox"], input[type="radio"]) {
    width: 24px !important;
    min-width: 24px !important;
    height: 24px !important;
    min-height: 24px !important;
    margin: 0 10px 0 0 !important;
    vertical-align: middle;
  }

  body.harthwyn-managed-page :where(label, .harthwyn-field-label, .harthwyn-form-label),
  body.harthwyn-plugin-owned-document :where(label, .harthwyn-field-label, .harthwyn-form-label),
  .harthwyn-admin :where(label, .harthwyn-field-label, .harthwyn-form-label),
  .toplevel_page_harthwyn :where(label, .harthwyn-field-label, .harthwyn-form-label),
  [class*="harthwyn_page_harthwyn"] :where(label, .harthwyn-field-label, .harthwyn-form-label) {
    font-size: 15px !important;
    line-height: 1.4 !important;
  }

  body.harthwyn-managed-page :where(button, .button, input[type="submit"], input[type="button"], input[type="reset"], .harthwyn-button, .harthwyn-btn),
  body.harthwyn-plugin-owned-document :where(button, .button, input[type="submit"], input[type="button"], input[type="reset"], .harthwyn-button, .harthwyn-btn),
  .harthwyn-admin :where(button, .button, input[type="submit"], input[type="button"], input[type="reset"], .harthwyn-button, .harthwyn-btn),
  .toplevel_page_harthwyn :where(button, .button, input[type="submit"], input[type="button"], input[type="reset"], .harthwyn-button, .harthwyn-btn),
  [class*="harthwyn_page_harthwyn"] :where(button, .button, input[type="submit"], input[type="button"], input[type="reset"], .harthwyn-button, .harthwyn-btn) {
    min-height: var(--harthwyn-mobile-form-field-min-height-260303) !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow: visible !important;
    text-overflow: clip !important;
    line-height: 1.2 !important;
  }

  body.harthwyn-managed-page :where(
    .harthwyn-form-grid,
    .harthwyn-profile-edit-grid,
    .harthwyn-event-editor-grid,
    .harthwyn-message-compose-grid,
    .harthwyn-auth-form-grid,
    .harthwyn-request-access-grid,
    .harthwyn-support-form-grid,
    .harthwyn-care-form-grid,
    .harthwyn-admin-form-grid,
    .harthwyn-field-grid,
    .harthwyn-settings-grid
  ),
  body.harthwyn-plugin-owned-document :where(
    .harthwyn-form-grid,
    .harthwyn-profile-edit-grid,
    .harthwyn-event-editor-grid,
    .harthwyn-message-compose-grid,
    .harthwyn-auth-form-grid,
    .harthwyn-request-access-grid,
    .harthwyn-support-form-grid,
    .harthwyn-care-form-grid,
    .harthwyn-admin-form-grid,
    .harthwyn-field-grid,
    .harthwyn-settings-grid
  ),
  .harthwyn-admin :where(
    .harthwyn-form-grid,
    .harthwyn-profile-edit-grid,
    .harthwyn-event-editor-grid,
    .harthwyn-message-compose-grid,
    .harthwyn-auth-form-grid,
    .harthwyn-request-access-grid,
    .harthwyn-support-form-grid,
    .harthwyn-care-form-grid,
    .harthwyn-admin-form-grid,
    .harthwyn-field-grid,
    .harthwyn-settings-grid
  ) {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 14px !important;
  }

  body.harthwyn-managed-page :where(.harthwyn-field, .harthwyn-form-row, .harthwyn-form-field, .harthwyn-control, .harthwyn-input-group),
  body.harthwyn-plugin-owned-document :where(.harthwyn-field, .harthwyn-form-row, .harthwyn-form-field, .harthwyn-control, .harthwyn-input-group),
  .harthwyn-admin :where(.harthwyn-field, .harthwyn-form-row, .harthwyn-form-field, .harthwyn-control, .harthwyn-input-group) {
    min-width: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.harthwyn-managed-page :where(.harthwyn-message-rich-editor, [contenteditable="true"].harthwyn-message-rich-editor),
  body.harthwyn-plugin-owned-document :where(.harthwyn-message-rich-editor, [contenteditable="true"].harthwyn-message-rich-editor) {
    min-height: 136px !important;
    padding: 14px !important;
    font-size: 16px !important;
    line-height: 1.45 !important;
    border-radius: 16px !important;
    width: 100% !important;
    max-width: 100% !important;
  }

  body.harthwyn-managed-page :where(.harthwyn-invitee-search, .harthwyn-recipient-search, .harthwyn-member-search, .harthwyn-event-member-search),
  body.harthwyn-plugin-owned-document :where(.harthwyn-invitee-search, .harthwyn-recipient-search, .harthwyn-member-search, .harthwyn-event-member-search) {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.harthwyn-managed-page input[type="hidden"],
  body.harthwyn-plugin-owned-document input[type="hidden"],
  .harthwyn-admin input[type="hidden"],
  .toplevel_page_harthwyn input[type="hidden"],
  [class*="harthwyn_page_harthwyn"] input[type="hidden"],
  body.harthwyn-managed-page [hidden],
  body.harthwyn-plugin-owned-document [hidden],
  .harthwyn-admin [hidden],
  body.harthwyn-managed-page .harthwyn-screen-reader-text,
  body.harthwyn-plugin-owned-document .harthwyn-screen-reader-text,
  .harthwyn-admin .harthwyn-screen-reader-text,
  body.harthwyn-managed-page .harthwyn-direct-upload-input--click-safe,
  body.harthwyn-plugin-owned-document .harthwyn-direct-upload-input--click-safe,
  .harthwyn-admin .harthwyn-direct-upload-input--click-safe {
    display: none !important;
  }
}
