:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #647181;
  --line: #dfe5eb;
  --accent: #146c63;
  --accent-strong: #0b4f49;
  --warn-bg: #fff3df;
  --warn-ink: #7a4700;
  --ok-bg: #e6f5ef;
  --ok-ink: #116149;
  --off-bg: #f1f2f4;
  --off-ink: #59616b;
}

* {
  box-sizing: border-box;
}

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

.footer {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto 24px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

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

.topbar h1,
.section-heading h2,
.result-head h3 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: clamp(22px, 3vw, 30px);
  line-height: 1.2;
}

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

.status-pill,
.state {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.status-pill {
  background: #edf1f4;
  color: #344250;
}

.shell {
  width: min(1080px, calc(100% - 32px));
  margin: 24px auto 48px;
}

.query-panel,
.result-card,
.notice,
.empty {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.query-panel {
  padding: 20px;
}

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

.section-heading h2 {
  font-size: 18px;
}

.section-heading span {
  color: var(--muted);
  font-size: 13px;
}

.search-form label {
  display: block;
  margin-bottom: 8px;
  color: #3c4856;
  font-weight: 700;
}

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

input,
button {
  height: 44px;
  border-radius: 8px;
  font: inherit;
}

input {
  width: 100%;
  min-width: 0;
  border: 1px solid #c9d2dc;
  padding: 0 13px;
  color: var(--ink);
  background: #fbfcfd;
}

input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(20, 108, 99, 0.16);
}

button {
  border: 0;
  padding: 0 22px;
  background: var(--accent);
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

button:hover {
  background: var(--accent-strong);
}

.notice,
.empty {
  margin-top: 16px;
  padding: 14px 16px;
}

.notice {
  border-color: #f0c27b;
  background: var(--warn-bg);
  color: var(--warn-ink);
}

.empty {
  color: var(--muted);
}

.results {
  margin-top: 22px;
}

.result-card {
  padding: 20px;
}

.result-card + .result-card {
  margin-top: 14px;
}

.result-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.result-head h3 {
  font-size: 22px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.state.ok {
  background: var(--ok-bg);
  color: var(--ok-ink);
}

.state.off {
  background: var(--off-bg);
  color: var(--off-ink);
}

dl {
  margin: 0;
}

.meta-grid,
.traffic-grid {
  display: grid;
  gap: 12px;
}

.meta-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.traffic-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 18px;
}

.meta-grid div,
.traffic-grid div {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  background: #fbfcfd;
}

dt {
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

dd {
  margin: 0;
  font-size: 16px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.meter-block {
  margin-top: 18px;
}

.meter-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
  color: #2c3844;
  font-size: 13px;
  font-weight: 800;
}

.meter {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e4e9ee;
}

.meter span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #146c63, #2f8b6f);
}

@media (max-width: 760px) {
  .topbar {
    align-items: flex-start;
    flex-direction: column;
  }

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

  button {
    width: 100%;
  }

  .result-head {
    align-items: stretch;
    flex-direction: column;
  }

  .state {
    width: max-content;
  }
}
