:root {
  --ink: #202428;
  --muted: #626a73;
  --line: #e2e7ee;
  --paper: #f7f9fc;
  --wash: #eef5ff;
  --soft: #f0f6ff;
  --blue: #3267f6;
  --blue-deep: #244dc4;
  --teal: #0c9b94;
  --green: #35a46f;
  --coral: #ee6c5d;
  --gold: #d99a22;
  --white: #ffffff;
  --shadow: 0 18px 44px rgba(28, 45, 74, 0.1);
}

* {
  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.5;
}

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px clamp(16px, 4vw, 46px);
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0;
  flex: 0 1 auto;
}

.brand-logo {
  display: block;
  width: clamp(190px, 26vw, 320px);
  max-width: 100%;
  height: auto;
  aspect-ratio: 900 / 251;
  object-fit: contain;
}

.brand-mark {
  display: block;
}

.brand-mark svg,
.tool-icon svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.nav {
  display: flex;
  align-items: center;
  gap: 15px;
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 650;
}

.nav a:hover {
  color: var(--blue);
}

main {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
}

.topline {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  align-items: end;
  gap: 24px;
  padding: 28px 0 14px;
}

.eyebrow {
  margin: 0 0 9px;
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  overflow-wrap: break-word;
}

h1 {
  max-width: 760px;
  margin: 0;
  font-size: 2.85rem;
  line-height: 1;
  letter-spacing: 0;
}

h2 {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1.08;
  letter-spacing: 0;
}

.lede {
  max-width: 680px;
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1rem;
}

.search-wrap {
  width: min(620px, 100%);
  margin: 0;
}

.search-wrap label,
.field label {
  display: block;
  margin-bottom: 8px;
  font-weight: 750;
}

.search-wrap input,
.field input,
.field select {
  width: 100%;
  height: 40px;
  padding: 0 12px;
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  outline: none;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.75);
}

.search-wrap input:focus,
.field input:focus,
.field select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(50, 103, 246, 0.14);
}

.tool-layout {
  display: grid;
  grid-template-columns: 292px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
  padding: 12px 0 34px;
}

.directory,
.calculator-panel,
.about {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(28, 45, 74, 0.06);
}

.directory {
  position: sticky;
  top: 74px;
  padding: 16px;
}

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

.tool-list {
  display: grid;
  gap: 7px;
}

.tool-button {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 7px 9px;
  color: var(--ink);
  text-align: left;
  background: var(--white);
  border: 1px solid transparent;
  border-radius: 8px;
  cursor: pointer;
}

.tool-button:hover,
.tool-button.is-active {
  border-color: #c9d8ff;
  background: var(--soft);
}

.tool-button.is-active {
  box-shadow: none;
}

.tool-button strong {
  display: block;
  color: #15191f;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tool-copy {
  min-width: 0;
}

.tool-category {
  display: block;
  color: var(--muted);
  font-size: 0.62rem;
  font-weight: 600;
}

.tool-button .tool-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  color: var(--blue);
  background: #edf4ff;
  border-radius: 8px;
}

.calculator-panel {
  min-height: 560px;
  padding: clamp(16px, 3vw, 26px);
}

.calculator-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

#tool-summary {
  max-width: 720px;
  margin: 10px 0 0;
  color: var(--muted);
}

.secondary-button {
  min-width: 84px;
  height: 36px;
  color: var(--white);
  background: var(--blue);
  border: 1px solid var(--blue);
  border-radius: 8px;
  cursor: pointer;
  font-weight: 750;
}

.secondary-button:hover {
  background: var(--blue-deep);
}

.calculator-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 0.78fr);
  gap: 20px;
  align-items: start;
  padding-top: 20px;
}

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

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

.hint {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
}

.results-panel {
  min-height: 300px;
  padding: 18px;
  background: linear-gradient(180deg, #eef5ff, #f7fbff);
  border: 1px solid #d6e4ff;
  border-radius: 8px;
}

.primary-result {
  margin: 12px 0;
  color: var(--blue-deep);
  font-size: 3.2rem;
  font-weight: 850;
  line-height: 1;
}

.result-note {
  min-height: 44px;
  margin: 0 0 16px;
  color: var(--muted);
}

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

.breakdown-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid #d7e2f2;
}

.breakdown-row strong {
  text-align: right;
}

.popular {
  padding: 20px 0 28px;
}

.guides {
  padding: 6px 0 28px;
}

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

.guide-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 186px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(28, 45, 74, 0.06);
}

.guide-card:hover {
  transform: translateY(-2px);
  border-color: #c9d8ff;
  box-shadow: 0 14px 30px rgba(28, 45, 74, 0.1);
}

.guide-card span {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
}

.guide-card strong {
  font-size: 1.1rem;
  line-height: 1.2;
}

.guide-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

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

.popular-card {
  display: grid;
  align-content: space-between;
  min-height: 136px;
  padding: 15px;
  text-align: left;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
}

a.popular-card {
  cursor: pointer;
}

.popular-card:hover {
  transform: translateY(-2px);
  border-color: #c9d8ff;
  box-shadow: 0 14px 30px rgba(28, 45, 74, 0.1);
}

.popular-card span {
  color: var(--blue);
  font-size: 0.78rem;
  font-weight: 800;
}

.popular-card strong {
  font-size: 1rem;
  line-height: 1.2;
}

.about {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 24px;
  margin: 22px 0 36px;
  padding: clamp(18px, 4vw, 34px);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
  margin: 0 0 34px;
}

.trust-card {
  display: grid;
  gap: 10px;
  min-height: 144px;
  padding: 16px;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(28, 45, 74, 0.06);
}

.trust-card:hover {
  transform: translateY(-2px);
  border-color: #c9d8ff;
  box-shadow: 0 14px 30px rgba(28, 45, 74, 0.1);
}

.trust-card strong {
  font-size: 1rem;
}

.trust-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.92rem;
}

.utility-image {
  height: 176px;
  margin: 0 0 36px;
  overflow: hidden;
  border-radius: 8px;
}

.utility-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.about p:last-child {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 22px clamp(16px, 4vw, 46px);
  color: var(--muted);
  background: #edf2f8;
  border-top: 1px solid var(--line);
}

.site-footer p {
  max-width: 680px;
  margin: 0;
}

.hidden {
  display: none;
}

.article-shell {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.article-hero,
.article-body,
.article-aside {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(28, 45, 74, 0.06);
}

.article-hero {
  padding: clamp(22px, 4vw, 34px);
}

.article-hero p:last-child,
.article-body p:last-child,
.article-aside p:last-child {
  margin-bottom: 0;
}

.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 260px;
  gap: 20px;
  margin-top: 18px;
}

.article-body {
  padding: clamp(22px, 4vw, 34px);
}

.article-body h2 {
  margin: 30px 0 12px;
}

.article-body h3 {
  margin: 22px 0 10px;
  font-size: 1.12rem;
}

.article-body p,
.article-body li {
  color: var(--muted);
}

.article-body ul,
.article-body ol {
  padding-left: 22px;
}

.article-callout,
.article-aside {
  padding: 18px;
}

.article-callout {
  margin: 24px 0;
  background: linear-gradient(180deg, #eef5ff, #f7fbff);
  border: 1px solid #d6e4ff;
  border-radius: 8px;
}

.article-callout strong {
  display: block;
  margin-bottom: 6px;
}

.article-links {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

.article-links a {
  color: var(--blue);
  font-weight: 700;
}

.breadcrumb {
  margin-bottom: 14px;
  color: var(--muted);
  font-size: 0.88rem;
}

.breadcrumb a {
  color: var(--blue);
}

.simple-page {
  width: min(900px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 40px;
}

.simple-page section {
  margin-bottom: 18px;
  padding: clamp(22px, 4vw, 34px);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 10px 28px rgba(28, 45, 74, 0.06);
}

.simple-page p,
.simple-page li {
  color: var(--muted);
}

.simple-page ul {
  padding-left: 22px;
}

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

  .brand-logo {
    width: clamp(180px, 42vw, 260px);
  }

  .topline,
  .tool-layout,
  .calculator-grid,
  .about {
    grid-template-columns: 1fr;
  }

  h1 {
    font-size: 2.25rem;
  }

  h2 {
    font-size: 1.55rem;
  }

  .directory {
    position: static;
  }

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

  .trust-grid,
  .guides-grid,
  .article-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  main {
    width: min(100% - 24px, 1080px);
  }

  .brand-logo {
    width: clamp(170px, 58vw, 230px);
  }

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

  .calculator-head,
  .site-footer {
    flex-direction: column;
  }

  .calculator-form,
  .popular-grid {
    grid-template-columns: 1fr;
  }

  .primary-result {
    font-size: 1.95rem;
  }

  h1 {
    font-size: 1.85rem;
  }

  h2 {
    font-size: 1.35rem;
  }
}
