:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --ink: #17202a;
  --muted: #667085;
  --line: #d8dee9;
  --card: #ffffff;
  --accent: #0f9f6e;
  --accent-dark: #087653;
  --danger: #c0362c;
  --soft: #e8f7f1;
  --shadow: 0 18px 50px rgba(17, 24, 39, .08);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(15, 159, 110, .08), transparent 34%),
    linear-gradient(315deg, rgba(38, 132, 255, .08), transparent 35%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.shell {
  width: min(1480px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0;
}

.topbar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(320px, 760px);
  gap: 20px;
  align-items: end;
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1, h2 { margin: 0; letter-spacing: 0; }
h1 { font-size: clamp(30px, 4vw, 54px); line-height: 1; }
h2 { font-size: 18px; margin-bottom: 18px; }

.host-card, .panel {
  background: rgba(255, 255, 255, .88);
  border: 1px solid rgba(216, 222, 233, .9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.host-card {
  display: grid;
  grid-template-columns: 1.2fr .8fr .9fr;
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
}

.grid {
  display: grid;
  grid-template-columns: 300px minmax(420px, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.panel {
  min-width: 0;
  padding: 18px;
  border-radius: 8px;
}

.primary { min-height: 620px; }

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input, select, textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  outline: none;
  padding: 11px 12px;
}

textarea {
  resize: vertical;
  min-height: 110px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

input:focus, select:focus, textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(15, 159, 110, .14);
}

button {
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 14px;
  font-weight: 800;
  min-height: 42px;
  padding: 10px 14px;
}

button:hover { background: var(--accent-dark); }
button:disabled { cursor: wait; opacity: .7; }
button.danger { background: var(--danger); }

.button-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
}

.tab {
  background: transparent;
  color: var(--muted);
  min-height: 38px;
}

.tab:hover, .tab.active {
  background: var(--soft);
  color: var(--accent-dark);
}

.tab-panel { display: none; }
.tab-panel.active { display: grid; gap: 14px; }

.inline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.endpoint-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.response-panel {
  position: sticky;
  top: 18px;
}

.webhook-panel {
  grid-column: 1 / 3;
}

.webhook-panel form {
  display: grid;
  gap: 14px;
}

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

.check-row input,
.event-grid input {
  width: auto;
}

.event-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.event-grid label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-weight: 650;
}

.response-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.response-head h2 { margin-bottom: 0; }
.response-head button {
  background: #eef2f7;
  color: var(--ink);
}

pre {
  min-height: 560px;
  max-height: 72vh;
  margin: 0;
  overflow: auto;
  border-radius: 8px;
  background: #111827;
  color: #d1fae5;
  padding: 16px;
  white-space: pre-wrap;
  word-break: break-word;
  font-size: 12px;
  line-height: 1.55;
}

.qr-box {
  display: grid;
  place-items: center;
  min-height: 190px;
  margin-top: 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: #fbfdff;
  color: var(--muted);
  overflow: hidden;
}

.qr-box img {
  max-width: 100%;
  max-height: 320px;
  height: auto;
  padding: 10px;
}

@media (max-width: 1180px) {
  .topbar, .grid { grid-template-columns: 1fr; }
  .webhook-panel { grid-column: auto; }
  .response-panel { position: static; }
}

@media (max-width: 680px) {
  .shell { width: min(100% - 20px, 1480px); padding: 16px 0; }
  .host-card, .inline { grid-template-columns: 1fr; }
  .event-grid { grid-template-columns: 1fr; }
  .button-grid { grid-template-columns: 1fr; }
  .tabs { overflow-x: auto; }
}
