:root {
  --bg: #0a0a0f;
  --surface: #111118;
  --surface2: #1a1a25;
  --border: #252535;
  --accent: #6ee7b7;
  --accent2: #818cf8;
  --accent3: #fb923c;
  --danger: #f87171;
  --text: #e2e8f0;
  --muted: #64748b;
  --card-glow: 0 0 0 1px var(--border), 0 4px 24px rgba(0,0,0,0.4);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Syne', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
}

body::before {
  content: '';
  position: fixed;
  top: -200px; left: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(110,231,183,0.04) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

body::after {
  content: '';
  position: fixed;
  bottom: -200px; right: -100px;
  width: 500px; height: 500px;
  background: radial-gradient(circle, rgba(129,140,248,0.05) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px;
  position: relative;
  z-index: 1;
}

/* ── Header ── */
header {
  margin-bottom: 48px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.header-left h1 {
  font-size: clamp(28px, 4vw, 48px);
  font-weight: 800;
  letter-spacing: -1.5px;
  line-height: 1;
  color: #fff;
}

.header-left h1 span { color: var(--accent); }

.header-left p {
  margin-top: 8px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.05em;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(110,231,183,0.08);
  border: 1px solid rgba(110,231,183,0.2);
  border-radius: 20px;
  padding: 6px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.05em;
}

.badge::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2s infinite;
}

.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(129,140,248,0.08);
  border: 1px solid rgba(129,140,248,0.25);
  border-radius: 20px;
  padding: 6px 14px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--accent2);
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: all 0.15s;
}

.share-btn:hover {
  background: rgba(129,140,248,0.15);
  border-color: rgba(129,140,248,0.4);
}

.share-btn.copied {
  color: var(--accent);
  background: rgba(110,231,183,0.08);
  border-color: rgba(110,231,183,0.3);
}

/* ── Section labels ── */
.section-title {
  font-size: 11px;
  font-family: 'JetBrains Mono', monospace;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* ── Input cards / sliders ── */
.inputs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 40px;
}

.input-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
  transition: border-color 0.2s;
}

.input-card:focus-within { border-color: var(--accent2); }

.input-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.input-label .hint {
  color: var(--accent);
  font-size: 9px;
  background: rgba(110,231,183,0.1);
  padding: 1px 5px;
  border-radius: 3px;
}

.input-value {
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -1px;
  margin-bottom: 12px;
  font-variant-numeric: tabular-nums;
}

input[type="range"] {
  -webkit-appearance: none;
  width: 100%;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  outline: none;
  cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(110,231,183,0.5);
  cursor: pointer;
}

input[type="number"] {
  width: 100%;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  color: var(--text);
  font-family: 'JetBrains Mono', monospace;
  font-size: 14px;
  outline: none;
}

input[type="number"]:focus { border-color: var(--accent2); }

/* ── Vendor filter pills ── */
.vendor-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
}

.vendor-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 8px 14px;
  border-radius: 24px;
  border: 1px solid var(--border);
  background: var(--surface);
  cursor: pointer;
  transition: all 0.15s;
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  user-select: none;
}

.vendor-pill:hover { border-color: #353550; color: var(--text); }
.vendor-pill.active { color: var(--text); }

.vendor-pill-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.15s;
}

.vendor-pill-count {
  font-size: 9px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--surface2);
  transition: color 0.15s;
}

/* ── Skills panel ── */
.skill-toggle {
  width: 40px; height: 22px;
  background: var(--border);
  border-radius: 11px;
  position: relative;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.skill-toggle.on { background: var(--accent); }

.skill-toggle-knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s;
}

.skill-toggle.on .skill-toggle-knob { transform: translateX(18px); }

.skill-card { border-color: rgba(110,231,183,0.2) !important; }

.skills-explainer {
  display: flex;
  gap: 16px;
  background: var(--surface);
  border: 1px solid rgba(110,231,183,0.15);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 16px;
  align-items: flex-start;
}

.explainer-icon { font-size: 24px; flex-shrink: 0; margin-top: 2px; }

.skill-savings-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid var(--border);
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
}

.skill-savings-row:last-child { border-bottom: none; }

.saving-positive { color: var(--accent); }
.saving-negative { color: var(--danger); }
.saving-neutral  { color: var(--muted); }

/* ── Context info bar ── */
.context-info {
  background: var(--surface2);
  border-radius: 6px;
  padding: 8px 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 20px;
}

/* ── Summary cards ── */
.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.summary-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 20px;
}

.summary-card.highlight {
  background: rgba(110,231,183,0.04);
  border-color: rgba(110,231,183,0.2);
}

.summary-stat-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin-bottom: 8px;
}

.summary-stat-val {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -1px;
  color: #fff;
  font-variant-numeric: tabular-nums;
}

.summary-stat-val.green  { color: var(--accent); }
.summary-stat-val.orange { color: var(--accent3); }

.summary-stat-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  margin-top: 4px;
}

/* ── Bar chart ── */
.chart-container {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px;
  margin-bottom: 48px;
}

.chart-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 180px;
  margin-top: 24px;
}

.chart-bar-wrap {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
  gap: 8px;
  cursor: pointer;
}

.chart-bar-inner {
  width: 100%;
  border-radius: 6px 6px 0 0;
  transition: all 0.5s cubic-bezier(0.4,0,0.2,1);
  position: relative;
  min-height: 4px;
}

.chart-bar-inner:hover { filter: brightness(1.2); }

.chart-bar-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--muted);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  padding: 0 2px;
}

.chart-bar-amount {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--text);
  text-align: center;
  margin-bottom: 4px;
}

.toggle-group {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  border-radius: 8px;
  padding: 4px;
}

.toggle-btn {
  padding: 6px 14px;
  border-radius: 5px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  border: none;
  background: transparent;
  color: var(--muted);
  transition: all 0.15s;
}

.toggle-btn.active {
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

/* ── Model cards ── */
.models-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 16px;
  margin-bottom: 48px;
}

.model-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s, border-color 0.2s;
  cursor: pointer;
  position: relative;
  animation: fadeIn 0.3s ease both;
}

.model-card:hover { transform: translateY(-2px); border-color: #353550; }

.model-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(110,231,183,0.2), 0 8px 32px rgba(0,0,0,0.5);
}

.model-card.selected::before {
  content: '✓ SELECTED';
  position: absolute;
  top: 12px; right: 12px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 9px;
  color: var(--accent);
  letter-spacing: 0.08em;
  background: rgba(110,231,183,0.1);
  border: 1px solid rgba(110,231,183,0.3);
  padding: 2px 8px;
  border-radius: 4px;
}

.model-card:nth-child(1) { animation-delay: 0.05s; }
.model-card:nth-child(2) { animation-delay: 0.10s; }
.model-card:nth-child(3) { animation-delay: 0.15s; }
.model-card:nth-child(4) { animation-delay: 0.20s; }
.model-card:nth-child(5) { animation-delay: 0.25s; }
.model-card:nth-child(6) { animation-delay: 0.30s; }
.model-card:nth-child(7) { animation-delay: 0.35s; }
.model-card:nth-child(8) { animation-delay: 0.40s; }
.model-card:nth-child(9) { animation-delay: 0.45s; }

.model-header {
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.vendor-dot {
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
  margin-top: 2px;
}

.model-name {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.3px;
  line-height: 1.2;
}

.vendor-name {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--muted);
  margin-top: 3px;
}

.model-body { padding: 16px 20px 20px; }

.pricing-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.pricing-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.pricing-val {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  color: var(--text);
}

.cost-bar {
  margin-top: 16px;
  height: 3px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.cost-bar-fill {
  height: 100%;
  border-radius: 2px;
  transition: width 0.5s cubic-bezier(0.4,0,0.2,1);
}

.monthly-cost {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}

.monthly-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.monthly-val {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.5px;
  font-variant-numeric: tabular-nums;
}

/* ── Comparison table ── */
.comparison-table {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 48px;
}

.table-header {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.table-title { font-weight: 700; font-size: 14px; color: #fff; }

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

thead th {
  padding: 12px 16px;
  text-align: left;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

thead th:not(:first-child) { text-align: right; }

tbody tr { border-bottom: 1px solid var(--border); transition: background 0.15s; }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: rgba(255,255,255,0.02); }

tbody td {
  padding: 14px 16px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  vertical-align: middle;
}

tbody td:not(:first-child) { text-align: right; }

.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px; height: 20px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  margin-right: 8px;
}

.rank-1 { background: rgba(251,191,36,0.15);  color: #fbbf24; }
.rank-2 { background: rgba(148,163,184,0.10); color: #94a3b8; }
.rank-3 { background: rgba(180,83,9,0.10);    color: #b45309; }
.rank-n { background: rgba(51,65,85,0.50);    color: var(--muted); }

.pill {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 9px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  font-weight: 600;
}

.pill-green  { background: rgba(110,231,183,0.12); color: var(--accent); }
.pill-orange { background: rgba(251,146,60,0.12);  color: var(--accent3); }
.pill-purple { background: rgba(129,140,248,0.12); color: var(--accent2); }
.pill-red    { background: rgba(248,113,113,0.12); color: var(--danger); }

/* ── Footer ── */
footer {
  border-top: 1px solid var(--border);
  padding-top: 24px;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  color: var(--muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── Animations ── */
@keyframes pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.5; transform: scale(0.8); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
