/* ── 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: 18px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 400px;
  box-shadow: var(--shadow-card);
  transition: border-color var(--duration-normal);
  position: relative;
  overflow: hidden;
}

.pg-request-panel::before,
.pg-response-panel::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(99,102,241,0.02) 0%, transparent 30%);
  pointer-events: none;
}

.pg-request-panel:hover,
.pg-response-panel:hover {
  border-color: var(--border-strong);
}

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

.pg-method-select {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 700;
  padding: 10px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs) 0 0 var(--radius-xs);
  color: var(--success);
  cursor: pointer;
  min-width: 95px;
  appearance: none;
  transition: all var(--duration-fast);
}

.pg-method-select:focus {
  border-color: var(--accent);
  z-index: 1;
  box-shadow: 0 0 0 3px var(--accent-muted);
}

.pg-url-input {
  flex: 1;
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 500;
  padding: 10px 14px;
  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;
  transition: all var(--duration-fast);
}

.pg-url-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
  z-index: 1;
}

.pg-url-bar .btn {
  border-radius: 0 var(--radius-xs) var(--radius-xs) 0;
  padding: 10px 18px;
  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: 7px 10px;
}

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

.pg-tab {
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 9px 18px;
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--duration-fast);
  letter-spacing: 0.01em;
}

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

.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: 7px 10px;
  font-family: var(--font-mono);
}

.pg-kv-remove {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 18px;
  padding: 4px 8px;
  border-radius: 6px;
  transition: all var(--duration-fast);
  line-height: 1;
}

.pg-kv-remove:hover {
  color: var(--danger);
  background: var(--danger-muted);
}

/* Body editor */
.pg-body-editor {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xs);
  color: var(--text);
  resize: vertical;
  tab-size: 2;
  width: 100%;
  transition: all var(--duration-fast);
}

.pg-body-editor:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-muted);
}

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

.pg-response-empty svg {
  animation: float-subtle 3s ease-in-out infinite;
}

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

.pg-response-body {
  font-family: var(--font-mono);
  font-size: 12px;
  line-height: 1.6;
  padding: 14px;
  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: 14px;
  color: var(--muted);
  font-weight: 500;
}

.pg-spinner {
  width: 32px;
  height: 32px;
  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: var(--font-sans);
}
