/* ── Playground ── */
.pg-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 24px;
}

@media (max-width: 960px) {
  .pg-layout { grid-template-columns: 1fr; }
}

.pg-request-panel,
.pg-response-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 400px;
}

/* URL bar */
.pg-url-bar {
  display: flex;
  gap: 0;
  align-items: stretch;
}

.pg-method-select {
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs) 0 0 var(--radius-xs);
  color: var(--success);
  cursor: pointer;
  min-width: 90px;
}

.pg-method-select:focus {
  border-color: var(--accent);
  z-index: 1;
}

.pg-url-input {
  flex: 1;
  font-family: 'SF Mono', 'Fira Code', monospace, inherit;
  font-size: 13px;
  padding: 8px 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: none;
  border-right: none;
  border-radius: 0;
  color: var(--text);
  outline: none;
  min-width: 0;
}

.pg-url-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
  z-index: 1;
}

.pg-url-bar .btn {
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  padding: 8px 16px;
  white-space: nowrap;
}

/* Route quick select */
.pg-route-quick {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.pg-route-quick select,
.pg-route-quick input {
  font-size: 12px;
  padding: 6px 8px;
}

/* Tabs */
.pg-tabs {
  display: flex;
  gap: 0;
  border-bottom: 1px solid var(--border);
}

.pg-tab {
  font-family: inherit;
  font-size: 12px;
  font-weight: 500;
  padding: 8px 16px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s, border-color 0.15s;
}

.pg-tab:hover {
  color: var(--text);
}

.pg-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

.pg-tab-content,
.pg-resp-tab-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Key-value rows */
.pg-kv-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
  align-items: center;
}

.pg-kv-row input {
  flex: 1;
  font-size: 12px;
  padding: 6px 8px;
  font-family: 'SF Mono', 'Fira Code', monospace, inherit;
}

.pg-kv-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color 0.15s, background 0.15s;
  line-height: 1;
}

.pg-kv-remove:hover {
  color: var(--danger);
  background: rgba(239,68,68,0.1);
}

/* Body editor */
.pg-body-editor {
  font-family: 'SF Mono', 'Fira Code', monospace, inherit;
  font-size: 12px;
  line-height: 1.6;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  resize: vertical;
  tab-size: 2;
  width: 100%;
}

.pg-body-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(139,92,246,0.15);
}

/* Response panel */
.pg-response-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  color: var(--muted);
  opacity: 0.4;
  gap: 12px;
  text-align: center;
}

.pg-response-status {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface);
  border-radius: var(--radius-xs);
  border: 1px solid var(--border);
  flex-wrap: wrap;
}

.pg-response-body {
  font-family: 'SF Mono', 'Fira Code', monospace;
  font-size: 12px;
  line-height: 1.6;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  overflow: auto;
  max-height: 400px;
  white-space: pre-wrap;
  word-break: break-word;
  margin: 0;
  flex: 1;
}

.pg-resp-tabs {
  margin-top: 8px;
}

/* Loading */
.pg-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  flex: 1;
  gap: 12px;
  color: var(--muted);
}

.pg-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: pg-spin 0.7s linear infinite;
}

@keyframes pg-spin {
  to { transform: rotate(360deg); }
}

/* History replay btn */
.pg-replay-btn {
  font-family: inherit;
}
