/* ============================================================
   DOCS LAYOUT
   ============================================================ */

:root {
  --sidenav-width: 300px;
  --toc-width: 260px;
}

.nav__active {
  color: var(--accent) !important;
  font-weight: 600;
}

/* Body roots for docs-only full-height layout */
body.docs-page {
  height: 100vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}


body.docs-page .nav {
  position: static;
  flex-shrink: 0;
}

.docs-layout {
  display: grid;
  grid-template-columns: var(--sidenav-width) 4px 1fr 4px var(--toc-width);
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

/* --- Sidenav --- */
.docs-sidenav {
  background: var(--paper-2);
  border-right: 1px solid var(--line);
  height: 100%;
  overflow-y: auto;
  padding: 28px 0 48px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
  grid-column: 1;
}

.docs-sidenav__close { display: none; }

/* --- Resizer --- */
.docs-resizer {
  width: 4px;
  cursor: col-resize;
  background: #c0c0c0;
  transition: background .15s;
  -webkit-user-select: none;
  user-select: none;
  z-index: 10;
  grid-row: 1 / -1;
}
#docs-resizer-left { grid-column: 2; }
#docs-resizer-right { grid-column: 4; }
.docs-resizer:hover {
  background: var(--accent);
}
.docs-resizer.dragging {
  background: #0d7aa5;
}

/* --- Nav toolbar (search + actions) --- */
.docs-nav-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 0 12px 16px;
}

.docs-search-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
  min-width: 0;
}

.docs-search-wrap > svg {
  position: absolute;
  left: 8px;
  color: var(--muted);
  pointer-events: none;
  flex-shrink: 0;
}

.docs-search-wrap input {
  width: 100%;
  padding: 6px 24px 6px 26px;
  font: inherit;
  font-size: .82rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  outline: none;
  transition: border-color .15s;
}

.docs-search-wrap input:focus { border-color: var(--accent); }
.docs-search-wrap input::placeholder { color: var(--muted); }

.docs-search__clear {
  position: absolute;
  right: 5px;
  padding: 2px 5px;
  font-size: .72rem;
  color: var(--muted);
  line-height: 1;
  transition: color .15s;
}
.docs-search__clear:hover { color: var(--ink); }

/* --- Search results --- */
.docs-search-results { padding-bottom: 8px; }

.docs-search-status {
  padding: 8px 20px;
  font-size: .83rem;
  color: var(--muted);
  margin: 0;
}

.docs-nav__section {
  padding: 0 20px 4px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 20px;
}

.docs-nav__item {
  display: flex;
  align-items: center;
  padding: 7px 20px 7px calc(46px + var(--nav-indent, 0) * 14px);
  font-size: .875rem;
  color: var(--ink-soft);
  text-decoration: none;
  border-left: 2px solid transparent;
  transition: color .15s, border-color .15s, background .15s;
  line-height: 1.4;
  overflow: hidden;
}

.docs-nav__item:hover { color: var(--accent); background: rgba(26,161,226,.05); }
.docs-nav__item.active {
  color: var(--accent);
  font-weight: 600;
  border-left-color: var(--accent);
  border-left-width: 3px;
  background: var(--accent-soft);
}

.docs-nav__category {
  border: none;
  display: block;
}
.docs-nav__category > summary {
  display: flex;
  align-items: center;
  list-style: none;
  width: 100%;
}

.docs-nav__category-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px 8px calc(20px + var(--nav-indent, 0) * 14px);
  font-size: .9rem;
  font-weight: 400;
  color: var(--ink-soft);
  cursor: pointer;
  list-style: none;
  user-select: none;
  border-left: 2px solid transparent;
  transition: color .15s, border-color .15s, background .15s;
}

.docs-nav__label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-nav__item-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.docs-nav__category-title:hover { color: var(--accent); background: rgba(26,161,226,.05); }
.docs-nav__category-title.active {
  color: var(--accent);
  font-weight: 600;
  border-left-color: var(--accent);
  border-left-width: 3px;
  background: var(--accent-soft);
}
.docs-nav__category-title.has-active {
  color: var(--accent);
  font-weight: 500;
  border-left-color: rgba(26,161,226,.35);
}

.docs-nav__category-title::-webkit-details-marker { display: none; }

.docs-nav__chevron {
  background: none;
  border: none;
  padding: 3px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 3px;
  width: 18px; height: 18px;
}
.docs-nav__chevron::before {
  content: "";
  display: block;
  width: 6px; height: 6px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform .2s;
  margin-top: 1px;
}
.docs-nav__chevron:hover::before { border-color: var(--accent); }
.docs-nav__category[open] > .docs-nav__category-title .docs-nav__chevron::before {
  transform: rotate(45deg);
}


/* --- Body + content --- */
.docs-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow-y: auto;
  grid-column: 3;
}

.docs-menu-btn { display: none; }

.docs-content {
  flex: 1;
  padding: clamp(32px, 4vw, 56px) 0 clamp(24px, 4vw, 64px) clamp(24px, 4vw, 64px);
  overflow-y: auto;
  overflow-x: hidden;
  min-height: 0;
  width: 100%;
  box-sizing: border-box;
}


/* --- TOC --- */
.docs-toc {
  border-left: 1px solid var(--line);
  padding: 28px 16px 28px 20px;
  overflow-y: auto;
  font-size: .9rem;
  grid-column: 5;
}

.docs-toc__title {
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 12px;
}

.docs-toc__link {
  display: block;
  padding: 3px 0 3px 10px;
  margin-left: -2px;
  color: var(--muted);
  text-decoration: none;
  line-height: 1.4;
  border-left: 2px solid transparent;
  transition: color .15s, border-color .15s;
}

.docs-toc__link--h3 {
  padding-left: 22px;
}

.docs-toc__link:hover { color: var(--ink); }

.docs-toc__link.active {
  color: var(--accent);
  border-left-color: var(--accent);
}

/* --- Breadcrumb --- */
.docs-breadcrumb {
  display: flex;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  font-size: .78rem;
  color: var(--muted);
  margin: 0;
  padding: 6px 24px;
  background: var(--paper);
  min-height: 40px;
  gap: 8px;
}

#docs-breadcrumb { flex: 1; }

.docs-breadcrumb__link {
  color: var(--muted);
  text-decoration: none;
  transition: color .15s;
  cursor: pointer;
}
.docs-breadcrumb__link:hover { color: var(--accent); }
.docs-breadcrumb__sep { color: var(--muted); }

/* --- Breadcrumb actions (right side) --- */
.docs-breadcrumb__actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* --- Copy link button --- */
.docs-copylink-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  cursor: pointer;
  transition: color .15s, border-color .15s;
  flex-shrink: 0;
}

.docs-copylink-btn:hover { color: var(--accent); border-color: var(--accent); }

/* --- Ask AI bar --- */
.docs-ai-bar {
  flex-shrink: 0;
}

.docs-ai-dropdown {
  position: relative;
}

.docs-ai-dropdown summary { list-style: none; }
.docs-ai-dropdown summary::-webkit-details-marker { display: none; }

.docs-ai-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  font-size: .8rem;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper-2);
  cursor: pointer;
  transition: color .15s, border-color .15s;
  user-select: none;
}

.docs-ai-btn:hover,
.docs-ai-dropdown[open] .docs-ai-btn { color: var(--accent); border-color: var(--accent); }

.docs-ai-chevron { transition: transform .15s; }
.docs-ai-dropdown[open] .docs-ai-chevron { transform: rotate(180deg); }

.docs-ai-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 16px rgba(14,27,61,.1);
  min-width: 140px;
  z-index: 20;
  overflow: hidden;
}

.docs-ai-option {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 14px;
  font-size: .85rem;
  color: var(--ink-soft);
  text-align: left;
  transition: background .12s, color .12s;
}

.docs-ai-option:hover { background: var(--paper-2); color: var(--ink); }

.docs-ai-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}

/* --- Back to top --- */
.docs-back-top {
  display: block;
  width: 100%;
  margin-top: 24px;
  padding: 6px 0;
  font-size: .8rem;
  color: var(--muted);
  text-align: left;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  transition: color .15s;
}

.docs-back-top:hover { color: var(--accent); }

.docs-ai-divider {
  border: none;
  border-top: 1px solid var(--line);
  margin: 4px 0;
}

/* --- Article typography --- */
.docs-article h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); margin: 0 0 24px; color: var(--accent); }
.docs-article h2 { font-size: 1.35rem; margin: 32px 0 14px; padding-top: 32px; border-top: 1px solid var(--line); color: var(--accent); }
.docs-article--api-endpoint h2 {
  border-top: none;
  padding-top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.docs-article--api-endpoint h1, .docs-article--api-endpoint h2, .docs-article--api-endpoint h3, .docs-article--api-endpoint h4 { margin-top: 0; }
.docs-article--api-endpoint h1 { margin-bottom: 16px; cursor: default; user-select: auto; }
.docs-article--api-endpoint .docs-heading--settings { margin-top: 8px; padding-top: 0; }

/* Collapsible API sections */
.api-section { margin-bottom: 8px; }
.api-section--collapsed .api-section__body { display: none; }

.api-section__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 0;
  line-height: 1;
}
.api-section__toggle svg { transition: transform .2s ease; }
.api-section--collapsed .api-section__toggle svg { transform: rotate(-90deg); }

.docs-article--api-endpoint .request-body-editor {
  width: calc(100% - clamp(24px, 4vw, 64px));
  margin: 0 0 0 clamp(24px, 4vw, 64px);
  margin-left: 0;
  box-sizing: border-box;
}

.docs-article--api-endpoint table {
  width: calc(100% - clamp(24px, 4vw, 64px));
  margin: 0 0 20px clamp(24px, 4vw, 64px);
  margin-left: 0;
}

.docs-article--api-endpoint table td:first-child {
  width: 35%;
}

.docs-article--api-endpoint table td:nth-child(2) {
  width: 55%;
}

.docs-article--api-endpoint table td:nth-child(3) {
  width: 10%;
  text-align: center;
  padding: 5px 4px;
}

.docs-article--api-endpoint table select.content-type-select,
.docs-article--api-endpoint table select.url-port,
.docs-article--api-endpoint table select.url-server,
.docs-article--api-endpoint table select.url-api-version {
  font-family: var(--mono);
  font-size: .85rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 8px;
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  outline: none;
}

/* Highlight URL config dropdown when placeholder is hovered */
.docs-article--api-endpoint table select.highlighted-var {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.docs-article h3 { font-size: 1.1rem; margin: 28px 0 10px; color: var(--accent); }
.docs-article h4 { font-size: .95rem; margin: 20px 0 8px; color: var(--accent); }
.docs-article p  { font-size: .97rem; line-height: 1.7; color: var(--ink-soft); margin: 0 0 16px; }

/* Constrain prose elements to match table right margin */
.docs-article:not(.docs-article--api-endpoint) > :not(table) {
  margin-right: clamp(24px, 4vw, 64px);
}
.docs-article ul,
.docs-article ol { padding-left: 22px; margin: 0 0 16px; }
.docs-article li { font-size: .95rem; line-height: 1.65; color: var(--ink-soft); margin-bottom: 4px; }
.docs-article a   { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.docs-article hr {
  border: none;
  border-top: 1px solid var(--line);
  margin: 24px 0;
}
.docs-article strong { color: var(--ink); }

.docs-article code {
  font-family: var(--mono);
  font-size: .85em;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 5px;
  color: var(--ink);
}

.docs-article pre {
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 20px 24px;
  overflow-x: auto;
  margin: 0 0 20px clamp(24px, 4vw, 64px);
  margin-left: 0;
  width: calc(100% - clamp(24px, 4vw, 64px));
  box-sizing: border-box;
}

.docs-article pre code {
  background: none;
  border: none;
  padding: 0;
  color: var(--ink);
  font-size: .875rem;
  line-height: 1.6;
}

.docs-article table {
  width: calc(100% - clamp(24px, 4vw, 64px));
  border-collapse: collapse;
  margin: 0 0 20px clamp(24px, 4vw, 64px);
  margin-left: 0;
  font-size: .9rem;
}

.docs-article th {
  background: var(--paper-2);
  font-weight: 700;
  text-align: left;
  padding: 10px 14px;
  border: 1px solid var(--line);
  color: var(--ink);
}

.docs-article td {
  padding: 5px 14px;
  border: 1px solid var(--line);
  color: var(--ink-soft);
  vertical-align: top;
}

.docs-article--api-endpoint table td:last-child {
  text-align: right;
  padding: 5px 4px;
}

.docs-article--api-endpoint td input.header-name,
.docs-article--api-endpoint td input.header-value {
  font-family: var(--mono);
  font-size: .85rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 8px;
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
  outline: none;
}

.docs-article blockquote {
  border-left: 3px solid var(--accent);
  margin: 0 0 16px clamp(24px, 4vw, 64px);
  margin-left: 0;
  padding: 12px 20px;
  background: rgba(26,161,226,.05);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  width: calc(100% - clamp(24px, 4vw, 64px));
}

.docs-article blockquote p { margin: 0; color: var(--ink); }

.docs-placeholder { color: var(--muted); font-size: .95rem; }

.request-body-editor {
  width: 100%;
  min-height: 4.5em;
  padding: 16px;
  font-family: var(--mono);
  font-size: .85rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  color: var(--ink);
  resize: vertical;
  margin: 0 0 32px 0;
  box-sizing: border-box;
  white-space: pre;
  word-wrap: normal;
  overflow-x: auto;
}

.request-body-editor.url-display,
.request-body-editor.query-params-display {
  min-height: 36px;
  padding: 8px 16px;
  white-space: nowrap;
  overflow-x: auto;
  box-sizing: border-box;
  width: calc(100% - clamp(24px, 4vw, 64px));
  margin: 0 0 20px clamp(24px, 4vw, 64px);
  margin-left: 0;
  font-family: var(--mono);
  font-size: .875rem;
}

.url-row {
  display: flex;
  align-items: stretch;
  width: calc(100% - clamp(24px, 4vw, 64px));
  margin: 0 0 20px 0;
  border-radius: 8px;
  overflow: hidden;
}

.url-row .request-body-editor.url-display {
  flex: 1;
  width: auto;
  margin: 0;
  border-radius: 0;
  min-width: 0;
}

.method-select {
  appearance: none;
  -webkit-appearance: none;
  font-family: var(--mono);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
  border: none;
  padding: 0 20px 0 10px;
  cursor: pointer;
  flex-shrink: 0;
  min-width: 72px;
  background-color: #5fbc2e;
  background-repeat: no-repeat;
  background-position: right 6px center;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%23fff' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  outline: none;
}

.method-select option { background: #fff; color: var(--ink); }

.method-select[data-method="GET"]     { background-color: #5fbc2e; }
.method-select[data-method="POST"]    { background-color: #1aa1e2; }
.method-select[data-method="PUT"]     { background-color: #f59e0b; }
.method-select[data-method="PATCH"]   { background-color: #8b5cf6; }
.method-select[data-method="DELETE"]  { background-color: #ef4444; }
.method-select[data-method="HEAD"]    { background-color: #3b82f6; }
.method-select[data-method="OPTIONS"] { background-color: #06b6d4; }

.request-body-editor .placeholder,
#docs-article .placeholder {
  padding: 0 2px;
  border-radius: 2px;
  cursor: default;
}

.request-body-editor .placeholder-filled,
#docs-article .placeholder-filled {
  color: #5fbc2e !important;
  background: rgba(95, 188, 46, 0.1);
}

.request-body-editor .placeholder-unfilled,
#docs-article .placeholder-unfilled {
  color: #d97706 !important;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 2px;
  cursor: default;
}

/* Variable reference highlighting on hover */
.request-body-editor .placeholder-filled[data-placeholder],
#docs-article .placeholder-filled[data-placeholder] {
  cursor: pointer;
}

.request-body-editor .placeholder-filled[data-placeholder]:hover,
#docs-article .placeholder-filled[data-placeholder]:hover,
.request-body-editor .placeholder-filled.active-ref,
#docs-article .placeholder-filled.active-ref {
  background: rgba(95, 188, 46, 0.25);
  text-decoration: underline;
  text-decoration-style: dashed;
}

/* Hover effects for unfilled placeholders (optional without value) */
#docs-article .placeholder-unfilled[data-placeholder]:hover {
  background: rgba(217, 119, 6, 0.15);
  text-decoration: underline;
  text-decoration-style: wavy;
}

#docs-article .setting-input:focus,
#docs-article .setting-select:focus {
  outline: none;
}

#docs-article .setting-input:focus ~ .docs-heading--settings,
#docs-article .setting-select:focus ~ .docs-heading--settings {
  /* Focus related styles */
}

/* Highlight variable input when placeholder is hovered */
.setting-input.highlighted-var,
.setting-select.highlighted-var {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* Highlight matched placeholders when variable is focused */
.placeholder-highlight {
  background: rgba(26, 161, 226, 0.3) !important;
  text-decoration: underline !important;
  text-decoration-style: dashed !important;
  text-underline-offset: 2px !important;
}

/* Active reference highlight */
.placeholder-filled.active-ref,
#docs-article .placeholder-filled.active-ref {
  background: rgba(95, 188, 46, 0.3) !important;
  text-decoration: underline !important;
  text-decoration-style: dashed !important;
  text-underline-offset: 2px !important;
}

.placeholder-unfilled.active-ref,
#docs-article .placeholder-unfilled.active-ref {
  background: rgba(217, 119, 6, 0.2) !important;
  text-decoration: underline !important;
  text-decoration-style: dashed !important;
  text-underline-offset: 2px !important;
}

/* Variables table: placeholder keys in first column should not be colored
   Only placeholders in actual usage (URL, request body, headers) get color */
#docs-article .docs-article--api-endpoint table td:first-child .placeholder,
#docs-article .docs-article--api-endpoint table td:first-child .placeholder-filled,
#docs-article .docs-article--api-endpoint table td:first-child .placeholder-unfilled {
  color: inherit;
  background: none;
  font-weight: normal;
  text-decoration: none;
}

.docs-search-mark {
  color: var(--accent);
  font-weight: 700;
  background: none;
}

.request-body-status {
  display: block;
  margin: 12px 0 16px clamp(24px, 4vw, 64px);
  margin-left: 0;
  font-size: .75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 4px;
  width: calc(100% - clamp(24px, 4vw, 64px));
  box-sizing: border-box;
}

.request-body-status.valid {
  color: #5fbc2e;
  background: rgba(95, 188, 46, .1);
}

.request-body-status.invalid {
  color: #dc3535;
  background: rgba(220, 53, 53, .1);
}


.request-body-actions {
  display: inline-flex;
  gap: 6px;
  margin-left: 8px;
  vertical-align: middle;
}

.request-body-actions-bottom {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
  margin: 16px clamp(24px, 4vw, 64px) 12px 0;
}

.request-body-actions-top,
.url-actions-top,
.query-params-actions-top {
  display: flex;
  gap: 6px;
  margin: 0;
  flex-shrink: 0;
}

.docs-heading--with-actions {
  padding-right: clamp(24px, 4vw, 64px);
}

.docs-article--api-endpoint table .vars-clear-row td {
  text-align: left;
  padding: 6px 14px;
  border-top: 1px solid var(--line);
}
.vars-reset-btn {
  background: none;
  border: none;
  padding: 0;
  font-size: 0.875rem;
  font-weight: 400;
  color: var(--muted);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}
.vars-reset-btn:hover { color: var(--accent); }

.docs-heading--with-actions .url-actions-top,
.docs-heading--with-actions .request-body-actions-top,
.docs-heading--with-actions .query-params-actions-top {
  margin-left: auto;
}

.request-body-btn {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 2px 4px;
  border-radius: 4px;
  transition: color 0.2s, background 0.2s;
}

.request-body-btn:hover {
  color: var(--ink);
  background: var(--paper-2);
}

.request-body-btn svg {
  width: 16px;
  height: 16px;
}

.request-body-editor .placeholder,
textarea .placeholder {
  color: var(--accent);
  font-weight: 600;
}

.setting-input,
.setting-select {
  font-family: var(--mono);
  font-size: .85rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 8px;
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
  outline: none;
}

.setting-select {
  cursor: pointer;
}

.url-port, .url-server, .url-api-version {
  text-align: left;
}

.header-name,
.header-value {
  font-family: var(--mono);
  font-size: .85rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 8px;
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
  outline: none;
}

.header-name .placeholder,
.header-value .placeholder {
  padding: 0 2px;
  border-radius: 2px;
}

.header-name .placeholder-filled,
.header-value .placeholder-filled {
  color: #5fbc2e;
  background: rgba(95, 188, 46, 0.1);
}

.header-name .placeholder-unfilled,
.header-value .placeholder-unfilled {
  color: #d97706;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-style: wavy;
  text-underline-offset: 2px;
}

.header-row-empty {
  display: none;
}

/* Content-Type dropdown styles */
.content-type-select {
  font-family: var(--mono);
  font-size: .85rem;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 4px 8px;
  color: var(--ink);
  width: 100%;
  box-sizing: border-box;
  cursor: pointer;
  outline: none;
}

/* Header row buttons */
.header-delete,
.header-add {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  vertical-align: middle;
}

.header-delete:hover,
.header-add:hover {
  color: var(--ink);
  background: var(--paper-2);
}

/* Variables table toggle switch column (3rd column) */
.docs-article--api-endpoint table td:nth-child(3) {
  width: 60px;
  text-align: center;
  padding: 5px 4px;
}

/* Last column (Delete button in Headers table) */
.docs-article--api-endpoint table tr td:last-child button.header-delete {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 5px 8px;
}

/* ── API Send button & live response ── */
.api-endpoint-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-right: clamp(24px, 4vw, 64px);
}
.api-endpoint-header h1 { margin-bottom: 0; flex: 1; }

.api-send-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  padding: 8px 18px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-family: inherit;
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: opacity .15s;
  white-space: nowrap;
}
.api-send-btn:hover:not(:disabled) { opacity: .85; }
.api-send-btn:disabled,
.api-send-btn--loading { opacity: .55; cursor: default; }

.api-response-live { margin-bottom: 26px; max-width: calc(100% - clamp(24px, 4vw, 64px)); }
.api-response-live .request-body-editor { width: 100%; margin: 0; }

.api-response-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.api-response-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: var(--radius-sm);
  font-family: var(--mono);
  font-size: .8rem;
  font-weight: 700;
}
.api-response-badge--success  { background: rgba(95,188,46,.12);  color: #5fbc2e; }
.api-response-badge--redirect { background: rgba(79,179,184,.12); color: var(--aqua); }
.api-response-badge--client   { background: rgba(217,119,6,.12);  color: #d97706; }
.api-response-badge--server   { background: rgba(220,53,53,.1);   color: #dc3535; }
.api-response-badge--error    { background: rgba(107,111,122,.1); color: var(--muted); }

.api-response-time {
  font-family: var(--mono);
  font-size: .8rem;
  color: var(--muted);
}

.api-response-body {
  max-height: 420px;
  overflow-y: auto;
  margin: 0;
}

.api-response-hint {
  font-size: .9rem;
  color: var(--muted);
  padding: 10px 16px;
  background: var(--paper-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin: 0;
}

.docs-match {
  position: relative;
  background: rgba(26,161,226,.07);
  border-radius: 4px;
}
.docs-match::before {
  content: "";
  position: absolute;
  left: -20px;
  top: 50%;
  transform: translateY(-50%);
  width: 14px;
  height: 14px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231AA1E2' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3Cpath d='M21 21l-4.35-4.35'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* --- Admonitions --- */
.admonition {
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 0 0 20px;
  border-left: 3px solid;
}

.admonition__title {
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin: 0 0 8px;
}

.admonition__body p:last-child { margin-bottom: 0; }

.admonition--note,
.admonition--info {
  background: rgba(26,161,226,.08);
  border-color: var(--accent);
}
.admonition--note .admonition__title,
.admonition--info .admonition__title { color: var(--accent); }

.admonition--tip {
  background: rgba(95,188,46,.08);
  border-color: var(--good);
}
.admonition--tip .admonition__title { color: var(--good); }

.admonition--caution,
.admonition--warning {
  background: rgba(214,166,71,.1);
  border-color: var(--gold);
}
.admonition--caution .admonition__title,
.admonition--warning .admonition__title { color: var(--gold); }

.admonition--danger {
  background: rgba(220,53,53,.08);
  border-color: #DC3535;
}
.admonition--danger .admonition__title { color: #DC3535; }

/* --- Toggle Switch for Optional Placeholders --- */
.docs-article--api-endpoint table .toggle-switch {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 24px;
  position: relative;
  cursor: pointer;
  border-radius: 20px;
  transition: background-color 0.2s ease;
  background: #d1d5db;
  flex-shrink: 0;
  margin: 0 auto;
  box-sizing: border-box;
}

.docs-article--api-endpoint table .toggle-switch.toggle-on {
  background: #5fbc2e;
}

.docs-article--api-endpoint table .toggle-knob {
  width: 20px;
  height: 20px;
  position: absolute;
  top: 2px;
  left: 2px;
  background: #fff;
  border-radius: 50%;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}

.docs-article--api-endpoint table .toggle-switch.toggle-on .toggle-knob {
  transform: translateX(20px);
}

/* --- Overlay --- */
.docs-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(14,27,61,.4);
  z-index: 40;
}

/* --- Hide TOC on medium screens --- */
@media (max-width: 1100px) {
  .docs-layout {
    grid-template-columns: var(--sidenav-width) 4px 1fr;
  }
  .docs-toc {
    display: none;
  }
  #docs-resizer-right {
    display: none;
  }
  /* Position elements correctly for 3-column layout on medium screens */
  .docs-sidenav {
    grid-column: 1;
  }
  #docs-resizer-left {
    grid-column: 2;
  }
  .docs-body {
    grid-column: 3;
  }
}

/* --- Mobile --- */
@media (max-width: 880px) {
  .docs-layout {
    grid-template-columns: 1fr;
  }

  .docs-sidenav,
  .docs-body,
  .docs-toc {
    grid-column: auto;
  }

  .docs-resizer {
    display: none;
  }

  .docs-content {
    padding-right: clamp(24px, 4vw, 64px);
  }

  .docs-body {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
  }

  .docs-breadcrumb {
    position: static;
  }

  .docs-sidenav {
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    width: 75vw;
    z-index: 50;
    transform: translateX(-100%);
    transition: transform .25s ease;
    padding-top: 56px;
  }

  .docs-sidenav.open {
    transform: translateX(0);
  }

  .docs-sidenav__close {
    display: block;
    position: absolute;
    top: 14px; right: 14px;
    background: none;
    border: none;
    font-size: 1.1rem;
    color: var(--muted);
    cursor: pointer;
    padding: 4px 8px;
  }

  .docs-overlay.open { display: block; }

  .docs-breadcrumb {
    flex-wrap: wrap;
    padding: 10px 16px 0;
    gap: 0;
  }

  .docs-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    order: 1;
    padding: 7px 12px;
    background: var(--paper-2);
    border: 1px solid var(--line);
    border-radius: var(--radius-sm);
    font-size: .88rem;
    font-weight: 600;
    color: var(--ink);
    cursor: pointer;
  }

  .docs-breadcrumb__actions {
    order: 2;
    margin-left: auto;
  }

  #docs-breadcrumb {
    order: 3;
    flex-basis: 100%;
    padding: 10px 2px 12px;
  }

  .docs-content {
    flex: 1;
    padding: clamp(32px, 4vw, 56px) 0 clamp(24px, 4vw, 64px) clamp(24px, 4vw, 64px);
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    width: 100%;
    box-sizing: border-box;
  }

  .docs-article {
    width: 100%;
    max-width: 100%;
  }

  .docs-article pre {
    margin: 0 0 20px clamp(24px, 4vw, 64px);
    margin-left: 0;
    width: calc(100% - clamp(24px, 4vw, 64px));
    box-sizing: border-box;
  }

  .docs-article table {
    margin: 0 0 20px clamp(24px, 4vw, 64px);
    margin-left: 0;
    width: calc(100% - clamp(24px, 4vw, 64px));
  }

  .docs-article blockquote {
    margin: 0 0 16px clamp(24px, 4vw, 64px);
    margin-left: 0;
    width: calc(100% - clamp(24px, 4vw, 64px));
  }

  .docs-toc {
    display: none;
  }
}
