:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-muted: #eef3ff;
  --text: #111827;
  --muted: #5b6475;
  --border: #d9e1ef;
  --brand: #2155d6;
  --brand-dark: #183e9f;
  --strong: #0f8f5f;
  --evaluate: #b7791f;
  --weak: #c2410c;
  --purple: #7c3aed;
  --shadow: 0 24px 70px rgba(27, 39, 70, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(33, 85, 214, 0.16), transparent 32rem),
    linear-gradient(180deg, #f8fbff 0%, var(--bg) 42%);
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select {
  font: inherit;
}

.hero {
  padding: 24px clamp(18px, 5vw, 64px) 42px;
}

.nav {
  display: flex;
  align-items: center;
  gap: 22px;
  max-width: 1180px;
  margin: 0 auto 64px;
  color: var(--muted);
  font-weight: 700;
}

.nav a:not(.brand):hover {
  color: var(--brand);
}

.toolbar-selectors {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.language-picker,
.currency-picker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.language-picker select,
.currency-picker select {
  width: auto;
  min-width: 132px;
  padding: 8px 10px;
  border-radius: 999px;
}

.brand {
  margin-right: auto;
  color: var(--brand);
  font-size: 1.2rem;
  letter-spacing: -0.04em;
}

.hero-content {
  max-width: 980px;
  margin: 0 auto;
  text-align: center;
}

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

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

h1 {
  margin-bottom: 22px;
  font-size: clamp(2.4rem, 7vw, 5.4rem);
  line-height: 0.94;
  letter-spacing: -0.075em;
}

h2 {
  margin-bottom: 10px;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  letter-spacing: -0.045em;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.15rem;
}

.hero-copy,
.section-heading p,
.footer,
.metric-card small,
.chart-heading p,
label small {
  color: var(--muted);
}

.hero-copy {
  max-width: 780px;
  margin: 0 auto;
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.65;
}

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

.tabs {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px;
  background: rgba(255, 255, 255, 0.84);
  box-shadow: 0 12px 34px rgba(27, 39, 70, 0.08);
  overflow: hidden;
}

.tab-button {
  max-width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-weight: 800;
  line-height: 1.2;
}

.tab-button.active {
  color: #fff;
  background: var(--brand);
}

.calculator-shell {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(360px, 1.05fr);
  gap: 24px;
  align-items: start;
}

.panel {
  border: 1px solid var(--border);
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.input-panel,
.results-panel,
.formulas,
.charts,
.report {
  padding: clamp(20px, 3vw, 32px);
}

.section-heading {
  margin-bottom: 24px;
}

.input-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

.wide,
.field-group {
  grid-column: 1 / -1;
}

label {
  display: grid;
  gap: 8px;
  color: #253044;
  font-size: 0.92rem;
  font-weight: 750;
}

.field-group {
  margin: 0;
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: 18px;
  background: #fbfdff;
}

.field-group legend {
  padding: 0 8px;
  color: var(--brand-dark);
  font-weight: 900;
}

input,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 13px 14px;
  color: var(--text);
  background: #fff;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

input:focus,
select:focus {
  border-color: var(--brand);
  background: #fff;
  box-shadow: 0 0 0 4px rgba(33, 85, 214, 0.12);
}

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

.decision-card {
  border: 1px solid transparent;
  border-radius: 24px;
  padding: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--strong), #0b6b55);
}

.decision-card.evaluate {
  background: linear-gradient(135deg, var(--evaluate), #8a5a12);
}

.decision-card.weak {
  background: linear-gradient(135deg, var(--weak), #8f2d12);
}

.decision-card .eyebrow,
.decision-card p {
  color: rgba(255, 255, 255, 0.82);
}

.decision-card h2 {
  margin-bottom: 8px;
  font-size: clamp(2rem, 4vw, 3.2rem);
}

.decision-card p:last-child {
  margin-bottom: 0;
  line-height: 1.55;
}

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

.metric-card {
  min-height: 128px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  background: var(--surface);
}

.metric-card.highlight {
  border-color: rgba(15, 143, 95, 0.25);
  background: linear-gradient(180deg, rgba(15, 143, 95, 0.11), #fff 72%);
}

.metric-label {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
  line-height: 1.35;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.metric-card strong {
  font-size: clamp(1.55rem, 3vw, 2.35rem);
  letter-spacing: -0.055em;
}

.capacity-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  color: var(--muted);
}

.capacity-strip span {
  flex: 1;
  min-width: 180px;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 14px 16px;
  background: var(--surface-muted);
}

.capacity-strip strong {
  color: var(--text);
}

.chart-panel,
.report-panel,
.formulas {
  margin-top: 0;
}

.projection-note {
  display: inline-block;
  margin: 0 0 18px;
  border: 1px solid rgba(183, 121, 31, 0.24);
  border-radius: 999px;
  padding: 8px 12px;
  color: #8a5a12;
  background: rgba(183, 121, 31, 0.08);
  font-size: 0.9rem;
  font-weight: 750;
}

.chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.chart-card {
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 18px;
  background: #fbfdff;
}

.chart-heading p {
  margin-bottom: 14px;
  line-height: 1.5;
}

canvas {
  display: block;
  width: 100%;
  height: 280px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: #fff;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.legend i {
  display: inline-block;
  width: 11px;
  height: 11px;
  margin-right: 6px;
  border-radius: 999px;
}

.legend-current { background: var(--brand); }
.legend-target { background: var(--strong); }
.legend-savings { background: var(--purple); }

.report {
  margin-top: 0;
}

.report-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
}

.report-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.primary-action,
.secondary-action {
  border: 0;
  border-radius: 999px;
  padding: 12px 16px;
  cursor: pointer;
  font-weight: 850;
}

.primary-action {
  color: #fff;
  background: var(--brand);
}

.secondary-action {
  color: var(--brand);
  background: var(--surface-muted);
}

.report-editor {
  min-height: 420px;
  border: 1px dashed var(--border);
  border-radius: 22px;
  padding: clamp(18px, 3vw, 30px);
  background: #fff;
  line-height: 1.6;
  outline: none;
}

.report-editor:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(33, 85, 214, 0.12);
}

.generated-report h1 {
  font-size: clamp(2rem, 4vw, 3.4rem);
}

.report-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.report-metrics div {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 14px;
  background: #fbfdff;
}

.report-metrics dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

.report-metrics dd {
  margin: 4px 0 0;
  font-size: 1.35rem;
  font-weight: 850;
}

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

.report-chart-grid img {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
}

.formulas {
  margin-top: 24px;
}

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

.formula-grid div {
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
  background: #fbfdff;
}

.formula-grid dt {
  margin-bottom: 6px;
  font-weight: 850;
}

.formula-grid dd {
  margin: 0;
  color: var(--muted);
}

.footer {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 32px;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 920px) {
  .calculator-shell,
  .chart-grid,
  .report-chart-grid {
    grid-template-columns: 1fr;
  }

  .report-heading {
    display: grid;
  }

  .input-grid.compact {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .hero {
    padding-inline: 16px;
  }

  .nav {
    margin-bottom: 42px;
  }

  .nav a:not(.brand) {
    display: none;
  }

  .toolbar-selectors {
    margin-left: auto;
    justify-content: flex-end;
  }

  main,
  .footer {
    width: min(100% - 24px, 1180px);
  }

  .input-grid,
  .input-grid.compact,
  .result-grid,
  .report-metrics,
  .formula-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    display: grid;
    width: 100%;
    justify-items: center;
  }

  .tab-button {
    width: calc(100% - 8px);
  }

  .panel {
    border-radius: 22px;
  }
}


@media print {
  body {
    background: #fff;
  }

  .hero,
  .tabs,
  #calculator-panel,
  #charts-panel,
  #formulas,
  .footer,
  .report-heading {
    display: none !important;
  }

  main,
  .report-panel,
  .report {
    width: 100%;
    margin: 0;
    box-shadow: none;
    border: 0;
  }

  #report-panel {
    display: block !important;
  }

  .report-editor {
    border: 0;
    padding: 0;
  }

  .report-chart-grid {
    grid-template-columns: 1fr 1fr;
  }
}
