.api-tester-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 14px 0 22px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.api-tester-trigger__summary {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
  color: #334155;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.api-tester-trigger__path {
  overflow: hidden;
  color: #334155;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.api-tester-trigger__button,
.api-tester__button {
  border: 0;
  border-radius: 6px;
  padding: 8px 14px;
  color: #fff;
  background: #42b983;
  cursor: pointer;
  font-weight: 600;
}

.api-tester-trigger__button {
  flex: 0 0 auto;
}

.api-tester-trigger__button:hover,
.api-tester__button:hover {
  background: #2f9b70;
}

.api-tester-trigger__button:disabled,
.api-tester__button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.api-tester-trigger--error {
  display: block;
  color: #b91c1c;
  background: #fef2f2;
}

.api-tester-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;
  padding: 16px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.46);
}

.api-tester-modal--open {
  display: block;
}

.api-tester-modal-open {
  overflow: hidden;
}

.api-tester-modal__dialog {
  width: min(1120px, 100%);
  max-height: calc(100vh - 32px);
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.28);
}

.api-tester-modal__bar {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #fff;
}

.api-tester-modal__title {
  color: #1f2937;
  font-size: 15px;
}

.api-tester-modal__close {
  border: 0;
  border-radius: 6px;
  padding: 7px 12px;
  color: #334155;
  background: #e2e8f0;
  cursor: pointer;
  font-weight: 600;
}

.api-tester-modal__content {
  min-height: 0;
  overflow: auto;
  padding: 12px;
}

.api-tester {
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
}

.api-tester__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid #e5e7eb;
  background: #f8fafc;
}

.api-tester__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #1f2937;
}

.api-tester__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.api-tester__method {
  min-width: 54px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #0f766e;
  color: #fff;
  text-align: center;
}

.api-tester__path {
  color: #334155;
}

.api-tester__body {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.api-tester__row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.api-tester__field {
  display: grid;
  gap: 6px;
}

.api-tester__label {
  font-size: 12px;
  font-weight: 600;
  color: #475569;
}

.api-tester input,
.api-tester select,
.api-tester textarea {
  width: 100%;
  box-sizing: border-box;
  border: 1px solid #d1d5db;
  border-radius: 6px;
  padding: 8px 10px;
  color: #111827;
  background: #fff;
  font: inherit;
}

.api-tester textarea {
  min-height: 96px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.api-tester__textarea--headers {
  min-height: 78px;
}

.api-tester__textarea--query {
  min-height: 78px;
}

.api-tester__textarea--body {
  min-height: 130px;
}

.api-tester__actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.api-tester__button--secondary {
  color: #334155;
  background: #e2e8f0;
}

.api-tester__button--secondary:hover {
  background: #cbd5e1;
}

.api-tester__check {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 6px;
  color: #475569;
  font-size: 12px;
  font-weight: 600;
}

.api-tester__check input {
  width: auto;
  margin: 0;
}

.api-tester__hint {
  font-size: 12px;
  color: #64748b;
}

.api-tester__credential-hint {
  margin-top: -4px;
  padding: 8px 10px;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 12px;
  line-height: 1.6;
}

.markdown-section .api-tester .api-tester__result,
.api-tester__result {
  display: grid;
  gap: 10px;
  padding: 14px;
  border-top: 1px solid #e5e7eb;
  background: #0f172a;
  color: #dbeafe;
}

.api-tester__result--empty {
  background: #f8fafc;
  color: #475569;
}

.api-tester__result--loading {
  background: #172554;
  color: #dbeafe;
}

.api-tester__result--error {
  background: #1f1720;
}

.api-tester__result-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.api-tester__result-title {
  color: inherit;
  font-size: 13px;
}

.markdown-section .api-tester .api-tester__status,
.api-tester__status {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
}

.markdown-section .api-tester pre.api-tester__output,
.api-tester__output {
  max-height: 300px;
  min-height: 72px;
  overflow: auto;
  box-sizing: border-box;
  margin: 0;
  padding: 12px;
  border: 1px solid #334155;
  border-radius: 6px;
  white-space: pre-wrap;
  color: #e5e7eb;
  background: #111827;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  text-shadow: none;
}

.api-tester__result--empty .api-tester__output {
  color: #475569;
  background: #fff;
  border-color: #e2e8f0;
}

.markdown-section .api-tester .api-tester__error,
.api-tester__error {
  color: #fecaca;
}

@media (max-width: 760px) {
  .api-tester-modal {
    padding: 8px;
  }

  .api-tester-modal__dialog {
    max-height: calc(100vh - 16px);
  }

  .api-tester-trigger,
  .api-tester__header,
  .api-tester__row {
    display: grid;
    grid-template-columns: 1fr;
  }

  .api-tester-trigger__summary {
    overflow: hidden;
  }
}
