:root {
  color-scheme: light;
  --ink: #111416;
  --muted: #68727e;
  --line: #dce2e8;
  --paper: #ffffff;
  --page: #f5f7fa;
  --green: #167a54;
  --blue: #2e67d1;
  --coral: #d85c48;
  --amber: #bd7f16;
  --shadow: 0 18px 58px rgba(17, 20, 22, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(135deg, rgba(46, 103, 209, 0.10), transparent 32%),
    linear-gradient(315deg, rgba(22, 122, 84, 0.12), transparent 38%),
    var(--page);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
  letter-spacing: 0;
}

button {
  cursor: pointer;
}

.shell {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
  padding: 24px 0 42px;
}

.topbar,
.panel-head,
.button-row,
.split {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar {
  margin-bottom: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  text-decoration: none;
  font-size: 25px;
  font-weight: 900;
}

.brand img {
  width: 38px;
  height: 38px;
}

.status-pill,
.count {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--muted);
  padding: 8px 12px;
  white-space: nowrap;
  font-size: 12px;
  font-weight: 900;
}

.status-pill.ok {
  border-color: rgba(22, 122, 84, 0.26);
  color: var(--green);
}

.status-pill.bad {
  border-color: rgba(216, 92, 72, 0.28);
  color: var(--coral);
}

.workspace {
  display: grid;
  grid-template-columns: 360px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.side,
.main {
  display: grid;
  gap: 16px;
}

.panel {
  border: 1px solid rgba(17, 20, 22, 0.10);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  padding: 18px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--green);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  line-height: 1.05;
  word-break: keep-all;
}

h1 {
  font-size: 38px;
}

h2 {
  font-size: 26px;
}

.field {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 850;
}

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

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 120px;
  padding: 12px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(46, 103, 209, 0.14);
}

.split {
  align-items: end;
}

.split .field {
  flex: 1;
}

.primary,
.ghost {
  display: inline-grid;
  place-items: center;
  min-height: 42px;
  border-radius: 8px;
  padding: 0 14px;
  font-weight: 900;
}

.primary {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: #fff;
}

.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.wide {
  width: 100%;
  margin-top: 14px;
}

.button-row {
  margin-top: 12px;
}

.button-row button {
  flex: 1;
}

.endpoint-list {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

code {
  display: block;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #111416;
  color: #fff;
  padding: 12px;
  white-space: nowrap;
  font-size: 13px;
}

.events {
  display: grid;
  gap: 10px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.event {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 12px;
}

.event-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.event-title {
  font-size: 17px;
  font-weight: 900;
}

.event-meta,
.event-message,
.event-payload {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.45;
}

.event-payload {
  overflow: auto;
  max-height: 170px;
  border-radius: 8px;
  background: #f1f4f7;
  padding: 10px;
  white-space: pre-wrap;
}

.badge {
  display: inline-grid;
  place-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 9px;
  background: rgba(46, 103, 209, 0.10);
  color: var(--blue);
  font-size: 12px;
  font-weight: 950;
}

.badge.warning {
  background: rgba(189, 127, 22, 0.12);
  color: var(--amber);
}

.badge.critical {
  background: rgba(216, 92, 72, 0.12);
  color: var(--coral);
}

.empty {
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  padding: 18px;
  text-align: center;
  font-weight: 850;
}

.toast {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  max-width: min(360px, calc(100vw - 32px));
  transform: translateY(120px);
  border-radius: 8px;
  background: var(--ink);
  color: #fff;
  padding: 12px 14px;
  box-shadow: var(--shadow);
  font-weight: 850;
  opacity: 0;
  transition: transform 180ms ease, opacity 180ms ease;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

@media (max-width: 900px) {
  .shell {
    width: min(100vw - 20px, 680px);
    padding-top: 14px;
  }

  .workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 540px) {
  .topbar,
  .panel-head,
  .split {
    align-items: stretch;
    flex-direction: column;
  }

  h1 {
    font-size: 32px;
  }

  .event-top {
    flex-direction: column;
  }
}
