:root {
  color-scheme: light;
  --ink: #172033;
  --muted: #637188;
  --paper: #f7faff;
  --surface: #ffffff;
  --surface-soft: #edf5ff;
  --line: #dbe6f4;
  --blue: #0b63f6;
  --blue-dark: #073b9a;
  --blue-soft: #eaf2ff;
  --blue-mid: #2f80ed;
  --cyan: #1fb6ff;
  --coral: #e85d75;
  --amber: #f2a23a;
  --violet: #5867dd;
  --shadow: 0 18px 50px rgba(21, 101, 216, 0.13);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 12% 0%, rgba(11, 99, 246, 0.2), transparent 330px),
    radial-gradient(circle at 94% 2%, rgba(31, 182, 255, 0.18), transparent 300px),
    linear-gradient(180deg, #edf5ff 0%, #f7faff 520px),
    var(--paper);
  color: var(--ink);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button,
input,
select {
  font: inherit;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px clamp(18px, 4vw, 56px);
  border-bottom: 1px solid rgba(219, 230, 244, 0.9);
  background: rgba(247, 250, 255, 0.88);
  backdrop-filter: blur(16px);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--blue-dark));
  color: white;
  font-size: 13px;
}

nav {
  display: flex;
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
}

.topbar-action,
.copy-button,
.download-button,
.action-button {
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--blue), var(--blue-mid));
  box-shadow: 0 10px 24px rgba(11, 99, 246, 0.22);
  color: white;
  cursor: pointer;
  font-weight: 750;
  padding: 11px 16px;
}

.topbar-action:hover,
.copy-button:hover,
.download-button:hover,
.action-button:hover {
  background: linear-gradient(135deg, var(--blue-dark), #062f7c);
}

.download-button {
  background: var(--ink);
}

.download-button:hover {
  background: #263553;
}

.action-button {
  border: 1px solid var(--line);
  background: var(--surface);
  box-shadow: none;
  color: var(--blue-dark);
}

.action-button:hover {
  border-color: var(--blue);
  background: var(--blue-soft);
  color: var(--blue-dark);
}

main {
  display: grid;
  gap: 72px;
}

.app-section,
.features-section,
.pricing-section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.app-section {
  padding-top: 46px;
}

.app-heading {
  max-width: 760px;
  margin-bottom: 28px;
  padding: 10px 0 2px;
}

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

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

h1 {
  max-width: 720px;
  margin-bottom: 16px;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 0.95;
}

h2 {
  margin-bottom: 0;
  font-size: clamp(24px, 3vw, 38px);
  line-height: 1.08;
}

.app-heading p,
.features-section > div:first-child,
.pricing-section > div:first-child {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.tool-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.calculator-list,
.calculator-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: var(--shadow);
}

.calculator-list {
  display: grid;
  gap: 8px;
  padding: 10px;
  max-height: calc(100vh - 112px);
  overflow: auto;
  border-top: 4px solid var(--blue);
}

.calc-tab {
  display: grid;
  gap: 4px;
  width: 100%;
  min-height: 72px;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  padding: 13px;
  text-align: left;
}

.calc-tab span {
  color: var(--ink);
  font-weight: 850;
}

.calc-tab small {
  font-size: 13px;
}

.calc-tab:hover {
  border-color: rgba(11, 99, 246, 0.28);
  background: rgba(234, 242, 255, 0.86);
}

.calc-tab.active {
  border-color: rgba(11, 99, 246, 0.45);
  background: linear-gradient(135deg, #eaf2ff, #d9e8ff);
  box-shadow: inset 3px 0 0 var(--blue);
}

.calc-tab.active span {
  color: var(--blue-dark);
}

.calculator-panel {
  display: grid;
  gap: 22px;
  padding: clamp(18px, 4vw, 32px);
  border-top: 4px solid var(--blue);
}

.panel-header {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.icon-button {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  cursor: pointer;
  font-size: 22px;
}

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

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

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.field label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.field output {
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 850;
}

.field input[type="number"],
.field select {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
}

.field input[type="number"]:focus,
.field select:focus {
  border-color: var(--blue);
  outline: 3px solid rgba(11, 99, 246, 0.15);
}

.range-input {
  width: 100%;
  height: 28px;
  accent-color: var(--blue);
  cursor: pointer;
}

.range-meta {
  display: flex;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
}

.result-layout {
  display: grid;
  grid-template-columns: 1.15fr repeat(2, 1fr);
  gap: 14px;
}

.result-card {
  display: grid;
  gap: 8px;
  min-height: 128px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 18px;
}

.result-card:not(.primary-result) {
  background: linear-gradient(180deg, #ffffff, #f7fbff);
}

.primary-result {
  background: linear-gradient(135deg, #0d1b3d, var(--blue-dark));
  color: white;
}

.result-card span,
.result-card small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.primary-result span,
.primary-result small {
  color: rgba(255, 255, 255, 0.74);
}

.result-card strong {
  overflow-wrap: anywhere;
  font-size: clamp(23px, 3vw, 34px);
  line-height: 1.05;
}

.chart-wrap {
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(11, 99, 246, 0.1), transparent),
    var(--surface);
  padding: 18px;
}

.chart-row {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.bar-track {
  height: 16px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eee9;
}

.bar {
  display: block;
  width: 0;
  height: 100%;
  min-width: 5%;
  border-radius: inherit;
  transition: width 180ms ease;
}

.bar.invested {
  background: var(--cyan);
}

.bar.growth {
  background: var(--blue);
}

.summary-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border: 1px dashed rgba(11, 99, 246, 0.4);
  border-radius: 8px;
  background: linear-gradient(135deg, #eef6ff, #f7fbff);
  padding: 16px;
}

.summary-box p {
  margin: 0;
  color: var(--blue-dark);
  line-height: 1.5;
}

.result-actions {
  display: flex;
  flex: 0 0 auto;
  gap: 10px;
}

.result-actions button {
  min-height: 44px;
  white-space: nowrap;
}

.features-section,
.pricing-section,
.content-section {
  display: grid;
  gap: 22px;
}

.feature-grid,
.pricing-grid,
.article-grid,
.faq-grid,
.policy-grid,
.library-grid,
.method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.feature-grid article,
.price-card,
.article-grid article,
.faq-grid article,
.policy-grid article,
.library-grid article,
.method-grid article,
.glossary-list article,
.formula-note {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px;
}

.feature-grid p,
.article-grid p,
.faq-grid p,
.policy-grid p,
.library-grid p,
.method-grid p,
.glossary-list p,
.about-section p,
.formula-note li,
.price-card p,
footer {
  color: var(--muted);
  line-height: 1.55;
}

.content-section {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.content-section > div:first-child {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

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

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

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

.glossary-list article {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 16px;
  align-items: start;
}

.glossary-list h3,
.glossary-list p {
  margin-bottom: 0;
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.trust-strip span {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--blue-dark);
  font-size: 13px;
  font-weight: 850;
  padding: 8px 12px;
}

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

.about-section {
  max-width: 900px;
}

.about-section p {
  max-width: 820px;
  margin-bottom: 10px;
  font-size: 16px;
}

.formula-note {
  background: linear-gradient(135deg, #eef6ff, #ffffff);
}

.formula-note h3 {
  margin-bottom: 10px;
}

.formula-note ul {
  margin: 0;
  padding-left: 20px;
}

.formula-note li + li {
  margin-top: 6px;
}

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

.price-card strong {
  display: block;
  margin: 10px 0;
  color: var(--coral);
  font-size: 30px;
}

.price-card.highlighted {
  border-color: rgba(232, 102, 79, 0.45);
  background: rgba(232, 102, 79, 0.08);
}

footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 28px clamp(18px, 4vw, 56px);
  border-top: 1px solid var(--line);
}

footer span:first-child {
  color: var(--ink);
  font-weight: 850;
}

footer a,
.legal-page a {
  color: var(--blue-dark);
  font-weight: 800;
}

.page-shell {
  width: min(920px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 64px;
}

.legal-page {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: clamp(22px, 5vw, 42px);
}

.legal-page h1 {
  font-size: clamp(34px, 6vw, 58px);
}

.legal-page h2 {
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 24px;
}

.legal-page p {
  color: var(--muted);
  line-height: 1.65;
}

.error-page {
  display: grid;
  min-height: 100vh;
  place-content: center;
  gap: 18px;
  width: min(720px, calc(100% - 32px));
  margin: 0 auto;
  text-align: center;
}

.error-page .brand {
  justify-content: center;
}

.error-page h1 {
  margin-bottom: 0;
}

.error-page p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.6;
}

.error-page .topbar-action {
  justify-self: center;
}

@media (max-width: 860px) {
  .topbar nav {
    display: none;
  }

  .tool-grid,
  .result-layout,
  .feature-grid,
  .pricing-grid,
  .article-grid,
  .faq-grid,
  .policy-grid,
  .library-grid,
  .method-grid {
    grid-template-columns: 1fr;
  }

  .glossary-list article {
    grid-template-columns: 1fr;
  }

  .calculator-list {
    grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
    max-height: none;
  }

  .calc-tab {
    min-height: 86px;
    text-align: center;
  }

  .summary-box,
  footer {
    align-items: stretch;
    flex-direction: column;
  }

  .result-actions {
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .topbar {
    padding-inline: 14px;
  }

  .topbar-action {
    display: none;
  }

  .app-section,
  .features-section,
  .pricing-section {
    width: min(100% - 24px, 1180px);
  }

  h1 {
    font-size: 40px;
  }

  .calculator-list,
  .input-grid {
    grid-template-columns: 1fr;
  }

  .panel-header {
    align-items: flex-start;
  }

  .chart-row {
    grid-template-columns: 1fr;
  }
}

.guide-shell,
.guide-hub {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0 72px;
}

.calculator-page-shell { width: min(1100px, calc(100% - 32px)); margin: 0 auto; padding: 42px 0 72px; }
.calculator-page-heading { max-width: 850px; margin-bottom: 26px; }
.calculator-page-heading h1 { max-width: 850px; font-size: clamp(36px, 6vw, 62px); line-height: 1.02; }
.calculator-page-heading > p:not(.eyebrow), .seo-content p, .seo-content li, .faq-list p { color: var(--muted); line-height: 1.7; }
.seo-content { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr); gap: 30px; margin-top: 46px; }
.seo-content h2 { margin: 34px 0 12px; font-size: 28px; }
.seo-content h2:first-child { margin-top: 0; }
.seo-aside { align-self: start; border-left: 4px solid var(--blue); background: var(--surface-soft); padding: 20px; }
.faq-list { display: grid; gap: 12px; margin-top: 16px; }
.faq-list details { border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 16px 18px; }
.faq-list summary { cursor: pointer; font-weight: 800; }
.faq-list p { margin: 10px 0 0; }
.related-links { display: flex; flex-wrap: wrap; gap: 10px; }
.related-links a { border-bottom: 2px solid var(--blue); color: var(--blue-dark); font-weight: 800; }

@media (max-width: 760px) { .seo-content { grid-template-columns: 1fr; } }

@media print {
  .topbar, footer, .result-actions, .icon-button, .seo-content, .range-meta, .range-input { display: none !important; }
  body { background: white; }
  .calculator-page-shell { width: 100%; padding: 0; }
  .calculator-panel { border: 0; box-shadow: none; }
}

.guide-article {
  width: min(780px, 100%);
  margin: 0 auto;
}

.guide-article h1,
.guide-hub-heading h1 {
  max-width: 900px;
  font-size: clamp(36px, 6vw, 60px);
  line-height: 1.05;
}

.guide-article h2 {
  margin-top: 36px;
  margin-bottom: 10px;
  font-size: 25px;
}

.guide-article p,
.guide-article li,
.guide-hub-heading p,
.guide-card-grid p {
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.guide-article table { width: 100%; border-collapse: collapse; margin: 18px 0 26px; background: var(--surface); font-variant-numeric: tabular-nums; }
.guide-article th, .guide-article td { border: 1px solid var(--line); padding: 12px; text-align: left; }
.guide-article th { background: var(--surface-soft); }

.guide-lead {
  font-size: 20px !important;
}

.breadcrumb,
.guide-meta,
.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.breadcrumb,
.guide-meta {
  color: var(--muted);
  font-size: 13px;
}

.guide-meta {
  margin: 18px 0 30px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.breadcrumb a,
.guide-actions a:last-child,
.guide-link,
.guide-card-grid h2 a {
  color: var(--blue-dark);
  font-weight: 800;
}

.guide-disclaimer {
  margin-top: 36px;
  border-left: 4px solid var(--blue);
  background: var(--surface-soft);
  padding: 18px 20px;
  color: var(--muted);
  line-height: 1.6;
}

.guide-actions {
  margin-top: 26px;
  justify-content: space-between;
}

.guide-hub-heading {
  max-width: 900px;
  margin-bottom: 32px;
}

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

.guide-card-grid article {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  padding: 22px;
}

.guide-card-grid h2 {
  font-size: 22px;
}

.guide-link {
  display: inline-block;
  margin-top: 8px;
}

@media (max-width: 760px) {
  .guide-card-grid {
    grid-template-columns: 1fr;
  }

  .guide-actions {
    align-items: flex-start;
    flex-direction: column;
  }
}
