:root {
  --blue-950: #062b55;
  --blue-800: #0755a5;
  --blue-600: #0a72d8;
  --blue-100: #e8f3ff;
  --mint: #43d3b2;
  --mint-soft: #dff9f2;
  --ink: #10263d;
  --muted: #62758a;
  --line: #d9e4ee;
  --paper: #ffffff;
  --wash: #f4f8fc;
  --shadow: 0 20px 60px rgba(6, 43, 85, 0.11);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(rgba(7, 85, 165, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(7, 85, 165, 0.035) 1px, transparent 1px),
    var(--wash);
  background-size: 32px 32px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.55;
}

button, input, select { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 0 5vw;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(217, 228, 238, 0.9);
  backdrop-filter: blur(14px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--blue-950);
  font-size: 1.1rem;
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: white;
  background: var(--blue-800);
  border-radius: 10px 10px 14px 10px;
  box-shadow: 5px 5px 0 var(--mint);
}

nav { display: flex; align-items: center; gap: 24px; }
nav a { color: var(--ink); font-size: 0.92rem; font-weight: 650; text-decoration: none; }
nav a:hover { color: var(--blue-600); }

.preview-badge {
  padding: 7px 11px;
  color: var(--blue-800);
  background: var(--blue-100);
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

main { min-height: 80vh; }

.workspace {
  width: min(1500px, 92vw);
  margin: 0 auto;
  padding: 58px 0 72px;
}

.workspace-heading {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 48px;
  align-items: end;
  margin-bottom: 30px;
}

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

h1, h2, p { margin-top: 0; }

h1 {
  max-width: 780px;
  margin-bottom: 0;
  color: var(--blue-950);
  font-size: clamp(2.2rem, 4.6vw, 4.5rem);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.workspace-intro {
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 1rem;
}

.tool-layout {
  display: grid;
  grid-template-columns: 250px minmax(430px, 1fr) minmax(270px, 0.62fr);
  gap: 18px;
  align-items: start;
}

.tool-sidebar, .calculator-card, .guide-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: 0 8px 30px rgba(6, 43, 85, 0.05);
}

.tool-sidebar { padding: 14px; }

.category-filter {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 12px;
}

.filter-button {
  min-height: 38px;
  padding: 8px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 10px;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 750;
}

.filter-button:hover, .filter-button.active {
  color: var(--blue-800);
  background: var(--blue-100);
}

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

.tool-button {
  display: grid;
  grid-template-columns: 34px 1fr;
  gap: 10px;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 9px 10px;
  color: var(--ink);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 12px;
  text-align: left;
  cursor: pointer;
}

.tool-button:hover { background: var(--wash); }
.tool-button.active { color: white; background: var(--blue-800); box-shadow: 0 8px 20px rgba(7, 85, 165, 0.22); }
.tool-button span:first-child { font-size: 1.1rem; text-align: center; }
.tool-button span:last-child { font-size: 0.85rem; font-weight: 720; line-height: 1.25; }

.calculator-card {
  min-height: 590px;
  padding: clamp(24px, 3vw, 42px);
  box-shadow: var(--shadow);
}

.calculator-topline { display: flex; gap: 15px; align-items: center; }

.tool-icon {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 52px;
  height: 52px;
  color: var(--blue-950);
  background: var(--mint-soft);
  border-radius: 15px;
  font-size: 1.5rem;
}

.tool-category { margin-bottom: 3px; color: var(--blue-600); font-size: 0.75rem; font-weight: 800; text-transform: uppercase; }
.calculator-card h2 { margin-bottom: 0; color: var(--blue-950); font-size: clamp(1.5rem, 2.4vw, 2.1rem); line-height: 1.12; }
.tool-summary { max-width: 650px; margin: 20px 0 26px; color: var(--muted); }

.calculator-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.field { display: grid; gap: 7px; }
.field.full { grid-column: 1 / -1; }
.field label { color: var(--ink); font-size: 0.86rem; font-weight: 760; }
.field-help { color: var(--muted); font-size: 0.75rem; }
.input-wrap { position: relative; }

.field input, .field select {
  width: 100%;
  min-height: 52px;
  padding: 12px 48px 12px 14px;
  color: var(--ink);
  background: #fbfdff;
  border: 1px solid #cbd9e6;
  border-radius: 12px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field select { padding-right: 14px; }
.field input:focus, .field select:focus { border-color: var(--blue-600); box-shadow: 0 0 0 4px rgba(10, 114, 216, 0.11); }
.unit { position: absolute; top: 50%; right: 14px; color: var(--muted); font-size: 0.8rem; transform: translateY(-50%); pointer-events: none; }

.calculate-button {
  grid-column: 1 / -1;
  min-height: 54px;
  margin-top: 4px;
  padding: 13px 18px;
  color: white;
  background: var(--blue-800);
  border: 0;
  border-radius: 13px;
  cursor: pointer;
  font-weight: 820;
  box-shadow: 0 9px 22px rgba(7, 85, 165, 0.22);
}

.calculate-button:hover { background: var(--blue-600); }
.calculate-button:focus-visible { outline: 3px solid var(--mint); outline-offset: 3px; }

.result-panel {
  margin-top: 24px;
  padding: 22px;
  background: var(--blue-950);
  border-radius: 16px;
  color: white;
}

.result-label { margin-bottom: 2px; color: #9fcfff; font-size: 0.73rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
.result-primary { margin-bottom: 10px; font-size: clamp(2rem, 4vw, 3.25rem); font-weight: 860; line-height: 1; letter-spacing: -0.04em; }
.result-secondary { display: flex; flex-wrap: wrap; gap: 8px 20px; color: #d8eaff; font-size: 0.9rem; }
.result-secondary strong { color: white; }
.result-note { margin: 14px 0 0; padding-top: 13px; color: #b8cce0; border-top: 1px solid rgba(255,255,255,0.13); font-size: 0.78rem; }

.guide-card { position: sticky; top: 90px; padding: 26px; }
.guide-card h2 { color: var(--blue-950); font-size: 1.25rem; }
.guide-card > p:not(.eyebrow) { color: var(--muted); font-size: 0.9rem; }
.formula { margin: 22px 0; padding: 16px; color: var(--blue-950); background: var(--blue-100); border-left: 4px solid var(--blue-600); border-radius: 4px 10px 10px 4px; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.78rem; line-height: 1.6; }

.tip { display: grid; grid-template-columns: 24px 1fr; gap: 10px; padding-top: 18px; border-top: 1px solid var(--line); }
.tip span { display: grid; place-items: center; width: 22px; height: 22px; color: var(--blue-800); background: var(--mint-soft); border-radius: 50%; font-weight: 900; }
.tip p { margin: 0; color: var(--muted); font-size: 0.82rem; }

.trust-strip {
  display: grid;
  grid-template-columns: 0.8fr 1.6fr;
  gap: 60px;
  padding: 64px max(5vw, calc((100vw - 1400px) / 2));
  color: white;
  background: var(--blue-950);
}

.trust-strip .eyebrow { color: var(--mint); }
.trust-strip h2 { margin: 0; font-size: clamp(1.8rem, 3vw, 3rem); line-height: 1.08; letter-spacing: -0.035em; }
.method-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; }
.method-grid strong { display: block; margin-bottom: 16px; color: var(--mint); font-size: 1.6rem; }
.method-grid p { margin: 0; color: #c6d8e9; font-size: 0.9rem; }

footer {
  display: flex;
  justify-content: space-between;
  gap: 40px;
  padding: 36px 5vw;
  background: white;
  border-top: 1px solid var(--line);
}

footer p { max-width: 560px; margin: 7px 0 0; color: var(--muted); font-size: 0.78rem; }
.footer-brand { color: var(--blue-950); font-weight: 850; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px 18px; max-width: 620px; }
.footer-links a { color: var(--blue-800); font-size: 0.8rem; font-weight: 750; text-decoration: none; }
.footer-links a:hover { text-decoration: underline; }
.footer-links p { flex-basis: 100%; text-align: right; }

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  width: min(1500px, 92vw);
  margin: 24px auto -28px;
  color: var(--muted);
  font-size: 0.8rem;
}
.breadcrumb a { color: var(--blue-800); text-decoration: none; }

.article-section {
  padding: 72px max(5vw, calc((100vw - 1200px) / 2));
  background: white;
  border-top: 1px solid var(--line);
}
.article-shell { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(270px, 0.55fr); gap: 64px; }
.article-copy h2, .article-copy h3, .policy-page h1, .policy-page h2 { color: var(--blue-950); letter-spacing: -0.025em; }
.article-copy h2 { margin-bottom: 18px; font-size: clamp(1.8rem, 3vw, 2.7rem); }
.article-copy h3 { margin: 34px 0 10px; font-size: 1.25rem; }
.article-copy p, .article-copy li, .policy-page p, .policy-page li { color: #40566d; }
.article-copy ol, .article-copy ul, .policy-page ul { padding-left: 1.35rem; }
.example-box { margin: 28px 0; padding: 22px; background: var(--mint-soft); border-radius: 14px; }
.example-box strong { display: block; margin-bottom: 6px; color: var(--blue-950); }
.faq-list details { padding: 17px 0; border-bottom: 1px solid var(--line); }
.faq-list summary { color: var(--blue-950); cursor: pointer; font-weight: 780; }
.faq-list details p { margin: 10px 0 0; font-size: 0.9rem; }
.source-card { align-self: start; padding: 24px; background: var(--wash); border: 1px solid var(--line); border-radius: 16px; }
.source-card h3 { margin: 0 0 12px; color: var(--blue-950); }
.source-card p { color: var(--muted); font-size: 0.84rem; }
.source-card a { color: var(--blue-800); overflow-wrap: anywhere; }

.article-index { width: min(1180px, calc(100% - 40px)); min-height: 70vh; margin: 0 auto; padding: 64px 0 90px; }
.article-index-head { max-width: 760px; margin-bottom: 34px; }
.article-index-head h1 { margin: 8px 0 14px; color: var(--blue-950); font-size: clamp(2.4rem, 5vw, 4.4rem); line-height: 1; letter-spacing: -0.04em; }
.article-index-head p { color: var(--muted); }
.article-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.article-card { display: block; padding: 25px; color: inherit; background: white; border: 1px solid var(--line); border-radius: 16px; text-decoration: none; box-shadow: 0 12px 36px rgba(24, 55, 87, 0.06); }
.article-card:hover { border-color: #9bbbe0; transform: translateY(-1px); }
.article-card span { color: var(--blue-600); font-size: 0.76rem; font-weight: 800; text-transform: uppercase; }
.article-card h2 { margin: 10px 0; color: var(--blue-950); font-size: 1.35rem; line-height: 1.2; }
.article-card p { margin: 0; color: var(--muted); font-size: 0.92rem; }
.guide-article { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 58px 0 90px; }
.guide-article-layout { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(260px, 0.5fr); gap: 64px; }
.guide-article h1 { margin: 10px 0 18px; color: var(--blue-950); font-size: clamp(2.25rem, 5vw, 4.2rem); line-height: 1.03; letter-spacing: -0.045em; }
.guide-summary { color: var(--muted); font-size: 1.05rem; }
.guide-body h2 { margin: 38px 0 12px; color: var(--blue-950); font-size: 1.45rem; }
.guide-body p, .guide-body li { color: #40566d; }
.guide-body ul { padding-left: 1.35rem; }
.guide-body a { color: var(--blue-800); font-weight: 750; }
.source-list { padding-left: 1.1rem; }
.source-list a { color: var(--blue-800); overflow-wrap: anywhere; }

.policy-page { width: min(820px, calc(100% - 40px)); min-height: 70vh; margin: 0 auto; padding: 72px 0 90px; }
.policy-page h1 { font-size: clamp(2.4rem, 5vw, 4.4rem); line-height: 1; }
.policy-page h2 { margin-top: 40px; }
.policy-page .lead { color: var(--muted); font-size: 1.08rem; }
.policy-meta { margin-bottom: 30px; color: var(--blue-600); font-size: 0.8rem; font-weight: 800; text-transform: uppercase; }
.policy-card { margin-top: 28px; padding: 22px; background: var(--blue-100); border-radius: 14px; }

.not-found { display: grid; place-items: center; min-height: 72vh; padding: 40px 20px; text-align: center; }
.not-found strong { color: var(--mint); font-size: 5rem; line-height: 1; }
.not-found h1 { margin: 14px 0; font-size: clamp(2rem, 5vw, 4rem); }
.not-found a { display: inline-block; margin-top: 12px; padding: 13px 18px; color: white; background: var(--blue-800); border-radius: 12px; font-weight: 800; text-decoration: none; }

@media (max-width: 1120px) {
  .tool-layout { grid-template-columns: 220px minmax(0, 1fr); }
  .guide-card { position: static; grid-column: 2; }
}

@media (max-width: 760px) {
  .site-header { min-height: 64px; padding: 0 20px; }
  nav a { display: none; }
  .preview-badge { font-size: 0.68rem; }
  .workspace { width: min(100% - 28px, 680px); padding-top: 34px; }
  .workspace-heading { grid-template-columns: 1fr; gap: 16px; }
  h1 { font-size: 2.55rem; }
  .tool-layout { display: block; }
  .tool-sidebar { margin-bottom: 14px; padding: 10px; overflow: hidden; }
  .category-filter { display: flex; overflow-x: auto; }
  .filter-button { flex: 0 0 auto; padding-inline: 13px; }
  .tool-list { display: flex; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
  .tool-button { flex: 0 0 170px; }
  .calculator-card { min-height: auto; padding: 24px 20px; border-radius: 17px; }
  .calculator-form { grid-template-columns: 1fr; }
  .field.full, .calculate-button { grid-column: auto; }
  .guide-card { margin-top: 14px; }
  .trust-strip { grid-template-columns: 1fr; gap: 30px; padding: 52px 24px; }
  .method-grid { grid-template-columns: 1fr; gap: 24px; }
  footer { display: block; padding: 30px 24px; }
  footer > p { margin-top: 22px; }
  .footer-links { justify-content: flex-start; margin-top: 20px; }
  .footer-links p { text-align: left; }
  .breadcrumb { width: calc(100% - 28px); margin-top: 18px; }
  .article-section { padding: 50px 20px; }
  .article-shell { grid-template-columns: 1fr; gap: 36px; }
  .article-index, .guide-article { width: calc(100% - 28px); padding-top: 42px; }
  .article-grid, .guide-article-layout { grid-template-columns: 1fr; }
  .guide-article-layout { gap: 34px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
