:root {
  color-scheme: dark;
  --bg: #101827;
  --panel: #172033;
  --panel-2: #202b42;
  --text: #f8fafc;
  --muted: #b7c2d3;
  --line: rgba(255,255,255,.14);
  --accent: #8fd3ff;
  --good: #9ef0c0;
  --bad: #ffb4b4;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--bg); }
body {
  min-height: 100svh;
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(143,211,255,.2), transparent 32rem),
    linear-gradient(145deg, #101827 0%, #111827 55%, #0b1020 100%);
}

.app-shell {
  width: min(1200px, 100%);
  min-height: calc(100svh - 3.5rem);
  margin: 0 auto;
  padding: clamp(1rem, 4vw, 3rem);
  display: grid;
  align-content: start;
  gap: 1.25rem;
}

.hero, .data-card {
  border: 1px solid var(--line);
  border-radius: 1.4rem;
  background: rgba(23, 32, 51, .88);
  box-shadow: 0 1.5rem 5rem rgba(0,0,0,.28);
  backdrop-filter: blur(18px);
}

.hero {
  min-height: min(58svh, 34rem);
  padding: clamp(1.25rem, 5vw, 4rem);
  display: grid;
  place-content: center;
  text-align: center;
}

.eyebrow {
  margin: 0 0 .55rem;
  color: var(--accent);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}

h1, h2 { margin: 0; line-height: 1.05; }
h1 { font-size: clamp(2.1rem, 8vw, 5rem); letter-spacing: -.06em; }
h2 { font-size: clamp(1.3rem, 4vw, 2rem); }

.intro {
  width: min(46rem, 100%);
  margin: 1rem auto 1.6rem;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.6;
}

.upload-panel {
  width: min(34rem, 100%);
  margin: 0 auto;
  padding: 1.2rem;
  display: grid;
  gap: .55rem;
  border: 1px dashed rgba(143,211,255,.55);
  border-radius: 1.1rem;
  background: rgba(32,43,66,.86);
  cursor: pointer;
  transition: border-color .2s ease, transform .2s ease, background .2s ease;
}
.upload-panel:hover { border-color: var(--accent); transform: translateY(-1px); background: rgba(38,51,78,.95); }
.upload-title { font-size: 1.1rem; font-weight: 800; }
.upload-copy { color: var(--muted); line-height: 1.45; }
.upload-panel input { width: 100%; max-width: 24rem; margin: .5rem auto 0; color: var(--muted); }
code { color: var(--good); }

.status { min-height: 1.5rem; margin: 1rem 0 0; color: var(--muted); }
.status.error { color: var(--bad); }
.status.success { color: var(--good); }

.data-card { padding: clamp(1rem, 3vw, 1.5rem); }
.table-toolbar {
  display: flex;
  gap: 1rem;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.row-count { margin: 0; color: var(--muted); white-space: nowrap; }

.tabs {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding: .35rem;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(10,16,30,.35);
}
.tab {
  border: 0;
  border-radius: .75rem;
  padding: .75rem 1rem;
  color: var(--muted);
  background: transparent;
  font: inherit;
  font-weight: 750;
  white-space: nowrap;
  cursor: pointer;
}
.tab:hover, .tab:focus-visible { color: var(--text); background: rgba(255,255,255,.07); outline: none; }
.tab.is-active { color: #07111f; background: var(--accent); }

.tab-panel { margin-top: 1rem; }
.panel-copy { margin: 0 0 1rem; color: var(--muted); line-height: 1.5; }
.table-wrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 1rem;
  max-height: 70svh;
  background: rgba(10,16,30,.35);
}
.placeholder {
  margin: 0;
  padding: 1rem;
  color: var(--muted);
}
table { width: 100%; border-collapse: collapse; min-width: 42rem; }
th, td { padding: .8rem .9rem; border-bottom: 1px solid var(--line); text-align: left; white-space: nowrap; }
th { position: sticky; top: 0; z-index: 1; background: #202b42; color: var(--text); font-size: .82rem; text-transform: uppercase; letter-spacing: .08em; }
td { color: #e9eef7; }
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: rgba(255,255,255,.035); }
.numeric { text-align: right; font-variant-numeric: tabular-nums; }
.warning { color: var(--bad); }

.footer {
  min-height: 3.5rem;
  padding: 1rem;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  font-size: .9rem;
}

@media (max-width: 640px) {
  .table-toolbar { align-items: start; flex-direction: column; }
  .hero { min-height: auto; }
  .row-count { white-space: normal; }
}
