* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: 'Segoe UI', Arial, sans-serif;
  background: #080b10;
  color: #e2e8f0;
  line-height: 1.7;
  font-size: 14px;
}

/* ── Sidebar layout (same structure as the dashboard's own Layout.tsx) ── */
html, body { height: 100%; }
.app { display: flex; height: 100vh; }

.sidebar {
  width: 240px;
  flex-shrink: 0;
  background: #0d1117;
  border-right: 1px solid #1e2a38;
  display: flex;
  flex-direction: column;
  padding: 24px 16px;
  gap: 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: transparent transparent;
}
.sidebar:hover,
.sidebar:focus-within {
  scrollbar-color: #2d3148 transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-button { display: none; width: 0; height: 0; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: transparent; border-radius: 3px; }
.sidebar:hover::-webkit-scrollbar-thumb,
.sidebar:focus-within::-webkit-scrollbar-thumb { background: #2d3148; }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 8px 16px;
  border-bottom: 1px solid #1e2a38;
  text-decoration: none;
}
.sidebar-logo img { height: 28px; width: auto; display: block; }

.sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.tab-btn {
  font-family: monospace;
  font-size: 12.5px;
  text-align: left;
  padding: 9px 12px;
  border-radius: 6px;
  cursor: pointer;
  border: none;
  background: none;
  color: #8899aa;
  transition: background 0.15s, color 0.15s;
  white-space: nowrap;
}
.tab-btn:hover { background: #1a2233; color: #e2e8f0; }
.tab-btn.active { background: #a78bfa1a; color: #a78bfa; font-weight: 700; }
.tab-btn:disabled { opacity: 0.3; cursor: default; }
.tab-btn:disabled:hover { background: none; color: #8899aa; }

.sidebar-bottom {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid #1e2a38;
}
.sidebar-bottom a {
  font-family: monospace;
  font-size: 11px;
  color: #4a5568;
  text-decoration: none;
}
.sidebar-bottom a:hover { color: #a78bfa; }

/* ── Page layout ── */
.content { flex: 1; overflow-y: auto; overflow-x: hidden; min-width: 0; }
.page { max-width: 900px; margin: 0 auto; padding: 32px 48px 64px; overflow-x: hidden; }

.tab-panel { display: none; }
.tab-panel.active { display: block; }

/* ── Mobile topbar + menu toggle (hidden on desktop) ──
   The toggle lives inside a solid, fixed topbar rather than
   floating alone over the scrollable content — otherwise it
   visually collides with whatever text scrolls underneath it. ── */
.mobile-topbar {
  display: none;
  align-items: center;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: #0d1117;
  border-bottom: 1px solid #1e2a38;
  padding: 0 14px;
  z-index: 50;
}
.menu-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  gap: 5px;
  flex-direction: column;
  width: 36px;
  height: 36px;
  background: transparent;
  border: 1px solid #2d3148;
  border-radius: 6px;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
}
.menu-toggle span {
  display: block;
  width: 16px;
  height: 1.5px;
  background: #8899aa;
  border-radius: 2px;
  transition: transform 0.2s, opacity 0.2s;
}
.menu-toggle.open span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.menu-toggle.open span:nth-child(2) { opacity: 0; }
.menu-toggle.open span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 39;
}
.sidebar-overlay.open { display: block; }

.panel-header {
  padding: 32px 0 28px;
  border-bottom: 1px solid #1e2a38;
  margin-bottom: 32px;
}
.panel-header h1 {
  font-size: 26px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 8px;
}
.panel-header p {
  color: #8899aa;
  font-size: 14px;
}

.section { margin-bottom: 40px; }
.section h2 {
  font-size: 18px;
  font-weight: 700;
  color: #f1f5f9;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section h2 .section-num {
  font-family: monospace;
  font-size: 12px;
  color: #a78bfa;
  background: #a78bfa1a;
  border: 1px solid #a78bfa44;
  border-radius: 4px;
  padding: 2px 7px;
}
.section p { margin-bottom: 12px; color: #c3ccd6; }
.section ul, .section ol { margin: 0 0 12px 20px; color: #c3ccd6; }
.section li { margin-bottom: 6px; }

code {
  font-family: 'JetBrains Mono', monospace;
  background: #131820;
  border: 1px solid #232b38;
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 13px;
  color: #ffd166;
}

pre {
  font-family: 'JetBrains Mono', monospace;
  background: #0d1117;
  border: 1px solid #232b38;
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13px;
  color: #c3ccd6;
  margin-bottom: 14px;
}

table { width: 100%; border-collapse: collapse; margin-bottom: 16px; }
th, td {
  text-align: left;
  padding: 9px 12px;
  border-bottom: 1px solid #1e2a38;
  font-size: 13px;
}
th { color: #8899aa; font-weight: 600; font-family: monospace; font-size: 11px; text-transform: uppercase; letter-spacing: 0.4px; }
td { color: #c3ccd6; }
td code { white-space: nowrap; }

.callout {
  border-radius: 8px;
  padding: 14px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}
.callout .icon { flex-shrink: 0; font-size: 15px; }
.callout-info    { background: #0c1a2e; border: 1px solid #1d3a5f; color: #93c5fd; }
.callout-warn    { background: #1c1500; border: 1px solid #6b4e00; color: #fbbf24; }
.callout-danger  { background: #1c0a0a; border: 1px solid #6b1414; color: #f87171; }

.badge {
  display: inline-block;
  font-family: monospace;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.3px;
}
.badge-get    { background: #0c1a2e; color: #60a5fa; }
.badge-post   { background: #0c2e14; color: #4ade80; }
.badge-put    { background: #2e2600; color: #fbbf24; }
.badge-delete { background: #2e0c0c; color: #f87171; }
.badge-patch  { background: #1e0c2e; color: #c084fc; }
/* License-status badges — reuse the same GET/PUT/DELETE color pairs above */
.badge-valid   { background: #0c2e14; color: #4ade80; }
.badge-warning { background: #2e2600; color: #fbbf24; }
.badge-expired { background: #2e0c0c; color: #f87171; }

/* Small text utility classes — replace inline style="" attributes so
   style-src can drop 'unsafe-inline' in the site's CSP (_headers).
   .h2-tight and .list-tight use the qualified compound selector (not
   just the bare class) because ".section h2" / ".section ul" above
   have higher specificity (2 classes) and would otherwise win
   regardless of source order. */
.section h2.h2-tight { font-size: 15px; margin-top: 24px; }
.link-accent { color: #a78bfa; }
.section ul.list-tight { margin-top: 8px; }
.no-margin-top { margin-top: 0; }

/* Endpoint detail — expandable request/response */
.endpoint {
  border: 1px solid #1e2a38;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
.endpoint summary {
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  list-style: none;
  background: #0d1117;
  font-size: 13px;
}
.endpoint summary::-webkit-details-marker { display: none; }
.endpoint summary::before {
  content: '+';
  font-family: monospace;
  color: #a78bfa;
  width: 14px;
  flex-shrink: 0;
}
.endpoint[open] summary::before { content: '−'; }
.endpoint summary .ep-desc { color: #8899aa; }
.endpoint-body { padding: 12px 14px 14px 38px; border-top: 1px solid #1e2a38; }
.endpoint-body p { font-size: 13px; margin-bottom: 8px; }
.endpoint-body pre { margin-bottom: 8px; font-size: 12px; }

/* ── Responsive — narrow viewports (tablet/phone) ──
   Same pattern as the rest of the site's own mobile nav
   (nav-hamburger / nav-mobile-menu in pqproxy-onprem-app):
   sidebar hidden entirely, a ☰ button reveals it as an overlay
   above the content — never squeezed into a horizontal strip.
   This block is placed last in the stylesheet on purpose so its
   rules win the cascade over the base (non-media) rules above,
   which share the same selector specificity. ── */
@media (max-width: 860px) {
  .mobile-topbar { display: flex; }
  .menu-toggle { display: flex; }
  .app { display: block; height: auto; min-height: 100vh; padding-top: 56px; }
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 260px;
    max-width: 80vw;
    z-index: 40;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .content { overflow-x: auto; }
  .page { padding: 24px 20px 48px; }
}

@media (max-width: 480px) {
  .page { padding: 16px 14px 40px; }
  pre { font-size: 12px; }
}
