:root {
  color-scheme: light;
  --bg: #f6f7f3;
  --panel: #ffffff;
  --ink: #17201c;
  --muted: #65706b;
  --line: #dfe5dd;
  --green: #176b4d;
  --green-2: #dceee6;
  --blue: #245c9a;
  --blue-2: #e2edf8;
  --gold: #9b6a18;
  --gold-2: #f3ead9;
  --shadow: 0 18px 50px rgba(26, 37, 32, 0.08);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(220, 238, 230, 0.72), transparent 380px),
    var(--bg);
  color: var(--ink);
}

button,
input {
  font: inherit;
}

.shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 48px;
}

.intro {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: end;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--green);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  max-width: 760px;
  margin-bottom: 12px;
  font-size: clamp(2.1rem, 6vw, 4.8rem);
  line-height: 0.95;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 1rem;
}

.lede {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.assumptions {
  display: grid;
  gap: 8px;
}

.assumptions span {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  padding: 10px 12px;
  color: #33413b;
  font-size: 0.9rem;
}

.workspace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  box-shadow: var(--shadow);
}

.controls {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 16px;
  padding: 18px;
}

.section-title {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.section-title p {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.ghost {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #304038;
  cursor: pointer;
  min-height: 34px;
  padding: 7px 12px;
  font-weight: 700;
}

.ghost:hover {
  border-color: #b7c2bc;
}

.tabs {
  display: inline-grid;
  grid-auto-flow: column;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f5f8f6;
  padding: 4px;
}

.tab {
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #506059;
  cursor: pointer;
  min-height: 32px;
  padding: 6px 12px;
  font-weight: 800;
}

.tab.active {
  background: #fff;
  color: var(--green);
  box-shadow: 0 1px 5px rgba(26, 37, 32, 0.1);
}

.tab:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

label {
  display: grid;
  gap: 7px;
  color: #34413b;
  font-size: 0.9rem;
  font-weight: 700;
}

label small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.35;
}

input {
  width: 100%;
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  background: #fbfcfb;
  color: var(--ink);
  min-height: 42px;
  padding: 9px 11px;
}

input:focus {
  border-color: var(--green);
  outline: 3px solid rgba(23, 107, 77, 0.15);
}

.input-affix {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  border: 1px solid #cfd8d2;
  border-radius: 8px;
  background: #fbfcfb;
  overflow: hidden;
}

.input-affix span {
  padding: 0 11px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.input-affix input {
  border: 0;
  border-radius: 0;
  background: transparent;
  min-width: 0;
}

.switch-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.switch-row input {
  width: 42px;
  min-height: 24px;
  accent-color: var(--green);
}

.results {
  display: grid;
  gap: 18px;
}

.hero-result {
  border-radius: 8px;
  background: #10231c;
  color: #fff;
  padding: 24px;
  min-height: 172px;
  display: grid;
  align-content: center;
}

.hero-result p {
  margin-bottom: 10px;
  color: #a9c7ba;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
}

.hero-result h2 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 5vw, 4.1rem);
  line-height: 1;
}

.hero-result span {
  color: #d7e6df;
  line-height: 1.45;
}

.cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.metric {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.metric p {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.84rem;
  font-weight: 800;
}

.metric strong {
  display: block;
  overflow-wrap: anywhere;
  font-size: clamp(1.2rem, 2.3vw, 1.75rem);
  line-height: 1.1;
}

.metric span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 0.86rem;
}

.chart-panel,
.table-panel {
  padding: 18px;
}

.chart-wrap {
  margin-top: 18px;
  min-height: 280px;
}

canvas {
  display: block;
  width: 100%;
  height: auto;
}

.table-panel {
  margin-top: 18px;
}

.table-wrap {
  margin-top: 14px;
  overflow-x: auto;
}

table {
  width: 100%;
  min-width: 820px;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 12px 10px;
  text-align: right;
  vertical-align: top;
}

th:first-child,
td:first-child,
th:nth-child(2),
td:nth-child(2) {
  text-align: left;
}

th {
  color: #52605a;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

td {
  color: #223029;
  font-size: 0.92rem;
  font-weight: 650;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 0.78rem;
  font-weight: 800;
}

.tag.green {
  background: var(--green-2);
  color: var(--green);
}

.tag.blue {
  background: var(--blue-2);
  color: var(--blue);
}

.tag.gold {
  background: var(--gold-2);
  color: var(--gold);
}

@media (max-width: 900px) {
  .intro,
  .workspace {
    grid-template-columns: 1fr;
  }

  .controls {
    position: static;
  }

  .cards {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 560px) {
  .shell {
    width: min(100% - 20px, 1180px);
    padding-top: 20px;
  }

  .intro {
    gap: 18px;
  }

  .hero-result,
  .chart-panel,
  .table-panel,
  .controls {
    padding: 14px;
  }
}
