:root {
  color-scheme: light;
  --bg: #f6f7f2;
  --panel: #ffffff;
  --text: #1e2528;
  --muted: #667174;
  --line: #d9dfdc;
  --primary: #176b5b;
  --primary-strong: #0f5145;
  --accent: #d99b3d;
  --danger: #b33d3d;
  --ok: #1e755f;
}

* {
  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;
  background:
    linear-gradient(135deg, rgba(23, 107, 91, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(217, 155, 61, 0.18), transparent 36%),
    var(--bg);
  color: var(--text);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(100%, 980px);
  min-height: 100vh;
  margin: 0 auto;
  padding: 48px 20px;
  display: grid;
  align-items: center;
}

.panel {
  width: min(100%, 620px);
  margin: 0 auto;
  padding: 28px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 24px 60px rgba(34, 48, 44, 0.12);
}

.brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--primary);
  color: white;
  font-weight: 800;
  font-size: 22px;
}

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

h1 {
  margin: 0;
  font-size: 34px;
  line-height: 1.08;
  font-weight: 760;
  letter-spacing: 0;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 5px;
  margin-bottom: 22px;
  background: #eef1ec;
  border-radius: 8px;
}

.tab {
  min-height: 42px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 700;
  cursor: pointer;
}

.tab.active {
  background: var(--panel);
  color: var(--text);
  box-shadow: 0 1px 6px rgba(36, 46, 43, 0.1);
}

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

.query-form.hidden,
.result.hidden {
  display: none;
}

label {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.input-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
}

input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  color: var(--text);
}

input:focus {
  outline: 3px solid rgba(23, 107, 91, 0.18);
  border-color: var(--primary);
}

.icon-button,
.primary {
  border: 0;
  border-radius: 8px;
  font-weight: 750;
  cursor: pointer;
}

.icon-button {
  min-width: 76px;
  min-height: 48px;
  padding: 0 14px;
  color: var(--primary);
  background: #e6eee9;
}

.primary {
  min-height: 48px;
  margin-top: 4px;
  color: white;
  background: var(--primary);
}

.primary:hover {
  background: var(--primary-strong);
}

.primary:disabled {
  cursor: wait;
  opacity: 0.7;
}

.result {
  margin-top: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.result-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border-radius: 999px;
  background: #e6eee9;
  color: var(--ok);
  font-size: 13px;
  font-weight: 800;
  text-transform: capitalize;
}

.status.bad {
  color: var(--danger);
  background: #f6e8e8;
}

.result-title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
}

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

.metric {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
}

.metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 5px;
}

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

.notice {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

@media (max-width: 560px) {
  .shell {
    padding: 22px 12px;
    align-items: start;
  }

  .panel {
    padding: 20px;
  }

  h1 {
    font-size: 28px;
  }

  .input-row,
  .grid {
    grid-template-columns: 1fr;
  }

  .icon-button {
    width: 100%;
  }
}
