:root {
  --fg: #17211d;
  --muted: #5b6761;
  --bg: #fbfcfa;
  --surface: #ffffff;
  --soft: #edf7f3;
  --warm: #f7f1e8;
  --line: #dbe5e0;
  --accent: #0f766e;
  --accent-strong: #0a5e58;
  --action: #bc4b24;
  --action-strong: #963b1c;
  --reading: 760px;
  --wide: 1120px;
  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 26px;
  --shadow-sm: 0 1px 2px rgba(23, 33, 29, .06);
  --shadow: 0 16px 44px rgba(31, 64, 52, .09);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--fg);
  background: var(--bg);
  font: 17px/1.72 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  text-rendering: optimizeLegibility;
}

img, svg { max-width: 100%; }

a {
  color: var(--accent-strong);
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

a:hover { text-decoration-thickness: 2px; }

a:focus-visible,
button:focus-visible,
input:focus-visible,
summary:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(15, 118, 110, .3);
  outline-offset: 3px;
}

.skip-link {
  position: fixed;
  z-index: 100;
  left: 16px;
  top: 12px;
  transform: translateY(-160%);
  padding: 9px 14px;
  border-radius: 999px;
  color: #fff;
  background: var(--fg);
  font-weight: 700;
  text-decoration: none;
}

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

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.wrap {
  width: 100%;
  max-width: var(--reading);
  margin: 0 auto;
  padding-inline: 22px;
}

.wrap.reading { max-width: var(--reading); }
.wrap.wide { max-width: var(--wide); }

header.site {
  position: sticky;
  z-index: 50;
  top: 0;
  border-bottom: 1px solid rgba(219, 229, 224, .9);
  background: rgba(251, 252, 250, .92);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

header.site .wrap {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.logo {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 10px;
  color: var(--fg);
  font-size: 20px;
  font-weight: 820;
  letter-spacing: -.025em;
  text-decoration: none;
}

.logo:hover { text-decoration: none; }

.brand-mark {
  display: inline-grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px 12px 12px 4px;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 7px 18px rgba(15, 118, 110, .2);
  font-size: 19px;
  font-weight: 850;
}

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

nav.top {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
}

nav.top > a,
nav.top .nav-more > summary {
  border-radius: 999px;
  color: var(--muted);
  cursor: pointer;
  font-size: 14px;
  font-weight: 620;
  line-height: 1.2;
  padding: 9px 10px;
  text-decoration: none;
  white-space: nowrap;
}

nav.top > a:hover,
nav.top .nav-more > summary:hover,
nav.top .nav-more[open] > summary {
  color: var(--accent-strong);
  background: var(--soft);
}

nav.top a.nav-search {
  margin-left: 3px;
  color: #fff;
  background: var(--accent);
  font-weight: 750;
}

nav.top a.nav-search:hover { color: #fff; filter: brightness(.92); }

nav.top .nav-more { position: relative; }
nav.top .nav-more > summary { list-style: none; user-select: none; }
nav.top .nav-more > summary::-webkit-details-marker { display: none; }
nav.top .nav-more > summary::after { content: "  ▾"; font-size: 10px; }

nav.top .nav-more-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  min-width: 210px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow);
}

nav.top .nav-more-panel a {
  display: block;
  padding: 9px 11px;
  border-radius: 9px;
  color: var(--fg);
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

nav.top .nav-more-panel a:hover { color: var(--accent-strong); background: var(--soft); }

main { min-height: 60vh; padding: 38px 0 72px; }

h1, h2, h3 {
  color: var(--fg);
  font-weight: 780;
  letter-spacing: -.025em;
}

h1 {
  max-width: 22ch;
  margin: .3em 0 .45em;
  font-size: clamp(2rem, 4vw, 3.2rem);
  line-height: 1.08;
}

.page-article h1,
.page-static h1 { font-size: clamp(2rem, 5vw, 2.7rem); }

h2 {
  margin: 2em 0 .62em;
  font-size: clamp(1.35rem, 2.2vw, 1.65rem);
  line-height: 1.25;
  scroll-margin-top: 96px;
}

h3 {
  margin: 1.5em 0 .45em;
  font-size: 1.12rem;
  line-height: 1.35;
  scroll-margin-top: 96px;
}

p, ul, ol { margin-top: .7em; margin-bottom: 1em; }

.lead { color: var(--muted); font-size: 1.08rem; }

.crumbs {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.5;
}

.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--accent-strong); text-decoration: underline; }

.meta {
  margin: -2px 0 20px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.answer {
  margin: 20px 0;
  padding: 18px 20px;
  border: 1px solid #cfe4db;
  border-left: 5px solid var(--accent);
  border-radius: var(--radius);
  background: linear-gradient(135deg, #f3faf7 0%, #fff 100%);
  box-shadow: var(--shadow-sm);
}

.answer strong.lbl {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.answer p { margin: .35em 0; }

.note,
.callout {
  margin: 16px 0;
  padding: 13px 15px;
  border: 1px solid #e9d9b8;
  border-radius: var(--radius-sm);
  color: #594b32;
  background: #fff9ed;
  font-size: 15px;
  line-height: 1.55;
}

.callout-info { color: #29485f; border-color: #c9ddec; background: #f1f8fd; }
.callout-ok { color: #275b46; border-color: #b9ddcd; background: #eff9f4; }

.tbl {
  margin: 16px 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  -webkit-overflow-scrolling: touch;
}

table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.48; }
th, td { padding: 12px 14px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th { color: #35433d; background: #f3f7f5; font-size: 13px; font-weight: 750; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
.tbl.price td:nth-child(2) { color: var(--accent-strong); font-weight: 760; font-variant-numeric: tabular-nums; white-space: nowrap; }

ol.steps {
  margin: 12px 0 22px;
  padding-left: 0;
  counter-reset: step;
  list-style: none;
}

ol.steps li {
  position: relative;
  min-height: 48px;
  padding: 9px 0 12px 50px;
  border-bottom: 1px dashed var(--line);
  line-height: 1.58;
  counter-increment: step;
}

ol.steps li:last-child { border-bottom: 0; }

ol.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 8px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 11px 11px 11px 4px;
  color: #fff;
  background: var(--accent);
  font-size: 14px;
  font-weight: 800;
}

code { padding: 2px 6px; border-radius: 5px; background: var(--soft); font-size: .92em; }

.toc {
  margin: 20px 0 24px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 14px;
}

.toc .toc-lbl {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.toc ul { display: flex; flex-wrap: wrap; gap: 7px 18px; margin: 0; padding: 0; list-style: none; }
.toc a { color: var(--fg); font-weight: 620; text-decoration: none; }
.toc a:hover { color: var(--accent-strong); text-decoration: underline; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
  margin: 20px 0;
}

.card {
  display: block;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--fg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.card:hover {
  border-color: #a5ccc0;
  box-shadow: 0 14px 34px rgba(31, 64, 52, .1);
  text-decoration: none;
  transform: translateY(-2px);
}

.card b { display: block; margin-bottom: 6px; font-size: 1rem; line-height: 1.35; }
.card small { display: block; color: var(--muted); font-size: 14px; line-height: 1.5; }

.related {
  margin-top: 42px;
  padding-top: 4px;
  border-top: 1px solid var(--line);
}

.related ul { padding-left: 20px; }
.sources { margin-top: 32px; color: var(--muted); font-size: 14px; line-height: 1.58; }

.hero {
  position: relative;
  margin: 0 0 30px;
  padding: clamp(26px, 5vw, 54px);
  overflow: hidden;
  border: 1px solid #d6e8e0;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 92% 10%, rgba(15, 118, 110, .13), transparent 32%),
    linear-gradient(135deg, #f4faf7 0%, #ffffff 58%, #faf7f0 100%);
  box-shadow: var(--shadow);
}

.hero::after {
  content: "";
  position: absolute;
  right: -45px;
  bottom: -60px;
  width: 190px;
  height: 190px;
  border: 24px solid rgba(15, 118, 110, .055);
  border-radius: 50%;
  pointer-events: none;
}

.hero h1 { max-width: 20ch; margin-top: 0; }
.hero > p, .hero .lead { position: relative; z-index: 1; max-width: 680px; color: var(--muted); font-size: 1.08rem; line-height: 1.65; }

.search-hero { position: relative; z-index: 2; max-width: 720px; margin: 23px 0 16px; }
.search-hero form, .search-page form { display: flex; gap: 10px; }

.search-hero input[type="search"],
.search-page input[type="search"] {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid #cddbd5;
  border-radius: 13px;
  color: var(--fg);
  background: var(--surface);
  box-shadow: inset 0 1px 2px rgba(23, 33, 29, .04);
  font: inherit;
}

.search-hero input[type="search"]:focus,
.search-page input[type="search"]:focus { border-color: var(--accent); }

.search-hero button,
.search-page button,
.calc-actions button {
  appearance: none;
  padding: 13px 20px;
  border: 0;
  border-radius: 13px;
  color: #fff;
  background: var(--accent);
  cursor: pointer;
  font: inherit;
  font-weight: 760;
}

.search-hero button:hover,
.search-page button:hover,
.calc-actions button:hover { filter: brightness(.92); }

.trust { position: relative; z-index: 1; display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 8px; }
.trust span { display: inline-flex; align-items: center; gap: 7px; padding: 7px 11px; border: 1px solid #d2e4dc; border-radius: 999px; color: #33423c; background: rgba(255, 255, 255, .78); font-size: 13px; line-height: 1.3; }
.trust span i { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }

.home-primary {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 22px 0 0;
}

.home-primary a {
  display: flex;
  min-height: 92px;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 15px 16px;
  border: 1px solid #d5e3dd;
  border-radius: 15px;
  color: var(--fg);
  background: rgba(255, 255, 255, .88);
  text-decoration: none;
  transition: transform .18s ease, border-color .18s ease;
}

.home-primary a:hover { border-color: var(--accent); transform: translateY(-2px); }
.home-primary a strong { font-size: 15px; line-height: 1.3; }
.home-primary a span { color: var(--muted); font-size: 13px; line-height: 1.4; }

.featured { margin: 34px 0 30px; }
.featured > h2, .popular h2 {
  margin: 0 0 13px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 780;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.featured-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.featured-cards a.card { display: flex; min-height: 140px; flex-direction: column; gap: 8px; }
.featured-cards a.card .price { color: var(--muted); font-size: 14px; line-height: 1.48; font-weight: 560; }
.featured-cards a.card .go { margin-top: auto; color: var(--accent-strong); font-size: 14px; font-weight: 760; }

.popular { margin: 28px 0; }
.popular-list { display: flex; flex-wrap: wrap; gap: 9px; margin: 0; padding: 0; list-style: none; }
.popular-list a { display: inline-block; padding: 8px 13px; border: 1px solid var(--line); border-radius: 999px; color: var(--fg); background: var(--surface); font-size: 14px; font-weight: 620; line-height: 1.3; text-decoration: none; }
.popular-list a:hover { border-color: #a5ccc0; color: var(--accent-strong); }

.cat-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 18px 0 12px; }
.cat-card { display: flex; min-height: 132px; flex-direction: column; justify-content: space-between; gap: 12px; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); color: var(--fg); background: var(--surface); box-shadow: var(--shadow-sm); text-decoration: none; transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease; }
.cat-card:hover { border-color: #a5ccc0; box-shadow: 0 12px 30px rgba(31, 64, 52, .09); transform: translateY(-2px); }
.cat-card svg { width: 30px; height: 30px; color: var(--accent); fill: none !important; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.cat-card svg * { fill: none !important; stroke: currentColor; }
.cat-card b { font-size: 15px; line-height: 1.3; }
.cat-card small { color: var(--muted); font-size: 13px; }
.browse-all { margin: 14px 0 32px; font-size: 15px; }
.browse-all a { font-weight: 720; }

.search-page { max-width: 820px; }
.search-page .search-meta { margin: 12px 0 0; color: var(--muted); font-size: 14px; }
.search-results { margin: 18px 0 0; padding: 0; list-style: none; }
.search-results li { border-bottom: 1px solid var(--line); }
.search-results a { display: block; padding: 16px 4px; color: var(--fg); text-decoration: none; }
.search-results a:hover { color: var(--accent-strong); }
.search-results b { display: block; margin: 4px 0; font-size: 1.03rem; line-height: 1.35; }
.search-results small { display: block; color: var(--muted); font-size: 14px; line-height: 1.48; }
.search-results .cat { display: inline-block; padding: 3px 9px; border-radius: 999px; color: var(--accent-strong); background: var(--soft); font-size: 12px; font-weight: 700; }
.search-empty { margin: 20px 0; color: var(--muted); }

.cancel-cta { display: block; margin: 18px 0 8px; text-decoration: none; }
.cancel-cta:hover { text-decoration: none; }
.cancel-cta .cancel-cta-btn { display: flex; width: 100%; align-items: center; justify-content: center; gap: 10px; padding: 15px 20px; border-radius: 14px; color: #fff; background: var(--action); box-shadow: 0 3px 0 rgba(121, 44, 18, .28); font-size: 1.02rem; font-weight: 780; line-height: 1.3; text-align: center; }
.cancel-cta:hover .cancel-cta-btn { background: var(--action-strong); }
.cancel-cta .cancel-cta-sub { display: block; margin-top: 9px; color: var(--muted); font-size: 12px; line-height: 1.45; text-align: center; }

figure.diagram { margin: 22px 0; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow-sm); }
figure.diagram img, figure.diagram svg { display: block; max-width: 100%; height: auto; margin: 0 auto; }
figure.diagram figcaption { padding: 9px 13px; border-top: 1px solid var(--line); color: var(--muted); background: #f5f8f6; font-size: 13px; line-height: 1.45; }

.calc-panel { margin: 22px 0; padding: 22px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--soft); }
.calc-panel h2 { margin-top: 0; }
.calc-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; }
.calc-panel label { display: block; margin-bottom: 5px; color: var(--fg); font-size: 14px; font-weight: 700; }
.calc-panel input, .calc-panel select { width: 100%; padding: 11px 12px; border: 1px solid #cddbd5; border-radius: var(--radius-sm); background: var(--surface); font: inherit; }
.calc-panel .full { grid-column: 1 / -1; }
.calc-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 5px; }
.calc-actions button.secondary { border: 1px solid var(--line); color: var(--fg); background: var(--surface); }
.calc-result { display: none; margin-top: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.calc-result.show { display: block; }
.calc-result .big { margin: 0 0 8px; color: var(--accent-strong); font-size: 1.65rem; font-weight: 820; line-height: 1.3; font-variant-numeric: tabular-nums; }
.calc-result dl { display: grid; grid-template-columns: 1fr auto; gap: 7px 16px; margin: 10px 0 0; font-size: 15px; }
.calc-result dt { color: var(--muted); }
.calc-result dd { margin: 0; font-weight: 700; text-align: right; font-variant-numeric: tabular-nums; }

.checklist { margin: 12px 0 20px; padding: 0; list-style: none; }
.checklist li { position: relative; padding: 9px 0 11px 30px; border-bottom: 1px dashed var(--line); line-height: 1.55; }
.checklist li:last-child { border-bottom: 0; }
.checklist li::before { content: "☐"; position: absolute; left: 0; top: 8px; color: var(--accent); font-weight: 800; }

.ad { display: block; min-height: 90px; margin: 30px 0; }
ol.steps + .ad, .ad + ol.steps, .sources + .ad, .ad + .sources { margin-top: 80px; }

footer.site { padding: 38px 0 26px; border-top: 1px solid var(--line); color: var(--muted); background: #f1f5f2; font-size: 14px; line-height: 1.55; }
.footer-top { display: grid; grid-template-columns: minmax(220px, 1fr) minmax(300px, 1.3fr); gap: 36px; align-items: start; }
.footer-about strong { color: var(--fg); font-size: 16px; }
.footer-about p { max-width: 560px; margin: 7px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 18px; }
.footer-links a { color: var(--muted); text-decoration: none; }
.footer-links a:hover { color: var(--accent-strong); text-decoration: underline; }
.footer-links a.foot-key { color: var(--fg); font-weight: 700; }
.copyright { margin: 28px 0 0; padding-top: 18px; border-top: 1px solid var(--line); font-size: 13px; }

@media (max-width: 900px) {
  header.site { position: relative; }
  header.site .wrap { min-height: auto; flex-direction: column; align-items: flex-start; padding-block: 14px; }
  nav.top { width: 100%; flex-wrap: wrap; justify-content: flex-start; }
  nav.top > a, nav.top .nav-more > summary { padding: 8px 9px; }
  nav.top a.nav-search { margin-left: auto; }
  .featured-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 680px) {
  body { font-size: 16px; line-height: 1.67; }
  .wrap { padding-inline: 16px; }
  main { padding: 26px 0 54px; }
  h1 { font-size: clamp(1.75rem, 8vw, 2.35rem); }
  h2 { font-size: 1.35rem; }
  .hero { padding: 24px 19px; border-radius: 20px; }
  .hero > p, .hero .lead { font-size: 1rem; }
  .search-hero form, .search-page form { flex-direction: column; }
  .search-hero button, .search-page button { width: 100%; }
  .home-primary, .featured-cards { grid-template-columns: 1fr; }
  .cat-grid { gap: 10px; }
  .cat-card { min-height: 118px; padding: 15px; }
  .cards { grid-template-columns: 1fr; }
  .toc ul { display: block; padding-left: 18px; list-style: disc; }
  .toc li + li { margin-top: 5px; }
  .calc-grid { grid-template-columns: 1fr; }
  .footer-top { grid-template-columns: 1fr; gap: 22px; }
  .footer-links { justify-content: flex-start; }
  th, td { padding: 9px 10px; font-size: 14px; }
  ol.steps li { padding-left: 44px; }
  .cancel-cta .cancel-cta-btn { padding: 14px 15px; font-size: 1rem; }
}

@media (max-width: 420px) {
  .brand-mark { width: 35px; height: 35px; }
  nav.top a.nav-search { margin-left: 0; }
  .cat-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; }
}

@media print {
  header.site, footer.site, .cancel-cta, .ad, .search-hero { display: none !important; }
  body { color: #000; background: #fff; font-size: 12pt; }
  main { padding: 0; }
  .wrap, .wrap.wide { max-width: none; padding: 0; }
  a { color: #000; text-decoration: underline; }
  .answer, .note, .tbl, figure.diagram { box-shadow: none; break-inside: avoid; }
}
