:root {
  --bg: #0d0f14;
  --bg-raised: #151822;
  --bg-input: #1b1f2b;
  --border: #262b3a;
  --text: #e6e8ee;
  --text-dim: #8a90a4;
  --accent: #7c6cf0;
  --accent-hover: #8f81f5;
  --get: #22c55e;
  --delete: #ef4444;
  --delete-hover: #dc2626;
  --ok-bg: #10321f;
  --ok-border: #1f5c37;
  --err-bg: #3a1414;
  --err-border: #6b1f1f;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

.app {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

.topbar {
  display: flex;
  align-items: center;
  padding: 24px 0 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  object-fit: cover;
  display: block;
}

.brand-name {
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
}

.tabs {
  display: flex;
  gap: 6px;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  padding-bottom: 1px;
}

.tab {
  appearance: none;
  background: transparent;
  border: none;
  color: var(--text-dim);
  font-size: 13.5px;
  font-weight: 500;
  padding: 10px 14px;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color .15s ease;
}

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

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

.tab.danger-tab.active {
  border-bottom-color: var(--delete);
}

.panels { padding-top: 28px; }

.panel { display: none; }
.panel.active { display: block; }

.method-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}

.method {
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 5px;
  letter-spacing: 0.02em;
}

.method.get {
  background: rgba(34, 197, 94, 0.12);
  color: var(--get);
}

.method.delete {
  background: rgba(239, 68, 68, 0.12);
  color: var(--delete);
}

.url {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13.5px;
  color: var(--text-dim);
}

.hint {
  font-size: 13px;
  color: var(--text-dim);
  margin: -8px 0 18px;
}

.form {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 420px;
}

.form label {
  font-size: 12.5px;
  color: var(--text-dim);
  font-weight: 500;
}

.form input {
  background: var(--bg-input);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  outline: none;
}

.form input:focus {
  border-color: var(--accent);
}

.btn {
  appearance: none;
  border: none;
  border-radius: 8px;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 16px;
  cursor: pointer;
  margin-top: 4px;
  width: fit-content;
  transition: background .15s ease, opacity .15s ease;
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn.primary {
  background: var(--accent);
  color: #fff;
}
.btn.primary:hover:not(:disabled) { background: var(--accent-hover); }

.btn.danger {
  background: var(--delete);
  color: #fff;
}
.btn.danger:hover:not(:disabled) { background: var(--delete-hover); }

.btn.ghost {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text);
}
.btn.ghost:hover { background: var(--bg-input); }

.result { margin-top: 22px; }

.result:empty { margin-top: 0; }

.status-line {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-weight: 600;
}

.status-line.ok { color: var(--get); }
.status-line.err { color: var(--delete); }

.result pre {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  line-height: 1.55;
  overflow-x: auto;
  margin: 0;
  color: var(--text);
}

.result.ok pre { border-color: var(--ok-border); background: var(--ok-bg); }
.result.err pre { border-color: var(--err-border); background: var(--err-bg); }

.spinner {
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  display: inline-block;
  animation: spin .7s linear infinite;
}

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

.modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  align-items: center;
  justify-content: center;
  padding: 16px;
  z-index: 10;
}

.modal-backdrop.open {
  display: flex;
}

.modal {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 22px;
  max-width: 380px;
  width: 100%;
}

.modal h2 {
  font-size: 16px;
  margin: 0 0 10px;
}

.modal p {
  font-size: 13.5px;
  color: var(--text-dim);
  margin: 0 0 20px;
  word-break: break-word;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

@media (max-width: 480px) {
  .app { padding: 0 16px 40px; }
  .form { max-width: 100%; }
}
