:root {
  --evergreen: #173F35;
  --green: #2A7A5B;
  --green-dark: #1f5f47;
  --mint: #E9F3EE;
  --offwhite: #F5F7F5;
  --text: #17221D;
  --muted: #52645B;
  --border: #CFDDD6;
  --white: #ffffff;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(23, 63, 53, .06), 0 6px 20px rgba(23, 63, 53, .05);
  --maxw: 1140px;
  --readw: 760px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Noto Sans", sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; overflow-x: hidden; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background: var(--white);
  line-height: 1.6;
  font-size: 17px;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--green); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3, h4 { color: var(--evergreen); line-height: 1.2; font-weight: 700; }
h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin: 0 0 .6em; letter-spacing: -.01em; }
h2 { font-size: clamp(1.4rem, 3vw, 1.75rem); margin: 1.8em 0 .5em; }
h3 { font-size: 1.2rem; margin: 1.4em 0 .4em; }
p { margin: 0 0 1em; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 999;
  background: var(--evergreen); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

:focus-visible { outline: 3px solid var(--green); outline-offset: 2px; border-radius: 4px; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ---------- Header ---------- */
.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--white);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 12px 0; min-height: 64px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: var(--evergreen); font-size: 1.02rem; }
.brand:hover { text-decoration: none; }
.brand img { width: 34px; height: 34px; }
.brand span { line-height: 1.1; }

.main-nav ul { list-style: none; display: flex; gap: 4px; margin: 0; padding: 0; flex-wrap: wrap; }
.main-nav a {
  display: block; padding: 9px 12px; border-radius: var(--radius-sm);
  color: var(--evergreen); font-weight: 600; font-size: .82rem; letter-spacing: .02em;
  text-transform: uppercase; transition: background-color .18s ease, color .18s ease;
}
.main-nav a:hover { background: var(--mint); text-decoration: none; }
.main-nav a[aria-current="page"] { background: var(--green); color: #fff; }

.nav-toggle {
  display: none; align-items: center; gap: 8px; background: var(--offwhite);
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; font: inherit; font-weight: 700; color: var(--evergreen); cursor: pointer;
  min-height: 44px;
}
.nav-toggle .bars { width: 18px; height: 2px; background: var(--evergreen); position: relative; }
.nav-toggle .bars::before, .nav-toggle .bars::after {
  content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: var(--evergreen);
}
.nav-toggle .bars::before { top: -6px; } .nav-toggle .bars::after { top: 6px; }

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .main-nav {
    position: absolute; left: 0; right: 0; top: 100%; background: var(--white);
    border-bottom: 1px solid var(--border); box-shadow: var(--shadow);
    display: none; z-index: 50;
  }
  .site-header { position: relative; }
  .main-nav.open { display: block; }
  .main-nav ul { flex-direction: column; padding: 8px 20px 16px; gap: 2px; }
  .main-nav a { padding: 12px; font-size: .9rem; }
}

/* ---------- Layout ---------- */
main { display: block; }
.section { padding: 34px 0; }
.section-alt { background: var(--offwhite); }
.narrow { max-width: var(--readw); }
.lead { font-size: 1.12rem; color: var(--text); }
.muted { color: var(--muted); }

.breadcrumbs { font-size: .85rem; color: var(--muted); padding: 14px 0 0; }
.breadcrumbs ol { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; }
.breadcrumbs li:not(:last-child)::after { content: "/"; margin-left: 6px; color: var(--border); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--green); color: #fff; border: 1px solid var(--green);
  padding: 13px 22px; border-radius: 999px; font-weight: 700; font-size: 1rem;
  cursor: pointer; min-height: 46px; transition: background-color .18s ease, transform .12s ease, box-shadow .18s ease;
}
.btn:hover { background: var(--green-dark); text-decoration: none; transform: translateY(-1px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn:disabled { background: #9db8ac; border-color: #9db8ac; cursor: not-allowed; transform: none; box-shadow: none; }
.btn-secondary { background: #fff; color: var(--green); border-color: var(--border); }
.btn-secondary:hover { background: var(--mint); }
.btn-block { width: 100%; }

/* ---------- Cards / boxes ---------- */
.card {
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.grid { display: grid; gap: 18px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 860px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; } }

.info-box {
  background: var(--mint); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 16px 18px; margin: 18px 0;
}
.info-box p:last-child { margin-bottom: 0; }
.pill { display: inline-block; background: var(--mint); color: var(--evergreen); border: 1px solid var(--border); border-radius: 999px; padding: 3px 11px; font-size: .78rem; font-weight: 700; }

.meta-line { font-size: .85rem; color: var(--muted); }

/* ---------- Calculator ---------- */
.calc {
  background: var(--white); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow);
}
.calc-hero { background: linear-gradient(180deg, var(--mint), #fff); }
.calc h2 { margin-top: 0; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; color: var(--evergreen); margin-bottom: 6px; }
.field .hint { font-size: .82rem; color: var(--muted); font-weight: 400; }
input[type="number"], input[type="text"], select {
  width: 100%; padding: 12px 14px; font: inherit; color: var(--text);
  border: 1px solid var(--border); border-radius: var(--radius-sm); background: #fff; min-height: 46px;
}
.presets { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.preset {
  background: var(--offwhite); border: 1px solid var(--border); border-radius: 999px;
  padding: 8px 14px; font: inherit; font-size: .9rem; cursor: pointer; min-height: 40px; color: var(--evergreen);
  transition: background-color .15s ease, border-color .15s ease;
}
.preset:hover { background: var(--mint); }
.preset[aria-pressed="true"] { background: var(--green); color: #fff; border-color: var(--green); }
.area-choice { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.area-choice > * { min-width: 0; }
.area-choice label {
  display: flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; min-width: 0;
  border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; cursor: pointer; background: #fff; font-weight: 600;
}
.area-choice label:has(input:checked) { border-color: var(--green); background: var(--mint); }
.area-choice .sub { display: block; flex-basis: 100%; font-weight: 400; font-size: .82rem; color: var(--muted); }
.calc-note { font-size: .85rem; color: var(--muted); margin-top: 12px; }
.calc-status { font-size: .9rem; margin-top: 10px; min-height: 1.2em; }
.calc-status[data-state="error"] { color: #8a2b21; font-weight: 600; }

/* ---------- Results ---------- */
.results { margin-top: 26px; }
.results-head { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; align-items: baseline; }
.result-card {
  border: 1px solid var(--border); border-radius: var(--radius); background: #fff;
  padding: 16px 18px; margin-bottom: 14px; box-shadow: var(--shadow);
}
.result-card.best { border-color: var(--green); box-shadow: 0 0 0 2px rgba(42,122,91,.18), var(--shadow); }
.result-top { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; }
.result-top > * { min-width: 0; }
.result-name { overflow-wrap: anywhere; }
.result-logo {
  width: 56px; height: 56px; display: flex; align-items: center; justify-content: center;
  background: var(--offwhite); border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden;
}
.result-logo img { max-width: 48px; max-height: 40px; object-fit: contain; }
.result-name { font-weight: 800; color: var(--evergreen); font-size: 1.05rem; }
.result-product { font-size: .88rem; color: var(--muted); }
.rank-badge { display: inline-block; font-size: .74rem; font-weight: 800; color: var(--green); border: 1px solid var(--green); border-radius: 999px; padding: 2px 9px; margin-bottom: 4px; }
.result-price { text-align: right; }
.result-price .big { font-size: 1.3rem; font-weight: 800; color: var(--evergreen); }
.result-price .small { font-size: .82rem; color: var(--muted); }
.result-figures { display: flex; flex-wrap: wrap; gap: 16px 24px; margin: 12px 0 6px; font-size: .9rem; min-width: 0; }
.result-figures div span { display: block; color: var(--muted); font-size: .78rem; }
.result-figures div b { color: var(--evergreen); font-size: 1.02rem; }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-top: 8px; }
.breakdown-toggle {
  background: none; border: none; color: var(--green); font: inherit; font-weight: 700; cursor: pointer; padding: 6px 0;
}
.breakdown { margin-top: 10px; border-top: 1px dashed var(--border); padding-top: 10px; display: none; }
.breakdown.open { display: block; }
.breakdown table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.breakdown td { padding: 6px 0; border-bottom: 1px solid var(--border); }
.breakdown td:last-child { text-align: right; font-variant-numeric: tabular-nums; color: var(--evergreen); font-weight: 600; }
.breakdown tr.total td { border-bottom: none; font-weight: 800; padding-top: 10px; }

@media (max-width: 560px) {
  .result-top { grid-template-columns: 44px 1fr; }
  .result-logo { width: 44px; height: 44px; }
  .result-price { grid-column: 1 / -1; text-align: left; }
}

/* ---------- Tables ---------- */
.table-wrap { width: 100%; }
table.data { width: 100%; border-collapse: collapse; font-size: .92rem; }
table.data th, table.data td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border); }
table.data th { color: var(--evergreen); background: var(--offwhite); font-weight: 700; }
table.data td { color: var(--text); }

@media (max-width: 680px) {
  table.data, table.data thead, table.data tbody, table.data th, table.data td, table.data tr { display: block; }
  table.data thead { display: none; }
  table.data tr { border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 12px; padding: 6px 12px; }
  table.data td { border-bottom: 1px dashed var(--border); padding: 8px 0; display: flex; justify-content: space-between; gap: 12px; }
  table.data td:last-child { border-bottom: none; }
  table.data td::before { content: attr(data-label); font-weight: 700; color: var(--evergreen); }
}

/* ---------- FAQ / accordion ---------- */
.faq details {
  border: 1px solid var(--border); border-radius: var(--radius-sm); margin-bottom: 10px; background: #fff; overflow: hidden;
}
.faq summary {
  list-style: none; cursor: pointer; padding: 15px 18px; font-weight: 700; color: var(--evergreen);
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 1.3rem; color: var(--green); transition: transform .2s ease; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq .faq-body { padding: 0 18px 16px; }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* ---------- Author box ---------- */
.author-box {
  display: flex; gap: 18px; align-items: flex-start; background: var(--mint);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 20px;
}
.author-box img { width: 84px; height: 84px; border-radius: 50%; object-fit: cover; flex: none; }
.author-box .name { font-weight: 800; color: var(--evergreen); margin-bottom: 2px; }
.author-box .role { font-size: .85rem; color: var(--muted); margin-bottom: 8px; }
.author-box p { margin: 0; font-size: .95rem; }
@media (max-width: 480px) { .author-box { flex-direction: column; } }

/* ---------- Steps ---------- */
.steps { counter-reset: step; display: grid; gap: 14px; }
.step { display: flex; gap: 14px; align-items: flex-start; }
.step .num {
  flex: none; width: 36px; height: 36px; border-radius: 50%; background: var(--green); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 800;
}
.step h3 { margin: 2px 0 4px; font-size: 1.05rem; }
.step p { margin: 0; font-size: .95rem; }

/* ---------- Live graph ---------- */
.graph-tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.graph-tab {
  background: #fff; border: 1px solid var(--border); border-radius: 999px; padding: 9px 18px;
  font: inherit; font-weight: 700; cursor: pointer; color: var(--evergreen); min-height: 44px;
}
.graph-tab[aria-selected="true"] { background: var(--green); color: #fff; border-color: var(--green); }
.graph-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin: 16px 0; }
@media (max-width: 560px) { .graph-stats { grid-template-columns: repeat(2, 1fr); } }
.stat { background: var(--offwhite); border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 12px; }
.stat .label { font-size: .78rem; color: var(--muted); }
.stat .value { font-size: 1.25rem; font-weight: 800; color: var(--evergreen); font-variant-numeric: tabular-nums; }
.chart-wrap { position: relative; width: 100%; overflow: hidden; }
.chart-wrap svg { width: 100%; height: auto; display: block; }
.chart-tooltip {
  position: absolute; background: var(--evergreen); color: #fff; font-size: .8rem; padding: 6px 9px;
  border-radius: 6px; pointer-events: none; opacity: 0; transform: translate(-50%, -120%); white-space: nowrap; transition: opacity .12s ease;
}

/* ---------- Footer ---------- */
.site-footer { background: var(--evergreen); color: #cfe0d8; margin-top: 40px; padding: 40px 0 26px; }
.site-footer h4 { color: #fff; font-size: .95rem; margin: 0 0 12px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 26px; }
@media (max-width: 780px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 460px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer a { color: #cfe0d8; }
.site-footer a:hover { color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; font-size: .9rem; }
.footer-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; color: #fff; margin-bottom: 12px; }
.footer-brand img { width: 30px; height: 30px; filter: brightness(0) invert(1); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.15); margin-top: 26px; padding-top: 18px; font-size: .82rem; color: #a9c3b8; }

/* ---------- Utilities ---------- */
.stack > * + * { margin-top: 14px; }
.center { text-align: center; }
.mt-0 { margin-top: 0; } .mb-0 { margin-bottom: 0; }
.tag-row { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
ul.clean { list-style: none; padding: 0; }
ul.clean li { padding-left: 26px; position: relative; margin-bottom: 8px; }
ul.clean li::before { content: ""; position: absolute; left: 4px; top: 9px; width: 8px; height: 8px; background: var(--green); border-radius: 50%; }
.noscript-note { background: #fff4e5; border: 1px solid #f0d9b0; padding: 12px 16px; border-radius: var(--radius-sm); }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
