.api-test-lead {
  margin: 0 0 16px;
}

.api-method-handler-shell {
  margin-bottom: 18px;
}

.api-method-handler-shell .api-method-handler-head {
  display: flex;
  gap: 10px;
  width: 100%;
  margin: 0;
  padding: 0;
  border: none;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  align-items: flex-start;
  box-sizing: border-box;
}

.api-method-handler-shell .api-method-handler-head:hover .api-mh-title {
  text-decoration: underline;
}

.api-method-handler-shell .api-mh-chev {
  flex: 0 0 auto;
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 0.75rem;
  transition: transform 0.15s ease;
}

.api-method-handler-shell.is-collapsed .api-mh-chev {
  transform: rotate(-90deg);
}

.api-method-handler-shell .api-mh-text {
  flex: 1;
  min-width: 0;
}

.api-method-handler-shell .api-mh-expanded {
  display: flex;
  flex-direction: column;
  gap: 6px;
  align-items: flex-start;
}

.api-method-handler-shell .api-mh-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0;
}

.api-method-handler-shell .api-mh-methods {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  word-break: break-word;
}

.api-method-handler-shell .api-mh-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.4;
  margin: 0;
  max-width: 100%;
}

.api-method-handler-shell .api-mh-collapsed {
  display: none;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.api-method-handler-shell.is-collapsed .api-mh-expanded {
  display: none;
}

.api-method-handler-shell.is-collapsed .api-mh-collapsed {
  display: block;
}

.api-method-handler-shell.is-collapsed .api-mh-body {
  display: none;
}

.api-method-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
  margin-bottom: 12px;
}

.api-method-row--wide {
  flex-direction: column;
  align-items: stretch;
}

.api-method-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 13px;
  color: var(--text-secondary);
  min-width: 140px;
}

.api-method-row--wide label {
  min-width: 0;
  width: 100%;
}

.api-method-row--campaigns {
  align-items: center;
}

.api-method-row--campaigns label {
  flex: 1 1 280px;
  max-width: 480px;
}

.api-method-row--campaigns select {
  min-width: 220px;
}

.api-method-inline-meta {
  font-size: 12px;
  color: var(--text-secondary);
  flex: 1 1 160px;
}

.api-method-row input[type="text"],
.api-method-row input[type="date"],
.api-method-row input[type="number"],
.api-method-row select,
.api-method-row textarea {
  background: var(--input-bg);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
}

.api-method-row textarea {
  width: 100%;
  min-height: 72px;
  resize: vertical;
}

.api-method-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.api-method-status {
  font-size: 13px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  min-height: 1.4em;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-color);
  background: var(--panel2);
  max-height: 420px;
  overflow: auto;
}

.api-method-status.is-ok {
  border-color: rgba(34, 197, 94, 0.35);
}

.api-method-status.is-err {
  border-color: rgba(239, 68, 68, 0.4);
  color: var(--alert-text);
}

.api-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 20px;
}

.api-modal-backdrop.open {
  display: flex;
}

.api-modal {
  max-width: 920px;
  max-height: 88vh;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-lg);
}

.api-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  font-weight: 600;
  font-size: 14px;
}

.api-modal-body {
  padding: 12px 16px;
  overflow: auto;
  flex: 1;
  min-height: 0;
}

.api-modal-body pre {
  margin: 0;
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
