:root {
  --bg: #f8f9fb;
  --surface: #ffffff;
  --surface-soft: #f3f4f6;
  --surface-muted: #edeef0;
  --surface-border: #d7dbe0;
  --surface-border-strong: #bec9c2;
  --text: #191c1e;
  --muted: #4f5a57;
  --accent: #004532;
  --accent-soft: #e1f0ea;
  --accent-strong: #065f46;
  --accent-faint: #dce2f7;
  --warning: #b36a00;
  --error: #ba1a1a;
  --shadow-sm: 0 1px 3px rgba(25, 28, 30, 0.08);
  --shadow-md: 0 12px 30px rgba(25, 28, 30, 0.08);
  --radius: 16px;
  --max-width: 1360px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.6;
}

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

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

[hidden] {
  display: none !important;
}

.page-shell {
  min-height: 100vh;
}

.container {
  width: min(var(--max-width), calc(100% - 24px));
  margin: 0 auto;
}

.section {
  padding: 72px 0;
}

.section-tight {
  padding: 48px 0;
}

.top-banner {
  border-bottom: 1px solid var(--surface-border);
}

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--surface-border);
}

.nav-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
  white-space: nowrap;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: linear-gradient(145deg, #fdf6d7, #f5c341 45%, #f2994a 100%);
  color: #8a4b00;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font-weight: 900;
}

.brand-logo {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
}

.brand-logo-large {
  width: 64px;
  height: 64px;
}

.nav-links {
  display: flex;
  gap: 14px;
  align-items: center;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
}

.nav-links::-webkit-scrollbar {
  display: none;
}

.nav-links a {
  padding: 8px 10px;
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.95rem;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--accent);
  background: var(--accent-soft);
}

.nav-secondary {
  display: flex;
  align-items: center;
  gap: 12px;
}

.button,
button.button {
  border: 0;
  cursor: pointer;
  border-radius: 12px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 14px 18px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  box-shadow: var(--shadow-sm);
}

.button:hover,
button.button:hover {
  transform: translateY(-1px);
  background: var(--accent-strong);
}

.button.secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--surface-border);
  box-shadow: none;
}

.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 12% 18%, rgba(0, 69, 50, 0.08), transparent 24%),
    radial-gradient(circle at 88% 20%, rgba(13, 105, 74, 0.08), transparent 20%),
    linear-gradient(180deg, #fbfcfd 0%, #f8f9fb 100%);
  border-bottom: 1px solid var(--surface-border);
}

.hero::after {
  content: "";
  position: absolute;
  inset: auto -12% -28% auto;
  width: 360px;
  height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 69, 50, 0.06) 0%, transparent 70%);
  pointer-events: none;
}

.hero-inner {
  position: relative;
  z-index: 1;
  padding: 86px 0 72px;
  text-align: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
}

.hero h1,
.page-title {
  margin: 18px 0 14px;
  font-size: clamp(2.2rem, 4vw, 3.65rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero p,
.page-intro {
  margin: 0 auto;
  max-width: 760px;
  color: var(--muted);
  font-size: 1.1rem;
}

.search-wrap {
  max-width: 720px;
  margin: 28px auto 0;
  position: relative;
}

.search-wrap input,
.field-input,
.field-select,
.field-textarea {
  width: 100%;
  border: 1px solid var(--surface-border);
  background: var(--surface);
  color: var(--text);
  border-radius: 14px;
  padding: 14px 16px;
  font: inherit;
  outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.search-wrap input {
  min-height: 58px;
  padding-left: 52px;
  box-shadow: var(--shadow-sm);
}

.search-icon {
  position: absolute;
  left: 18px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 1.1rem;
}

.search-icon svg,
.icon-svg {
  width: 18px;
  height: 18px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-wrap input:focus,
.field-input:focus,
.field-select:focus,
.field-textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(0, 69, 50, 0.1);
}

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

.tool-card,
.panel,
.result-card,
.info-card,
.faq-card,
.legal-card,
.ad-slot,
.page-card {
  background: var(--surface);
  border: 1px solid var(--surface-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.tool-card {
  position: relative;
  min-height: 170px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform 0.15s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.tool-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 69, 50, 0.35);
  box-shadow: var(--shadow-md);
}

.tool-icon {
  width: 52px;
  height: 52px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--surface-soft);
  color: var(--accent);
  font-size: 1.45rem;
  font-weight: 900;
}

.tool-card h3,
.section-title,
.subsection-title {
  margin: 0;
  letter-spacing: -0.03em;
}

.tool-card p,
.muted,
.section-copy,
.small-copy,
.faq-answer,
.legal-card p,
.legal-card li {
  color: var(--muted);
}

.popular-badge,
.pill {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.trust-card,
.legal-card,
.info-card,
.faq-card,
.panel,
.result-card,
.page-card {
  padding: 24px;
}

.trust-icon {
  width: 52px;
  height: 52px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  margin-bottom: 14px;
  font-size: 1.3rem;
}

.trust-icon svg {
  width: 24px;
  height: 24px;
}

.footer {
  border-top: 1px solid var(--surface-border);
  background: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 20px;
  padding: 40px 0;
}

.footer-links {
  display: grid;
  gap: 10px;
}

.footer-links a {
  color: var(--muted);
}

.footer-links a:hover {
  color: var(--accent);
}

.footer-note {
  color: var(--muted);
  font-size: 0.94rem;
}

.page-header {
  padding: 40px 0 18px;
}

.page-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 20px;
  align-items: start;
}

.page-main {
  display: grid;
  gap: 20px;
}

.page-hero-copy {
  padding: 30px 0 10px;
}

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

.form-grid.single {
  grid-template-columns: 1fr;
}

.field {
  display: grid;
  gap: 8px;
}

.field label,
.label {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.field-help,
.field-error,
.disclaimer {
  font-size: 0.92rem;
}

.field-error {
  color: var(--error);
  min-height: 1.2em;
}

.field-input,
.field-select {
  min-height: 52px;
}

.field-input[type="range"] {
  padding: 0;
  min-height: 30px;
  accent-color: var(--accent);
}

.input-with-prefix {
  position: relative;
}

.input-prefix {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
  font-weight: 700;
}

.input-with-prefix .field-input {
  padding-left: 32px;
}

.mode-switch {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mode-switch button {
  border: 1px solid var(--surface-border);
  background: #fff;
  color: var(--text);
  padding: 12px 14px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
}

.mode-switch button.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.calculate-button {
  width: 100%;
  min-height: 54px;
  margin-top: 4px;
}

.result-card {
  background: linear-gradient(180deg, #ffffff 0%, #f3faf7 100%);
}

.result-figure {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: var(--accent);
  margin: 6px 0 0;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.result-box {
  border: 1px solid var(--surface-border);
  border-radius: 14px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.6);
}

.result-box strong {
  display: block;
  margin-top: 6px;
  font-size: 1.1rem;
}

.table-wrap {
  overflow-x: auto;
  margin-top: 18px;
}

table {
  width: 100%;
  border-collapse: collapse;
}

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

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

.section-title {
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  margin-bottom: 12px;
}

.section-copy {
  margin-top: 0;
}

.formula {
  padding: 18px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--surface-border);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  overflow-x: auto;
}

.faq-list {
  display: grid;
  gap: 12px;
}

.faq-card summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}

.faq-card summary::-webkit-details-marker {
  display: none;
}

.faq-card summary::after {
  content: "+";
  float: right;
  color: var(--accent);
  font-weight: 900;
}

.faq-card[open] summary::after {
  content: "–";
}

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

.related-card {
  padding: 18px;
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  background: #fff;
  transition: transform 0.15s ease, border-color 0.15s ease;
}

.related-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 69, 50, 0.35);
}

.related-card .tool-icon {
  width: 44px;
  height: 44px;
  margin-bottom: 12px;
}

.sidebar-column {
  display: grid;
  gap: 20px;
  position: sticky;
  top: 92px;
}

.sidebar-card {
  padding: 20px;
}

.ad-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f5f5f5;
  color: #9a9a9a;
  overflow: hidden;
}

.ad-label {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: #9a9a9a;
}

.ad-slot-top-banner {
  width: 100%;
  min-height: 90px;
}

.ad-slot-mid-calculator {
  width: min(336px, 100%);
  min-height: 280px;
  margin: 24px auto;
}

.ad-slot-sidebar-right {
  width: 100%;
  min-height: 250px;
}

.ad-slot-mid-content {
  width: 100%;
  min-height: 90px;
}

.ad-slot-in-content {
  width: min(300px, 100%);
  min-height: 250px;
  margin: 16px auto;
}

.ad-slot-sticky-footer {
  position: fixed;
  left: 0;
  bottom: 0;
  width: 100%;
  min-height: 60px;
  z-index: 999;
  display: none;
  padding: 0 44px 0 12px;
}

.ad-slot-sticky-footer .ad-close {
  position: absolute;
  top: 4px;
  right: 8px;
  background: transparent;
  border: 0;
  color: #9a9a9a;
  font-size: 14px;
  cursor: pointer;
}

.badge-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 700;
  font-size: 0.9rem;
}

.legal-list {
  margin: 0;
  padding-left: 20px;
}

.contact-link {
  color: var(--accent);
  font-weight: 800;
}

@media (max-width: 1100px) {
  .cards-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .page-layout {
    grid-template-columns: 1fr;
  }

  .sidebar-column {
    position: static;
    order: 2;
  }

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

@media (max-width: 768px) {
  .container {
    width: min(var(--max-width), calc(100% - 16px));
  }

  .hero-inner {
    padding: 72px 0 56px;
  }

  .nav-inner {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .nav-secondary {
    width: 100%;
    justify-content: space-between;
  }

  .cards-grid,
  .trust-grid,
  .related-grid,
  .footer-grid,
  .result-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .tool-card,
  .trust-card,
  .legal-card,
  .info-card,
  .faq-card,
  .panel,
  .result-card,
  .page-card {
    padding: 20px;
  }

  .page-header {
    padding-top: 28px;
  }

  .section,
  .section-tight {
    padding: 56px 0;
  }

  .ad-slot-top-banner {
    min-height: 50px;
  }

  .ad-slot-mid-calculator {
    width: min(300px, 100%);
    min-height: 250px;
  }

  .ad-slot-sticky-footer {
    display: flex;
  }
}

@media (max-width: 520px) {
  .brand {
    font-size: 1rem;
  }

  .brand-mark {
    width: 32px;
    height: 32px;
  }

  .search-wrap input {
    min-height: 54px;
  }

  .button,
  button.button {
    width: 100%;
  }
}
