:root {
  --bg: #0f172a;
  --surface: #111c33;
  --surface-alt: #172542;
  --border: #253659;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --accent: #38bdf8;
  --accent-strong: #0284c7;
  --ok: #22c55e;
  --warn: #f59e0b;
  --err: #f87171;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.topbar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.5rem;
}

.brand {
  display: flex;
  align-items: baseline;
  gap: 0.65rem;
}

.brand-mark {
  font-family: var(--mono);
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
}

.brand-sub {
  font-size: 0.9rem;
  color: var(--muted);
}

.nav-links {
  display: flex;
  gap: 1rem;
}

.nav-link {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 500;
}

.nav-link.active,
.nav-link:hover {
  color: var(--text);
}

.status-strip {
  background: #0b1222;
  border-bottom: 1px solid var(--border);
  padding: 0.55rem 0;
}

.status-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.status-items {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-family: var(--mono);
  border: 1px solid var(--border);
  background: var(--surface);
}

.pill-ok {
  border-color: rgba(34, 197, 94, 0.45);
  color: #86efac;
}

.pill-warn {
  border-color: rgba(245, 158, 11, 0.5);
  color: #fcd34d;
}

.pill-muted {
  color: var(--muted);
}

.layout {
  display: grid;
  grid-template-columns: minmax(320px, 460px) minmax(0, 1fr);
  gap: 1.25rem;
  padding-top: 1.25rem;
  padding-bottom: 2rem;
}

.docs-layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
  padding-top: 1.25rem;
  padding-bottom: 2rem;
}

@media (max-width: 920px) {
  .layout {
    grid-template-columns: 1fr;
  }
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.15rem;
}

.panel-header h1,
.panel-header h2 {
  margin: 0 0 0.25rem;
  font-size: 1.15rem;
}

.muted {
  color: var(--muted);
  margin: 0;
  font-size: 0.88rem;
}

.form-grid {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.field-full {
  grid-column: 1 / -1;
}

label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  background: var(--surface-alt);
  color: var(--text);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.45rem 0.6rem;
  font-size: 0.9rem;
  font-family: var(--mono);
}

input:focus,
select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.hint {
  font-size: 0.76rem;
  color: var(--muted);
}

.toggles {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem 0.75rem;
}

.toggles legend {
  font-size: 0.8rem;
  color: var(--muted);
  padding: 0 0.35rem;
}

.check {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  font-weight: 500;
  font-size: 0.84rem;
}

.actions {
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  border: 1px solid transparent;
  padding: 0.55rem 0.95rem;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-sm {
  padding: 0.3rem 0.65rem;
  font-size: 0.8rem;
}

.btn-primary {
  background: var(--accent-strong);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent);
  color: #0b1222;
}

.btn-secondary {
  background: var(--surface-alt);
  border-color: var(--border);
  color: var(--text);
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--muted);
}

.btn-ghost:hover,
.btn-secondary:hover {
  color: var(--text);
  border-color: var(--accent);
}

.btn-group {
  display: flex;
  gap: 0.45rem;
}

.error-text {
  color: var(--err);
  font-size: 0.84rem;
}

.output-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.output-header {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.stats-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.stat-chip {
  font-family: var(--mono);
  font-size: 0.76rem;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 0.15rem 0.45rem;
  color: var(--muted);
}

.code-box {
  margin: 0;
  background: #0b1222;
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.85rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  overflow-x: auto;
  white-space: pre;
}

.code-output {
  min-height: 280px;
  max-height: 480px;
  overflow-y: auto;
}

.code-cmd {
  white-space: pre-wrap;
  word-break: break-all;
}

.code-spec {
  max-height: 520px;
  overflow-y: auto;
}

.command-block {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.command-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.command-header h3 {
  margin: 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.endpoints-list {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  margin-top: 0.9rem;
}

.endpoint-card {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 0.75rem 0.9rem;
  background: var(--surface-alt);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
}

.endpoint-main {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.method-badge {
  font-family: var(--mono);
  font-size: 0.75rem;
  font-weight: 700;
  padding: 0.18rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
}

.method-get {
  background: rgba(56, 189, 248, 0.2);
  color: #7dd3fc;
}

.method-post {
  background: rgba(34, 197, 94, 0.2);
  color: #86efac;
}

.method-delete {
  background: rgba(248, 113, 113, 0.2);
  color: #fca5a5;
}

.method-put {
  background: rgba(245, 158, 11, 0.2);
  color: #fcd34d;
}

.endpoint-path {
  font-family: var(--mono);
  font-size: 0.88rem;
  color: var(--text);
}

.endpoint-summary {
  font-size: 0.84rem;
  color: var(--muted);
}

.footer {
  border-top: 1px solid var(--border);
  padding: 1rem 0 2rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.footer p {
  margin: 0;
}
