/* DevQuorra API docs — mobile / Android / iOS UX */

:root {
  --dq-mobile-pad: 18px;
  --dq-mobile-section-gap: 28px;
  --dq-mobile-touch: 44px;
  --dq-mobile-header-h: 56px;
  --dq-mobile-bottom-h: 64px;
}

  /* ── Typography (mobile) ───────────────────────────────────── */
@media (max-width: 768px) {
  html.dq-docs-mobile {
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
  }

  html.dq-docs-mobile body,
  body.dq-docs-page {
    overflow-x: hidden;
    /* Android often reports 0 safe-area — keep a floor under the bottom bar. */
    padding-bottom: calc(var(--dq-mobile-bottom-h) + max(env(safe-area-inset-bottom, 0px), 1.5rem));
    -webkit-overflow-scrolling: touch;
  }

  html.dq-docs-mobile h1:not(.dq-openapi-view-title) {
    font-size: 1.5rem !important;
    line-height: 1.25;
  }

  .dq-openapi-view-title {
    font-size: 1.0625rem !important;
    line-height: 1.3 !important;
  }

  html.dq-docs-mobile h2,
  .dq-meta-group-title {
    font-size: 1.25rem;
  }

  html.dq-docs-mobile h3 {
    font-size: 1.125rem;
  }

  html.dq-docs-mobile p,
  html.dq-docs-mobile li,
  html.dq-docs-mobile .dq-lead {
    font-size: 1rem;
    line-height: 1.6;
  }
}

/* ── Sticky mobile topbar ────────────────────────────────────── */
.dq-mobile-topbar {
  display: none;
}

@media (max-width: 768px) {
  .dq-mobile-topbar {
    display: flex;
    align-items: center;
    gap: 10px;
    position: sticky;
    top: 0;
    z-index: 120;
    height: var(--dq-mobile-header-h);
    min-height: var(--dq-mobile-header-h);
    padding: 0 var(--dq-mobile-pad);
    padding-top: env(safe-area-inset-top, 0);
    background: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid #e2e8f0;
    box-shadow: 0 1px 8px rgba(15, 23, 42, 0.06);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    pointer-events: auto;
  }

  /* Same fixed header chrome as working ReDoc — used on /docs, /redoc, /openapi-view */
  .dq-redoc-topbar.dq-mobile-topbar--inline,
  .dq-mobile-topbar.dq-mobile-topbar--inline {
    display: flex;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100050;
    pointer-events: auto;
    isolation: isolate;
    box-sizing: border-box;
    height: calc(var(--dq-mobile-header-h) + env(safe-area-inset-top, 0px));
    min-height: calc(var(--dq-mobile-header-h) + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) var(--dq-mobile-pad) 0;
    background: #ffffff;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  }

  /* Clear fixed topbar so docs / openapi titles are not overlapped */
  body:has(.dq-mobile-topbar--inline),
  body:has(redoc),
  body.dq-openapi-page {
    padding-top: calc(var(--dq-mobile-header-h) + env(safe-area-inset-top, 0px)) !important;
  }

  #dq-docs-shell {
    padding-top: 16px;
  }

  redoc {
    display: block;
    position: relative;
    z-index: 1;
  }

  .dq-redoc-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1;
  }

  /* Match ReDoc working header: menu + title (logo stays off on narrow screens) */
  .dq-mobile-topbar--inline .dq-mobile-topbar__logo,
  .dq-mobile-topbar--inline .dq-redoc-logo {
    display: none !important;
  }

  .dq-redoc-name.dq-mobile-topbar__title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1f2937;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
  }

  /* Platform meta panel — Android UI/UX: padding + values not clipped */
  #dq-docs-header .dq-cell-meta {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-top: 16px;
    box-sizing: border-box;
  }

  #dq-docs-header .dq-meta-panel {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 18px 18px 16px;
    border-radius: 16px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.06);
    overflow: visible;
  }

  #dq-docs-header .dq-meta-group {
    min-width: 0;
  }

  #dq-docs-header .dq-meta-group-title {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    letter-spacing: 0.06em;
    color: #334155;
    margin: 0 0 10px;
  }

  #dq-docs-header .dq-meta-list {
    width: 100%;
  }

  #dq-docs-header .dq-meta-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 0;
    min-width: 0;
    width: 100%;
    box-sizing: border-box;
  }

  #dq-docs-header .dq-meta-row dt {
    flex: 0 1 auto;
    max-width: 46%;
    margin: 0;
    min-width: 0;
  }

  #dq-docs-header .dq-meta-row-label {
    gap: 8px;
    font-size: 0.875rem;
    line-height: 1.35;
  }

  #dq-docs-header .dq-meta-row-icon {
    width: 18px;
    height: 18px;
  }

  #dq-docs-header .dq-meta-row dd {
    flex: 1 1 auto;
    min-width: 0;
    max-width: 54%;
    margin: 0;
    padding: 0;
    font-size: 0.875rem;
    font-weight: 700;
    line-height: 1.35;
    text-align: right;
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  #dq-docs-header .dq-meta-divider {
    margin: 14px 0;
  }

  #dq-docs-header .dq-meta-ready-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    max-width: 100%;
    min-height: 28px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 0.75rem;
    white-space: normal;
    text-align: center;
    line-height: 1.2;
  }

  #dq-docs-header .dq-platform-urls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
  }

  #dq-docs-header .dq-platform-link {
    width: 100%;
  }

  .dq-mobile-topbar__menu {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: var(--dq-mobile-touch);
    height: var(--dq-mobile-touch);
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    background: #fff;
    color: #334155;
    cursor: pointer;
    padding: 0;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    pointer-events: auto;
    user-select: none;
    -webkit-user-select: none;
  }

  .dq-mobile-topbar__menu:focus-visible {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
  }

  .dq-mobile-topbar__menu--open {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #2563eb;
  }

  /* Unicode menu glyph — reliable on Android WebView */
  .dq-menu-glyph {
    display: block;
    font-size: 1.375rem;
    font-weight: 700;
    line-height: 1;
    color: inherit;
    pointer-events: none;
  }

  .dq-mobile-topbar__menu svg,
  .dq-hamburger-icon {
    display: none !important;
  }

  .dq-mobile-topbar__logo {
    display: none;
    width: 38px;
    height: 38px;
    flex-shrink: 0;
    border-radius: 10px;
    object-fit: cover;
  }

  .dq-mobile-topbar__title {
    flex: 1;
    min-width: 0;
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.2;
  }

  /* Hero brand — 3 rows, all flush left */
  #dq-docs-header .dq-cell-brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 10px;
    min-width: 0;
    width: 100%;
    padding: 0 !important;
    margin: 0 !important;
  }

  #dq-docs-header .dq-brand-row {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    width: 100%;
    margin: 0;
    padding: 0;
  }

  #dq-docs-header .dq-brand-row--identity {
    gap: 10px;
  }

  #dq-docs-header .dq-logo-img {
    display: flex !important;
    flex-shrink: 0;
    margin: 0;
  }

  #dq-docs-header .dq-title {
    flex: 1 1 auto;
    width: auto;
    min-width: 0;
    max-width: 100%;
    margin: 0;
    padding: 0;
    white-space: normal;
    overflow: visible;
    text-overflow: unset;
    font-size: 1.25rem;
    text-align: left;
    line-height: 1.2;
  }

  #dq-docs-header .dq-brand-row--badges .dq-pill {
    margin: 0;
  }

  #dq-docs-header .dq-docs-hero-actions,
  #dq-docs-header .dq-header-actions-below-title.dq-docs-hero-actions {
    justify-content: flex-start !important;
    width: 100% !important;
    margin: 16px 0 28px !important;
    padding: 0 0 4px !important;
  }

  #dq-docs-header .dq-cell-main,
  #dq-docs-header .dq-tagline,
  #dq-docs-header .dq-lead,
  #dq-docs-header .dq-hero-links {
    text-align: left;
    align-items: stretch;
    justify-content: flex-start;
    width: 100%;
    margin-left: 0;
    padding-left: 0;
  }

  #dq-docs-header .dq-hero-links {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: 4px;
  }

  #dq-docs-header .dq-hero-link {
    width: 100%;
    justify-content: flex-start;
    text-align: left;
  }

  #dq-docs-shell .swagger-ui .scheme-container {
    text-align: left !important;
    margin-left: 0 !important;
    padding-left: 0 !important;
  }

  #dq-docs-shell .swagger-ui .opblock-tag-section,
  #dq-docs-shell .swagger-ui .opblock-tag,
  #dq-docs-shell .swagger-ui .opblock-tag a,
  #dq-docs-shell .swagger-ui .opblock-tag > small {
    text-align: left !important;
  }

  #dq-docs-header .dq-logo-img,
  #dq-docs-header .dq-logo-img img {
    width: 28px !important;
    height: 28px !important;
    max-width: 28px !important;
    max-height: 28px !important;
  }

  #dq-docs-header .dq-pill {
    flex-shrink: 0;
  }

  #dq-docs-shell {
    padding: 16px var(--dq-mobile-pad) 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  .dq-header-card {
    padding: 18px 16px 20px;
    border-radius: 16px;
    overflow: visible;
  }

  #dq-docs-header .dq-header-card {
    padding-left: 16px;
    padding-right: 16px;
    overflow: visible;
  }

  #dq-docs-header {
    position: relative;
    top: auto;
    z-index: 1;
    margin-bottom: 12px;
  }

  /* Landing hero content stays visible on mobile (do not hide stats/features/nav). */

  #dq-external-search {
    position: sticky;
    top: calc(var(--dq-mobile-header-h) + env(safe-area-inset-top, 0px));
    z-index: 100;
    margin: 0 0 var(--dq-mobile-section-gap);
    padding: 10px 0 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #f8fafc 72%, rgba(248, 250, 252, 0));
  }

  #dq-external-search.dq-search-card {
    margin-top: 0;
    animation: none;
  }

  #dq-external-search .dq-search-bar {
    min-height: var(--dq-mobile-touch);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  }

  #dq-external-search .dq-search-icon {
    left: 14px;
    width: 18px;
    height: 18px;
  }

  #dq-external-search .dq-search-icon svg {
    width: 18px;
    height: 18px;
  }

  #dq-external-search #dq-search-proxy {
    height: var(--dq-mobile-touch);
    font-size: 16px;
    padding: 0 84px 0 42px;
    -webkit-appearance: none;
    appearance: none;
    touch-action: manipulation;
  }

  #dq-external-search .dq-search-actions {
    right: 6px;
    gap: 2px;
  }

  #dq-external-search .dq-search-filter,
  #dq-external-search .dq-search-clear {
    width: 34px;
    height: 34px;
    border-radius: 8px;
  }

  #dq-external-search .dq-search-filter svg,
  #dq-external-search .dq-search-clear svg {
    width: 18px;
    height: 18px;
  }
}

/* ── Unified action buttons ──────────────────────────────────── */
.dq-action-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--dq-mobile-touch);
  padding: 0 18px;
  border: none;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
  color: #fff !important;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.32);
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  white-space: nowrap;
}

.dq-action-btn svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
}

.dq-action-btn:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
}

.dq-action-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

.dq-action-btn--ghost {
  background: #fff;
  color: #2563eb !important;
  border: 1px solid #cbd5e1;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.dq-header-actions,
.dq-header-actions-below-title,
.dq-openapi-view-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

/* ReDoc title actions — hidden until ReDoc finishes loading and actions are placed */
.dq-redoc-title-actions,
.dq-redoc-title-actions--pending {
  display: none !important;
  flex-direction: column;
  align-items: stretch;
  width: 100%;
}

.dq-redoc-title-actions.dq-redoc-title-actions--placed {
  display: flex !important;
}

.dq-redoc-title-actions .dq-action-btn,
.dq-redoc-title-actions .dq-website-btn,
.dq-redoc-title-actions .dq-mobile-back-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  flex: 1 1 auto;
  min-height: var(--dq-mobile-touch);
}

@media (min-width: 769px) {
  .dq-redoc-title-actions {
    flex-direction: row;
    align-items: center;
    width: auto;
  }

  .dq-redoc-title-actions .dq-action-btn,
  .dq-redoc-title-actions .dq-website-btn,
  .dq-redoc-title-actions .dq-mobile-back-btn {
    width: auto;
    flex: 0 1 auto;
  }
}

@media (max-width: 768px) {
  .dq-header-actions,
  .dq-header-actions-below-title,
  .dq-openapi-view-actions {
    width: 100%;
    gap: 8px;
  }

  .dq-redoc-title-actions {
    width: 100%;
    gap: 8px;
  }

  .dq-header-actions .dq-action-btn,
  .dq-header-actions-below-title:not(.dq-docs-hero-actions) .dq-action-btn,
  .dq-openapi-view-actions .dq-action-btn,
  .dq-header-actions .dq-mobile-back-btn,
  .dq-header-actions .dq-website-btn,
  .dq-header-actions-below-title:not(.dq-docs-hero-actions) .dq-mobile-back-btn,
  .dq-header-actions-below-title:not(.dq-docs-hero-actions) .dq-website-btn {
    flex: 1 1 calc(50% - 4px);
    min-width: 0;
    min-height: var(--dq-mobile-touch);
    padding: 0 12px;
    font-size: 0.8125rem;
  }

  /* Hero action buttons — handled by dq-docs-hero-actions-styles inline block */

  .dq-redoc-title-actions .dq-action-btn,
  .dq-redoc-title-actions .dq-website-btn,
  .dq-redoc-title-actions .dq-mobile-back-btn {
    width: 100%;
    flex: 1 1 auto;
    min-width: 0;
    min-height: var(--dq-mobile-touch);
    padding: 0 12px;
    font-size: 0.8125rem;
    justify-content: center;
    text-align: center;
  }

  .dq-header-actions .dq-action-btn:only-child,
  .dq-openapi-view-actions .dq-action-btn:only-child {
    flex: 1 1 100%;
  }
}

@media (max-width: 400px) {
  .dq-header-actions .dq-action-btn,
  .dq-header-actions-below-title .dq-action-btn,
  .dq-openapi-view-actions .dq-action-btn {
    flex: 1 1 100%;
  }
}

/* Legacy button classes map to action btn sizing on mobile */
@media (max-width: 768px) {
  .dq-mobile-back-btn,
  .dq-website-btn {
    min-height: var(--dq-mobile-touch);
    border-radius: 10px;
  }
}

/* ── Mobile nav drawer ───────────────────────────────────────── */
.dq-mobile-drawer {
  position: fixed;
  inset: 0;
  /* Must sit above fixed topbar (100050) and openapi action header */
  z-index: 100100;
  pointer-events: none;
  visibility: hidden;
}

.dq-mobile-drawer.dq-mobile-drawer--open {
  pointer-events: auto;
  visibility: visible;
}

.dq-mobile-drawer__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.dq-mobile-drawer--open .dq-mobile-drawer__backdrop {
  opacity: 1;
}

.dq-mobile-drawer__panel {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(320px, 88vw);
  background: #fff;
  box-shadow: 4px 0 24px rgba(15, 23, 42, 0.12);
  transform: translateX(-100%);
  transition: transform 0.28s ease;
  display: flex;
  flex-direction: column;
  padding-top: env(safe-area-inset-top, 0);
}

.dq-mobile-drawer--open .dq-mobile-drawer__panel {
  transform: translateX(0);
}

.dq-mobile-drawer__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px;
  border-bottom: 1px solid #e2e8f0;
}

.dq-mobile-drawer__head h2 {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  color: #1e293b;
}

.dq-mobile-drawer__close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}

.dq-mobile-drawer__quick {
  margin: 0;
  padding: 8px 10px 0;
  list-style: none;
  border-bottom: 1px solid #e2e8f0;
}

.dq-mobile-drawer__section-label {
  margin: 0;
  padding: 14px 18px 6px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: #64748b;
}

.dq-mobile-drawer__list {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 8px 10px 24px;
  margin: 0;
  list-style: none;
}

.dq-mobile-drawer__group {
  margin-bottom: 4px;
}

.dq-mobile-drawer__group-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
  padding: 12px 14px;
  border: none;
  border-radius: 10px;
  background: transparent;
  color: #334155;
  font-size: 0.9375rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.dq-mobile-drawer__group-toggle:hover,
.dq-mobile-drawer__group--active > .dq-mobile-drawer__group-toggle,
.dq-mobile-drawer__group--open > .dq-mobile-drawer__group-toggle {
  background: #eff6ff;
  color: #2563eb;
}

.dq-mobile-drawer__group-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dq-mobile-drawer__chevron {
  flex-shrink: 0;
  font-size: 0.75rem;
  line-height: 1;
  transition: transform 0.15s ease;
}

.dq-mobile-drawer__group--open > .dq-mobile-drawer__group-toggle .dq-mobile-drawer__chevron {
  transform: rotate(180deg);
}

.dq-mobile-drawer__sublist {
  margin: 0 0 6px;
  padding: 0 0 0 8px;
  list-style: none;
  border-left: 2px solid #e2e8f0;
  margin-left: 14px;
}

.dq-mobile-drawer__link {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 10px;
  color: #334155;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s ease, color 0.15s ease;
  line-height: 1.35;
}

.dq-mobile-drawer__link--tag {
  font-size: 0.8125rem;
  color: #64748b;
}

.dq-mobile-drawer__link--op {
  padding-top: 8px;
  padding-bottom: 8px;
}

.dq-mobile-drawer__op-label {
  flex: 1;
  min-width: 0;
}

.dq-mobile-drawer__method {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.5rem;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 0.625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  background: #64748b;
}

.dq-mobile-drawer__method--get { background: #16a34a; }
.dq-mobile-drawer__method--post { background: #2563eb; }
.dq-mobile-drawer__method--put { background: #d97706; }
.dq-mobile-drawer__method--patch { background: #ca8a04; }
.dq-mobile-drawer__method--delete { background: #dc2626; }

.dq-mobile-drawer__link:hover,
.dq-mobile-drawer__link.dq-mobile-drawer__link--active {
  background: #eff6ff;
  color: #2563eb;
}

/* ── Sticky bottom action bar ────────────────────────────────── */
.dq-mobile-bottom-bar {
  display: none;
}

@media (max-width: 768px) {
  .dq-mobile-bottom-bar {
    display: flex;
    align-items: stretch;
    gap: 6px;
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 130;
    padding: 8px 10px;
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px), 1.25rem);
    background: rgba(255, 255, 255, 0.97);
    border-top: 1px solid #e2e8f0;
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.08);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }

  .dq-mobile-bottom-bar .dq-action-btn {
    flex: 1 1 0;
    min-width: 0;
    min-height: 44px;
    padding: 0 6px;
    font-size: 0.6875rem;
    gap: 4px;
    border-radius: 10px;
  }

  .dq-mobile-bottom-bar .dq-action-btn svg {
    width: 14px;
    height: 14px;
  }

  .dq-mobile-bottom-bar .dq-action-btn span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
}

/* ── Endpoint cards (mobile) ─────────────────────────────────── */
@media (max-width: 768px) {
  #dq-docs-shell .swagger-ui .opblock-tag-section {
    margin-bottom: var(--dq-mobile-section-gap);
    border-radius: 16px;
  }

  #dq-docs-shell .swagger-ui .opblock {
    border-radius: 12px;
    margin: 8px 12px 12px;
    overflow: hidden;
  }

  #dq-docs-shell .swagger-ui .opblock .opblock-summary {
    min-height: var(--dq-mobile-touch);
    padding: 12px 14px;
  }

  #dq-docs-shell .swagger-ui .opblock-summary-method {
    min-width: 56px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-align: center;
  }

  #dq-docs-shell .swagger-ui .opblock-body {
    padding: 12px 14px;
  }

  #dq-docs-shell .swagger-ui .btn.try-out__btn {
    min-height: var(--dq-mobile-touch);
    border-radius: 10px;
  }

  .swagger-ui {
    overflow-x: hidden;
    max-width: 100%;
  }

  .swagger-ui table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
  }

  .swagger-ui img {
    max-width: 100%;
    height: auto;
  }
}

/* ── OpenAPI JSON viewer ─────────────────────────────────────── */
.dq-openapi-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 14px;
  margin-bottom: 16px;
}

.dq-openapi-toolbar .dq-action-btn {
  min-height: 44px;
  padding: 0 14px;
  font-size: 0.8125rem;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.dq-openapi-code-wrap {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x pan-y;
  overscroll-behavior-x: contain;
  border-radius: 12px;
  border: 1px solid #1e293b;
  background: #0f172a;
}

.dq-openapi-code-wrap pre {
  margin: 0;
  min-width: 0;
  padding: 14px 14px 14px 12px;
  overflow: visible;
  max-width: none;
  background: transparent;
}

.dq-openapi-code-wrap code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.8125rem;
  line-height: 1.55;
  white-space: pre;
  word-break: normal;
  color: #e2e8f0;
}

.dq-json-line {
  display: block;
  min-height: 1.55em;
  scroll-margin-top: calc(var(--dq-mobile-header-h, 56px) + 16px);
}

.dq-json-line--target {
  margin-inline: -8px;
  padding-inline: 8px;
  border-left: 3px solid #60a5fa;
  background: rgb(37 99 235 / 0.28);
}

.dq-json-key { color: #93c5fd; }
.dq-json-str { color: #86efac; }
.dq-json-num { color: #fcd34d; }
.dq-json-kw { color: #f472b6; }

.dq-openapi-linenumbers {
  position: sticky;
  left: 0;
  z-index: 1;
  box-sizing: border-box;
  min-width: calc(var(--dq-openapi-gutter-ch, 3) * 1ch + 1.25rem);
  width: auto;
  padding: 14px 10px;
  background: #1e293b;
  color: #64748b;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 0.75rem;
  font-variant-numeric: tabular-nums;
  line-height: 1.55;
  text-align: right;
  white-space: pre;
  user-select: none;
  pointer-events: none;
  overflow: visible;
  border-right: 1px solid #334155;
}

.dq-openapi-view-head {
  padding: 16px var(--dq-mobile-pad) !important;
}

.dq-openapi-content {
  padding: 0 var(--dq-mobile-pad) 24px !important;
}

@media (max-width: 768px) {
  .dq-redoc-topbar:not(.dq-mobile-topbar--inline) {
    display: none;
  }

  /* Title / actions clear the fixed topbar — no overlap */
  body.dq-openapi-page {
    padding-top: calc(var(--dq-mobile-header-h) + env(safe-area-inset-top, 0px)) !important;
    padding-bottom: calc(var(--dq-mobile-bottom-h) + max(env(safe-area-inset-bottom, 0px), 1.5rem)) !important;
  }

  .dq-openapi-fixed-header {
    position: relative !important;
    top: auto !important;
    z-index: 1;
    box-shadow: none;
  }

  .dq-openapi-view-title {
    margin-top: 4px !important;
    padding-top: 0 !important;
    font-size: 1.0625rem !important;
  }

  .dq-openapi-view-head {
    padding-top: 12px !important;
    padding-bottom: 16px !important;
  }

  .dq-openapi-toolbar {
    gap: 10px;
    margin-top: 12px;
    margin-bottom: 8px;
  }

  .dq-openapi-toolbar .dq-action-btn {
    flex: 1 1 calc(50% - 5px);
    min-width: 0;
    justify-content: center;
  }

  .dq-openapi-content {
    padding-top: 12px !important;
    padding-bottom: 20px !important;
  }

  .dq-openapi-code-wrap code {
    font-size: 0.75rem;
  }

  /* ReDoc: keep content clear of fixed chrome */
  body:has(redoc) {
    padding-bottom: calc(var(--dq-mobile-bottom-h) + max(env(safe-area-inset-bottom, 0px), 1.5rem)) !important;
  }

  redoc {
    --redoc-mobile-pad: var(--dq-mobile-pad);
  }

  .dq-mobile-bottom-bar {
    padding-bottom: max(8px, env(safe-area-inset-bottom, 0px), 1.25rem);
  }
}

/* ── Enterprise documentation polish (presentation only) ───── */
:root {
  --dq-docs-control-h: 42px;
  --dq-docs-focus: 0 0 0 3px rgb(37 99 235 / 0.2);
  --dq-docs-soft-shadow: 0 1px 2px rgb(15 23 42 / 0.04), 0 10px 30px rgb(15 23 42 / 0.06);
  --dq-docs-menu-shadow: 0 24px 70px rgb(15 23 42 / 0.24), 0 6px 20px rgb(15 23 42 / 0.1);
}

:where(
  .dq-mobile-topbar,
  .dq-mobile-drawer,
  .dq-openapi-page,
  #dq-docs-shell
) :where(a, button, input, select, textarea):focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  box-shadow: var(--dq-docs-focus);
}

.dq-mobile-topbar {
  border-color: rgb(226 232 240 / 0.88);
  background: rgb(255 255 255 / 0.9);
  box-shadow: 0 1px 0 rgb(15 23 42 / 0.045);
  backdrop-filter: blur(16px) saturate(150%);
  -webkit-backdrop-filter: blur(16px) saturate(150%);
}

.dq-mobile-topbar__menu,
.dq-mobile-drawer__close {
  transition:
    color 200ms ease,
    background-color 200ms ease,
    border-color 200ms ease,
    box-shadow 200ms ease,
    transform 200ms ease;
}

@media (hover: hover) {
  .dq-mobile-topbar__menu:hover,
  .dq-mobile-drawer__close:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #1d4ed8;
    transform: translateY(-1px);
  }
}

.dq-mobile-drawer__panel {
  border-right: 1px solid rgb(226 232 240 / 0.92);
  box-shadow: var(--dq-docs-menu-shadow);
}

.dq-mobile-drawer__head {
  background: rgb(255 255 255 / 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.dq-mobile-drawer__group-toggle,
.dq-mobile-drawer__link {
  transition:
    color 200ms ease,
    background-color 200ms ease,
    box-shadow 200ms ease,
    transform 200ms ease;
}

.dq-mobile-drawer__link--op:hover {
  transform: translateX(2px);
}

.dq-action-btn,
.dq-website-btn,
.dq-mobile-back-btn {
  min-height: var(--dq-docs-control-h);
  border-radius: 11px;
  font-weight: 600;
  transition:
    filter 200ms ease,
    transform 200ms ease,
    box-shadow 200ms ease,
    border-color 200ms ease;
}

@media (hover: hover) {
  .dq-action-btn:hover,
  .dq-website-btn:hover,
  .dq-mobile-back-btn:hover {
    transform: translateY(-1px);
  }
}

.dq-openapi-code-wrap {
  border-color: #26354d;
  border-radius: 16px;
  box-shadow: 0 16px 44px rgb(15 23 42 / 0.16);
}

.dq-openapi-code-wrap pre {
  scrollbar-color: rgb(100 116 139 / 0.75) transparent;
  scrollbar-width: thin;
}

.dq-json-line--target {
  border-left-color: #60a5fa;
  background: linear-gradient(90deg, rgb(37 99 235 / 0.34), rgb(37 99 235 / 0.12));
}

@media (prefers-reduced-motion: reduce) {
  .dq-docs-mobile *,
  .dq-docs-mobile *::before,
  .dq-docs-mobile *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
