:root {
  color-scheme: dark;
  --bg: #07111f;
  --panel: rgba(14, 28, 48, 0.88);
  --panel-border: rgba(148, 163, 184, 0.18);
  --text: #e5eefb;
  --muted: #9bb0c9;
  --accent: #67e8f9;
  --accent-2: #818cf8;
  --good: #34d399;
  --warn: #fbbf24;
  --bad: #f87171;
  --shadow: 0 14px 28px rgba(2, 8, 23, 0.24);
  --radius-sm: 6px;
  --radius-md: 8px;
  --space-1: 6px;
  --space-2: 10px;
  --space-3: 14px;
  --space-4: 18px;
  --space-5: 24px;
  --text-xs: 0.74rem;
  --text-sm: 0.86rem;
  --text-md: 0.94rem;
  --text-base: 1rem;
  --text-lg: clamp(1rem, 1.2vw, 1.2rem);
  --text-xl: clamp(1.5rem, 2vw, 2.1rem);
  --text-hero: clamp(1.6rem, 2.5vw, 2.35rem);
  --line-tight: 1.2;
  --line-body: 1.5;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  background:
    radial-gradient(circle at top left, rgba(103, 232, 249, 0.16), transparent 28%),
    radial-gradient(circle at top right, rgba(129, 140, 248, 0.18), transparent 22%),
    linear-gradient(180deg, #091423 0%, #030712 100%);
  color: var(--text);
}

code,
pre {
  font-family: "JetBrains Mono", "Cascadia Code", "SFMono-Regular", Consolas, monospace;
}

a {
  color: var(--accent);
}

.page-shell {
  width: 90vw;
  margin: 0 auto;
  padding: var(--space-4) 0 calc(var(--space-5) + var(--space-1));
}

.hero,
.card {
  min-width: 0;
  backdrop-filter: blur(16px);
  background: var(--panel);
  border: 1px solid var(--panel-border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(300px, 0.9fr);
  gap: var(--space-3);
  padding: var(--space-4);
  margin-bottom: var(--space-3);
}

.hero h1,
.card h2 {
  margin: 0;
  overflow-wrap: anywhere;
}

.hero h1 {
  font-size: var(--text-hero);
  line-height: 1.1;
}

.card h2 {
  font-size: var(--text-lg);
  line-height: var(--line-tight);
}

.eyebrow,
.card-label,
.filter-field span {
  margin: 0 0 var(--space-1);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: var(--text-xs);
  color: var(--accent);
  font-weight: 700;
}

.subtitle,
.muted,
th,
td {
  color: var(--muted);
}

.subtitle {
  max-width: 65ch;
  line-height: var(--line-body);
  font-size: var(--text-md);
  margin: var(--space-2) 0;
}

.compact {
  font-size: var(--text-sm);
}

.small {
  display: block;
  font-size: var(--text-xs);
  margin-top: 4px;
}

.info-banner {
  border: 1px solid rgba(251, 191, 36, 0.28);
  background: rgba(251, 191, 36, 0.08);
  color: #fde68a;
  padding: var(--space-2) calc(var(--space-2) + 2px);
  border-radius: var(--radius-md);
  line-height: 1.4;
  margin: var(--space-2) 0 var(--space-3);
  font-size: var(--text-sm);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  color: var(--text);
  border: 1px solid rgba(103, 232, 249, 0.24);
  transition: transform 0.16s ease, border-color 0.16s ease, background 0.16s ease;
  font-size: var(--text-sm);
  line-height: 1.2;
}

.button:hover {
  transform: translateY(-1px);
  border-color: rgba(103, 232, 249, 0.48);
}

.button.primary {
  background: linear-gradient(135deg, rgba(103, 232, 249, 0.18), rgba(129, 140, 248, 0.14));
}

.button.secondary {
  background: rgba(15, 23, 42, 0.6);
}

.hero-panel {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-3);
  border-radius: var(--radius-md);
  background: rgba(8, 18, 33, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.1);
}

.hero-panel h2 {
  font-size: var(--text-xl);
}

.hero-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-2);
}

.hero-metrics div,
.stat-card {
  min-width: 0;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.52);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.hero-metrics span {
  display: block;
  color: var(--muted);
  font-size: var(--text-xs);
  margin-bottom: 6px;
}

.hero-metrics strong {
  color: var(--text);
  font-size: var(--text-base);
  overflow-wrap: anywhere;
}

.command-grid,
.grid {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}

.command-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.summary-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.chart-grid,
.detail-grid {
  grid-template-columns: 1.15fr 0.85fr;
}

.card {
  padding: var(--space-3);
}

.chart-card {
  overflow: hidden;
}

.command-card pre {
  margin: var(--space-2) 0 0;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  overflow-x: auto;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.12);
  color: #dbeafe;
  white-space: pre-wrap;
  font-size: var(--text-sm);
  line-height: 1.4;
}

.bullet-list {
  margin: 0;
  padding-left: 18px;
  line-height: var(--line-body);
  font-size: var(--text-sm);
}

.stat-card h2 {
  margin-top: 2px;
  font-size: var(--text-xl);
  line-height: 1.1;
}

.card-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.card-header>div {
  min-width: 0;
}

.filter-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(4, minmax(0, 1fr));
  gap: var(--space-2);
}

.filter-field {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
}

.filter-field input,
.filter-field select {
  background: rgba(15, 23, 42, 0.85);
  color: var(--text);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--radius-sm);
  padding: 9px 10px;
  font-size: var(--text-sm);
  line-height: 1.2;
}

.filter-field input:focus,
.filter-field select:focus {
  outline: none;
  border-color: rgba(103, 232, 249, 0.6);
}

.chart-frame {
  position: relative;
  width: 100%;
  height: 260px;
  min-height: 260px;
}

.chart-card canvas {
  display: block;
  width: 100% !important;
  height: 100% !important;
  min-height: 0;
}

.spec-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: var(--space-2);
}

.spec-list div {
  min-width: 0;
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  background: rgba(15, 23, 42, 0.5);
  border: 1px solid rgba(148, 163, 184, 0.12);
}

.spec-list dt {
  color: var(--muted);
  font-size: var(--text-xs);
  margin-bottom: 6px;
}

.spec-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 600;
  font-size: var(--text-base);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.notes-box {
  margin-top: var(--space-2);
  padding: var(--space-2);
  border-radius: var(--radius-sm);
  border: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.46);
  line-height: var(--line-body);
  font-size: var(--text-sm);
  overflow-wrap: anywhere;
}

.notes-box p {
  margin: 10px 0 0;
}

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

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  padding: 9px 8px;
  text-align: left;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  font-size: var(--text-sm);
  line-height: 1.35;
  vertical-align: top;
  overflow-wrap: anywhere;
}

th {
  color: #c8d7eb;
  font-weight: 700;
  font-size: var(--text-xs);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tbody tr {
  cursor: pointer;
  transition: background 0.16s ease;
}

tbody tr:hover {
  background: rgba(103, 232, 249, 0.04);
}

tbody tr.selected-row {
  background: rgba(129, 140, 248, 0.12);
}

.empty-state {
  text-align: center;
  padding: var(--space-4) var(--space-2);
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: 4px;
  padding: 3px 6px;
  font-size: 0.72rem;
  line-height: 1.1;
  background: rgba(148, 163, 184, 0.12);
}

.badge.good {
  color: var(--good);
}

.badge.warn {
  color: var(--warn);
}

.badge.bad {
  color: var(--bad);
}

@media (max-width: 1180px) {

  .command-grid,
  .summary-grid,
  .chart-grid,
  .detail-grid,
  .filter-grid,
  .hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 780px) {
  .page-shell {
    width: 90vw;
    padding: 18px 0 40px;
  }

  .hero,
  .card {
    padding: 18px;
    border-radius: 8px;
  }

  .hero-metrics,
  .spec-list {
    grid-template-columns: 1fr;
  }

  .chart-frame {
    height: 240px;
    min-height: 240px;
  }

  th,
  td {
    font-size: 0.88rem;
  }
}