:root {
  --bg: #f3f4f6;
  --card: #ffffff;
  --border: #e5e7eb;
  --text: #111827;
  --text-muted: #6b7280;
  --accent: #4f46e5;
  --accent-hover: #4338ca;
  --danger: #dc2626;
  --danger-hover: #b91c1c;
  --font-sans: system-ui, -apple-system, sans-serif;
  --font-mono: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.06);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  min-height: 100vh;
}

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 32px 16px 64px;
}

/* ── Header ── */
.site-header {
  margin-bottom: 32px;
}

.logo {
  font-size: 24px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.5px;
}

.tagline {
  color: var(--text-muted);
  margin-top: 2px;
}

/* ── Buttons ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius);
  border: none;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: background 0.15s;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  text-decoration: none;
}
.btn-primary:hover { background: var(--accent-hover); }

.btn-copy {
  background: #f3f4f6;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-copy:hover { background: #e5e7eb; }

.btn-danger {
  background: transparent;
  color: var(--danger);
  border: 1px solid #fecaca;
}
.btn-danger:hover { background: #fef2f2; }

/* ── Card ── */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* ── URL bar ── */
.url-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.url-bar code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  word-break: break-all;
  flex: 1;
}

.url-bar .label {
  color: var(--text-muted);
  font-size: 13px;
  white-space: nowrap;
}

/* ── Landing page ── */
.landing-body {
  padding: 24px 20px;
}

.hint {
  color: var(--text-muted);
  margin-bottom: 16px;
}

.curl-examples {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 24px;
}

.curl-block {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.curl-block-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: #f9fafb;
  border-bottom: 1px solid var(--border);
}

.curl-block pre {
  padding: 12px 14px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text);
  overflow-x: auto;
  white-space: pre;
  background: #fff;
  margin: 0;
}

/* ── Method badges ── */
.method-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  font-family: var(--font-mono);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.method-get    { background: #dcfce7; color: #15803d; }
.method-post   { background: #dbeafe; color: #1d4ed8; }
.method-put    { background: #ffedd5; color: #c2410c; }
.method-patch  { background: #fef9c3; color: #a16207; }
.method-delete { background: #fee2e2; color: #b91c1c; }
.method-other  { background: #f3f4f6; color: #374151; }

/* ── Inspector page header ── */
.inspect-header {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inspect-header .row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inspect-header .row.space-between {
  justify-content: space-between;
}

.inspect-header code {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
  word-break: break-all;
  flex: 1;
}

/* ── Live indicator ── */
.live-indicator {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted);
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-connected    { background: #22c55e; }
.dot-disconnected { background: #9ca3af; }

/* ── Empty state ── */
.empty-state {
  text-align: center;
  padding: 64px 20px;
  color: var(--text-muted);
}

.pulse-ring {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #e0e7ff;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  animation: pulse 2s infinite;
}

.pulse-ring::after {
  content: '';
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--accent);
}

@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.08); }
}

/* ── Request cards ── */
.request-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.request-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.request-card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  flex-wrap: wrap;
}

.status-code {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: #15803d;
  background: #dcfce7;
  padding: 2px 7px;
  border-radius: 4px;
}

.time-relative {
  font-size: 12px;
  color: var(--text-muted);
}

.time-absolute {
  font-size: 11px;
  font-family: var(--font-mono);
  color: #9ca3af;
  margin-left: auto;
}

.request-ip {
  font-size: 11px;
  font-family: var(--font-mono);
  color: #9ca3af;
}

.forwarded-meta {
  font-size: 11px;
  font-family: var(--font-mono);
  color: #9ca3af;
  background: #f3f4f6;
  padding: 2px 6px;
  border-radius: 4px;
}

/* ── Two-panel body/headers ── */
.card-panels {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 120px;
}

.panel {
  padding: 14px 16px;
  overflow: auto;
}

.panel + .panel {
  border-left: 1px solid var(--border);
}

.panel-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 10px;
}

.body-pre {
  font-family: var(--font-mono);
  font-size: 12px;
  white-space: pre-wrap;
  word-break: break-all;
  color: var(--text);
  margin: 0;
}

.body-empty {
  font-size: 12px;
  color: #9ca3af;
  font-style: italic;
}

.headers-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.headers-table td {
  padding: 3px 6px 3px 0;
  vertical-align: top;
}

.header-key {
  font-family: var(--font-mono);
  color: var(--text-muted);
  white-space: nowrap;
  padding-right: 12px !important;
  font-weight: 500;
}

.header-val {
  font-family: var(--font-mono);
  color: var(--text);
  word-break: break-all;
}

/* ── Responsive ── */
@media (max-width: 600px) {
  .card-panels {
    grid-template-columns: 1fr;
  }
  .panel + .panel {
    border-left: none;
    border-top: 1px solid var(--border);
  }
  .time-absolute {
    display: none;
  }
}
