/* Aligns with src/admin/src/index.css theme tokens and data-theme / data-bs-theme. */
:root {
  /* Single sans + monospace stack (Bootstrap 5.3-compatible); avoids mixed system defaults when other --bs-* vars are overridden. */
  --bs-font-sans-serif:  "Segoe UI", "Helvetica Neue", system-ui, -apple-system, "Noto Sans", "Liberation Sans", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
  --bs-font-monospace: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  --bs-body-font-family: var(--bs-font-sans-serif);

  /* Horizontal space between TOC text and the resize handle, and between the handle and the main pane (lg+). Chosen for balance with container padding; changing only affects doc spec layout. */
  --docs-splitter-adjacent-padding: 1rem;

  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-200: #bfdbfe;
  --primary-300: #93c5fd;
  --primary-400: #60a5fa;
  --primary-500: #3b82f6;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --primary-800: #1e40af;
  --primary-900: #1e3a8a;
  --primary-950: #172554;

  --secondary-50: #fafafa;
  --secondary-100: #f5f5f5;
  --secondary-200: #e5e5e5;
  --secondary-300: #d4d4d4;
  --secondary-400: #a3a3a3;
  --secondary-500: #737373;
  --secondary-600: #525252;
  --secondary-700: #404040;
  --secondary-800: #262626;
  --secondary-900: #171717;
  --secondary-950: #0a0a0a;

  --eci-bg: #ffffff;
  --eci-text: var(--secondary-900);
  --eci-muted: var(--secondary-500);
  --eci-muted-alt: var(--secondary-500);
  --eci-heading: var(--secondary-800);
  --eci-accent: var(--primary-600);
  --eci-accent-hover: var(--primary-700);
  --eci-tile-bg: #ffffff;
  --eci-border: var(--secondary-200);
  --eci-blockquote-bg: var(--secondary-100);

  --bs-body-color: var(--secondary-900);
  --bs-body-color-rgb: 23, 23, 23;
  --bs-body-bg: #ffffff;
  --bs-primary: var(--primary-600);
  --bs-primary-rgb: 37, 99, 235;
  --bs-info: var(--primary-600);
  --bs-info-rgb: 37, 99, 235;
  --bs-secondary: var(--secondary-500);
  --bs-secondary-rgb: 115, 115, 115;
  --bs-light: var(--secondary-100);
  --bs-light-rgb: 245, 245, 245;
  --bs-border-color: var(--secondary-200);
  --bs-emphasis-color: var(--secondary-900);
  --bs-secondary-color: var(--secondary-500);
  --bs-tertiary-bg: var(--secondary-100);
  --bs-card-bg: #ffffff;
  --bs-card-color: var(--secondary-900);
  --bs-card-border-color: var(--secondary-200);
  --bs-card-cap-bg: #ffffff;
  --bs-card-cap-color: var(--secondary-900);

  --json-key: #0451a5;
  --json-string: #a31515;
  --json-number: #098658;
  --json-literal: #0000ff;
  --json-comment: #6a737d;
  --json-text: #000000;
}

[data-theme="dark"] {
  --eci-bg: var(--secondary-900);
  --eci-text: var(--secondary-50);
  --eci-muted: var(--secondary-400);
  --eci-muted-alt: var(--secondary-400);
  --eci-heading: var(--secondary-100);
  --eci-accent: var(--primary-400);
  --eci-accent-hover: var(--primary-300);
  --eci-tile-bg: var(--secondary-800);
  --eci-border: var(--secondary-700);
  --eci-blockquote-bg: var(--secondary-800);

  --bs-body-color: var(--secondary-50);
  --bs-body-color-rgb: 250, 250, 250;
  --bs-body-bg: var(--secondary-900);
  --bs-primary: var(--primary-400);
  --bs-primary-rgb: 96, 165, 250;
  --bs-info: var(--primary-400);
  --bs-info-rgb: 96, 165, 250;
  --bs-secondary: var(--secondary-400);
  --bs-secondary-rgb: 163, 163, 163;
  --bs-light: var(--secondary-800);
  --bs-light-rgb: 38, 38, 38;
  --bs-border-color: var(--secondary-700);
  --bs-emphasis-color: var(--secondary-50);
  --bs-secondary-color: var(--secondary-400);
  --bs-tertiary-bg: var(--secondary-800);
  --bs-card-bg: var(--secondary-800);
  --bs-card-color: var(--secondary-50);
  --bs-card-border-color: var(--secondary-700);
  --bs-card-cap-bg: var(--secondary-800);
  --bs-card-cap-color: var(--secondary-50);

  --json-key: #79b8ff;
  --json-string: #9ecbff;
  --json-number: #b392f0;
  --json-literal: #f97583;
  --json-comment: #959da5;
  --json-text: #e1e4e8;
}

[data-theme="dark"] .bg-white {
  background-color: var(--eci-tile-bg) !important;
}

[data-theme="dark"] .text-dark {
  color: var(--eci-text) !important;
}

.swaggeroni-navbar .navbar-brand {
  color: var(--eci-text) !important;
}

.swaggeroni-navbar .navbar-brand:hover {
  color: var(--eci-accent) !important;
}

.swaggeroni-navbar .navbar-nav .nav-link {
  color: var(--eci-text) !important;
}

.swaggeroni-navbar .navbar-nav .nav-link:hover {
  color: var(--eci-accent) !important;
}

.swaggeroni-navbar .docs-theme-toggle {
  color: var(--eci-muted) !important;
  border: none;
  background: transparent;
  padding: 0.35rem 0.5rem;
  font-size: 1.1rem;
  line-height: 1;
}

.swaggeroni-navbar .docs-theme-toggle:hover {
  color: var(--eci-accent) !important;
}

.swaggeroni-navbar .docs-theme-toggle:focus-visible {
  color: var(--eci-accent) !important;
  box-shadow: none;
  outline: 2px solid var(--eci-accent);
  outline-offset: 2px;
}

.docs-body {
  min-height: 100vh;
  background-color: var(--bs-body-bg);
  color: var(--bs-body-color);
  font-family: var(--bs-body-font-family);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.markdown-body {
  font-family: inherit;
}

.markdown-body code,
.markdown-body pre,
.markdown-body samp,
.markdown-body kbd {
  font-family: var(--bs-font-monospace);
}

.markdown-body pre code {
  font-family: inherit;
}

.docs-group-card {
  border-left: 6px solid var(--bs-primary);
  box-shadow: 0 0.5rem 1.5rem rgba(0, 0, 0, 0.08);
}

.docs-spec-row {
  align-items: flex-start;
}

.doc-viewer-row {
  min-height: calc(100vh - 10rem);
  align-items: stretch;
}

.doc-viewer-row .doc-toc-col {
  overflow: visible;
}

@media (min-width: 992px) {
  .doc-viewer-row .doc-toc-col {
    flex: 0 0 33.333%;
    min-width: 240px;
    max-width: 560px;
    width: min(360px, 33.333%);
  }
}

.doc-toc-resize-handle {
  width: 4px;
  flex-shrink: 0;
  cursor: col-resize;
  background: color-mix(in srgb, var(--bs-border-color) 55%, transparent);
  margin: 0.5rem 4px;
  border-radius: 2px;
  transition: background-color 120ms ease;
  align-self: stretch;
}

.doc-toc-resize-handle:hover {
  background: color-mix(in srgb, var(--bs-border-color) 85%, transparent);
}

.doc-content-col {
  min-width: 0;
  min-height: 0;
}

@media (min-width: 992px) {
  .doc-viewer-row .doc-toc-col {
    padding-right: var(--docs-splitter-adjacent-padding);
  }

  .doc-viewer-row .doc-content-col {
    padding-left: var(--docs-splitter-adjacent-padding);
  }
}

.doc-viewer-row .doc-toc-col #docs-toc {
  scrollbar-width: thin;
  scrollbar-color: var(--bs-border-color) transparent;
}

.doc-viewer-row .doc-toc-col #docs-toc::-webkit-scrollbar {
  width: 6px;
}

.doc-viewer-row .doc-toc-col #docs-toc::-webkit-scrollbar-track {
  background: transparent;
}

.doc-viewer-row .doc-toc-col #docs-toc::-webkit-scrollbar-thumb {
  background: var(--bs-border-color);
  border-radius: 3px;
}

#docs-toc.docs-toc {
  font-family: inherit;
  font-size: 0.9375rem;
  line-height: 1.45;
  /* Chevron column: 1em icon (see .docs-toc-chevron) plus .docs-toc-summary flex gap; matches .docs-toc-spec-details-body padding-left. */
  --docs-toc-chevron-gutter: calc(1em + 0.35rem);
  /* Label-only operation rows: padding to align with method column in method/path mode; internal to #docs-toc only. */
  --docs-toc-op-label-mode-indent: var(--docs-toc-chevron-gutter);
}

#docs-toc.docs-toc a,
#docs-toc.docs-toc .docs-toc-op-link {
  font-size: inherit;
}

#docs-toc .docs-toc-toolbar .form-check-label {
  font-size: 0.875rem;
}

/* Sort toggle only applies when operations show method & path (Title mode has no path/method columns to sort). */
#docs-toc.docs-toc-display-label .docs-toc-sort-wrap {
  display: none !important;
}

.docs-toc-summary {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.docs-toc-chevron {
  flex-shrink: 0;
  transition: transform 0.15s ease;
  opacity: 0.85;
}

#docs-toc .docs-toc-chevron {
  font-size: 1em;
}

/* Indents spec tree (Summary, articles, ops) to align with text after the chevron in .docs-toc-summary. */
#docs-toc .docs-toc-group-spec .docs-toc-details > .docs-toc-spec-details-body {
  padding-left: var(--docs-toc-chevron-gutter);
}

details[open] > .docs-toc-summary .docs-toc-chevron {
  transform: rotate(90deg);
}

#docs-toc .docs-toc-op-label {
  display: inline;
  font-size: inherit;
}

#docs-toc .docs-toc-op-methodpath {
  display: inline;
}

#docs-toc.docs-toc-display-label .docs-toc-op-methodpath {
  display: none;
}

#docs-toc.docs-toc-display-methodpath .docs-toc-op-label {
  display: none;
}

#docs-toc.docs-toc-display-label .docs-toc-op-item {
  padding-left: var(--docs-toc-op-label-mode-indent);
}

#docs-toc .doc-toc-method {
  font-size: inherit;
  font-weight: 400;
  margin-right: 0.35rem;
}

#docs-toc .doc-toc-op-path-text {
  font-size: inherit;
}

.doc-toc-method-get {
  color: var(--bs-primary);
}

.doc-toc-method-post {
  color: #198754;
}

.doc-toc-method-put {
  color: #fd7e14;
}

.doc-toc-method-patch {
  color: #6f42c1;
}

.doc-toc-method-delete {
  color: #dc3545;
}

.markdown-body pre {
  background: var(--bs-tertiary-bg);
  padding: 1rem;
  border-radius: 0.375rem;
  color: var(--bs-body-color);
}

.markdown-body code {
  color: var(--eci-accent);
  background: var(--eci-blockquote-bg);
}

.docs-operation-detail .docs-op-desc-md h1,
.docs-operation-detail .docs-op-desc-md h2,
.docs-operation-detail .docs-op-desc-md h3,
.docs-operation-detail .docs-op-desc-md h4,
.docs-operation-detail .docs-op-desc-md h5,
.docs-operation-detail .docs-op-desc-md h6 {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--bs-body-color);
}

.docs-operation-detail .docs-op-desc-md h1 {
  font-size: 1.25rem !important;
}

.docs-operation-detail .docs-op-desc-md h2 {
  font-size: 1.125rem !important;
}

.docs-operation-detail .docs-op-desc-md h3 {
  font-size: 1.05rem !important;
}

.docs-operation-detail .docs-op-desc-md h4 {
  font-size: 1rem !important;
}

.docs-operation-detail .docs-op-desc-md h5,
.docs-operation-detail .docs-op-desc-md h6 {
  font-size: 0.9375rem !important;
}

.docs-operation-detail .docs-op-desc-md > :first-child {
  margin-top: 0 !important;
}

.doc-viewer-json {
  max-height: 20rem;
  overflow: auto;
  line-height: 1.45;
  background: var(--eci-tile-bg) !important;
  color: var(--eci-text);
  border: 1px solid var(--eci-border);
}

.doc-viewer-json code {
  font-family: var(--bs-font-monospace, ui-monospace, monospace);
  font-size: 0.8125rem;
  background: none !important;
  color: inherit;
  padding: 0;
}

.docs-json-frag-string {
  color: var(--json-string);
}

.docs-json-frag-number {
  color: var(--json-number);
}

.docs-json-frag-literal {
  color: var(--json-literal);
}

.docs-json-frag-text {
  color: var(--json-text);
}

.docs-json-frag-comment {
  color: var(--json-comment);
  font-style: italic;
}

.docs-json-key-tt {
  text-decoration: underline dotted;
  text-decoration-color: var(--json-comment);
  text-underline-offset: 2px;
  cursor: help;
  color: var(--json-key);
}

.docs-json-tooltips .tooltip-inner {
  max-width: min(420px, 92vw);
  text-align: left;
}

@media (min-width: 992px) {
  .docs-toc-column {
    position: sticky;
    top: 1rem;
    align-self: flex-start;
    max-height: calc(100vh - 2rem);
    overflow: visible;
  }

  .doc-viewer-row .docs-toc-column {
    max-height: calc(100vh - 2rem);
    overflow-y: auto;
    overflow-x: hidden;
  }
}

.docs-toc-details > .docs-toc-summary {
  cursor: pointer;
  list-style: none;
}

#docs-toc .docs-toc-details > .docs-toc-summary {
  font-weight: 400;
}

.docs-toc-details > .docs-toc-summary::-webkit-details-marker {
  display: none;
}

#docs-toc a {
  color: var(--bs-body-color);
  text-decoration: none;
}

#docs-toc a.docs-toc-link-active {
  color: var(--bs-primary);
  font-weight: 400;
  background-color: rgba(var(--bs-primary-rgb), 0.12);
  border-radius: 0.25rem;
  padding: 0.2rem 0.35rem;
  margin: -0.2rem -0.35rem;
}

#docs-toc a.docs-toc-link-active .doc-toc-method,
#docs-toc a.docs-toc-link-active .doc-toc-op-path-text,
#docs-toc a.docs-toc-link-active .docs-toc-op-label {
  color: var(--bs-primary);
}

#docs-toc a:hover,
#docs-toc a:focus-visible {
  color: var(--bs-emphasis-color);
  text-decoration: none;
}

#docs-toc a.docs-toc-link-active:hover,
#docs-toc a.docs-toc-link-active:focus-visible {
  color: var(--bs-primary);
  background-color: rgba(var(--bs-primary-rgb), 0.18);
}

#docs-toc a:focus-visible {
  outline: 2px solid var(--bs-border-color);
  outline-offset: 2px;
  border-radius: 2px;
}

#docs-toc a.docs-toc-link-active:focus-visible {
  outline-color: var(--bs-primary);
}

.docs-json-tree-list {
  list-style: none;
  padding-left: 1rem;
  margin: 0;
}

.docs-json-key {
  color: var(--json-key);
}

.docs-json-str {
  color: var(--json-string);
}

.docs-json-lit {
  color: var(--json-literal);
}

.docs-schema-property-table {
  table-layout: fixed;
}

.docs-schema-property-table td {
  word-break: break-word;
}

.docs-json-plain code {
  color: inherit;
}

.docs-json-view .btn-check:checked + .btn-outline-secondary {
  z-index: 1;
}
