:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --ink: #172033;
  --muted: #667085;
  --line: #d9e1ec;
  --line-strong: #b9c8d9;
  --blue: #0f766e;
  --cyan: #0891b2;
  --green: #16805a;
  --red: #c2413c;
  --amber: #b7791f;
  --shadow: 0 22px 70px rgba(23, 32, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(to right, rgba(8, 145, 178, 0.06) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(8, 145, 178, 0.05) 1px, transparent 1px),
    #f5f7fb;
  background-size: 48px 48px, 48px 48px, auto;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
textarea {
  font: inherit;
}

a {
  color: #0e7490;
  font-weight: 800;
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

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

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

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  background: #fff;
  color: var(--blue);
  font-weight: 900;
}

.brand strong,
.brand small {
  display: block;
}

.brand small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  gap: 8px;
}

.nav a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: #344054;
}

.layout {
  min-height: calc(100vh - 108px);
  display: grid;
  grid-template-columns: minmax(280px, 0.9fr) minmax(420px, 1.1fr);
  gap: 18px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 40px rgba(23, 32, 51, 0.08);
}

.intro {
  padding: 24px;
  align-self: start;
  display: grid;
  gap: 18px;
}

.main-card {
  padding: 18px;
  display: grid;
  gap: 16px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1;
}

h2 {
  font-size: 22px;
}

.lede {
  margin: 0;
  color: #475467;
  font-size: 15px;
  line-height: 1.7;
}

.status {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--muted);
}

.dot.ok {
  background: var(--green);
}

.dot.err {
  background: var(--red);
}

.dot.warn {
  background: var(--amber);
}

.metrics,
.result-summary {
  display: grid;
  gap: 10px;
}

.metric,
.result-item {
  min-height: 64px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.metric span,
.result-item span,
.field span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.metric strong,
.result-item strong {
  display: block;
  margin-top: 8px;
  overflow-wrap: anywhere;
  font-size: 14px;
}

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

.card-head.compact {
  margin-bottom: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #b8dfeb;
  border-radius: 8px;
  background: #effbfe;
  color: #0e7490;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.form,
.query {
  display: grid;
  gap: 12px;
}

.field {
  display: grid;
  gap: 8px;
}

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

textarea:focus,
input:focus {
  border-color: var(--cyan);
  box-shadow: 0 0 0 3px rgba(8, 145, 178, 0.12);
}

textarea {
  min-height: 250px;
  resize: vertical;
  padding: 12px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  line-height: 1.55;
}

input {
  min-height: 48px;
  padding: 0 12px;
}

.help {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.row {
  display: grid;
  grid-template-columns: 1fr 140px;
  gap: 12px;
  align-items: end;
}

button {
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--blue);
  color: #fff;
  cursor: pointer;
  font-weight: 900;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.62;
}

.result-panel {
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
  padding: 14px;
}

.empty {
  display: grid;
  gap: 6px;
  color: var(--muted);
}

.empty strong {
  color: #344054;
}

.result {
  display: grid;
  gap: 12px;
}

.result h2 {
  margin: 0;
  font-size: 18px;
}

.result.ok h2 {
  color: var(--green);
}

.result.err h2 {
  color: var(--red);
}

.result.warn h2 {
  color: var(--amber);
}

.result-summary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

pre {
  margin: 0;
  overflow: auto;
  max-height: 280px;
  padding: 12px;
  border-radius: 8px;
  background: #111827;
  color: #dbeafe;
  font-size: 13px;
}

@media (max-width: 900px) {
  .layout {
    min-height: auto;
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .page {
    width: min(100% - 24px, 1180px);
    padding: 14px 0;
  }

  .topbar,
  .row,
  .card-head {
    display: grid;
    grid-template-columns: 1fr;
  }

  .result-summary {
    grid-template-columns: 1fr;
  }

  textarea {
    min-height: 210px;
  }
}
