*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* Typography */
h1 {
  font-size: var(--font-size-2xl);
  font-weight: 700;
}
h2 {
  font-size: var(--font-size-xl);
  font-weight: 600;
}
h3 {
  font-size: var(--font-size-lg);
  font-weight: 600;
}
h4 {
  font-size: var(--font-size-md);
  font-weight: 600;
}
h5,
h6 {
  font-size: var(--font-size-base);
  font-weight: 600;
}

p {
  line-height: 1.6;
}

a {
  color: var(--color-accent);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

code,
pre,
.mono {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
}

pre {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--space-md);
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--color-text);
  max-height: 400px;
  overflow-y: auto;
}

code {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border-light);
  border-radius: var(--radius-sm);
  padding: 1px 5px;
  color: var(--color-text);
}

/* Utility classes */
.hidden {
  display: none !important;
}
.text-muted {
  color: var(--color-text-muted);
}
.text-secondary {
  color: var(--color-text-secondary);
}
.text-success {
  color: var(--color-success);
}
.text-danger {
  color: var(--color-danger);
}
.text-warning {
  color: var(--color-warning);
}
.text-info {
  color: var(--color-info);
}
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}
.text-mono {
  font-family: var(--font-mono);
  font-size: var(--font-size-sm);
}
.fw-bold {
  font-weight: 700;
}
.fw-semibold {
  font-weight: 600;
}

.flex {
  display: flex;
}
.flex-col {
  flex-direction: column;
}
.flex-wrap {
  flex-wrap: wrap;
}
.items-center {
  align-items: center;
}
.justify-between {
  justify-content: space-between;
}
.justify-end {
  justify-content: flex-end;
}
.gap-sm {
  gap: var(--space-sm);
}
.gap-md {
  gap: var(--space-md);
}
.gap-lg {
  gap: var(--space-lg);
}

.mt-sm {
  margin-top: var(--space-sm);
}
.mt-md {
  margin-top: var(--space-md);
}
.mt-lg {
  margin-top: var(--space-lg);
}
.mb-sm {
  margin-bottom: var(--space-sm);
}
.mb-md {
  margin-bottom: var(--space-md);
}
.mb-lg {
  margin-bottom: var(--space-lg);
}

.p-md {
  padding: var(--space-md);
}
.p-lg {
  padding: var(--space-lg);
}

.w-full {
  width: 100%;
}

.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-lg) 0;
}

/* Page heading */
.page-header {
  margin-bottom: var(--space-lg);
  border-bottom: 1px solid var(--color-border);
  padding-bottom: var(--space-md);
}
.page-header h2 {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}
.page-subtitle {
  color: var(--color-text-secondary);
  margin-top: var(--space-xs);
  font-size: var(--font-size-sm);
}

/* Endpoint reference pill */
.endpoint-ref {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  font-family: var(--font-mono);
  font-size: var(--font-size-xs);
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: 2px 10px;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}
.endpoint-ref .method {
  font-weight: 700;
  color: var(--color-accent);
}

/* Section label */
.section-label {
  font-size: var(--font-size-xs);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-text-secondary);
  margin-bottom: var(--space-sm);
}

/* Empty state */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  color: var(--color-text-muted);
  gap: var(--space-md);
}
.empty-state .empty-icon {
  font-size: 48px;
}
.empty-state p {
  font-size: var(--font-size-md);
}

/* Loading spinner */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
.spinner.spinner-lg {
  width: 36px;
  height: 36px;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.loading-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl);
  gap: var(--space-md);
  color: var(--color-text-secondary);
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--color-surface-2);
}
::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--color-text-muted);
}

/* Result block */
.result-block {
  margin-top: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.result-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-sm) var(--space-md);
  background: var(--color-surface-2);
  border-bottom: 1px solid var(--color-border);
  font-weight: 600;
  font-size: var(--font-size-sm);
}
.result-block pre {
  border: none;
  border-radius: 0;
  margin: 0;
}
