:root {
  --bg: #0b1220;
  --card: #121a2b;
  --text: #e8edf7;
  --muted: #93a0b8;
  --line: #243049;
  --accent: #ff3d57;
  --in: #22c55e;
  --out: #f59e0b;
  --net: #38bdf8;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "SF Pro Display", "PingFang SC", "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top right, rgba(255, 61, 87, 0.18), transparent 28%),
    radial-gradient(circle at 10% 80%, rgba(56, 189, 248, 0.12), transparent 24%),
    var(--bg);
}

.page {
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 56px;
}

.hero {
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: 700;
}

.hero h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.1;
}

.subtitle {
  margin: 0;
  color: var(--muted);
  max-width: 720px;
}

.card {
  background: rgba(18, 26, 43, 0.92);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 24px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(8px);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field span {
  font-size: 14px;
  color: var(--muted);
}

.field input,
.field select,
button {
  font: inherit;
}

.field input,
.field select {
  width: 100%;
  border: 1px solid var(--line);
  background: #0d1424;
  color: var(--text);
  border-radius: 12px;
  padding: 12px 14px;
}

.field input:focus,
.field select:focus {
  outline: 2px solid rgba(56, 189, 248, 0.35);
  border-color: var(--net);
}

.span-2 {
  grid-column: span 2;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

button {
  border: none;
  border-radius: 12px;
  padding: 12px 18px;
  cursor: pointer;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

button:hover {
  transform: translateY(-1px);
}

button:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

#submit-btn {
  background: linear-gradient(135deg, #ff3d57, #ff7a45);
  color: white;
  font-weight: 700;
}

.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.status {
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
}

.status.loading {
  background: rgba(56, 189, 248, 0.12);
  border: 1px solid rgba(56, 189, 248, 0.35);
}

.status.error {
  background: rgba(255, 61, 87, 0.12);
  border: 1px solid rgba(255, 61, 87, 0.35);
}

.hidden {
  display: none;
}

.results {
  margin-top: 24px;
}

.summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  border-radius: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  background: #0d1424;
}

.metric p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
}

.metric h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 32px);
}

.metric small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
}

.metric.in h2 { color: var(--in); }
.metric.out h2 { color: var(--out); }
.metric.net h2 { color: var(--net); }

.warning {
  margin: 16px 0 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #f8d08a;
  font-size: 14px;
}

.tables {
  display: grid;
  gap: 20px;
  margin-top: 24px;
}

.table-block h3 {
  margin: 0 0 10px;
  font-size: 16px;
}

.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-size: 13px;
}

th {
  color: var(--muted);
  background: #0d1424;
  position: sticky;
  top: 0;
}

td code,
.hash-link {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12px;
  color: #b7c4dc;
  word-break: break-all;
}

.hash-link {
  color: var(--net);
  text-decoration: none;
}

.hash-link:hover {
  text-decoration: underline;
}

.footer {
  margin-top: 20px;
  color: var(--muted);
  font-size: 13px;
}

.footer a {
  color: var(--net);
}

@media (max-width: 760px) {
  .form-grid,
  .summary {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: span 1;
  }
}
