:root {
  --docs-bg: #f3f6fa;
  --docs-surface: #ffffff;
  --docs-primary: #0097ff;
  --docs-primary-dark: #0076c9;
  --docs-primary-soft: #e6f4ff;
  --docs-text: #18253d;
  --docs-muted: #63708a;
  --docs-border: #dce8f5;
  --docs-header-height: 48px;
  --docs-sidebar-width: 280px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, Arial, sans-serif;
  background: var(--docs-bg);
  color: var(--docs-text);
}

a {
  color: inherit;
}

.docs-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ───── Header ───── */

.docs-header {
  height: var(--docs-header-height);
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 0 24px;
  background: var(--docs-primary);
  color: #ffffff;
  flex-shrink: 0;
  position: sticky;
  top: 0;
  z-index: 100;
}

.docs-header__brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.docs-header__eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.78;
}

.sympla-logo {
  width: 100px;
  height: 42px;
  display: block;
}

.sympla-logo--footer {
  width: 96px;
  height: 40px;
}

.docs-header__nav {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.docs-header__nav a {
  color: #ffffff;
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  opacity: 0.95;
}

.docs-header__nav a:hover {
  text-decoration: underline;
}

/* ───── Body (sidebar + main) ───── */

.docs-body {
  display: flex;
  width: 100%;
  min-height: calc(100vh - var(--docs-header-height));
  flex: 1;
  background: linear-gradient(
    to right,
    var(--docs-surface) var(--docs-sidebar-width),
    var(--docs-bg) var(--docs-sidebar-width)
  );
}

.docs-page--standalone .docs-body {
  background: var(--docs-bg);
}

/* ───── Sidebar ───── */

.docs-sidebar {
  width: var(--docs-sidebar-width);
  flex-shrink: 0;
  position: sticky;
  top: var(--docs-header-height);
  height: calc(100vh - var(--docs-header-height));
  overflow-y: auto;
  background: var(--docs-surface);
  border-right: 1px solid #e5e7eb;
}

  .docs-sidebar__inner {
    padding: 0 0 20px;
  }

  .docs-sidebar__section-title {
    font-size: 14px;
    padding: 12px 12px 10px;
  }

  .docs-sidebar__link {
    padding: 7px 12px;
  }

  .docs-sidebar__title {
    padding: 12px 12px 10px;
  }

.docs-sidebar__title {
  margin: 0;
  padding: 14px 16px 12px;
  font-size: 10px;
  font-weight: 700;
  color: #9ca3af;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  border-bottom: 1px solid #e5e7eb;
}

.docs-main.docs-main--breaking-changes {
  padding: 48px 56px 64px;
}

.breaking-changes-page {
  max-width: 920px;
  margin: 0 auto;
  color: var(--docs-text);
}

.breaking-changes-page__eyebrow {
  margin: 0 0 10px;
  color: var(--docs-primary);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.breaking-changes-page h1 {
  margin: 0;
  color: var(--docs-text);
  font-size: 34px;
}

.breaking-changes-page__summary {
  max-width: 720px;
  margin: 14px 0 34px;
  color: var(--docs-muted);
  font-size: 16px;
  line-height: 1.6;
}

.breaking-changes-entry {
  margin-top: 24px;
  padding: 26px 30px;
  border: 1px solid #dbe3ec;
  border-radius: 12px;
  background: #fff;
}

.breaking-changes-entry h2 {
  margin: 0 0 14px;
  color: var(--docs-text);
  font-size: 22px;
}

.breaking-changes-entry p,
.breaking-changes-entry li {
  color: var(--docs-muted);
  line-height: 1.65;
}

.breaking-changes-entry code {
  color: #7c3aed;
  font-weight: 600;
}

.docs-sidebar__nav {
  display: flex;
  flex-direction: column;
}

.docs-sidebar__section {
  display: flex;
  flex-direction: column;
}

.docs-sidebar__section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 0;
  padding: 13px 16px 12px;
  font-size: 15px;
  font-weight: 700;
  color: #111827;
  border-bottom: 1px solid #e5e7eb;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  user-select: none;
}

.docs-sidebar__section-title::after {
  content: "⌃";
  font-size: 13px;
  line-height: 1;
  color: #9ca3af;
  flex-shrink: 0;
  margin-left: 8px;
  display: inline-block;
  transition: transform 0.2s ease;
}

.docs-sidebar__section-title--collapsed::after {
  transform: rotate(180deg);
}

.docs-sidebar__links {
  display: flex;
  flex-direction: column;
  padding: 6px 0;
}

.docs-sidebar__link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px;
  text-decoration: none;
  border-left: 3px solid transparent;
  transition: background-color 0.12s ease, border-color 0.12s ease;
}

.docs-sidebar__link:hover {
  background: #f4f9ff;
}

.docs-sidebar__link--active {
  background: #e7f1fb;
  border-left-color: #0097ff;
}

.docs-sidebar__method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 18px;
  padding: 0 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
  line-height: 1;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.docs-sidebar__method--get    { background: #2f80ed; }
.docs-sidebar__method--post   { background: #27ae60; }
.docs-sidebar__method--put    { background: #f2994a; }
.docs-sidebar__method--delete { background: #eb5757; }
.docs-sidebar__method--patch  { background: #9b51e0; }
.docs-sidebar__method--head,
.docs-sidebar__method--options { background: #64748b; }

.docs-sidebar__content {
  display: flex;
  flex: 1;
  min-width: 0;
  flex-direction: column;
}

.docs-sidebar__label {
  color: #374151;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.docs-sidebar__meta {
  display: none;
}

/* ───── Main content ───── */

.docs-main {
  flex: 1;
  min-width: 0;
  padding: 28px 0 64px;
}

.docs-main--changelog {
  padding: 32px 40px 64px;
}

.changelog-page {
  width: min(1040px, 100%);
  margin: 0 auto;
}

.changelog-page__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--docs-border);
}

.changelog-page__eyebrow {
  margin: 0 0 8px;
  color: var(--docs-primary-dark);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.changelog-page h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.1;
}

.changelog-page__summary {
  margin: 10px 0 0;
  color: var(--docs-muted);
  font-size: 15px;
  line-height: 1.6;
}

.changelog-page__page-size {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--docs-muted);
  font-size: 13px;
  font-weight: 600;
}

.changelog-page__page-size select {
  min-width: 150px;
  padding: 10px 12px;
  border: 1px solid var(--docs-border);
  border-radius: 10px;
  background: var(--docs-surface);
  color: var(--docs-text);
  font: inherit;
}

.changelog-page__notice {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
  padding: 14px 18px;
  border: 1px solid var(--docs-border);
  border-radius: 14px;
  background: var(--docs-surface);
}

.changelog-page__notice-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: #111827;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
}

.changelog-page__notice p {
  margin: 0;
  color: var(--docs-text);
  font-size: 15px;
  line-height: 1.5;
}

.changelog-page__error {
  margin: 0;
  padding: 18px 20px;
  border: 1px solid #ffd2d2;
  border-radius: 12px;
  background: #fff3f3;
  color: #9f2d2d;
}

.changelog-list {
  display: flex;
  flex-direction: column;
}

.changelog-entry {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 28px;
  padding: 28px 0;
  border-bottom: 1px solid var(--docs-border);
}

.changelog-entry__meta {
  color: var(--docs-muted);
  font-size: 14px;
  font-weight: 600;
}

.changelog-entry__content {
  min-width: 0;
}

.changelog-entry__title-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}

.changelog-entry__title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
}

.changelog-entry__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.changelog-entry__badge--breaking {
  background: #fff0eb;
  color: #d14a1f;
}

.changelog-entry__badge--planned {
  background: #f3ecff;
  color: #6f42c1;
}

.changelog-entry__badge--update {
  background: var(--docs-primary-soft);
  color: var(--docs-primary-dark);
}

.changelog-entry__summary {
  margin: 0 0 14px;
  color: var(--docs-text);
  font-size: 15px;
  line-height: 1.6;
}

.changelog-entry__details {
  margin: 0 0 18px;
  padding-left: 20px;
  color: var(--docs-text);
  font-size: 15px;
  line-height: 1.7;
}

.changelog-entry__details li + li {
  margin-top: 8px;
}

.changelog-entry__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.changelog-entry__tag {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 8px;
  background: #111827;
  color: #ffffff;
  font-size: 12px;
  font-weight: 700;
}

.changelog-pagination {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 28px;
}

.changelog-pagination__button,
.changelog-pagination__page {
  min-width: 40px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--docs-border);
  border-radius: 10px;
  background: var(--docs-surface);
  color: var(--docs-text);
  font: inherit;
  cursor: pointer;
}

.changelog-pagination__button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.changelog-pagination__pages {
  display: flex;
  align-items: center;
  gap: 8px;
}

.changelog-pagination__page--active {
  background: var(--docs-primary);
  border-color: var(--docs-primary);
  color: #ffffff;
}

#swagger-ui {
  max-width: 932px;
  margin: 0 auto;
  width: 100%;
  padding: 0 32px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

/* ───── Swagger overrides ───── */

.swagger-ui .wrapper {
  max-width: none;
  padding: 0;
}

.swagger-ui .info {
  margin: 0 0 28px;
}

.swagger-ui .info .title,
.swagger-ui .opblock-tag,
.swagger-ui .opblock .opblock-summary-path,
.swagger-ui a.nostyle {
  color: var(--docs-text);
}

.swagger-ui .info .title {
  font-size: 28px;
}

.swagger-ui .info p,
.swagger-ui .info li,
.swagger-ui .markdown p {
  color: var(--docs-muted);
  font-size: 14px;
  line-height: 1.6;
}

.swagger-ui .scheme-container {
  margin: 0 0 28px;
  padding: 16px 20px;
  border: 1px solid var(--docs-border);
  border-radius: 8px;
  background: var(--docs-surface);
  box-shadow: none;
}

.swagger-ui .opblock-tag-section {
  margin: 0 0 28px;
  padding: 0 0 20px;
  border-bottom: 1px solid #eef4fb;
}

.swagger-ui .opblock-tag {
  position: static;
  top: auto;
  z-index: auto;
  margin: 0 0 12px;
  padding: 0 0 12px;
  border: 0;
  border-bottom: 1px solid var(--docs-border);
  background: transparent;
  box-shadow: none;
}

.swagger-ui .opblock-tag small {
  color: var(--docs-muted);
}

.swagger-ui .opblock {
  margin: 0 0 8px;
  border-radius: 8px;
  box-shadow: none;
  border: 1px solid var(--docs-border);
}

.swagger-ui .opblock .opblock-summary {
  align-items: center;
}

.swagger-ui .opblock .opblock-summary-method {
  min-width: 54px;
  border-radius: 4px;
  font-size: 11px;
}

.swagger-ui .opblock .opblock-summary-path {
  font-size: 12px;
}

.swagger-ui .opblock .opblock-summary-description {
  color: var(--docs-text);
  font-weight: 500;
}

.swagger-ui .btn.authorize,
.swagger-ui .btn.execute {
  border-color: var(--docs-primary);
  background: var(--docs-primary);
  color: #ffffff;
}

.swagger-ui .btn.authorize:hover,
.swagger-ui .btn.execute:hover {
  border-color: var(--docs-primary-dark);
  background: var(--docs-primary-dark);
}

/* ───── Swagger topbar / version selector ───── */

.swagger-ui .topbar {
  background: var(--docs-surface);
  border-bottom: 1px solid var(--docs-border);
  padding: 12px 0;
}

.swagger-ui .topbar .topbar-wrapper .link {
  display: none;
}

.swagger-ui .topbar .topbar-wrapper {
  padding: 0;
}

.swagger-ui .topbar .select-label {
  color: var(--docs-text) !important;
  font-weight: 600;
  font-size: 14px;
  opacity: 1;
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.swagger-ui .topbar .select-label,
.swagger-ui .topbar .select-label * {
  color: var(--docs-text) !important;
  opacity: 1;
}

.swagger-ui .topbar .select-label select {
  min-width: 130px;
  margin-left: 10px;
  padding: 8px 28px 8px 12px;
  border: 1px solid var(--docs-border);
  border-radius: 8px;
  background: var(--docs-surface);
  color: var(--docs-text);
  -webkit-text-fill-color: var(--docs-text);
  font: inherit;
  font-size: 14px;
  cursor: pointer;
  appearance: auto;
}

.swagger-ui .topbar .select-label select option {
  color: var(--docs-text);
  background: var(--docs-surface);
}

.swagger-ui .topbar .select-label select:focus {
  outline: 2px solid var(--docs-primary);
  outline-offset: 1px;
}

/* ───── Footer ───── */

.docs-footer {
  padding: 32px 40px 20px calc(var(--docs-sidebar-width) + 40px);
  background: var(--docs-surface);
  border-top: 1px solid var(--docs-border);
}

.docs-page--standalone .docs-footer {
  padding-left: 40px;
}

.docs-footer__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  align-items: start;
}

.docs-footer__group,
.docs-footer__brand {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.docs-footer__group h2 {
  margin: 0 0 6px;
  font-size: 14px;
}

.docs-footer__group a,
.docs-footer__legal a {
  color: var(--docs-muted);
  font-size: 13px;
  text-decoration: none;
}

.docs-footer__group a:hover,
.docs-footer__legal a:hover {
  color: var(--docs-primary-dark);
  text-decoration: underline;
}

.docs-footer__brand p {
  margin: 0;
  color: var(--docs-muted);
  font-size: 13px;
  line-height: 1.6;
  max-width: 320px;
}

.docs-footer__legal {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 32px;
  padding-top: 16px;
  border-top: 1px solid var(--docs-border);
  color: var(--docs-muted);
  font-size: 12px;
}

.docs-footer__legal-links {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

/* ───── Responsive ───── */

@media (max-width: 1024px) {
  .docs-sidebar {
    width: 240px;
  }

  #swagger-ui {
    padding: 0 24px;
  }

  .docs-footer {
    padding: 28px 24px 16px;
  }

  .docs-main--changelog {
    padding: 28px 24px 40px;
  }

  .changelog-page__header {
    flex-direction: column;
    align-items: stretch;
  }

  .changelog-entry {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

@media (max-width: 768px) {
  .docs-body {
    flex-direction: column;
  }

  .docs-sidebar {
    width: 100%;
    position: static;
    height: auto;
    max-height: 260px;
    border-right: none;
    border-bottom: 1px solid var(--docs-border);
    overflow-y: auto;
  }

  .docs-sidebar__inner {
    padding: 8px 0;
  }

  .docs-sidebar__section-title {
    padding: 4px 12px 6px;
  }

  .docs-sidebar__link {
    padding: 7px 12px;
  }

  .docs-sidebar__title {
    padding: 0 12px 12px;
  }

  .docs-main {
    padding: 20px 0 40px;
  }

  .docs-main--changelog {
    padding: 20px 16px 40px;
  }

  #swagger-ui {
    padding: 0 16px;
  }

  .docs-header {
    padding: 0 16px;
  }

  .docs-footer {
    padding: 24px 16px 16px;
  }

  .docs-footer__grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .docs-header,
  .docs-footer__legal {
    flex-direction: column;
    align-items: flex-start;
  }

  .changelog-pagination {
    justify-content: space-between;
    flex-wrap: wrap;
  }
}
