:root {
  --ink: #14231f;
  --muted: #5c6862;
  --line: #d9e2dc;
  --paper: #ffffff;
  --wash: #eef7f3;
  --panel: #f7faf8;
  --brand: #0d3b36;
  --brand-2: #176c60;
  --accent: #c47a24;
  --accent-soft: #fff0d8;
  --focus: #1e7a68;
  --shadow: 0 18px 48px rgba(13, 59, 54, 0.13);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: #f6f8f6;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  background:
    linear-gradient(180deg, rgba(238, 247, 243, 0.95), rgba(255, 255, 255, 0) 420px),
    #f6f8f6;
}

a {
  color: inherit;
}

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 72px;
  padding: 14px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(20, 35, 31, 0.1);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  font-weight: 750;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 8px;
  background: var(--brand);
  color: #fffaf1;
  font-weight: 850;
}

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

.top-nav a {
  min-height: 38px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 650;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  background: var(--wash);
  color: var(--brand);
  outline: none;
}

.calculator-band {
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(640px, 1.35fr);
  gap: clamp(24px, 4vw, 54px);
  align-items: start;
  max-width: 1440px;
  margin: 0 auto;
  padding: clamp(32px, 6vw, 70px) clamp(18px, 4vw, 56px) 28px;
}

.intro-copy {
  padding-top: 12px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 0.82rem;
  font-weight: 850;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  letter-spacing: 0;
}

h1 {
  max-width: 700px;
  margin: 0;
  font-size: clamp(2.45rem, 2.1rem + 1.3vw, 4rem);
  line-height: 1.02;
}

h2 {
  margin: 0;
  font-size: clamp(1.7rem, 1.55rem + 0.7vw, 2.5rem);
  line-height: 1.12;
}

h3 {
  margin: 0 0 8px;
  font-size: 1.08rem;
  line-height: 1.25;
}

p {
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.intro-copy p:last-child {
  max-width: 560px;
  margin-top: 18px;
  font-size: 1.1rem;
}

.tool-surface {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  border-bottom: 1px solid var(--line);
  background: #edf4f0;
}

.tab-button {
  min-height: 54px;
  padding: 10px 8px;
  border: 0;
  border-right: 1px solid var(--line);
  background: transparent;
  color: #52645b;
  cursor: pointer;
  font-size: 0.9rem;
  font-weight: 800;
}

.tab-button:last-child {
  border-right: 0;
}

.tab-button:hover,
.tab-button:focus-visible {
  background: #fff;
  color: var(--brand);
  outline: none;
}

.tab-button.is-active {
  background: var(--paper);
  color: var(--brand);
}

.panel {
  padding: clamp(18px, 3vw, 30px);
}

.calc-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: clamp(20px, 3vw, 30px);
  margin: 0;
}

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

label {
  position: relative;
  display: grid;
  gap: 8px;
  color: #34443e;
  font-size: 0.92rem;
  font-weight: 760;
}

input {
  width: 100%;
  min-height: 46px;
  border: 1px solid #c8d5ce;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 11px 12px;
  font-size: 1rem;
}

input:focus {
  border-color: var(--focus);
  outline: 3px solid rgba(30, 122, 104, 0.18);
}

.suffix {
  position: absolute;
  right: 11px;
  bottom: 14px;
  color: #748078;
  font-size: 0.78rem;
  font-weight: 800;
  pointer-events: none;
}

.suffix + input {
  padding-right: 58px;
}

.results-pane {
  min-height: 100%;
  border-left: 4px solid var(--brand-2);
  border-radius: 0 8px 8px 0;
  background: linear-gradient(180deg, #f2faf6, #ffffff);
  padding: 22px;
}

.result-label {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
  text-transform: uppercase;
}

.result-number {
  display: block;
  margin: 0 0 18px;
  color: var(--brand);
  font-size: clamp(2rem, 1.6rem + 1.4vw, 3rem);
  font-weight: 850;
  line-height: 1;
}

.breakdown {
  display: grid;
  gap: 0;
  margin: 0;
}

.breakdown div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 11px 0;
  border-top: 1px solid rgba(20, 35, 31, 0.1);
}

.breakdown dt {
  color: var(--muted);
  font-weight: 650;
}

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

.ad-slot {
  display: grid;
  min-height: 90px;
  max-width: 1120px;
  margin: 24px auto;
  padding: 0 18px;
  place-items: center;
}

.ad-slot span {
  display: grid;
  width: 100%;
  min-height: 90px;
  place-items: center;
  border: 1px dashed #bfd0c7;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.65);
  color: #76847d;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.context-band,
.links-band,
.guide-band {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(36px, 6vw, 74px) clamp(18px, 4vw, 38px);
}

.context-band {
  display: grid;
  grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1.3fr);
  gap: 36px;
  align-items: start;
}

.explain-grid,
.guide-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.explain-grid article,
.guide-card {
  border-top: 3px solid var(--brand-2);
  background: var(--paper);
  padding: 18px;
}

.guide-card {
  display: grid;
  gap: 8px;
  color: inherit;
  text-decoration: none;
}

.guide-card:hover,
.guide-card:focus-visible {
  outline: 2px solid rgba(30, 122, 104, 0.2);
  outline-offset: 3px;
}

.guide-card span {
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 850;
  text-transform: uppercase;
}

.guide-card strong {
  font-size: 1.08rem;
  line-height: 1.3;
}

.guide-card p {
  margin: 0;
}

.links-band {
  display: grid;
  grid-template-columns: minmax(260px, 0.8fr) minmax(0, 1.2fr);
  gap: 24px;
  align-items: center;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

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

.related-links a {
  display: grid;
  gap: 8px;
  min-height: 132px;
  padding: 18px;
  border: 1px solid #cddbd3;
  border-radius: 8px;
  background: #fff;
  text-decoration: none;
}

.related-links a:hover,
.related-links a:focus-visible {
  border-color: var(--accent);
  outline: none;
}

.related-links span {
  color: var(--accent);
  font-size: 0.84rem;
  font-weight: 850;
  text-transform: uppercase;
}

.related-links strong {
  font-size: 1.05rem;
  line-height: 1.35;
}

.guide-list {
  margin-top: 24px;
}

.content-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(28px, 5vw, 58px) clamp(18px, 4vw, 38px) clamp(48px, 7vw, 82px);
}

.guide-index-hero {
  max-width: 920px;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: clamp(24px, 4vw, 44px);
  align-items: start;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 700;
}

.breadcrumbs a {
  color: var(--brand-2);
  text-decoration: none;
}

.breadcrumbs a:hover,
.breadcrumbs a:focus-visible {
  text-decoration: underline;
  outline: none;
}

.article-hero {
  margin-bottom: 26px;
}

.article-hero h1 {
  max-width: 860px;
}

.article-hero p {
  max-width: 820px;
  font-size: 1.08rem;
}

.article-body {
  min-width: 0;
}

.quick-box,
.article-section,
.article-cta,
.source-panel {
  margin-top: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: clamp(18px, 3vw, 28px);
}

.quick-box {
  border-left: 5px solid var(--accent);
  background: #fffaf2;
}

.quick-box h2,
.article-section h2,
.article-cta h2,
.source-panel h2 {
  font-size: clamp(1.35rem, 1.2rem + 0.4vw, 1.8rem);
}

.quick-box ul,
.source-panel ul {
  margin: 16px 0 0;
  padding-left: 21px;
}

.quick-box li,
.source-panel li {
  margin: 10px 0;
  color: var(--muted);
  line-height: 1.55;
}

.article-section p:last-child {
  margin-bottom: 0;
}

.article-cta {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  background: var(--brand);
}

.article-cta h2,
.article-cta p {
  color: #fff;
}

.article-cta .eyebrow {
  color: #f2be66;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 12px;
}

.button-link,
.text-link {
  min-height: 44px;
  border-radius: 8px;
  text-decoration: none;
  font-weight: 850;
}

.button-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 15px;
  background: #fff;
  color: var(--brand);
}

.text-link {
  display: inline-flex;
  align-items: center;
  color: #fff;
}

.button-link:hover,
.button-link:focus-visible,
.text-link:hover,
.text-link:focus-visible {
  text-decoration: underline;
  outline: none;
}

.source-panel a {
  color: var(--brand-2);
  font-weight: 760;
}

.article-sidebar {
  position: sticky;
  top: 92px;
  display: grid;
  gap: 18px;
}

.sidebar-block {
  display: grid;
  gap: 12px;
}

.sidebar-block .guide-card {
  padding: 16px;
}

.sidebar-ad {
  margin: 0;
  padding: 0;
}

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

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 28px clamp(18px, 4vw, 56px);
  background: var(--brand);
  color: #fff;
}

.site-footer p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.78);
  font-size: 0.92rem;
}

.site-footer nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
}

.site-footer a {
  color: #fff;
  font-weight: 760;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: underline;
  outline: none;
}

@media (max-width: 1060px) {
  .calculator-band,
  .context-band,
  .links-band {
    grid-template-columns: 1fr;
  }

  .intro-copy {
    padding-top: 0;
  }
}

@media (max-width: 820px) {
  .site-header,
  .site-footer {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-nav,
  .site-footer nav {
    justify-content: flex-start;
  }

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

  .tab-button {
    border-bottom: 1px solid var(--line);
  }

  .calc-grid,
  .field-grid,
  .explain-grid,
  .guide-list,
  .related-links,
  .guide-nav-grid {
    grid-template-columns: 1fr;
  }

  .results-pane {
    border-left: 0;
    border-top: 4px solid var(--brand-2);
    border-radius: 0 0 8px 8px;
  }
}

@media (max-width: 920px) {
  .article-layout {
    grid-template-columns: 1fr;
  }

  .article-sidebar {
    position: static;
  }

  .article-cta {
    align-items: flex-start;
    flex-direction: column;
  }

  .cta-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .calculator-band {
    padding-left: 12px;
    padding-right: 12px;
  }

  .panel {
    padding: 14px;
  }

  .top-nav a {
    padding-left: 9px;
    padding-right: 9px;
  }
}
