:root {
  --bg: #0b0f14;
  --surface: #121821;
  --surface-2: #17202c;
  --border: #253142;
  --text: #e7edf5;
  --muted: #8fa1b7;
  --accent: #10b981;
  --accent-dim: rgba(16, 185, 129, 0.14);
  --danger: #f87171;
  --radius: 10px;
  --mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  --sans: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

code, .mono {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
}

a {
  color: #34d399;
  text-decoration: none;
}
a:hover { text-decoration: underline; }

.container {
  max-width: 1040px;
  margin: 0 auto;
  padding: 0 20px;
}

.topbar {
  border-bottom: 1px solid var(--border);
  background: rgba(11, 15, 20, 0.92);
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(8px);
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: var(--accent-dim);
  border: 1px solid rgba(16, 185, 129, 0.35);
  color: var(--accent);
  font-weight: 700;
  font-family: var(--mono);
  font-size: 0.9rem;
}

.brand-name {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.brand-sub {
  font-size: 0.78rem;
  color: var(--muted);
}

.topbar-badges {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.badge {
  font-size: 0.75rem;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--muted);
  background: var(--surface);
}

.badge-accent {
  border-color: rgba(16, 185, 129, 0.4);
  background: var(--accent-dim);
  color: #6ee7b7;
}

.hero {
  padding: 36px 0 20px;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  letter-spacing: -0.02em;
}

.hero-copy {
  margin: 0 0 24px;
  color: var(--muted);
  max-width: 780px;
  font-size: 0.96rem;
}

.hero-copy code {
  font-size: 0.84rem;
  color: var(--text);
  background: var(--surface-2);
  padding: 2px 6px;
  border-radius: 5px;
}

.lookup-card, .panel, .kpi-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.lookup-card {
  padding: 18px;
}

.field-row {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: flex-end;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-grow { flex: 1 1 360px; }
.field-range { flex: 0 0 165px; }
.field-btn { flex: 0 0 auto; }

label {
  font-size: 0.8rem;
  color: var(--muted);
  font-weight: 500;
}

input[type="text"], select {
  width: 100%;
  height: 42px;
  padding: 0 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 0.92rem;
  font-family: var(--mono);
}

input[type="text"]:focus, select:focus {
  outline: none;
  border-color: var(--accent);
}

.btn {
  height: 42px;
  padding: 0 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: opacity 0.15s, border-color 0.15s;
}
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  color: #052e1f;
}
.btn-primary:hover:not(:disabled) { opacity: 0.92; }

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--border);
  height: 36px;
  font-size: 0.84rem;
}

.btn-outline {
  background: transparent;
  color: #6ee7b7;
  border-color: rgba(16, 185, 129, 0.45);
  height: 36px;
  font-size: 0.84rem;
}

.lookup-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  font-size: 0.82rem;
  color: var(--muted);
}

.link-btn {
  background: none;
  border: none;
  padding: 0;
  color: #34d399;
  font-size: 0.82rem;
  cursor: pointer;
  text-decoration: underline;
}

.status-banner {
  margin-top: 14px;
  padding: 12px 16px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.9rem;
}
.status-banner.error {
  border-color: rgba(248, 113, 113, 0.5);
  color: #fecaca;
  background: rgba(248, 113, 113, 0.1);
}

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0,0,0,0);
}

.results {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding-bottom: 40px;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}

.kpi-card {
  padding: 16px 18px;
}

.kpi-label {
  font-size: 0.78rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.kpi-value {
  margin-top: 6px;
  font-size: 1.45rem;
  font-weight: 700;
}

.info-bar {
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 0.84rem;
  color: var(--muted);
}

.panel {
  padding: 18px;
}

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

.panel-head h2 {
  margin: 0;
  font-size: 1.05rem;
}

.muted { color: var(--muted); font-size: 0.85rem; }
.small { font-size: 0.8rem; margin-top: 8px; }

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

th, td {
  padding: 10px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  white-space: nowrap;
}

th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  font-weight: 600;
}

.num { text-align: right; font-family: var(--mono); font-variant-numeric: tabular-nums; }

.export-intro {
  margin: 0 0 16px;
  font-size: 0.9rem;
  color: var(--muted);
}
.export-intro code {
  color: var(--text);
  background: var(--bg);
  padding: 2px 6px;
  border-radius: 5px;
  font-size: 0.82rem;
}

.pricing-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 14px;
}

.price-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

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

.price-header h3 {
  margin: 0 0 4px;
  font-size: 0.98rem;
}

.price-tag {
  font-family: var(--mono);
  font-weight: 700;
  color: #6ee7b7;
  background: var(--accent-dim);
  border: 1px solid rgba(16, 185, 129, 0.35);
  padding: 4px 10px;
  border-radius: 6px;
  white-space: nowrap;
}

.endpoint-box {
  font-size: 0.76rem;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  padding: 8px 10px;
  border-radius: 6px;
  overflow-x: auto;
  white-space: nowrap;
}

.price-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.tx-verify-box {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
}

.tx-verify-box label {
  display: block;
  margin-bottom: 8px;
}

.footer {
  border-top: 1px solid var(--border);
  padding: 22px 0 34px;
  color: var(--muted);
  font-size: 0.82rem;
}

.footer-inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.footer-inner p { margin: 0; }
.footer-brand { font-size: 0.8rem; }
