/* ===== Kaptl Swagger UI polish + clean Schemas tables ===== */
:root {
  --k-brand: #3b4ec7;   /* indigo, matches site primary */
  --k-purple: #748cfc;  /* Kaptl brand purple */
  --k-ink: #1b2136;
  --k-muted: #6c6f8a;
  --k-line: #e6e8f0;
  --k-tint: #f6f7fc;
}

html, body { background: #fff; }
.swagger-ui .wrapper { padding: 0 16px; }

/* Hide Swagger's native (messy, nested) Schemas/Models section — we render our
   own clean tables from the same spec via schema-tables.js. */
.swagger-ui section.models { display: none !important; }

/* ===== Clean schema tables (injected by schema-tables.js) ===== */
.kaptl-schemas {
  max-width: 1460px;
  margin: 4px auto 48px;
  padding: 0 20px;
  font-family: "Play", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--k-ink);
}
.kaptl-schemas__h {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--k-ink);
  margin: 8px 0 6px;
}
.kaptl-schemas__h span {
  font-size: .82rem;
  font-weight: 700;
  color: #fff;
  background: var(--k-brand);
  border-radius: 999px;
  padding: 1px 11px;
  vertical-align: middle;
  margin-left: 8px;
}
.kaptl-schemas__filter {
  width: 100%;
  max-width: 340px;
  margin: 4px 0 18px;
  padding: 9px 13px;
  border: 1px solid var(--k-line);
  border-radius: 9px;
  font-size: .9rem;
  color: var(--k-ink);
  background: #fff;
}
.kaptl-schemas__filter:focus {
  outline: none;
  border-color: var(--k-purple);
  box-shadow: 0 0 0 3px rgba(116, 140, 252, .18);
}
.kaptl-schemas__list { display: flex; flex-direction: column; gap: 10px; }

.kaptl-schema {
  border: 1px solid var(--k-line);
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.kaptl-schema[open] { box-shadow: 0 1px 3px rgba(16, 24, 40, .05); }
.kaptl-schema > summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  font-weight: 800;
  color: var(--k-brand);
}
.kaptl-schema > summary::-webkit-details-marker { display: none; }
.kaptl-schema > summary::after {
  content: "\203A";
  margin-left: auto;
  color: var(--k-purple);
  font-size: 1.4rem;
  line-height: 1;
  transition: transform .15s ease;
}
.kaptl-schema[open] > summary::after { transform: rotate(90deg); }
.kaptl-schema > summary:hover { background: rgba(116, 140, 252, .06); }
.kaptl-schema__name { font-size: 1rem; }
.kaptl-schema__count {
  font-size: .7rem;
  font-weight: 600;
  color: var(--k-muted);
  background: var(--k-tint);
  border: 1px solid var(--k-line);
  border-radius: 999px;
  padding: 2px 9px;
}
.kaptl-schema__desc { margin: 0; padding: 10px 16px 0; color: var(--k-muted); font-size: .85rem; line-height: 1.5; }
.kaptl-schema__empty { padding: 8px 16px 14px; color: var(--k-muted); font-style: italic; }

.kaptl-schema__scroll { overflow-x: auto; padding: 12px 16px 16px; }
.kaptl-schema__table { width: 100%; border-collapse: collapse; font-size: .86rem; }
.kaptl-schema__table th {
  text-align: left;
  font-weight: 700;
  color: var(--k-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  font-size: .67rem;
  padding: 6px 10px;
  border-bottom: 2px solid var(--k-line);
  white-space: nowrap;
}
.kaptl-schema__table td { padding: 7px 10px; border-bottom: 1px solid var(--k-line); vertical-align: top; }
.kaptl-schema__table tr:last-child td { border-bottom: 0; }
.kaptl-schema__table tbody tr:hover td { background: var(--k-tint); }
.kaptl-schema__table code {
  font-family: "Roboto Mono", ui-monospace, monospace;
  font-size: .82em;
  background: var(--k-tint);
  border: 1px solid var(--k-line);
  border-radius: 5px;
  padding: 1px 5px;
}
.kaptl-schema__table .f-name code { color: var(--k-ink); font-weight: 700; background: #fff; border-color: transparent; padding-left: 0; }
.kaptl-schema__table .f-type code { color: var(--k-purple); }
.kaptl-schema__table .f-req { text-align: center; white-space: nowrap; }
.kaptl-schema__table .f-req .yes { color: #12855f; font-weight: 800; }
.kaptl-schema__table .f-desc { color: var(--k-muted); line-height: 1.45; min-width: 240px; }
.kaptl-schema__table .f-desc code { color: var(--k-brand); }
