/* Layout and phone-width overrides for the self-hosted Swagger UI on /developers/reference/. */
.ref-page { max-width: 1100px; margin: 0 auto; padding: 16px; }
.ref-title { font-size: 1.6rem; line-height: 1.2; margin: .5rem 0; }
.ref-hint { margin: .25rem 0; padding: .6rem .9rem; border-left: 4px solid var(--accent); background: var(--panel); border-radius: 0 8px 8px 0; font-weight: 600; }
.ref-meta { color: var(--muted); font-size: .9rem; margin: .5rem 0 1rem; overflow-wrap: anywhere; }

#swagger-ui .swagger-ui { font-family: var(--font); }
/* Authorize comes first, above the long description, so it is on screen without scrolling. */
#swagger-ui .swagger-ui div:has(> .scheme-container) { display: flex; flex-direction: column; }
#swagger-ui .swagger-ui .scheme-container { order: -1; }
#swagger-ui .swagger-ui .info { margin: 16px 0; }
#swagger-ui .swagger-ui .info .title { font-size: 1.5rem; }
#swagger-ui .swagger-ui .wrapper { padding: 0; max-width: none; }
/* The server selector is fixed to the production API; the spec has a single server. */
#swagger-ui .swagger-ui .scheme-container { padding: 12px 0; box-shadow: none; background: transparent; }
#swagger-ui .swagger-ui .scheme-container .schemes { flex-wrap: wrap; gap: 8px; }
#swagger-ui .swagger-ui .write-note blockquote, #swagger-ui .swagger-ui .opblock-description-wrapper blockquote {
  margin: 0 0 12px; padding: 8px 12px; border-left: 4px solid #d98e04; background: rgba(217, 142, 4, .12); border-radius: 0 6px 6px 0;
}
#swagger-ui .swagger-ui .opblock-description-wrapper blockquote p { margin: 0; }

/* Tap targets: the buttons people need on a phone are at least 44px tall. */
#swagger-ui .swagger-ui .btn { min-height: 44px; padding: 8px 18px; font-size: 1rem; }
#swagger-ui .swagger-ui .btn.authorize { display: inline-flex; align-items: center; gap: 8px; }
#swagger-ui .swagger-ui .opblock .opblock-summary { min-height: 48px; padding: 6px; }
#swagger-ui .swagger-ui input[type=text], #swagger-ui .swagger-ui input[type=password], #swagger-ui .swagger-ui textarea, #swagger-ui .swagger-ui select {
  font-size: 16px; /* 16px stops iOS Safari zooming into the field */
}

@media (max-width: 640px) {
  .ref-page { padding: 12px; }
  .ref-title { font-size: 1.35rem; }
  /* Authorize sits on its own row, full width, above the operations. */
  #swagger-ui .swagger-ui .scheme-container .auth-wrapper { float: none; display: block; margin: 0; }
  #swagger-ui .swagger-ui .scheme-container .auth-wrapper .authorize { width: 100%; justify-content: center; }
  #swagger-ui .swagger-ui .scheme-container .schemes { display: block; }
  /* Operation rows wrap instead of overflowing sideways. */
  #swagger-ui .swagger-ui .opblock .opblock-summary { flex-wrap: wrap; row-gap: 4px; }
  #swagger-ui .swagger-ui .opblock .opblock-summary-path { flex: 1 1 100%; max-width: 100%; font-size: 14px; overflow-wrap: anywhere; word-break: break-all; }
  #swagger-ui .swagger-ui .opblock .opblock-summary-description { flex: 1 1 100%; text-align: left; padding: 0 6px; }
  #swagger-ui .swagger-ui .opblock .opblock-summary-method { min-width: 64px; }
  #swagger-ui .swagger-ui .opblock-body pre, #swagger-ui .swagger-ui .highlight-code pre { white-space: pre-wrap; overflow-wrap: anywhere; }
  /* Tables scroll inside themselves, never the page. */
  #swagger-ui .swagger-ui .table-container { overflow-x: auto; }
  #swagger-ui .swagger-ui table.parameters, #swagger-ui .swagger-ui table.responses-table { display: block; overflow-x: auto; }
  #swagger-ui .swagger-ui .parameters-col_description input[type=text] { width: 100%; max-width: 100%; }
  #swagger-ui .swagger-ui .opblock-section-header { flex-wrap: wrap; gap: 8px; padding: 8px; }
  #swagger-ui .swagger-ui .opblock-section-header .try-out { margin: 0; }
  #swagger-ui .swagger-ui .execute-wrapper .btn, #swagger-ui .swagger-ui .btn-group .btn { width: 100%; }
  #swagger-ui .swagger-ui .btn-group { display: flex; flex-direction: column; gap: 8px; padding: 0; }
  /* The Authorize dialog fits the screen. */
  #swagger-ui .swagger-ui .dialog-ux .modal-ux { width: calc(100vw - 24px); max-width: 100%; min-width: 0; top: 12px; transform: none; left: 12px; max-height: calc(100vh - 24px); overflow-y: auto; }
  #swagger-ui .swagger-ui .dialog-ux .modal-ux-content { max-height: none; }
  #swagger-ui .swagger-ui .auth-container input[type=text], #swagger-ui .swagger-ui .auth-container input[type=password] { width: 100%; min-width: 0; }
}
