:root {
  color-scheme: dark;
  --bg: #06101d;
  --panel: #0c1b2d;
  --panel-2: #11253d;
  --line: #29435f;
  --text: #edf6ff;
  --muted: #9eb3ca;
  --blue: #4da3ff;
  --green: #54e39c;
  --red: #ff7882;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at 85% -10%, #163e67 0, transparent 35%), var(--bg);
  font-family: "Segoe UI", Arial, sans-serif;
}

button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.sim-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px clamp(18px, 5vw, 64px);
  border-bottom: 1px solid var(--line);
  background: rgba(4, 14, 25, 0.86);
  backdrop-filter: blur(14px);
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: clamp(24px, 4vw, 38px); }
h2 { margin-bottom: 6px; }

.eyebrow {
  margin-bottom: 5px;
  color: #7fbfff;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.sim-topbar nav { display: flex; flex-wrap: wrap; gap: 10px; }
a { color: #9fd0ff; }

.sim-shell { width: min(1480px, calc(100% - 32px)); margin: 26px auto 50px; }
.sim-panel, .endpoint-bar {
  border: 1px solid var(--line);
  border-radius: 13px;
  background: linear-gradient(145deg, rgba(17, 37, 61, .97), rgba(8, 23, 39, .98));
  box-shadow: 0 20px 50px rgba(0, 0, 0, .27);
}
.sim-panel { padding: clamp(18px, 3vw, 28px); }

.login-panel { display: grid; grid-template-columns: 1fr minmax(280px, 420px); gap: 30px; max-width: 950px; margin: 80px auto; }
.muted, label span, .response-meta { color: var(--muted); }
.error-text { min-height: 20px; margin: 0; color: var(--red); }

form, label { display: grid; gap: 8px; }
.form-grid { display: grid; gap: 13px; }
.form-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

input, select, textarea {
  width: 100%;
  min-height: 43px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #061321;
}
textarea { resize: vertical; }
input:focus, select:focus, textarea:focus { outline: 2px solid rgba(77, 163, 255, .35); border-color: var(--blue); }

button, .download-link {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: #132943;
  text-align: center;
  text-decoration: none;
}
.primary { border-color: #287ed4; background: #2372c4; font-weight: 800; }
.secondary { background: transparent; }
.wide { width: 100%; margin-top: 5px; }

.endpoint-bar { display: flex; align-items: center; justify-content: space-between; gap: 15px; margin-bottom: 16px; padding: 13px 17px; }
.endpoint-bar div { display: flex; flex-wrap: wrap; gap: 9px; }
code { color: #b9dcff; }
.pill { padding: 5px 10px; border-radius: 999px; font-size: 12px; font-weight: 800; }
.pill.online { color: var(--green); background: rgba(33, 132, 88, .22); }
.pill.error { color: var(--red); background: rgba(163, 45, 56, .22); }

.sim-grid { display: grid; grid-template-columns: minmax(420px, .92fr) minmax(460px, 1.08fr); gap: 16px; }
.panel-heading, .quick-row, .json-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.event-fields { padding: 15px; border: 1px solid var(--line); border-radius: 9px; background: rgba(3, 14, 25, .45); }
.event-fields[hidden] { display: none; }
.quick-row { flex-wrap: wrap; margin-top: 4px; }
.quick-row button { flex: 1 1 130px; }

.display-preview {
  display: grid;
  place-items: center;
  min-height: 220px;
  margin: 18px 0;
  padding: 24px;
  border: 8px solid #02070d;
  border-radius: 17px;
  background: #174ea6;
  box-shadow: inset 0 0 0 1px #33475d;
  text-align: center;
}
.preview-symbol { color: #fff; font-size: 38px; font-weight: 900; }
.display-preview strong { max-width: 90%; color: #fff; font-size: clamp(24px, 4vw, 42px); }
.display-preview span { color: rgba(255,255,255,.72); }

.json-heading { margin: 14px 0 7px; color: var(--muted); font-size: 13px; font-weight: 800; }
.json-heading button { min-height: 30px; padding: 4px 9px; }
pre { max-height: 330px; margin: 0; padding: 14px; overflow: auto; border: 1px solid var(--line); border-radius: 9px; color: #b9dcff; background: #030b14; white-space: pre-wrap; overflow-wrap: anywhere; }
.download-link { display: block; margin-top: 14px; }
.download-link[hidden], [hidden] { display: none !important; }

@media (max-width: 940px) {
  .sim-grid, .login-panel { grid-template-columns: 1fr; }
  .login-panel { margin-top: 28px; }
}

@media (max-width: 620px) {
  .sim-topbar, .endpoint-bar, .panel-heading { align-items: stretch; flex-direction: column; }
  .sim-topbar nav a { flex: 1; }
  .form-grid.two { grid-template-columns: 1fr; }
  .sim-shell { width: min(100% - 20px, 1480px); margin-top: 14px; }
}
