:root {
  color-scheme: light;
  --bg: #f4f5f7;
  --panel: #ffffff;
  --ink: #17202a;
  --muted: #657080;
  --line: #d8dee8;
  --accent: #0f6c81;
  --accent-strong: #0a4e5e;
  --ok-bg: #e8f5ee;
  --ok-ink: #17613b;
  --err-bg: #fff0ed;
  --err-ink: #9a341f;
  --shadow: 0 18px 50px rgba(28, 39, 55, 0.12);
}

* {
  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;
  color: var(--ink);
  background: var(--bg);
}

.app-shell {
  width: min(1180px, calc(100vw - 32px));
  min-height: 100vh;
  margin: 0 auto;
  padding: 32px 0;
  display: grid;
  grid-template-columns: minmax(320px, 470px) minmax(360px, 1fr);
  gap: 24px;
  align-items: start;
}

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

.query-panel {
  padding: 24px;
}

.result-panel {
  min-height: 520px;
  padding: 24px;
}

.panel-header,
.result-topline {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
}

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

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

h1 {
  font-size: 30px;
  line-height: 1.15;
}

h2 {
  font-size: 26px;
  line-height: 1.2;
}

.status-pill,
.state-badge {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #eef6f8;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.lookup-form {
  margin-top: 24px;
  display: grid;
  gap: 16px;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 140px;
  gap: 14px;
}

.field-row .short:first-child {
  max-width: 150px;
}

label {
  display: grid;
  gap: 7px;
  min-width: 0;
}

label span {
  color: #334155;
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
}

input:focus,
select:focus {
  outline: 3px solid rgba(15, 108, 129, 0.18);
  border-color: var(--accent);
}

.advanced {
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
}

.advanced summary,
.raw-data summary {
  cursor: pointer;
  color: var(--accent-strong);
  font-weight: 700;
}

button {
  height: 48px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

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

button:disabled {
  cursor: wait;
  opacity: 0.72;
}

.button-icon {
  margin-right: 8px;
}

.empty-state {
  height: 470px;
  display: grid;
  align-content: center;
  justify-items: center;
  text-align: center;
  color: var(--muted);
}

.empty-state h2 {
  color: var(--ink);
}

.result-card,
.error-card {
  display: grid;
  gap: 22px;
}

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

.result-grid div {
  min-height: 78px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 12px;
  background: #fafbfc;
}

dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

dd {
  margin: 6px 0 0;
  overflow-wrap: anywhere;
  font-size: 15px;
  font-weight: 750;
}

.result-address {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.error-card {
  border: 1px solid #fecaca;
  border-radius: 8px;
  padding: 18px;
  background: var(--err-bg);
  color: var(--err-ink);
}

.raw-data {
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.license-box {
  margin-top: 12px;
  margin-bottom: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #f8fafc;
  color: var(--ink);
}

.license-box p:last-of-type {
  margin: 0;
  color: #334155;
  line-height: 1.45;
}

.license-box a {
  display: inline-flex;
  margin-top: 10px;
  color: var(--accent-strong);
  font-weight: 750;
  text-decoration: none;
}

.license-box a:hover {
  text-decoration: underline;
}

pre {
  max-height: 260px;
  overflow: auto;
  padding: 14px;
  border-radius: 6px;
  background: #111827;
  color: #e5e7eb;
  font-size: 12px;
  line-height: 1.45;
}

.hidden {
  display: none;
}

@media (max-width: 860px) {
  .app-shell {
    grid-template-columns: 1fr;
    width: min(100vw - 20px, 680px);
    padding: 10px 0 24px;
  }

  .query-panel,
  .result-panel {
    padding: 18px;
  }

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

  h1 {
    font-size: 25px;
  }
}
