:root {
  --bg: #ffffff;
  --surface: #f8f9fa;
  --surface2: #f0f3f6;
  --border: #e0e3eb;
  --border-light: #eff1f3;
  --text: #131722;
  --text2: #434651;
  --text3: #787b86;
  --blue: #2962ff;
  --blue-bg: #e8effd;
  --green: #089981;
  --green-bg: #e6f5f1;
  --red: #f23645;
  --red-bg: #fde8ea;
  --orange: #ff9800;
  --orange-bg: #fff3e0;
  --purple: #7b1fa2;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.08);
}

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

body {
  font-family:'Source Sans 3', system-ui, -apple-system, sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.5;
  -webkit-font-smoothing:antialiased;
}

.container { max-width:1200px; margin:0 auto; padding:20px 24px; }

/* ── Header ── */
.header {
  background:var(--bg);
  border-bottom:1px solid var(--border);
  padding:16px 0;
  margin-bottom:24px;
  position:sticky;
  top:0;
  z-index:100;
  backdrop-filter:blur(8px);
  background:rgba(255,255,255,0.95);
}
.header-inner {
  max-width:1200px;
  margin:0 auto;
  padding:0 24px;
  display:flex;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  gap:12px;
}
.logo { font-size:18px; font-weight:700; color:var(--text); letter-spacing:-0.5px; }
.logo span { color:var(--blue); }
.header-tag {
  font-size:12px;
  color:var(--text3);
  background:var(--surface);
  padding:4px 10px;
  border-radius:20px;
  border:1px solid var(--border);
}

/* ── Cards ── */
.card {
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:var(--radius);
  padding:20px;
  margin-bottom:16px;
  box-shadow:var(--shadow);
}
.card-title {
  font-size:15px;
  font-weight:700;
  color:var(--text);
  margin-bottom:16px;
  display:flex;
  align-items:center;
  gap:8px;
}
.card-title .icon {
  width:20px; height:20px;
  border-radius:4px;
  display:flex; align-items:center; justify-content:center;
  font-size:12px; color:#fff;
}

/* ── Stats Row ── */
.stats-row {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(180px,1fr));
  gap:12px;
  margin-bottom:20px;
}
.stat-card {
  background:var(--surface);
  border:1px solid var(--border-light);
  border-radius:var(--radius);
  padding:14px 16px;
}
.stat-label {
  font-size:11px; font-weight:600; color:var(--text3);
  text-transform:uppercase; letter-spacing:0.5px; margin-bottom:4px;
}
.stat-value {
  font-size:22px; font-weight:700; color:var(--text);
  font-variant-numeric:tabular-nums;
}
.stat-sub { font-size:12px; color:var(--text3); margin-top:2px; }

/* ── Inputs ── */
.input-grid {
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(200px,1fr));
  gap:14px;
  margin-bottom:20px;
}
.input-group { display:flex; flex-direction:column; gap:4px; }
.input-group label {
  font-size:12px; font-weight:600; color:var(--text3);
  text-transform:uppercase; letter-spacing:0.3px;
}
.input-group input,
.input-group select {
  padding:10px 12px;
  border:1px solid var(--border);
  border-radius:6px;
  font-size:14px;
  font-family:inherit;
  color:var(--text);
  background:var(--bg);
  transition:border 0.15s;
}
.input-group input:focus,
.input-group select:focus {
  outline:none;
  border-color:var(--blue);
  box-shadow:0 0 0 3px rgba(41,98,255,0.1);
}

/* ── Tables ── */
.table-wrap { overflow-x:auto; margin:0 -4px; }
table { width:100%; border-collapse:collapse; font-size:13px; }
thead th {
  background:var(--surface); color:var(--text3);
  font-weight:600; font-size:11px;
  text-transform:uppercase; letter-spacing:0.5px;
  padding:10px 12px; text-align:left;
  border-bottom:1px solid var(--border);
  position:sticky; top:0;
}
tbody td {
  padding:10px 12px;
  border-bottom:1px solid var(--border-light);
  color:var(--text2);
}
tbody tr:hover { background:var(--surface); }
.num { text-align:right; font-variant-numeric:tabular-nums; font-weight:500; }
.green { color:var(--green); }
.red { color:var(--red); }
.blue { color:var(--blue); }
.bold { font-weight:700; color:var(--text); }

/* ── Badges ── */
.badge { display:inline-block; padding:2px 8px; border-radius:4px; font-size:11px; font-weight:600; }
.badge-green { background:var(--green-bg); color:var(--green); }
.badge-red { background:var(--red-bg); color:var(--red); }
.badge-blue { background:var(--blue-bg); color:var(--blue); }
.badge-orange { background:var(--orange-bg); color:var(--orange); }

/* ── Result Boxes ── */
.result-box {
  background:var(--blue-bg);
  border:1px solid rgba(41,98,255,0.15);
  border-radius:var(--radius);
  padding:16px 20px;
  margin:16px 0;
}
.result-box.green-box {
  background:var(--green-bg);
  border-color:rgba(8,153,129,0.15);
}
.result-box h3 { font-size:14px; font-weight:700; color:var(--blue); margin-bottom:8px; }
.result-box.green-box h3 { color:var(--green); }
.result-row { display:flex; justify-content:space-between; align-items:baseline; padding:4px 0; font-size:13px; gap:16px; }
.result-row .label { color:var(--text3); flex-shrink:0; }
.result-row .value { font-weight:600; color:var(--text); font-variant-numeric:tabular-nums; text-align:right; }

/* ── Tabs ── */
.tabs {
  display:flex; gap:0;
  border-bottom:1px solid var(--border);
  margin-bottom:20px;
  overflow-x:auto;
}
.tab {
  padding:10px 18px;
  font-size:13px; font-weight:600;
  color:var(--text3);
  cursor:pointer;
  border-bottom:2px solid transparent;
  transition:all 0.15s;
  white-space:nowrap;
  user-select:none;
}
.tab:hover { color:var(--text); }
.tab.active { color:var(--blue); border-bottom-color:var(--blue); }
.tab-panel { display:none; }
.tab-panel.active { display:block; }

/* ── Sensitivity Grid ── */
.sens-grid {
  display:grid;
  grid-template-columns:repeat(auto-fill, minmax(120px,1fr));
  gap:8px;
}
.sens-cell {
  background:var(--surface);
  border:1px solid var(--border-light);
  border-radius:6px;
  padding:10px;
  text-align:center;
}
.sens-cell .demand { font-size:11px; font-weight:600; color:var(--text3); margin-bottom:2px; }
.sens-cell .xpct { font-size:18px; font-weight:700; }

/* ── Verdict ── */
.verdict-box {
  display:flex;
  align-items:flex-start;
  gap:16px;
  padding:20px;
  border-radius:var(--radius);
  margin-top:16px;
}
.verdict-box.retail { background:var(--green-bg); border:1px solid rgba(8,153,129,0.15); }
.verdict-box.nonretail { background:var(--blue-bg); border:1px solid rgba(41,98,255,0.15); }
.verdict-icon { font-size:28px; flex-shrink:0; }
.verdict-text h4 { font-size:15px; font-weight:700; margin-bottom:4px; }
.verdict-text p { font-size:13px; color:var(--text2); line-height:1.6; }

/* ── Footer ── */
.footer {
  text-align:center;
  padding:24px;
  font-size:11px;
  color:var(--text3);
  border-top:1px solid var(--border);
  margin-top:40px;
}

/* ── Responsive ── */
@media(max-width:768px) {
  .container { padding:12px 16px; }
  .stats-row { grid-template-columns:1fr 1fr; }
  .input-grid { grid-template-columns:1fr; }
  .header-inner { flex-direction:column; align-items:flex-start; }
  .stat-value { font-size:18px; }
  .tab { padding:10px 12px; font-size:12px; }
}
@media(max-width:480px) {
  .stats-row { grid-template-columns:1fr; }
  .result-row { flex-direction:column; gap:2px; }
  .result-row .value { text-align:left; }
}
