:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --panel: #ffffff;
  --text: #16243a;
  --muted: #5e6f8a;
  --line: #d8e1ee;
  --accent: #0f6fbf;
  --ok: #1d8b4a;
  --bad: #bf2f42;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "IBM Plex Sans", "Segoe UI", sans-serif;
  background: linear-gradient(180deg, #edf2fb 0%, var(--bg) 100%);
  color: var(--text);
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.2rem 1.4rem;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
}

.topbar h1 {
  margin: 0;
  font-size: 1.35rem;
}

.topbar p {
  margin: 0.35rem 0 0;
  color: var(--muted);
  max-width: 56rem;
}

.key-box {
  min-width: 25rem;
}

.key-box label {
  display: block;
  font-weight: 600;
  margin-bottom: 0.35rem;
}

.key-row {
  display: flex;
  gap: 0.45rem;
}

input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  padding: 0.55rem 0.6rem;
  background: #fff;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  border-radius: 0.4rem;
  padding: 0.5rem 0.7rem;
  cursor: pointer;
  font-weight: 600;
}

button:hover {
  border-color: var(--accent);
}

.layout {
  display: grid;
  grid-template-columns: 19rem 1fr;
  min-height: calc(100vh - 104px);
}

.sidebar {
  border-right: 1px solid var(--line);
  background: #f9fbff;
  padding: 0.9rem;
  overflow: auto;
}

.sidebar h2 {
  font-size: 0.9rem;
  margin: 1rem 0 0.5rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.sidebar-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.tab-list {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.tab-btn {
  text-align: left;
  width: 100%;
}

.tab-btn.active {
  border-color: var(--accent);
  background: #e8f3ff;
}

.content {
  padding: 1rem;
  overflow: auto;
}

.content-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.content-header h2 {
  margin: 0;
}

.meta {
  color: var(--muted);
  font-size: 0.9rem;
}

.results {
  margin-top: 1rem;
  display: grid;
  gap: 0.8rem;
}

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 0.6rem;
  padding: 0.7rem;
}

.card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}

.endpoint {
  font-family: "IBM Plex Mono", "Consolas", monospace;
  font-size: 0.88rem;
}

.status {
  font-weight: 700;
  font-size: 0.82rem;
}

.status.ok {
  color: var(--ok);
}

.status.bad {
  color: var(--bad);
}

pre {
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  background: #111b2c;
  color: #e6f0ff;
  border-radius: 0.45rem;
  padding: 0.65rem;
  font-size: 0.8rem;
  overflow: auto;
  max-height: 24rem;
}

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

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .key-box {
    min-width: 0;
    width: 100%;
  }

  .topbar {
    flex-direction: column;
  }
}
