*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, system-ui, sans-serif;
  background: #0f0f11;
  color: #e8e8ec;
  min-height: 100vh;
}

.hidden { display: none !important; }

.api-docs-app {
  height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.api-docs-header {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px 20px;
  border-bottom: 1px solid #2a2a32;
  background: #141418;
  position: sticky;
  top: 0;
  z-index: 10;
}

.api-docs-brand {
  font-weight: 700;
  color: #c4bfff;
  text-decoration: none;
  font-size: 15px;
  flex-shrink: 0;
}

.api-docs-header__center {
  flex: 1;
  min-width: 0;
}

.api-docs-title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.api-docs-subtitle {
  margin: 2px 0 0;
  font-size: 11px;
  color: #9a9aaa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.api-docs-header__actions {
  display: flex;
  gap: 12px;
  flex-shrink: 0;
}

.api-docs-link {
  color: #9a9aaa;
  text-decoration: none;
  font-size: 12px;
  font-weight: 500;
}

.api-docs-link:hover { color: #c4bfff; }

.api-docs-body {
  flex: 1;
  display: flex;
  min-height: 0;
  overflow: hidden;
}

.api-routes-sidebar {
  width: 280px;
  min-width: 200px;
  max-width: 480px;
  flex-shrink: 0;
  border-right: 1px solid #2a2a32;
  background: #121216;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.api-routes-resizer {
  width: 6px;
  flex-shrink: 0;
  cursor: col-resize;
  background: transparent;
  position: relative;
}

.api-routes-resizer:hover,
.api-docs--resizing .api-routes-resizer {
  background: #6c63ff33;
}

.api-routes-resizer::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 2px;
  width: 2px;
  background: #2a2a32;
}

.api-routes-sidebar__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  height: 50px;
  flex-shrink: 0;
  border-bottom: 1px solid #2a2a32;
  font-size: 13px;
  font-weight: 600;
}

.api-routes-sidebar__count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  color: #6b6b7a;
  background: #1a1a20;
  border: 1px solid #2a2a32;
  border-radius: 999px;
  padding: 2px 8px;
}

.api-routes-search {
  padding: 10px 12px;
  flex-shrink: 0;
  border-bottom: 1px solid #2a2a32;
}

.api-routes-search__input {
  width: 100%;
  border: 1px solid #2a2a32;
  background: #1a1a20;
  color: #e8e8ec;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 12px;
}

.api-routes-nav {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 8px 0 24px;
}

.api-route-group__title {
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b6b7a;
}

.api-route-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  grid-template-rows: auto auto;
  gap: 2px 8px;
  width: 100%;
  text-align: left;
  border: none;
  background: transparent;
  color: inherit;
  padding: 8px 14px;
  cursor: pointer;
  border-left: 2px solid transparent;
}

.api-route-item:hover { background: #1c1c22; }
.api-route-item--active {
  background: #6c63ff14;
  border-left-color: #6c63ff;
}

.api-route-item__method { grid-row: 1 / span 2; align-self: center; font-size: 10px; }
.api-route-item__path {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: #c4bfff;
}
.api-route-item__summary {
  grid-column: 2;
  font-size: 11px;
  color: #9a9aaa;
}

.api-route-main {
  flex: 1;
  overflow: hidden;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: #0f0f11;
}

.api-route-detail {
  flex: 1;
  overflow: hidden;
  min-height: 0;
}

.api-route-detail__layout {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.api-route-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  height: 50px;
  padding: 0 32px;
  border-bottom: 1px solid #2a2a32;
  background: #0f0f11;
}

.api-route-bar__left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.api-route-bar__method { font-size: 9px; min-width: 40px; }

.api-route-bar__title {
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.api-route-bar__path {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: #9a9aaa;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.api-route-bar__auth {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  background: #eab30820;
  color: #facc15;
  border: 1px solid #eab30840;
}

.api-route-detail__split {
  display: flex;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.api-route-detail__docs {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

.api-route-detail__docs-inner {
  max-width: 42rem;
  padding: 48px 40px 48px 48px;
}

.api-route-detail__try {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
}

.api-route-detail__try-inner {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 48px 48px 48px 40px;
}

.api-route-detail__warn {
  margin: 0 0 16px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #eab30814;
  border: 1px solid #eab30840;
  color: #fde68a;
  font-size: 12px;
  line-height: 1.5;
}

.api-route-detail__warn code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
}

.api-panel {
  margin-bottom: 16px;
  border: 1px solid #2a2a32;
  border-radius: 8px;
  background: rgba(20, 20, 24, 0.6);
  overflow: hidden;
}

.api-route-detail__try-inner .api-panel {
  margin-bottom: 0;
}

.api-panel__title {
  margin: 0;
  padding: 10px 14px;
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid #2a2a32;
}

.api-panel__title--plain {
  padding: 14px 14px 0;
  border-bottom: none;
  font-weight: 400;
  font-size: 12px;
  color: #e8e8ec;
}

.api-panel--code .api-code-block--curl {
  margin: 8px 14px 0;
  border: 1px solid #2a2a32;
  border-radius: 8px;
  background: #1e1e1e;
}

.api-panel__footer {
  display: flex;
  justify-content: flex-end;
  padding: 12px 14px 14px;
}

.api-panel__head-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid #2a2a32;
}

.api-panel__head-row .api-panel__title {
  padding: 0;
  border: none;
}

.api-panel__body {
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.api-panel__fields {
  display: flex;
  flex-direction: column;
}

.api-field-row {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  padding: 14px 16px;
  border-bottom: 1px solid #2a2a32;
}

.api-field-row:last-child { border-bottom: none; }

.api-field-row__meta {
  flex: 1;
  min-width: 0;
}

.api-field-row__label {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
}

.api-field-row__control {
  width: 168px;
  flex-shrink: 0;
  --ig-border: #2a2a32;
  --ig-bg: #0f0f11;
  --ig-text: #e8e8ec;
  --ig-hint: #6b6b7a;
  --ig-border-focus: #6c63ff;
  --ig-focus-ring: rgba(108, 99, 255, 0.25);
  --ig-radius: 8px;
}

.api-field-row__control .cdb-select,
.api-field-row__control .cdb-ms,
.api-field-row__control .cdb-tl,
.api-field-row__control .cdb-ol {
  width: 100%;
}

.api-field-row__control .cdb-select__trigger {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
}

.api-field-row__control .cdb-ig__control {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 12px;
  border: 1px solid var(--ig-border);
  background: var(--ig-bg);
  color: var(--ig-text);
  border-radius: var(--ig-radius);
}

.api-field-row__control .cdb-ig__control:focus {
  outline: none;
  border-color: var(--ig-border-focus);
  box-shadow: 0 0 0 3px var(--ig-focus-ring);
}

.api-input--sm {
  padding: 8px 10px;
  font-size: 12px;
}

.api-textarea--sm {
  min-height: 72px;
  padding: 8px 10px;
  font-size: 11px;
}

.api-field-block {
  border-bottom: 1px solid #2a2a32;
}

.api-field-block__head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px 4px;
}

.api-field-block__name {
  font-size: 12px;
  font-weight: 600;
  color: #d4d4dc;
}

.api-field-block__type {
  font-size: 10px;
  color: #6b6b7a;
}

.api-field-block__nested {
  padding: 0 0 4px 12px;
  border-left: 2px solid #2a2a32;
  margin: 0 16px 8px;
}

.api-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.api-field__label {
  font-size: 12px;
  font-weight: 600;
  color: #d4d4dc;
}

.api-field__req {
  font-style: normal;
  font-weight: 500;
  color: #f87171;
  font-size: 10px;
}

.api-field__type {
  font-weight: 500;
  color: #6b6b7a;
  font-size: 10px;
}

.api-field__hint {
  margin: 4px 0 0;
  font-size: 11px;
  color: #6b6b7a;
  line-height: 1.45;
}

.api-field__hint code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 10px;
  color: #c4bfff;
}

.api-input,
.api-textarea {
  width: 100%;
  border: 1px solid #2a2a32;
  background: #0f0f11;
  color: #e8e8ec;
  border-radius: 8px;
  padding: 9px 11px;
  font-size: 13px;
  font-family: inherit;
}

.api-input--mono,
.api-textarea--mono {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
}

.api-textarea {
  min-height: 120px;
  resize: vertical;
  line-height: 1.5;
}

.api-btn {
  border: 1px solid #2a2a32;
  background: #1a1a20;
  color: #e8e8ec;
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.api-btn:hover { border-color: #6c63ff66; }
.api-btn:disabled { opacity: 0.6; cursor: wait; }

.api-btn--primary {
  background: #6c63ff;
  border-color: #6c63ff;
  color: #fff;
}

.api-btn--primary:hover { background: #5a52e0; }

.api-code-block--curl {
  margin: 0;
  border: none;
  border-radius: 0;
  border-top: 1px solid #2a2a32;
  max-height: 200px;
  overflow: auto;
}

.api-code-block--response {
  margin: 0;
  border: none;
  border-radius: 0;
  border-top: 1px solid #2a2a32;
  max-height: 360px;
  overflow: auto;
}

.api-response--ok .api-panel__title { color: #86efac; }
.api-response--err .api-panel__title { color: #fca5a5; }

.api-panel--compact .api-panel__body { padding: 12px 14px; }

.api-endpoint-label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 600;
  color: #6b6b7a;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.api-endpoint-url {
  display: block;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  color: #c4bfff;
  word-break: break-all;
  line-height: 1.55;
}

.api-route-empty {
  color: #9a9aaa;
  font-size: 14px;
  max-width: 520px;
  padding: 24px;
}

.api-route-empty code {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 12px;
  color: #c4bfff;
}

.api-route-detail__desc {
  margin: 0 0 20px;
  color: #9a9aaa;
  line-height: 1.55;
  font-size: 13px;
}

.api-route-detail__meta {
  margin: 0 0 20px;
  font-size: 12px;
  color: #9a9aaa;
}

.api-route-section {
  margin-bottom: 20px;
}

.api-route-section h3 {
  margin: 0 0 8px;
  font-size: 13px;
  font-weight: 600;
}

.api-code-block {
  margin: 0;
  padding: 14px;
  border-radius: 10px;
  background: #18181c;
  border: 1px solid #2a2a32;
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  font-size: 11px;
  line-height: 1.5;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-word;
}

.api-method {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  border: 1px solid transparent;
  font-family: Inter, sans-serif;
}

.api-method--get { background: #3b82f620; color: #60a5fa; border-color: #3b82f640; }
.api-method--post { background: #22c55e20; color: #4ade80; border-color: #22c55e40; }
.api-method--put { background: #eab30820; color: #facc15; border-color: #eab30840; }
.api-method--patch { background: #f9731620; color: #fb923c; border-color: #f9731640; }
.api-method--delete { background: #ef444420; color: #f87171; border-color: #ef444440; }

.api-docs-status {
  position: fixed;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: #1a1a20;
  border: 1px solid #2a2a32;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 13px;
  z-index: 20;
  display: none;
}

.api-docs-status--show { display: block; }
.api-docs-status--err { border-color: #ef444466; color: #fca5a5; }
.api-docs-status--ok { border-color: #22c55e66; color: #86efac; }

body.api-docs--resizing {
  cursor: col-resize;
  user-select: none;
}

.api-routes-empty {
  padding: 12px 14px;
  font-size: 12px;
  color: #6b6b7a;
}

@media (max-width: 768px) {
  .api-docs-body { flex-direction: column; }
  .api-routes-resizer { display: none; }
  .api-routes-sidebar {
    width: 100% !important;
    max-width: none;
    min-height: auto;
    max-height: 42vh;
    border-right: none;
    border-bottom: 1px solid #2a2a32;
  }
  .api-route-detail__layout { flex-direction: column; }
  .api-route-detail__docs {
    border-right: none;
    border-bottom: 1px solid #2a2a32;
  }
}
