:root {
  --ink: #1f2933;
  --muted: #52606d;
  --line: #d9e2ec;
  --surface: #ffffff;
  --page: #f5f7fa;
  --accent: #0070c0;
  --accent-ink: #ffffff;
  --ok: #0a7c3e;
  --warn: #9a5b00;
  --error: #b42318;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* Same width and gutter as Swagger UI's own .wrapper, so the page reads as one column. */
.wrap { max-width: 1460px; margin: 0 auto; padding: 0 20px; }

.topbar { background: #1b2733; color: #fff; }
.topbar-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 56px; flex-wrap: wrap; }
.brand { font-weight: 700; font-size: 18px; display: flex; align-items: center; gap: 10px; }
.badge { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: #2f4254; color: #d9e2ec; }
.topbar nav { display: flex; gap: 18px; }
.topbar nav a { color: #bcccdc; text-decoration: none; font-size: 14px; }
.topbar nav a:hover { color: #fff; text-decoration: underline; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px 24px;
  margin: 20px 0;
}
.card h1 { font-size: 22px; margin: 0 0 8px; }
.card h2 { font-size: 16px; margin: 0 0 8px; }
.card ol { margin: 0; padding-left: 20px; line-height: 1.6; font-size: 14px; }
.card code { font-family: var(--mono); font-size: 13px; background: #f0f4f8; padding: 1px 4px; border-radius: 3px; white-space: nowrap; }
.lead { color: var(--muted); font-size: 15px; line-height: 1.55; max-width: 110ch; margin: 0 0 16px; }
.note { color: var(--muted); font-size: 14px; margin: 8px 0 0; }

.columns { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
@media (max-width: 800px) { .columns { grid-template-columns: 1fr; } }

.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.toggle { font-size: 14px; display: flex; align-items: center; gap: 6px; cursor: pointer; }

.status { min-height: 20px; margin: 8px 0 12px; font-size: 14px; color: var(--muted); }
.status.ok { color: var(--ok); }
.status.warn { color: var(--warn); }
.status.error { color: var(--error); }

.field label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.field textarea {
  width: 100%;
  min-height: 150px;
  resize: vertical;
  font-family: var(--mono);
  font-size: 13px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--ink);
  background: #fbfcfd;
}
.field textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; }

.actions { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.actions button {
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 6px;
  border: 1px solid var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
  cursor: pointer;
}
.actions button.secondary { background: transparent; color: var(--accent); }
.actions button:disabled { opacity: 0.45; cursor: not-allowed; }

details { margin-top: 16px; font-size: 14px; }
details summary { cursor: pointer; font-weight: 600; }
details pre {
  font-family: var(--mono);
  font-size: 12px;
  background: #f0f4f8;
  border-radius: 6px;
  padding: 12px;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
}

/* Keep Swagger UI's API overview; its title and links repeat the header above. */
#swagger-ui .info { margin: 10px 0 20px; }
#swagger-ui .info hgroup.main,
#swagger-ui .info__tos,
#swagger-ui .info__contact,
#swagger-ui .info__license { display: none; }
/* Sit the Authorize bar on the page background, like the cards, rather than a white band. */
#swagger-ui .scheme-container { background: transparent; box-shadow: none; padding: 0 0 8px; margin: 0; }

/* Wide schema boxes scroll inside their section instead of widening the page on phones. */
#swagger-ui section.models { overflow-x: auto; }
