:root {
  color-scheme: dark;
  --bg: #0d1117;
  --panel: #151b23;
  --panel-2: #1f2937;
  --text: #e6edf3;
  --muted: #9da7b3;
  --line: #30363d;
  --accent: #7dd3fc;
  --good: #86efac;
  --bad: #fca5a5;
  --warn: #facc15;
  --shadow: 0 20px 60px rgb(0 0 0 / 0.25);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: radial-gradient(circle at top left, #172554 0, transparent 34rem), var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.hero, main, footer {
  width: min(1180px, calc(100vw - 32px));
  margin: 0 auto;
}

.hero {
  display: grid;
  grid-template-columns: 1fr minmax(230px, 320px);
  gap: 24px;
  align-items: end;
  padding: 48px 0 24px;
}

h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2.2rem, 6vw, 5rem); line-height: 0.95; margin-bottom: 16px; }
h2 { margin-bottom: 8px; }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 760px; }
.eyebrow { color: var(--accent); letter-spacing: .08em; text-transform: uppercase; font-size: .78rem; font-weight: 700; }
.muted { color: var(--muted); }

.panel, .hero-card {
  background: color-mix(in srgb, var(--panel) 92%, transparent);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.panel { padding: 22px; margin-bottom: 22px; }
.hero-card { padding: 22px; display: grid; gap: 8px; }
.hero-card strong { font-size: 1.8rem; }
.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: start;
  gap: 18px;
  margin-bottom: 18px;
}

.button-row { display: flex; flex-wrap: wrap; gap: 10px; }
button {
  border: 0;
  border-radius: 999px;
  padding: 10px 15px;
  color: #001018;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
}
button.secondary { background: var(--panel-2); color: var(--text); border: 1px solid var(--line); }
button:hover { filter: brightness(1.08); }
.status { min-height: 1.25em; color: var(--warn); }

.input-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
}
.field-section {
  grid-column: 1 / -1;
  color: var(--accent);
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 8px;
  font-weight: 800;
}
.field {
  display: grid;
  gap: 7px;
  background: rgb(255 255 255 / 0.025);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
}
.field label { font-weight: 700; }
.field small { color: var(--muted); line-height: 1.35; }
.input-with-suffix { display: flex; align-items: stretch; }
input, textarea {
  width: 100%;
  background: #0b1220;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
}
.input-with-suffix input { border-radius: 12px 0 0 12px; }
.suffix {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-left: 0;
  border-radius: 0 12px 12px 0;
  padding: 0 10px;
  color: var(--muted);
  background: #111827;
}
.checkbox-field { display: flex; gap: 10px; align-items: center; }
.checkbox-field input { width: auto; }

.results-grid, .scenario-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.result-card { margin-bottom: 0; }
.primary-result { background: linear-gradient(135deg, rgb(14 116 144 / .35), var(--panel)); }
.big-number { font-size: clamp(2rem, 5vw, 4rem); font-weight: 900; margin: 12px 0; }
.good { color: var(--good); }
.bad { color: var(--bad); }
.warn { color: var(--warn); }
.metric-list { display: grid; gap: 8px; margin-top: 16px; }
.metric-row { display: flex; justify-content: space-between; gap: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.metric-row span:first-child { color: var(--muted); }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: right; padding: 10px 8px; border-bottom: 1px solid var(--line); }
th:first-child, td:first-child { text-align: left; }

.two-col { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, .9fr); gap: 24px; }
textarea { margin-top: 12px; min-height: 180px; font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace; }
.methodology li { margin-bottom: 10px; color: var(--muted); }
footer { padding: 22px 0 44px; color: var(--muted); }

@media (max-width: 800px) {
  .hero, .two-col { grid-template-columns: 1fr; }
  .panel-heading { display: block; }
  .button-row { margin-top: 12px; }
}
