:root {
  color-scheme: light;
  --bg: #f4f7f6;
  --ink: #15201d;
  --muted: #65736d;
  --line: #dce5e1;
  --panel: #ffffff;
  --accent: #047857;
  --accent-strong: #065f46;
  --warn: #b45309;
  --shadow: 0 18px 48px rgba(18, 38, 32, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: var(--bg);
}

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

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.05;
}

h2 {
  font-size: 18px;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  font-weight: 700;
  box-shadow: 0 8px 24px rgba(18, 38, 32, 0.06);
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--warn);
}

.dot.online {
  background: var(--accent);
  box-shadow: 0 0 0 5px rgba(4, 120, 87, 0.14);
}

.metrics {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 14px;
  margin-bottom: 14px;
}

.metric,
.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.metric {
  min-width: 0;
  padding: 18px;
}

.metric span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.metric strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: 20px;
}

.content {
  display: grid;
  grid-template-columns: minmax(280px, 0.8fr) minmax(0, 1.2fr);
  gap: 14px;
  align-items: start;
}

.panel {
  min-width: 0;
  overflow: hidden;
}

.panelTitle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid var(--line);
}

button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent-strong);
  background: #eef8f4;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

button:hover {
  background: #dff3eb;
}

.jsonView,
.message pre {
  margin: 0;
  overflow: auto;
  font: 13px/1.55 "Cascadia Code", Consolas, "SFMono-Regular", monospace;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.jsonView {
  min-height: 420px;
  padding: 18px;
  color: #19352d;
}

.messagesPanel {
  min-height: 540px;
}

.messages {
  display: grid;
  gap: 12px;
  max-height: 680px;
  overflow: auto;
  padding: 14px;
}

.message {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdfc;
}

.message header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.message strong {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--accent-strong);
}

.message time {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 13px;
}

.message pre {
  padding: 14px;
}

.empty {
  display: grid;
  min-height: 180px;
  place-items: center;
  color: var(--muted);
}

@media (max-width: 780px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding: 20px 0;
  }

  .topbar,
  .content,
  .metrics {
    grid-template-columns: 1fr;
  }

  .topbar {
    display: grid;
  }

  .status {
    justify-content: center;
    width: 100%;
  }

  .message header {
    display: grid;
  }
}
