:root {
  --bg: #0f1419;
  --bg-elev: #1a2332;
  --bg-row: #151c27;
  --bg-row-alt: #1a2332;
  --border: #2a3544;
  --text: #e7ecf3;
  --muted: #8b9bb4;
  --accent: #3d9cf0;
  --accent-dim: #2563a8;
  --good: #34d399;
  --warn: #fbbf24;
  --chip: #243044;
  --focus: #60a5fa;
  --shadow: 0 8px 32px rgba(0,0,0,.35);
  --radius: 12px;
  --font: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html { color-scheme: dark; }
body {
  margin: 0;
  font-family: var(--font);
  background: radial-gradient(1200px 600px at 10% -10%, #1b2a44 0%, transparent 55%),
              radial-gradient(900px 500px at 100% 0%, #132033 0%, transparent 50%),
              var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.45;
}

a { color: var(--accent); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: #7cc4ff; }

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 1.25rem 1rem 3rem;
}

header.hero {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

header.hero h1 {
  margin: 0 0 .35rem;
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  letter-spacing: -0.02em;
}

header.hero .tagline {
  margin: 0;
  color: var(--muted);
  max-width: 42rem;
  font-size: .95rem;
}

.meta-bar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem .75rem;
  align-items: center;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--chip);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: .35rem .75rem;
  font-size: .8rem;
  color: var(--muted);
}

.pill strong { color: var(--text); font-weight: 600; }
.pill.live { border-color: #1f6b4a; background: #123528; color: var(--good); }
.pill.snap { border-color: #6b5a1f; background: #2a2412; color: var(--warn); }
.pill.err { border-color: #7f1d1d; background: #2a1212; color: #fca5a5; }

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-bottom: 1rem;
  align-items: center;
}

.toolbar input[type="search"] {
  flex: 1 1 220px;
  min-width: 180px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: .65rem .9rem;
  font-size: .95rem;
  outline: none;
}
.toolbar input[type="search"]:focus {
  border-color: var(--focus);
  box-shadow: 0 0 0 3px rgba(96,165,250,.2);
}

.toolbar select {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 10px;
  padding: .65rem .75rem;
  font-size: .9rem;
}

.table-card {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.table-scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: .9rem;
  min-width: 760px;
}

thead th {
  position: sticky;
  top: 0;
  background: #121a26;
  text-align: left;
  padding: .75rem .85rem;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
  font-weight: 600;
  font-size: .78rem;
  text-transform: uppercase;
  letter-spacing: .04em;
  white-space: nowrap;
  user-select: none;
}

thead th.sortable { cursor: pointer; }
thead th.sortable:hover { color: var(--text); }
thead th .sort-ind { opacity: .45; margin-left: .25rem; font-size: .7rem; }
thead th.active { color: var(--accent); }
thead th.active .sort-ind { opacity: 1; }

tbody td {
  padding: .7rem .85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody tr:nth-child(even) { background: var(--bg-row-alt); }
tbody tr:nth-child(odd) { background: var(--bg-row); }
tbody tr:hover { background: #223049; }

.model {
  display: flex;
  flex-direction: column;
  gap: .25rem;
}
.model .name { font-weight: 600; }
.badges { display: flex; flex-wrap: wrap; gap: .3rem; }
.badge {
  font-size: .68rem;
  padding: .15rem .4rem;
  border-radius: 6px;
  background: #243044;
  color: var(--muted);
  border: 1px solid var(--border);
}
.badge.vram { color: #a5b4fc; border-color: #3730a3; background: #1e1b4b; }
.badge.tier { color: #94a3b8; }

.num {
  font-family: var(--mono);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}
.num.min { color: var(--good); font-weight: 600; }

.status {
  font-size: .75rem;
  text-transform: lowercase;
  color: var(--muted);
}
.status.available { color: var(--good); }

.spark {
  display: block;
  width: 96px;
  height: 28px;
}
.spark polyline {
  fill: none;
  stroke: var(--accent);
  stroke-width: 1.5;
  stroke-linejoin: round;
  stroke-linecap: round;
}
.spark .fill {
  stroke: none;
  fill: rgba(61,156,240,.12);
}

.empty, .error-banner {
  padding: 1.5rem;
  text-align: center;
  color: var(--muted);
}
.error-banner { color: #fca5a5; }

footer.legal {
  margin-top: 1.75rem;
  padding: 1rem 1.1rem;
  background: rgba(26,35,50,.7);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  font-size: .78rem;
  line-height: 1.55;
}

footer.legal p { margin: 0; }

@media (max-width: 640px) {
  .wrap { padding: 1rem .75rem 2rem; }
  thead th, tbody td { padding: .55rem .55rem; }
  .spark { width: 72px; height: 24px; }
}
