:root {
  --bg: #eef6ef;
  --surface: #ffffff;
  --surface-soft: #f7fbf8;
  --line: #d6e6d9;
  --text: #1f3126;
  --muted: #5a6d61;
  --green: #2f8f4d;
  --green-strong: #23713d;
  --green-soft: #d9f1df;
  --radius: 16px;
  --shadow: 0 18px 40px rgba(32, 70, 45, 0.08);
}

* {
  box-sizing: border-box;
}

[id] {
  scroll-margin-top: 7rem;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Manrope", "Segoe UI", sans-serif;
  line-height: 1.5;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, #f8fff9 0%, transparent 38%),
    radial-gradient(circle at 92% 84%, #e6f7ea 0%, transparent 36%),
    var(--bg);
}

.page {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.3rem 0 2.8rem;
  position: relative;
  z-index: 2;
}

.bg-shape {
  position: fixed;
  z-index: 1;
  width: 290px;
  height: 290px;
  border-radius: 999px;
  filter: blur(8px);
  pointer-events: none;
}

.bg-shape--left {
  left: -120px;
  top: 120px;
  background: linear-gradient(145deg, #dff3e4 0%, #ecf8ef 100%);
}

.bg-shape--right {
  right: -90px;
  bottom: -60px;
  background: linear-gradient(145deg, #cdecd5 0%, #e7f8eb 100%);
}

.topbar {
  position: sticky;
  top: 0.7rem;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 1rem;
  margin-bottom: 1.3rem;
  padding: 0.45rem 0.65rem;
  border: 1px solid rgba(201, 221, 206, 0.75);
  border-radius: 18px;
  background: rgba(247, 251, 248, 0.9);
  box-shadow: 0 12px 30px rgba(32, 70, 45, 0.08);
  backdrop-filter: blur(14px);
}

.brand {
  text-decoration: none;
  color: inherit;
  display: inline-flex;
  align-items: center;
  gap: 0.7rem;
  margin-right: auto;
}

.brand__icon {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(145deg, #f0fbf3 0%, #def2e4 100%);
  border: 1px solid #cae6d2;
}

.brand__icon svg {
  width: 28px;
  height: 28px;
  fill: var(--green);
}

.brand__text {
  display: grid;
  line-height: 1.1;
}

.brand__text strong {
  font-size: 1rem;
}

.brand__text small {
  color: var(--muted);
  font-size: 0.74rem;
}

.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid #c9ddce;
  background: #ffffffb3;
  color: #2a5138;
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.ghost-btn:hover {
  background: #ffffff;
  border-color: #b9d2c0;
  transform: translateY(-1px);
}

.topbar__logos {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding-left: 0.2rem;
}

.topbar__logos img {
  display: block;
  width: 96px;
  height: 38px;
  object-fit: contain;
}

.landing {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

.hero-shell {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  align-items: start;
}

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  border-radius: 22px;
  padding: 1.35rem;
  position: relative;
  overflow: hidden;
}

.card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, rgba(47, 143, 77, 0.2), rgba(47, 143, 77, 0));
}

.hero,
.calculator,
.passport,
.benefits,
.story,
.info-card,
.methodology,
.grant {
  background:
    linear-gradient(180deg, rgba(248, 252, 249, 0.95) 0%, rgba(255, 255, 255, 1) 30%),
    var(--surface);
}

.hero {
  padding: 1.5rem;
}

.hero h1 {
  margin: 0.55rem 0 0.95rem;
  font-size: clamp(2rem, 3.2vw, 3rem);
  line-height: 1.08;
  letter-spacing: -0.03em;
  max-width: 16ch;
}

.hero__text {
  color: var(--muted);
  margin: 0;
  font-size: 1rem;
  max-width: 58ch;
}

.eyebrow {
  display: inline-flex;
  margin: 0;
  border-radius: 999px;
  padding: 0.3rem 0.75rem;
  background: #e7f7eb;
  color: #285f39;
  font-size: 0.82rem;
  font-weight: 700;
}

.hero__metrics {
  margin-top: 1.15rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
}

.metric {
  display: grid;
  gap: 0.35rem;
  padding: 0.95rem;
  border-radius: 16px;
  border: 1px solid #deeee2;
  background:
    linear-gradient(180deg, rgba(239, 248, 242, 0.9) 0%, rgba(255, 255, 255, 0.95) 100%);
}

.metric strong {
  font-size: 0.92rem;
}

.metric span {
  color: #547060;
  font-size: 0.86rem;
  line-height: 1.45;
}

.hero__reference {
  margin-top: 1.15rem;
  border: 1px solid #d5e8d9;
  border-radius: 16px;
  background:
    linear-gradient(135deg, rgba(237, 247, 240, 0.95) 0%, rgba(248, 252, 249, 1) 100%);
  padding: 0.85rem 0.9rem;
}

.hero__reference-title {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 800;
  color: #2f6140;
}

.hero__reference-scale {
  margin: 0.32rem 0 0;
  font-size: 0.82rem;
  line-height: 1.45;
  color: #476656;
}

.formula-grid {
  margin-top: 1.15rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.formula-card {
  border: 1px solid #dbe9de;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(247, 251, 248, 0.98) 0%, rgba(255, 255, 255, 1) 100%);
  padding: 1rem;
}

.formula-card h3 {
  margin: 0;
  font-size: 1rem;
}

.formula-card p {
  margin: 0.48rem 0 0;
  color: #4d6859;
  font-size: 0.92rem;
}

.formula-card__formula {
  font-weight: 800;
  color: #234f34;
  letter-spacing: -0.01em;
}

.source-link {
  display: inline-flex;
  margin-top: 0.7rem;
  color: var(--green-strong);
  font-weight: 700;
  text-decoration: none;
  border-bottom: 1px solid rgba(35, 113, 61, 0.25);
}

.source-link:hover {
  border-bottom-color: rgba(35, 113, 61, 0.55);
}

.card__header h2 {
  margin: 0.38rem 0 0;
  font-size: 1.45rem;
}

.card__header p {
  margin: 0.35rem 0 1rem;
  color: var(--muted);
  font-size: 0.95rem;
}

.calculator {
  background:
    radial-gradient(circle at top right, rgba(217, 241, 223, 0.8) 0%, transparent 30%),
    linear-gradient(180deg, rgba(244, 251, 246, 0.98) 0%, rgba(255, 255, 255, 1) 28%),
    var(--surface);
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
}

.field {
  display: grid;
  gap: 0.33rem;
  font-size: 0.84rem;
  font-weight: 700;
  color: #37533f;
}

.field input,
.field select,
.field textarea {
  font: inherit;
  color: var(--text);
  font-size: 0.93rem;
  font-weight: 500;
  border-radius: 11px;
  border: 1px solid #cde0d2;
  background: #fff;
  padding: 0.62rem 0.72rem;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: #77b889;
  box-shadow: 0 0 0 3px #e4f4e8;
}

.field textarea {
  resize: vertical;
  min-height: 112px;
}

.field--wide {
  grid-column: 1 / -1;
}

.field--muted {
  opacity: 0.65;
}

.components-head {
  margin-top: 0.35rem;
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr auto;
  gap: 0.55rem;
  font-size: 0.75rem;
  color: #5b7464;
  font-weight: 700;
}

.components-list {
  margin-top: 0.35rem;
  display: grid;
  gap: 0.45rem;
}

.component-row {
  display: grid;
  grid-template-columns: 2.2fr 1fr 1fr auto;
  gap: 0.55rem;
  align-items: center;
}

.component-row select,
.component-row input {
  font: inherit;
  color: var(--text);
  font-size: 0.87rem;
  font-weight: 500;
  border-radius: 10px;
  border: 1px solid #cde0d2;
  background: #fff;
  padding: 0.55rem 0.62rem;
  min-width: 0;
}

.component-row input.is-readonly {
  background: #f4faf5;
  color: #436050;
}

.row-remove {
  border: 1px solid #d4e4d8;
  background: #f6faf7;
  color: #355847;
  border-radius: 10px;
  padding: 0.52rem 0.58rem;
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
}

.inline-btn {
  margin-top: 0.55rem;
  width: fit-content;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem;
  margin-top: 0.1rem;
}

.report-format {
  display: grid;
  gap: 0.28rem;
  color: #37533f;
  font-size: 0.78rem;
  font-weight: 700;
  min-width: 150px;
}

.report-format select {
  min-height: 40px;
  border-radius: 11px;
  border: 1px solid #cde0d2;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 0.58rem 0.72rem;
  outline: none;
}

.report-format select:focus {
  border-color: #77b889;
  box-shadow: 0 0 0 3px #e4f4e8;
}

.actions button,
.primary-btn,
.secondary-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 11px;
  padding: 0.68rem 0.95rem;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.primary-btn:hover,
.secondary-btn:hover,
.actions button:hover {
  transform: translateY(-1px);
}

.primary-btn {
  background: linear-gradient(155deg, var(--green) 0%, var(--green-strong) 100%);
  color: #fff;
  box-shadow: 0 8px 18px rgba(41, 113, 66, 0.26);
}

.secondary-btn {
  background: #edf6ef;
  color: #2c5e3d;
  border: 1px solid #c9dfcf;
}

.hero__action-link {
  min-width: 140px;
}

.secondary-btn[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.result {
  margin-top: 0.95rem;
  border-radius: 13px;
  border: 1px solid #d4e8d9;
  background: #f6fbf7;
  padding: 0.9rem;
  min-height: 76px;
  display: grid;
  gap: 0.25rem;
}

.result--empty {
  color: #658171;
  font-size: 0.92rem;
  align-content: center;
}

.result__class {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 0.28rem 0.64rem;
  font-size: 0.81rem;
  font-weight: 800;
  letter-spacing: 0.03em;
}

.class-1 {
  background: #ffdfe0;
  color: #8f1320;
}

.class-2 {
  background: #ffe9db;
  color: #7f3d10;
}

.class-3 {
  background: #fff4d7;
  color: #75570a;
}

.class-4 {
  background: #e8f5de;
  color: #326725;
}

.class-5 {
  background: #e3f8ec;
  color: #205334;
}

.result__title {
  margin: 0;
  font-weight: 800;
  font-size: 1rem;
}

.result__meta {
  margin: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.result__table-wrap {
  margin-top: 0.45rem;
  border: 1px solid #dceade;
  border-radius: 10px;
  overflow: auto;
  background: #fff;
}

.result__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.8rem;
}

.result__table th,
.result__table td {
  text-align: left;
  border-bottom: 1px solid #edf4ef;
  padding: 0.42rem 0.52rem;
  white-space: nowrap;
}

.result__table th {
  font-size: 0.74rem;
  color: #486452;
  background: #f6fbf7;
}

.result__table tbody tr:last-child td {
  border-bottom: none;
}

.history {
  margin-top: 0.9rem;
}

.history__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.45rem;
}

.history__title {
  font-size: 0.83rem;
  color: #4f6a5a;
  font-weight: 800;
}

.history__hint {
  color: #6d8578;
  font-size: 0.76rem;
}

.history ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 0.43rem;
}

.history li {
  border: 1px solid #dfede2;
  background: #fcfefc;
  border-radius: 10px;
  padding: 0.55rem 0.62rem;
}

.history__item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.65rem;
  align-items: center;
}

.history__open {
  width: 100%;
  padding: 0;
  border: none;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
}

.history__name {
  display: block;
  font-size: 0.86rem;
  font-weight: 800;
}

.history__meta {
  display: block;
  margin-top: 0.15rem;
  color: #486251;
  font-size: 0.8rem;
}

.history__remove {
  border: 1px solid #d5e5d8;
  background: #f5faf6;
  color: #355847;
  border-radius: 10px;
  padding: 0.45rem 0.65rem;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
}

.history__empty {
  color: #6b8275;
  font-size: 0.84rem;
}

.note {
  margin: 0.9rem 0 0;
  font-size: 0.76rem;
  color: #5f7969;
}

.passport {
  padding: 1.45rem;
}

.passport-layout {
  margin-top: 1.15rem;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 1rem;
  align-items: start;
}

.passport-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.72rem;
}

.passport-preview {
  display: grid;
  gap: 0.85rem;
}

.passport-preview__card {
  border: 1px solid #dbe8de;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(247, 251, 248, 0.96) 0%, rgba(255, 255, 255, 1) 100%);
  padding: 1rem;
}

.passport-preview__card h3 {
  margin: 0;
  font-size: 1rem;
}

.passport-preview__eyebrow {
  margin: 0 0 0.45rem;
  color: #517061;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.passport-preview__text {
  margin: 0.55rem 0 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.passport-status {
  display: grid;
  gap: 0.45rem;
  color: #486656;
  font-size: 0.9rem;
}

.passport-status__class {
  display: inline-flex;
  width: fit-content;
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 800;
}

.passport-status__title {
  margin: 0;
  font-size: 1.06rem;
  font-weight: 800;
  color: #264934;
}

.passport-status__meta {
  margin: 0;
  color: #5c7668;
}

.info-grid,
.details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.info-card h2,
.story h2,
.benefits h2,
.methodology h2,
.grant h2 {
  margin: 0.45rem 0 0;
  font-size: clamp(1.35rem, 2.2vw, 2rem);
  line-height: 1.15;
}

.info-card > p:not(.eyebrow),
.story > p:not(.eyebrow),
.section-heading > p:not(.eyebrow),
.methodology-card p {
  color: var(--muted);
}

.info-list,
.steps-list {
  margin: 1rem 0 0;
  padding-left: 1.15rem;
  display: grid;
  gap: 0.72rem;
  color: #405d4c;
}

.benefits {
  padding: 1.45rem;
}

.section-heading {
  max-width: 760px;
}

.section-heading h2 {
  margin: 0.45rem 0 0;
}

.section-heading p:last-child {
  margin: 0.55rem 0 0;
}

.benefits-grid {
  margin-top: 1.15rem;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.8rem;
}

.benefit,
.methodology-card {
  border: 1px solid #dbeadf;
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(247, 251, 248, 0.96) 0%, rgba(255, 255, 255, 1) 100%);
  padding: 1rem;
}

.benefit h3,
.methodology-card h3 {
  margin: 0;
  font-size: 1rem;
}

.benefit p,
.methodology-card p {
  margin: 0.45rem 0 0;
  font-size: 0.92rem;
  line-height: 1.5;
}

.story {
  min-height: 100%;
}

.methodology-grid {
  margin-top: 1.15rem;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
}

.grant h2 {
  margin: 0;
  font-size: 1.35rem;
}

.grant__text {
  margin: 0.6rem 0 0;
  color: #385646;
  line-height: 1.45;
}

.grant__text--small {
  margin-top: 0.5rem;
  color: #5c7866;
  font-size: 0.9rem;
}

.grant__logos {
  margin-top: 0.85rem;
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.logo-slot {
  border: 1px dashed #bcd7c4;
  border-radius: 12px;
  background: #f8fcf9;
  min-height: 86px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 0.6rem;
  font-size: 0.83rem;
  font-weight: 700;
  color: #426351;
}

.logo-slot img {
  display: block;
  width: 100%;
  max-height: 72px;
  object-fit: contain;
}

.reveal {
  animation: fadeUp 0.6s ease both;
}

.reveal-delay {
  animation-delay: 0.08s;
}

@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 960px) {
  .topbar {
    gap: 0.65rem;
  }

  .topbar__logos {
    width: 100%;
    justify-content: flex-end;
  }

  .info-grid,
  .details-grid,
  .methodology-grid,
  .formula-grid,
  .passport-layout {
    grid-template-columns: 1fr;
  }

  .hero__metrics,
  .benefits-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .page {
    width: min(1180px, calc(100% - 1rem));
    padding-top: 0.8rem;
  }

  .topbar {
    flex-wrap: wrap;
    top: 0.45rem;
  }

  .brand {
    width: 100%;
  }

  .ghost-btn {
    flex: 1 1 auto;
    padding-inline: 0.7rem;
  }

  .topbar__logos {
    justify-content: center;
  }

  .topbar__logos img {
    width: min(42vw, 118px);
    height: 34px;
  }

  .history__head {
    align-items: flex-start;
    flex-direction: column;
  }

  .card {
    padding: 1rem;
    border-radius: 18px;
  }

  .hero {
    padding: 1.1rem;
  }

  .hero h1 {
    max-width: none;
    font-size: clamp(1.8rem, 10vw, 2.5rem);
  }

  .hero__metrics,
  .benefits-grid {
    grid-template-columns: 1fr;
  }

  .form-grid,
  .passport-form {
    grid-template-columns: 1fr;
  }

  .components-head {
    display: none;
  }

  .component-row {
    grid-template-columns: 1fr;
    border: 1px solid #dfebe2;
    border-radius: 12px;
    background: #fdfefd;
    padding: 0.5rem;
  }

  .row-remove {
    justify-self: start;
  }

  .history li {
    padding: 0.6rem;
  }

  .history__item {
    grid-template-columns: 1fr;
  }

  .grant__logos {
    grid-template-columns: 1fr;
  }
}
