:root {
  --ink: #17211f;
  --muted: #5f6b67;
  --paper: #f7f5ef;
  --surface: #ffffff;
  --surface-soft: #eeeee8;
  --line: #d8dbd4;
  --brand: #075b54;
  --brand-dark: #06443f;
  --accent: #d7a63e;
  --warning: #fff5dc;
  --warning-line: #dcae4c;
  --shadow: 0 24px 60px rgb(23 33 31 / 9%);
  --radius: 22px;
  --radius-small: 13px;
  --content: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

a {
  color: var(--brand);
  text-underline-offset: 0.18em;
}

button,
input,
select {
  font: inherit;
}

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 10px 16px;
  color: #fff;
  background: var(--brand-dark);
  border-radius: 8px;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.site-header {
  width: min(calc(100% - 40px), var(--content));
  min-height: 76px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  color: var(--ink);
  font-size: 1.08rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.brand span {
  color: var(--accent);
}

.site-header nav,
.footer-links {
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-header nav a,
.footer-links a {
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 650;
  text-decoration: none;
}

.site-header nav a:hover,
.site-header nav a:focus-visible,
.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--brand);
  text-decoration: underline;
}

.hero {
  width: min(calc(100% - 40px), var(--content));
  margin: 30px auto 0;
  padding: clamp(32px, 6vw, 76px);
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(260px, 0.55fr);
  gap: clamp(36px, 7vw, 88px);
  align-items: end;
  color: #fff;
  background:
    radial-gradient(circle at 88% 12%, rgb(215 166 62 / 28%), transparent 28%),
    linear-gradient(135deg, #075b54, #063d39);
  border-radius: 32px;
  box-shadow: var(--shadow);
}

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

.hero .eyebrow {
  color: #f2cf84;
}

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

h1,
h2,
h3 {
  line-height: 1.1;
  letter-spacing: -0.035em;
}

h1 {
  max-width: 790px;
  margin-bottom: 22px;
  font-size: clamp(2.4rem, 6vw, 5.35rem);
}

h2 {
  font-size: clamp(1.8rem, 3.5vw, 3rem);
}

h3 {
  font-size: 1.12rem;
}

.hero__lead {
  max-width: 680px;
  margin-bottom: 30px;
  color: rgb(255 255 255 / 82%);
  font-size: clamp(1rem, 1.6vw, 1.2rem);
}

.hero__actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.hero__formula {
  padding: 24px;
  color: var(--ink);
  background: #f8f3e5;
  border: 1px solid rgb(255 255 255 / 40%);
  border-radius: var(--radius);
}

.hero__formula span,
.metric-card span,
.cost-note span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__formula strong {
  display: block;
  margin-bottom: 12px;
  font-size: 1.38rem;
  line-height: 1.2;
}

.hero__formula p {
  margin-bottom: 0;
  color: var(--muted);
}

.hero__formula ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  font-size: 0.9rem;
}

.hero__formula li + li {
  margin-top: 6px;
}

.button {
  min-height: 48px;
  padding: 13px 20px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
  background: var(--brand);
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 800;
  text-decoration: none;
  transition: 160ms ease;
}

.hero .button {
  color: var(--brand-dark);
  background: #fff;
}

.hero .button--light-outline {
  color: #fff;
  background: transparent;
  border-color: rgb(255 255 255 / 46%);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgb(0 0 0 / 14%);
}

.button:focus-visible,
input:focus-visible,
select:focus-visible,
summary:focus-visible,
a:focus-visible {
  outline: 3px solid #efbe54;
  outline-offset: 3px;
}

.button--large {
  min-height: 56px;
  padding-inline: 28px;
  font-size: 1rem;
}

.button--secondary {
  color: #fff;
  background: var(--brand-dark);
}

.button--ghost {
  color: var(--brand-dark);
  background: transparent;
  border-color: var(--brand);
}

.trust-strip {
  width: min(calc(100% - 40px), var(--content));
  margin: 24px auto 72px;
  padding: 0 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}

.trust-strip span {
  padding-left: 20px;
  position: relative;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 650;
}

.trust-strip span::before {
  content: "";
  position: absolute;
  top: 0.48em;
  left: 0;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
}

.calculator-shell,
.result,
.source-section,
.tool-index,
.archive-section {
  width: min(calc(100% - 40px), var(--content));
  margin-inline: auto;
}

.tool-index {
  padding-bottom: 76px;
  scroll-margin-top: 20px;
}

.section-heading {
  max-width: 790px;
  margin-bottom: 28px;
}

.section-heading h2 {
  margin-bottom: 14px;
}

.section-heading > p:last-child {
  color: var(--muted);
}

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

.tool-card {
  min-height: 265px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 14px 34px rgb(23 33 31 / 6%);
  text-decoration: none;
  transition: 160ms ease;
}

.tool-card:hover,
.tool-card:focus-visible {
  border-color: var(--brand);
  transform: translateY(-3px);
}

.tool-card--pdf {
  color: #fff;
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.tool-card__number,
.file-type {
  margin-bottom: 28px;
  color: var(--brand);
  font-size: 0.74rem;
  font-weight: 850;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tool-card--pdf .tool-card__number {
  color: #f2cf84;
}

.tool-card h3 {
  margin-bottom: 10px;
  font-size: 1.35rem;
}

.tool-card p {
  color: var(--muted);
  font-size: 0.9rem;
}

.tool-card--pdf p {
  color: rgb(255 255 255 / 72%);
}

.tool-card strong {
  margin-top: auto;
  color: var(--brand);
  font-size: 0.88rem;
}

.tool-card--pdf strong {
  color: #f2cf84;
}

.calculator-shell {
  padding: clamp(26px, 5vw, 58px);
  display: grid;
  grid-template-columns: minmax(220px, 0.65fr) minmax(0, 1.35fr);
  gap: clamp(36px, 7vw, 88px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
  scroll-margin-top: 20px;
}

.calculator-shell + .result,
.result + .calculator-shell {
  margin-top: 34px;
}

.result + .calculator-shell {
  margin-top: 64px;
}

.section-intro {
  align-self: start;
  position: sticky;
  top: 24px;
}

.section-intro h2 {
  margin-bottom: 18px;
}

.section-intro > p:not(.eyebrow) {
  color: var(--muted);
}

.pdf-promise {
  margin-top: 22px;
  padding: 16px;
  display: grid;
  gap: 4px;
  color: var(--brand-dark);
  background: #e7f1ee;
  border-radius: var(--radius-small);
  font-size: 0.84rem;
}

.pdf-promise span {
  color: var(--muted);
}

.formula-box,
.notice-box {
  margin-top: 22px;
  padding: 16px;
  display: grid;
  gap: 5px;
  color: var(--brand-dark);
  background: #e7f1ee;
  border-radius: var(--radius-small);
  font-size: 0.84rem;
}

.formula-box span,
.notice-box p {
  margin: 0;
  color: var(--muted);
}

.notice-box {
  margin: 0 0 22px;
  background: var(--warning);
  border: 1px solid var(--warning-line);
}

.inline-pdf-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.9rem;
  font-weight: 800;
}

form {
  min-width: 0;
}

fieldset {
  margin: 0 0 30px;
  padding: 0 0 30px;
  border: 0;
  border-bottom: 1px solid var(--line);
}

legend {
  width: 100%;
  margin-bottom: 18px;
  font-size: 1.08rem;
  font-weight: 850;
  letter-spacing: -0.02em;
}

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

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

label > span:first-child:not(.input-with-unit),
.field-grid label > span:first-child {
  display: block;
  margin-bottom: 8px;
  font-size: 0.88rem;
  font-weight: 750;
}

input,
select {
  width: 100%;
  min-height: 50px;
  padding: 11px 13px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #b9c0bc;
  border-radius: 11px;
}

.input-with-unit {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  background: var(--surface-soft);
  border-radius: 11px;
}

.input-with-unit input {
  background: #fff;
}

.input-with-unit > span {
  padding-inline: 13px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.field-help {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.84rem;
}

.product-facts {
  margin-top: 16px;
  padding: 15px 17px;
  display: grid;
  gap: 4px;
  color: var(--muted);
  background: #f4f7f5;
  border-left: 4px solid var(--brand);
  border-radius: 8px;
  font-size: 0.84rem;
}

.product-facts strong {
  color: var(--ink);
}

.checkbox-stack {
  padding-top: 2px;
  display: grid;
  gap: 12px;
}

.checkbox-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.checkbox-row input {
  width: 19px;
  min-height: 19px;
  margin: 2px 0 0;
  flex: 0 0 auto;
  accent-color: var(--brand);
}

.checkbox-row span {
  margin: 0 !important;
  font-weight: 650 !important;
}

.form-error {
  min-height: 24px;
  margin-bottom: 8px;
  color: #a22626;
  font-weight: 700;
}

.result {
  margin-top: 34px;
  padding: clamp(26px, 5vw, 58px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 30px;
  box-shadow: var(--shadow);
  scroll-margin-top: 20px;
}

.result-heading {
  margin-bottom: 28px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 28px;
}

.result-heading h2 {
  margin-bottom: 12px;
}

.print-brand {
  display: none;
  margin-bottom: 8px;
  font-weight: 850;
}

.print-document-header {
  display: none;
}

.result-heading p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.source-status {
  padding: 8px 12px;
  flex: 0 0 auto;
  color: var(--brand-dark);
  background: #e7f1ee;
  border-radius: 999px;
  font-size: 0.78rem;
  font-weight: 800;
}

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

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

.metric-card {
  min-height: 170px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
}

.metric-card--primary {
  color: #fff;
  background: var(--brand);
  border-color: var(--brand);
}

.metric-card--primary span,
.metric-card--primary small {
  color: rgb(255 255 255 / 76%);
}

.metric-card strong {
  display: block;
  margin-block: 12px;
  font-size: clamp(1.35rem, 2.8vw, 2.1rem);
  line-height: 1.12;
}

.metric-card small {
  color: var(--muted);
  line-height: 1.35;
}

.metric-card.metric-card--primary small {
  color: rgb(255 255 255 / 82%);
}

.material-plan {
  margin-bottom: 22px;
  padding: 26px;
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(220px, 0.5fr);
  gap: 30px;
  background: #f4f7f5;
  border-radius: var(--radius);
}

.check-list,
.warning-panel ul {
  margin: 0;
  padding-left: 20px;
}

.check-list li,
.warning-panel li {
  margin-bottom: 8px;
}

.cost-note {
  padding: 18px;
  align-self: start;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
}

.cost-note p {
  margin-bottom: 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.warning-panel {
  margin-bottom: 24px;
  padding: 24px;
  background: var(--warning);
  border: 1px solid var(--warning-line);
  border-radius: var(--radius-small);
}

.warning-panel p {
  margin: 16px 0 0;
  font-size: 0.88rem;
  font-weight: 650;
}

.calculation-breakdown {
  margin-bottom: 22px;
  padding: 24px;
  background: #f4f7f5;
  border-radius: var(--radius-small);
}

.calculation-breakdown h3 {
  margin-bottom: 16px;
}

.calculation-breakdown p {
  margin-bottom: 0;
}

.calculation-breakdown dl {
  margin: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 24px;
}

.calculation-breakdown dl > div {
  padding-block: 9px;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  border-bottom: 1px solid var(--line);
}

.calculation-breakdown dt {
  color: var(--muted);
}

.calculation-breakdown dd {
  margin: 0;
  font-weight: 800;
  text-align: right;
}

.comparison {
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.comparison summary {
  padding: 20px 0;
  cursor: pointer;
  font-weight: 800;
}

.table-scroll {
  margin-bottom: 20px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}

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

th {
  color: var(--muted);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

tr.is-best {
  background: #edf6f2;
}

.best-label {
  color: var(--brand);
  font-weight: 800;
}

.result-actions {
  padding-top: 24px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.print-help {
  width: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 0.82rem;
}

.source-section {
  margin-top: 80px;
  padding-bottom: 80px;
}

.archive-section {
  padding-top: 82px;
  scroll-margin-top: 20px;
}

.archive-section--links {
  padding-bottom: 82px;
}

.archive-grid {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 16px;
}

.archive-card,
.link-groups article {
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
}

.archive-card--featured {
  color: #fff;
  background: var(--brand-dark);
  border-color: var(--brand-dark);
}

.archive-card .file-type {
  display: block;
  margin-bottom: 18px;
}

.archive-card--featured .file-type {
  color: #f2cf84;
}

.archive-card p,
.link-groups p {
  color: var(--muted);
  font-size: 0.9rem;
}

.archive-card--featured p {
  color: rgb(255 255 255 / 72%);
}

.archive-card > a,
.card-actions > a:not(.button) {
  font-weight: 800;
}

.card-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.archive-card--featured .button {
  color: var(--brand-dark);
  background: #fff;
}

.archive-card--featured .card-actions > a:not(.button) {
  color: #fff;
}

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

.link-groups ul {
  margin: 0;
  padding-left: 19px;
}

.link-groups li + li {
  margin-top: 10px;
}

.link-groups a {
  font-size: 0.88rem;
  font-weight: 750;
}

.source-section > div:first-child {
  max-width: 760px;
}

.source-grid {
  margin-top: 30px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.source-grid article {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
}

.source-grid p {
  color: var(--muted);
  font-size: 0.9rem;
}

.source-grid a {
  font-size: 0.86rem;
  font-weight: 800;
}

footer {
  padding: 34px max(20px, calc((100% - var(--content)) / 2));
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 14px 30px;
  color: #fff;
  background: var(--ink);
}

footer p {
  margin-bottom: 0;
  color: rgb(255 255 255 / 64%);
  font-size: 0.86rem;
}

.prototype-note {
  grid-column: 1 / -1;
  padding-top: 14px;
  border-top: 1px solid rgb(255 255 255 / 14%);
}

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

  .hero__formula {
    max-width: 520px;
  }

  .section-intro {
    position: static;
  }

  .trust-strip,
  .result-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tool-card-grid,
  .archive-grid,
  .link-groups {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .material-plan {
    grid-template-columns: 1fr;
  }

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

  .link-groups article:last-child {
    grid-column: 1 / -1;
  }
}

@media (max-width: 640px) {
  .site-header {
    width: min(calc(100% - 28px), var(--content));
    min-height: 68px;
  }

  .site-header nav a:last-child {
    display: none;
  }

  .site-header nav {
    gap: 12px;
  }

  .hero,
  .calculator-shell,
  .result,
  .source-section,
  .trust-strip,
  .tool-index,
  .archive-section {
    width: min(calc(100% - 28px), var(--content));
  }

  .hero {
    margin-top: 14px;
    border-radius: 24px;
  }

  h1 {
    font-size: clamp(2.35rem, 13vw, 3.9rem);
  }

  .trust-strip {
    margin-bottom: 50px;
    padding-inline: 4px;
    grid-template-columns: 1fr 1fr;
  }

  .calculator-shell,
  .result {
    border-radius: 22px;
  }

  .field-grid,
  .field-grid--two,
  .result-grid,
  .tool-card-grid,
  .archive-grid,
  .link-groups,
  .calculation-breakdown dl {
    grid-template-columns: 1fr;
  }

  .link-groups article:last-child {
    grid-column: auto;
  }

  .tool-card {
    min-height: 220px;
  }

  .field-wide {
    grid-column: auto;
  }

  .result-heading {
    display: block;
  }

  .source-status {
    width: fit-content;
    margin-top: 16px;
  }

  .metric-card {
    min-height: 140px;
  }

  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
  }

  tr {
    margin-bottom: 14px;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 10px;
  }

  td {
    padding: 7px 0;
    display: grid;
    grid-template-columns: minmax(95px, 0.45fr) 1fr;
    gap: 12px;
    border: 0;
  }

  td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.7rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
  }

  .result-actions .button {
    width: 100%;
  }

  .hero__actions .button {
    width: 100%;
  }

  footer {
    grid-template-columns: 1fr;
  }

  .footer-links {
    justify-content: flex-start;
  }

  .prototype-note {
    grid-column: auto;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 14mm;
  }

  body {
    background: #fff;
    font-size: 10pt;
  }

  .site-header,
  .hero,
  .trust-strip,
  .tool-index,
  .calculator-shell,
  .source-section,
  .archive-section,
  footer,
  .result-actions {
    display: none !important;
  }

  body.print-mode .result:not(.print-target) {
    display: none !important;
  }

  body.print-mode .result.print-target {
    display: block !important;
  }

  .result {
    width: 100%;
    margin: 0;
    padding: 0;
    border: 0;
    box-shadow: none;
  }

  .print-brand {
    display: block;
  }

  .print-document-header {
    margin-bottom: 10mm;
    padding-bottom: 5mm;
    display: grid;
    gap: 1mm;
    border-bottom: 1px solid #b9c0bc;
  }

  .print-document-header span {
    color: var(--brand);
    font-size: 9pt;
    font-weight: 850;
  }

  .print-document-header strong {
    font-size: 15pt;
  }

  .print-document-header small {
    color: var(--muted);
  }

  .result-heading,
  .result-grid,
  .material-plan,
  .warning-panel {
    break-inside: avoid;
  }

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

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

  .metric-card {
    min-height: 120px;
  }

  .calculation-breakdown,
  .print-document-header {
    break-inside: avoid;
  }
}
