:root {
  color-scheme: dark;
  --bg: #111113;
  --panel: #1d1d21;
  --text: #f5f5f7;
  --muted: #a1a1aa;
  --accent: #e11d48;
  --line: #33333a;
}

* {
  box-sizing: border-box;
}

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

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: center;
  padding: 24px clamp(16px, 4vw, 48px);
  border-bottom: 1px solid var(--line);
}

h1, h2, p {
  margin: 0;
}

p {
  color: var(--muted);
  margin-top: 4px;
}

nav {
  display: flex;
  gap: 10px;
}

.button, button {
  border: 1px solid var(--line);
  background: #26262c;
  color: var(--text);
  border-radius: 6px;
  padding: 10px 14px;
  text-decoration: none;
  cursor: pointer;
}

.button:first-child {
  background: var(--accent);
  border-color: var(--accent);
}

.layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  padding: 24px clamp(16px, 4vw, 48px);
}

.panel {
  border: 1px solid var(--line);
  background: var(--panel);
  border-radius: 8px;
  padding: 18px;
  min-width: 0;
}

.wide {
  grid-column: 1 / -1;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

dt {
  color: var(--muted);
  font-size: 13px;
}

dd {
  margin: 4px 0 0;
  font-size: 24px;
  font-weight: 700;
}

pre, .logs {
  overflow: auto;
  white-space: pre-wrap;
  line-height: 1.5;
}

.log-row {
  border-top: 1px solid var(--line);
  padding: 10px 0;
}

.tool-form {
  display: grid;
  grid-template-columns: 130px minmax(180px, 1fr) 110px auto;
  gap: 12px;
  align-items: end;
}

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

input, select {
  width: 100%;
  border: 1px solid var(--line);
  background: #141418;
  color: var(--text);
  border-radius: 6px;
  padding: 10px 12px;
}

.tool-result {
  margin-top: 12px;
}

@media (max-width: 760px) {
  .topbar, .layout {
    grid-template-columns: 1fr;
  }

  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .tool-form {
    grid-template-columns: 1fr;
  }
}
