/* Shared overrides for OpenAPI Swagger UI shells under /docs/openapi/.
   Stock swagger-ui.css is desktop-oriented (wide tables, fixed input widths). */

#swagger-ui {
  /* Natural document flow — do not use 100vh minus nav height.
     On mobile the sticky header is taller than --docs-nav-height (search wraps),
     so a fixed height clipped content and stacked the footer over Swagger. */
  width: 100%;
  max-width: 100%;
  overflow-x: hidden;
  box-sizing: border-box;
}

#swagger-ui .swagger-ui {
  max-width: 100%;
}

#swagger-ui .swagger-ui .wrapper {
  padding-left: max(0.75rem, env(safe-area-inset-left));
  padding-right: max(0.75rem, env(safe-area-inset-right));
}

#swagger-ui .swagger-ui .scheme-container {
  padding-left: max(0.75rem, env(safe-area-inset-left));
  padding-right: max(0.75rem, env(safe-area-inset-right));
}

#swagger-ui .swagger-ui table {
  display: block;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#swagger-ui .swagger-ui .opblock-body pre,
#swagger-ui .swagger-ui .microlight,
#swagger-ui .swagger-ui .highlight-code {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

#swagger-ui .swagger-ui input[type="text"],
#swagger-ui .swagger-ui input[type="password"],
#swagger-ui .swagger-ui input[type="search"],
#swagger-ui .swagger-ui input[type="email"],
#swagger-ui .swagger-ui textarea,
#swagger-ui .swagger-ui select {
  max-width: 100% !important;
  box-sizing: border-box;
}

#swagger-ui .swagger-ui .parameter__name,
#swagger-ui .swagger-ui .response-col_status,
#swagger-ui .swagger-ui .opblock-summary-path,
#swagger-ui .swagger-ui .opblock-summary-description {
  word-break: break-word;
  overflow-wrap: anywhere;
}

@media (max-width: 767px) {
  #swagger-ui .swagger-ui .opblock-summary {
    flex-wrap: wrap;
    align-items: flex-start;
  }

  #swagger-ui .swagger-ui .opblock-summary-method {
    margin-bottom: 0.25rem;
  }

  #swagger-ui .swagger-ui .opblock-summary-path {
    max-width: 100%;
    flex: 1 1 100%;
  }

  #swagger-ui .swagger-ui .opblock-tag {
    padding-right: 0.5rem;
  }

  #swagger-ui .swagger-ui .btn {
    white-space: normal;
  }

  #swagger-ui .swagger-ui .auth-wrapper,
  #swagger-ui .swagger-ui .authorize {
    max-width: 100%;
  }

  #swagger-ui .swagger-ui .dialog-ux .modal-ux {
    width: calc(100vw - 1.5rem);
    max-width: 100%;
    margin: 0.75rem;
  }
}

#docs-site-footer {
  margin-top: 0;
}
