/* API Console — Credible-style layout (extends docs.css) */

.console-workspace {
  display: flex;
  flex: 1;
  min-height: 0;
  background: var(--doc-bg);
}

.console-sidebar {
  width: 300px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--doc-sidebar);
  border-right: 1px solid var(--doc-sidebar-border);
}

.console-sidebar__nav {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 0.85rem 1.5rem;
}

.api-cat {
  margin-bottom: 0.85rem;
}

.api-getting-started {
  display: block;
  width: 100%;
  margin: 0.35rem 0 0.5rem;
  padding: 0.55rem 0.65rem;
  border: none;
  border-radius: var(--doc-radius);
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--doc-text);
  cursor: pointer;
}

.api-getting-started:hover {
  background: rgba(0, 0, 0, 0.04);
}

.api-getting-started--active {
  background: #eceef1;
}

.console-doc {
  flex: 1;
  width: 100%;
  max-width: none;
  box-sizing: border-box;
  overflow-y: auto;
  padding: 1.75rem 2rem 3rem;
}

.console-doc.doc-content {
  max-width: none;
  width: 100%;
}

.console-doc .doc-title {
  margin-top: 0;
}

.console-doc h2 {
  margin: 1.75rem 0 0.65rem;
  font-size: 1.0625rem;
  font-weight: 500;
}

.console-doc h2:first-of-type {
  margin-top: 1.25rem;
}

.console-doc p,
.console-doc li {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--doc-text);
}

.console-doc p {
  margin: 0 0 0.75rem;
  color: var(--doc-muted);
}

.console-flow__label {
  margin: 0 0 0.65rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--doc-muted);
}

.console-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.35rem;
  padding: 1rem 1.15rem;
  border: 1px solid var(--doc-border);
  border-radius: var(--doc-radius-sm);
  background: #f9fafb;
  margin-bottom: 0.5rem;
}

.console-flow__step {
  padding: 0.45rem 0.75rem;
  border: 1px solid var(--doc-border);
  border-radius: var(--doc-radius);
  background: #fff;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--doc-text);
  white-space: nowrap;
}

.console-flow__arrow {
  color: var(--doc-muted);
  font-size: 0.875rem;
  line-height: 1;
}

#consoleRequestPanel {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  min-width: 0;
}

#consoleRequestPanel[hidden] {
  display: none;
}

.console-doc[hidden] {
  display: none;
}

.api-cat__select {
  width: 100%;
  appearance: none;
  padding: 0.55rem 2rem 0.55rem 2.25rem;
  border: 1px solid var(--doc-border);
  border-radius: var(--doc-radius-sm);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 0.65rem center;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--doc-text);
  cursor: pointer;
}

.api-cat__select:focus {
  outline: none;
  border-color: #c5cad3;
}

.api-cat__select--collections {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M3 10l9-6 9 6M5 10v8h14v-8'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-position: 0.65rem center, right 0.65rem center;
  background-repeat: no-repeat, no-repeat;
}

.api-cat__select--invoices {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M14 3H6a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V9z'/%3E%3Cpath d='M14 3v6h6'/%3E%3C/svg%3E"), url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%236b7280' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-position: 0.65rem center, right 0.65rem center;
  background-repeat: no-repeat, no-repeat;
}

.api-endpoint-list {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.api-sidebar__section-head {
  margin: 1.25rem 0 0.5rem;
  padding: 0 0.15rem;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--doc-muted);
}

.api-endpoint {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  width: 100%;
  padding: 0.5rem 0.55rem;
  border: none;
  border-radius: var(--doc-radius);
  background: transparent;
  text-align: left;
  font: inherit;
  font-size: 0.8125rem;
  color: var(--doc-text);
  cursor: pointer;
}

.api-endpoint:hover {
  background: rgba(0, 0, 0, 0.04);
}

.api-endpoint--active {
  background: #eceef1;
  font-weight: 500;
}

.api-endpoint__name {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.console-method {
  flex-shrink: 0;
  min-width: 44px;
  text-align: center;
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  padding: 0.2rem 0.35rem;
  border-radius: var(--doc-radius);
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  color: #fff;
}

.console-method--GET { background: var(--doc-get); }
.console-method--POST { background: var(--doc-post); }

.console-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
  background: var(--doc-bg);
}

.console-main__head {
  padding: 1.75rem 2rem 1.25rem;
  border-bottom: none;
}

.console-main__head.request-head {
  padding: 1.75rem 2rem 1.25rem;
}

.console-main .path-vars {
  padding: 0 2rem 0.75rem;
  background: var(--doc-bg);
}

.console-main .path-vars:not([hidden]) {
  padding-top: 0.75rem;
}

.console-main .path-vars:not([hidden]) + .path-vars:not([hidden]) {
  padding-top: 0.35rem;
}

.console-main .request-bar {
  margin-top: 1rem;
  padding: 0 2rem 1.25rem;
  background: var(--doc-bg);
}

.console-main__title {
  margin: 0 0 0.35rem;
  font-size: 1.5rem;
  font-weight: 500;
  letter-spacing: -0.03em;
}

.console-main__desc {
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--doc-muted);
  max-width: 720px;
}

.console-sidebar-backdrop {
  display: none;
}

@media (max-width: 900px) {
  .console-sidebar-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    z-index: 40;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
  }

  .console-sidebar-backdrop.is-open {
    opacity: 1;
    pointer-events: auto;
  }

  .console-sidebar {
    position: fixed;
    top: calc(var(--doc-topbar-h) + var(--doc-subnav-h));
    left: 0;
    bottom: 0;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform 0.2s ease;
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
  }

  .console-sidebar.is-open {
    transform: translateX(0);
  }

  .console-mobile-menu {
    display: inline-flex;
  }

  .console-doc {
    padding: 1.25rem 1rem 2.5rem;
  }
}

.doc-topbar .console-mobile-menu {
  flex-shrink: 0;
}

.console-mobile-menu {
  display: none;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--doc-border);
  border-radius: var(--doc-radius);
  background: #fff;
  color: var(--doc-text);
  cursor: pointer;
}
