:root {
  color-scheme: light;
  --primary-green: #0f6b57;
  --dark-green: #064e3b;
  --soft-green: #e8f5f1;
  --accent-gold: #a66a00;
  --soft-gold: #fff4d6;
  --heading-text: #334155;
  --body-text: #5b6b7f;
  --muted-text: #718096;
  --page-bg: #eef6f4;
  --card-bg: #ffffff;
  --light-border: #d8e3e0;
  --active-border: #7db8a8;
  --surface-tint: #fbfefd;
  --primary-green-rgb: 15, 107, 87;
  --dark-green-rgb: 6, 78, 59;
  --soft-green-rgb: 232, 245, 241;
  --heading-text-rgb: 51, 65, 85;
  --bg: var(--page-bg);
  --surface: var(--card-bg);
  --text: var(--body-text);
  --muted: var(--muted-text);
  --heading: var(--heading-text);
  --heading-secondary: var(--body-text);
  --line: var(--light-border);
  --accent: var(--primary-green);
  --accent-dark: var(--dark-green);
  --accent-soft: var(--soft-green);
  --blue: var(--primary-green);
  --blue-soft: var(--soft-green);
  --gold: var(--accent-gold);
  --gold-soft: var(--soft-gold);
  --rose: var(--dark-green);
  --rose-soft: var(--soft-green);
  --danger: #b42318;
  --shadow: 0 20px 54px rgba(var(--heading-text-rgb), 0.09);
  --small-shadow: 0 10px 24px rgba(var(--heading-text-rgb), 0.065);
  --focus-ring: 0 0 0 4px rgba(var(--primary-green-rgb), 0.18);
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --primary-green: #2dd4bf;
  --dark-green: #99f6e4;
  --soft-green: #123a34;
  --accent-gold: #f4b44d;
  --soft-gold: #3f2d10;
  --heading-text: #edf7f5;
  --body-text: #d5e2df;
  --muted-text: #a9b8b5;
  --page-bg: #0b211f;
  --card-bg: #12302c;
  --light-border: #2a4b45;
  --active-border: #2dd4bf;
  --surface-tint: #102b27;
  --primary-green-rgb: 45, 212, 191;
  --dark-green-rgb: 153, 246, 228;
  --soft-green-rgb: 18, 58, 52;
  --heading-text-rgb: 237, 247, 245;
  --danger: #f87171;
  --shadow: 0 22px 60px rgba(0, 0, 0, 0.34);
  --small-shadow: 0 12px 28px rgba(0, 0, 0, 0.26);
  --focus-ring: 0 0 0 4px rgba(var(--primary-green-rgb), 0.22);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Arial, Helvetica, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(var(--primary-green-rgb), 0.14), transparent 34%),
    linear-gradient(135deg, #fbfefd 0%, var(--bg) 52%, #fdf8ea 100%);
  color: var(--text);
}

:root[data-theme="dark"] body {
  background:
    radial-gradient(circle at top left, rgba(var(--primary-green-rgb), 0.18), transparent 36%),
    linear-gradient(135deg, #061412 0%, var(--bg) 55%, #0f1f1d 100%);
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid rgba(var(--primary-green-rgb), 0.7);
  outline-offset: 3px;
}

.page {
  width: 100%;
  min-height: 100vh;
  display: grid;
  gap: 22px;
  place-items: center;
  padding: 32px 16px;
}

.selector,
.calculator {
  width: min(100%, 920px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 26px;
}

.selector {
  display: grid;
  gap: 20px;
  background:
    linear-gradient(135deg, rgba(var(--primary-green-rgb), 0.12), transparent 45%),
    var(--surface);
}

.calculator {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(320px, 1fr);
  gap: 22px;
  align-items: start;
}

.intro {
  grid-column: 1 / -1;
}

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(216, 227, 224, 0.82);
  padding-bottom: 16px;
}

.brand-lockup {
  display: block;
  border: 1px solid rgba(var(--primary-green-rgb), 0.12);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.82);
  padding: 6px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.035);
  text-decoration: none;
}

.home-logo {
  flex: 0 0 auto;
  width: 192px;
}

.page-logo {
  width: min(100%, 180px);
}

.brand-lockup picture {
  display: block;
}

.brand-lockup img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 6px;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 6px;
}

.site-nav a,
.site-nav button {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 8px 10px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 650;
  line-height: 1.2;
  text-decoration: none;
}

.site-nav a:hover,
.site-nav button:hover,
.site-nav a:focus-visible,
.site-nav button:focus-visible {
  border-color: rgba(var(--primary-green-rgb), 0.18);
  background: rgba(228, 245, 240, 0.7);
  color: var(--accent-dark);
}

.hero {
  display: grid;
  gap: 14px;
  padding: 4px 0 6px;
}

.hero .eyebrow,
.hero h1,
.hero p {
  margin-bottom: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
}

.detail-header {
  display: grid;
  gap: 18px;
  background:
    linear-gradient(135deg, rgba(var(--primary-green-rgb), 0.1), transparent 48%),
    var(--surface);
}

.detail-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border-bottom: 1px solid rgba(216, 227, 224, 0.82);
  padding-bottom: 14px;
}

.detail-nav {
  flex: 1 1 auto;
}

.detail-hero {
  max-width: 760px;
}

.detail-hero .eyebrow {
  margin: 0 0 14px;
  font-size: 0.76rem;
  line-height: 1.2;
}

.detail-hero h1 {
  margin: 0;
  font-size: clamp(2rem, 3.25vw, 2.6rem);
  line-height: 1.08;
}

.detail-hero p:last-child {
  margin: 14px 0 0;
  max-width: 720px;
  line-height: 1.65;
}

.related-chips {
  margin-top: 2px;
}

.primary-action,
.secondary-action {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  padding: 10px 16px;
  font: inherit;
  font-weight: 750;
  line-height: 1.2;
  text-decoration: none;
}

.primary-action {
  border: 0;
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(var(--primary-green-rgb), 0.22);
}

.primary-action:hover,
.primary-action:focus-visible {
  background: var(--accent-dark);
}

.secondary-action {
  border: 1px solid rgba(var(--primary-green-rgb), 0.28);
  background: rgba(255, 255, 255, 0.76);
  color: var(--accent-dark);
}

.secondary-action:hover,
.secondary-action:focus-visible {
  background: var(--accent-soft);
}

.calculator-selection {
  display: grid;
  gap: 22px;
}

.section-heading {
  display: grid;
  gap: 3px;
}

.section-heading h2 {
  margin: 0;
  color: var(--heading);
  font-size: 1.12rem;
  line-height: 1.25;
}

.health-feature-card {
  min-height: 128px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px 18px;
  border: 1px solid rgba(var(--primary-green-rgb), 0.18);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(228, 245, 240, 0.92), rgba(255, 255, 255, 0.96)),
    #ffffff;
  color: var(--text);
  padding: 18px;
  text-align: left;
  box-shadow: 0 16px 34px rgba(var(--primary-green-rgb), 0.1);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.health-feature-card:hover,
.health-feature-card:focus-visible {
  border-color: rgba(var(--primary-green-rgb), 0.34);
  box-shadow: 0 18px 38px rgba(var(--primary-green-rgb), 0.14);
  transform: translateY(-1px);
}

.health-feature-card.active {
  border-color: var(--active-border);
  box-shadow: inset 4px 0 0 rgba(var(--primary-green-rgb), 0.62), 0 18px 38px rgba(var(--primary-green-rgb), 0.13);
}

.health-feature-card span {
  grid-column: 1;
  color: var(--accent-dark);
  font-size: clamp(1.25rem, 2.4vw, 1.75rem);
  font-weight: 800;
  line-height: 1.1;
}

.health-feature-card strong {
  grid-column: 1;
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.55;
}

.health-feature-card small {
  grid-column: 2;
  grid-row: 1 / span 2;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  padding: 9px 14px;
  font-size: 0.9rem;
  font-weight: 750;
  line-height: 1.2;
  white-space: nowrap;
}

.popular-calculators {
  display: grid;
  gap: 10px;
}

.popular-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
}

.category-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 2px;
}

.category-filter-tab {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  padding: 8px 12px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
}

.category-filter-tab:hover,
.category-filter-tab:focus-visible {
  border-color: rgba(var(--primary-green-rgb), 0.2);
  background: rgba(228, 245, 240, 0.62);
  color: var(--accent-dark);
}

.category-filter-tab.active,
.category-filter-tab[aria-pressed="true"] {
  border-color: rgba(var(--primary-green-rgb), 0.34);
  background: var(--accent-soft);
  color: var(--accent-dark);
  box-shadow: inset 0 0 0 1px rgba(var(--primary-green-rgb), 0.08);
}

.category-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

.calculator-category {
  display: grid;
  gap: 12px;
}

.category-heading {
  display: grid;
  gap: 6px;
  margin-top: 4px;
}

.calculator-category + .calculator-category {
  margin-top: 8px;
}

.category-heading h2 {
  margin: 0;
  color: var(--heading);
  font-size: clamp(1.38rem, 2.4vw, 1.6rem);
  font-weight: 700;
  line-height: 1.25;
}

.category-heading p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.tile-grid.two-col {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.tile-grid.one-col {
  grid-template-columns: minmax(0, 1fr);
}

.tile-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 9px;
}

.calculator-tile {
  min-height: 62px;
  display: grid;
  align-content: center;
  gap: 5px;
  border: 1px solid rgba(216, 227, 224, 0.88);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--text);
  padding: 10px 40px 10px 12px;
  text-align: left;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.035);
  position: relative;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.2s, transform 0.2s, background 0.2s, color 0.2s;
}

.calculator-tile::before {
  content: none;
}

.calculator-tile::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--accent);
  border-bottom: 2px solid var(--accent);
  position: absolute;
  top: 50%;
  right: 15px;
  transform: translateY(-50%) rotate(-45deg);
}

.popular-tile::before {
  content: none;
}

.popular-tile::after {
  top: 50%;
  right: 15px;
  transform: translateY(-50%) rotate(-45deg);
}

.calculator-tile:hover {
  background: var(--surface-tint);
  border-color: rgba(var(--primary-green-rgb), 0.32);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.115);
  transform: translateY(-1px);
}

.calculator-tile:focus-visible {
  outline: 0;
  border-color: var(--active-border);
  box-shadow: var(--focus-ring), var(--small-shadow);
}

.calculator-tile.active {
  border-color: rgba(var(--primary-green-rgb), 0.3);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.045);
}

.calculator-tile:nth-child(2)::before {
  background: var(--blue-soft);
}

.calculator-tile:nth-child(2)::after {
  border-color: var(--blue);
}

.calculator-tile:nth-child(3)::before {
  background: var(--gold-soft);
}

.calculator-tile:nth-child(3)::after {
  border-color: var(--gold);
}

.calculator-tile:nth-child(4)::before {
  background: var(--rose-soft);
}

.calculator-tile:nth-child(4)::after {
  border-color: var(--rose);
}

.calculator-tile:nth-child(5)::before {
  background: var(--accent-soft);
}

.calculator-tile:nth-child(5)::after {
  border-color: var(--accent);
}

.calculator-tile:nth-child(6)::before {
  background: var(--gold-soft);
}

.calculator-tile:nth-child(6)::after {
  border-color: var(--gold);
}

.calculator-tile span {
  color: var(--accent-dark);
  font-size: 0.98rem;
  font-weight: 800;
  line-height: 1.1;
}

.calculator-tile:nth-child(2) span {
  color: var(--blue);
}

.calculator-tile:nth-child(3) span {
  color: var(--gold);
}

.calculator-tile:nth-child(4) span {
  color: var(--rose);
}

.calculator-tile:nth-child(5) span {
  color: var(--accent);
}

.calculator-tile:nth-child(6) span {
  color: var(--gold);
}

.calculator-tile[data-calculator-target="emi"]::before {
  background: var(--blue-soft);
}

.calculator-tile[data-calculator-target="emi"]::after {
  border-color: var(--blue);
}

.calculator-tile[data-calculator-target="emi"] span {
  color: var(--blue);
}

.calculator-tile[data-calculator-target="nps"]::before {
  background: var(--gold-soft);
}

.calculator-tile[data-calculator-target="nps"]::after {
  border-color: var(--gold);
}

.calculator-tile[data-calculator-target="nps"] span {
  color: var(--gold);
}

.calculator-tile[data-calculator-target="epf"]::before {
  background: var(--rose-soft);
}

.calculator-tile[data-calculator-target="epf"]::after {
  border-color: var(--rose);
}

.calculator-tile[data-calculator-target="epf"] span {
  color: var(--rose);
}

.calculator-tile[data-calculator-target="lumpsum"]::before {
  background: var(--accent-soft);
}

.calculator-tile[data-calculator-target="lumpsum"]::after {
  border-color: var(--accent);
}

.calculator-tile[data-calculator-target="lumpsum"] span {
  color: var(--accent);
}

.calculator-tile[data-calculator-target="rd"]::before {
  background: var(--gold-soft);
}

.calculator-tile[data-calculator-target="rd"]::after {
  border-color: var(--gold);
}

.calculator-tile[data-calculator-target="rd"] span {
  color: var(--gold);
}

.calculator-tile strong {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 500;
  line-height: 1.3;
  max-width: none;
}

.popular-tile {
  min-height: 78px;
  gap: 6px;
  padding: 12px 50px 12px 12px;
}

.popular-tile::before {
  width: 42px;
  height: 42px;
  top: 13px;
  right: 13px;
}

.popular-tile::after {
  width: 15px;
  height: 15px;
  border-right-width: 3px;
  border-bottom-width: 3px;
  top: 25px;
  right: 28px;
}

.popular-tile span {
  font-size: 1.08rem;
  line-height: 1;
}

.popular-tile strong {
  font-size: 0.82rem;
  line-height: 1.35;
}

.health-tile {
  min-height: 118px;
  grid-template-columns: minmax(0, 1fr);
  align-content: center;
  gap: 10px;
  padding: 16px 86px 16px 16px;
  background:
    linear-gradient(135deg, rgba(var(--primary-green-rgb), 0.16), rgba(166, 106, 0, 0.1)),
    #ffffff;
  border-color: var(--active-border);
  box-shadow: 0 14px 34px rgba(var(--primary-green-rgb), 0.12);
}

.health-tile::before {
  width: 52px;
  height: 52px;
  background: var(--accent-soft);
}

.health-tile::after {
  border-color: var(--accent);
  top: 29px;
  right: 32px;
}

.health-tile span {
  color: var(--accent-dark);
  font-size: clamp(1.5rem, 2.6vw, 1.95rem);
}

.health-tile strong {
  max-width: calc(100% - 90px);
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 500;
  line-height: 1.5;
}

.health-tile small {
  color: var(--accent-dark);
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.45;
}

.health-tile.active {
  background:
    linear-gradient(135deg, rgba(var(--primary-green-rgb), 0.18), rgba(166, 106, 0, 0.1)),
    #ffffff;
  border-color: var(--active-border);
  box-shadow: inset 4px 0 0 rgba(var(--primary-green-rgb), 0.55), 0 16px 36px rgba(var(--primary-green-rgb), 0.13);
}

.trust-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.trust-card {
  display: grid;
  gap: 6px;
  border: 1px solid rgba(216, 227, 224, 0.9);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.78);
  padding: 13px;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.04);
}

.trust-card strong {
  color: var(--text);
  font-size: 0.98rem;
  font-weight: 700;
}

.trust-card span {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.6;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--primary-green);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.intro h1,
.intro h2 {
  margin: 0;
  color: var(--heading-text);
  font-size: clamp(2rem, 3.6vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
}

.intro p:last-child {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.7;
}

.calculator > .intro h2 {
  font-size: clamp(2.25rem, 2.7vw, 2.5rem);
  line-height: 1.18;
}

.form {
  display: grid;
  gap: 16px;
  background: var(--surface-tint);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
}

.wide-form {
  grid-column: 1 / -1;
}

.form-section {
  display: grid;
  gap: 14px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 18px;
}

.form-section:last-of-type {
  border-bottom: 0;
  padding-bottom: 0;
}

.form-section h2 {
  margin: 0;
  color: var(--heading-text);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.field {
  display: grid;
  gap: 8px;
}

label {
  font-weight: 600;
  font-size: 0.95rem;
  line-height: 1.35;
}

.field-hint {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.55;
}

.input-wrap {
  min-height: 54px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 0 14px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.input-wrap:hover {
  border-color: rgba(var(--primary-green-rgb), 0.28);
}

.input-wrap:focus-within {
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

.input-wrap span {
  color: var(--muted);
  white-space: nowrap;
}

input,
select,
textarea {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
  font-size: 1.05rem;
}

select {
  appearance: none;
}

textarea {
  min-height: 150px;
  padding: 14px 0;
  resize: vertical;
  line-height: 1.55;
}

.textarea-wrap {
  align-items: stretch;
}

.contact-form {
  max-width: 720px;
}

.checkbox-field {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  color: var(--text);
  font-size: 0.94rem;
  font-weight: 500;
  line-height: 1.55;
}

.checkbox-field input {
  width: 18px;
  min-width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--accent);
}

.contact-status {
  min-height: 22px;
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.55;
}

.contact-status.success {
  color: var(--accent-dark);
}

.contact-status.error {
  color: var(--danger);
}

.form button {
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-dark));
  color: #ffffff;
  font-weight: 700;
  box-shadow: 0 14px 26px rgba(var(--primary-green-rgb), 0.22);
  transition: filter 0.2s, transform 0.2s, box-shadow 0.2s;
}

.form button:hover {
  filter: brightness(1.04);
  box-shadow: 0 16px 30px rgba(var(--primary-green-rgb), 0.28);
}

.form button:disabled {
  cursor: not-allowed;
  filter: saturate(0.72);
  opacity: 0.72;
  transform: none;
}

.form button:focus-visible {
  outline: 0;
  box-shadow: var(--focus-ring), 0 14px 26px rgba(var(--primary-green-rgb), 0.22);
}

.form button:active {
  transform: translateY(1px);
}

.hidden {
  display: none !important;
}

.error {
  min-height: 18px;
  color: var(--danger);
  font-size: 0.82rem;
  line-height: 1.45;
}

.slider-control {
  display: grid;
  gap: 6px;
  margin-top: 10px;
}

.slider-control input[type="range"] {
  width: 100%;
  min-height: 36px;
  accent-color: var(--accent);
  cursor: pointer;
}

.slider-control input[type="range"]:focus-visible {
  outline: 3px solid rgba(var(--primary-green-rgb), 0.18);
  outline-offset: 3px;
}

.slider-control div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1.35;
}

.results {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  min-width: 0;
}

.result {
  min-width: 0;
  min-height: 104px;
  display: grid;
  align-content: center;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.82), rgba(248, 251, 253, 0.96)),
    var(--surface-tint);
  padding: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.055);
}

.result.primary {
  min-height: 138px;
  background:
    linear-gradient(135deg, rgba(var(--primary-green-rgb), 0.18), rgba(255, 255, 255, 0.9)),
    var(--accent-soft);
  border-color: rgba(var(--primary-green-rgb), 0.25);
}

.result span {
  color: var(--muted);
  font-size: 0.88rem;
  line-height: 1.35;
}

.result > span::after,
.summary-visual-card span::after {
  content: ":";
}

.result strong {
  display: block;
  max-width: 100%;
  min-width: 0;
  white-space: normal;
  overflow-wrap: anywhere;
  font-size: clamp(1.05rem, 2.1vw, 1.8rem);
  line-height: 1.1;
}

.result.primary strong {
  font-size: clamp(1.25rem, 2.7vw, 2.15rem);
}

.result.primary strong {
  color: var(--accent-dark);
}

.insight-box {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  border: 1px solid rgba(var(--primary-green-rgb), 0.18);
  border-left: 4px solid var(--accent);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(228, 245, 240, 0.72), rgba(255, 255, 255, 0.92)),
    #ffffff;
  padding: 14px 16px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.035);
}

.insight-box strong {
  color: var(--accent-dark);
  font-size: 0.92rem;
  line-height: 1.35;
}

.insight-box p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.65;
}

.health-suggestions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.health-suggestions article {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.035);
}

.health-suggestions strong {
  color: var(--accent-dark);
  font-size: 0.94rem;
  line-height: 1.35;
}

.health-suggestions p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.chart-section,
.table-section,
.scenario-section,
.formula-section {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  border-top: 1px solid var(--line);
  padding-top: 20px;
}

.scenario-section {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--small-shadow);
}

.chart-section {
  background:
    linear-gradient(135deg, rgba(var(--primary-green-rgb), 0.08), rgba(166, 106, 0, 0.05)),
    #ffffff;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--small-shadow);
}

.chart-section h2,
.table-section h2,
.scenario-section h2,
.formula-section h2,
.explanation h2 {
  margin: 0;
  font-size: 1.25rem;
  line-height: 1.25;
}

.chart-section p,
.table-section p,
.scenario-section p,
.formula-section p,
.explanation p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.7;
}

.scenario-form {
  display: grid;
  gap: 14px;
}

.scenario-form button {
  justify-self: start;
  min-height: 48px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #ffffff;
  padding: 0 20px;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(var(--primary-green-rgb), 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.scenario-form button:hover,
.scenario-form button:focus-visible {
  background: var(--accent-dark);
  box-shadow: 0 16px 28px rgba(var(--primary-green-rgb), 0.24);
  transform: translateY(-1px);
}

.scenario-form button:active {
  transform: translateY(1px);
}

.scenario-input-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.scenario-input-card {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-width: 0;
  margin: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--surface-tint));
  padding: 14px;
}

.scenario-input-card legend {
  grid-column: 1 / -1;
  padding: 0 6px;
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 700;
}

.scenario-input-card legend span {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 500;
}

.mini-field {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.mini-field label {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.3;
}

.mini-field input {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 10px 11px;
  color: var(--text);
  font: inherit;
  background: #ffffff;
}

.mini-field input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(var(--primary-green-rgb), 0.13);
  outline: none;
}

.scenario-results {
  display: grid;
  gap: 14px;
}

.scenario-card-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.scenario-card {
  display: grid;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-tint);
  padding: 16px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.055);
}

.scenario-card.best,
.comparison-table tr.best-row {
  background:
    linear-gradient(135deg, rgba(var(--primary-green-rgb), 0.14), rgba(255, 255, 255, 0.94)),
    #f5fbf8;
}

.scenario-card.best {
  border-color: rgba(var(--primary-green-rgb), 0.32);
}

.scenario-card-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 0.86rem;
}

.scenario-card strong {
  color: var(--accent-dark);
  font-size: clamp(1.12rem, 2vw, 1.55rem);
  line-height: 1.15;
  white-space: nowrap;
}

.scenario-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.scenario-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 0.88rem;
}

.scenario-card dd {
  margin: 0;
  color: var(--text);
  font-weight: 650;
  text-align: right;
}

.best-badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 700;
}

.formula-section {
  background: var(--surface-tint);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--small-shadow);
}

.formula-section sup {
  line-height: 0;
}

.formula-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.formula-grid div {
  display: grid;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.035);
}

.formula-grid strong {
  color: var(--accent-dark);
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
}

.formula-grid span,
.disclaimer {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.6;
}

.disclaimer {
  border-left: 4px solid var(--gold);
  background: var(--gold-soft);
  border-radius: 8px;
  padding: 12px 14px;
}

#growth-chart {
  width: 100%;
  height: auto;
  min-height: 280px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--surface-tint));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), var(--small-shadow);
}

.calculator-chart-section {
  grid-column: 1 / -1;
  display: grid;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(var(--primary-green-rgb), 0.06), rgba(166, 106, 0, 0.04)),
    #ffffff;
  padding: 18px;
  box-shadow: var(--small-shadow);
}

.calculator-chart-section h2 {
  margin: 0;
  font-size: 1.18rem;
  line-height: 1.25;
}

.calculator-chart-section p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

.calculator-chart-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.calculator-chart-card {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.035);
}

.calculator-chart-card strong {
  color: var(--text);
  font-size: 0.96rem;
  line-height: 1.35;
}

.mini-chart {
  width: 100%;
  height: auto;
  min-height: 220px;
  border: 1px solid rgba(216, 227, 224, 0.82);
  border-radius: 8px;
  background: linear-gradient(180deg, #ffffff, var(--surface-tint));
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--small-shadow);
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
  background: #ffffff;
}

th,
td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  text-align: right;
  white-space: nowrap;
}

th:first-child,
td:first-child {
  text-align: left;
}

th {
  background: #eef6f3;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover {
  background: var(--surface-tint);
}

.table-toggle {
  justify-self: end;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(var(--primary-green-rgb), 0.22);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--accent-dark);
  padding: 9px 14px;
  font: inherit;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.2;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.04);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.table-toggle:hover,
.table-toggle:focus-visible {
  border-color: rgba(var(--primary-green-rgb), 0.34);
  background: rgba(228, 245, 240, 0.78);
  transform: translateY(-1px);
}

.app-dashboard {
  min-height: 100vh;
  grid-template-columns: 280px minmax(0, 1fr);
  align-items: stretch;
  place-items: stretch;
  gap: 0;
  padding: 0;
  background:
    radial-gradient(circle at 20% 0%, rgba(var(--primary-green-rgb), 0.13), transparent 26%),
    linear-gradient(135deg, #f8fcfb 0%, var(--page-bg) 58%, #f8fafc 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.app-dashboard::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 39;
  background: rgba(6, 78, 59, 0.32);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.app-sidebar {
  height: 100vh;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(180deg, #073f36, #062f2a);
  color: #ffffff;
  padding: 28px 20px 20px;
  position: sticky;
  top: 0;
  overflow: hidden;
}

.topbar-logo {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.topbar-logo {
  width: 190px;
}

.topbar-logo img {
  display: block;
  width: 100%;
  height: auto;
}

.sidebar-nav {
  min-height: 0;
  display: grid;
  gap: 8px;
  align-content: start;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.34) transparent;
}

.sidebar-nav::-webkit-scrollbar {
  width: 6px;
}

.sidebar-nav::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar-nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.28);
}

.sidebar-nav::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.46);
}

.sidebar-section-label {
  margin: 14px 12px 4px;
  color: rgba(255, 255, 255, 0.44);
  font-size: 0.72rem;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sidebar-nav a,
.sidebar-nav button {
  min-height: 46px;
  display: flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 14px;
  background: transparent;
  color: rgba(255, 255, 255, 0.72);
  padding: 0 14px;
  font: inherit;
  font-size: 0.94rem;
  font-weight: 700;
  text-align: left;
  text-decoration: none;
}

.sidebar-nav a:hover,
.sidebar-nav a:focus-visible,
.sidebar-nav a.active,
.sidebar-nav button:hover,
.sidebar-nav button:focus-visible,
.sidebar-nav button.active {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.11);
  color: #ffffff;
}

.dashboard-shell {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 26px;
  padding: 24px clamp(22px, 3vw, 42px) 42px;
}

.dashboard-topbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  border: 1px solid rgba(216, 227, 224, 0.72);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.78);
  padding: 12px 16px;
  box-shadow: 0 18px 44px rgba(var(--heading-text-rgb), 0.08);
  backdrop-filter: blur(18px);
}

.sidebar-toggle {
  width: 44px;
  height: 44px;
  display: none;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(var(--heading-text-rgb), 0.12);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  padding: 0;
  box-shadow: 0 14px 28px rgba(var(--heading-text-rgb), 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.sidebar-toggle span {
  width: 17px;
  height: 1.8px;
  display: block;
  border-radius: 999px;
  background: #0b1117;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease;
}

.sidebar-toggle span + span {
  margin-top: 4.5px;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  border-color: rgba(var(--primary-green-rgb), 0.32);
  background: #ffffff;
  box-shadow: 0 18px 34px rgba(var(--heading-text-rgb), 0.16), 0 0 0 5px rgba(var(--primary-green-rgb), 0.08);
  transform: translateY(-1px);
}

.app-dashboard.sidebar-open .sidebar-toggle span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.app-dashboard.sidebar-open .sidebar-toggle span:nth-child(2) {
  opacity: 0;
}

.app-dashboard.sidebar-open .sidebar-toggle span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

.topbar-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.topbar-links a,
.topbar-links button {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 12px;
  background: transparent;
  color: var(--muted);
  padding: 0 12px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 750;
  text-decoration: none;
}

.topbar-links a:hover,
.topbar-links button:hover,
.topbar-links a:focus-visible,
.topbar-links button:focus-visible {
  border-color: var(--light-border);
  background: var(--soft-green);
  color: var(--accent-dark);
}

.theme-toggle {
  width: 44px;
  height: 44px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(var(--heading-text-rgb), 0.12);
  background: rgba(255, 255, 255, 0.92);
  color: #0b1117;
  padding: 0;
  box-shadow: 0 14px 28px rgba(var(--heading-text-rgb), 0.12), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.theme-toggle:hover,
.theme-toggle:focus-visible {
  border-color: rgba(var(--primary-green-rgb), 0.32);
  background: #ffffff;
  box-shadow: 0 18px 34px rgba(var(--heading-text-rgb), 0.16), 0 0 0 5px rgba(var(--primary-green-rgb), 0.08);
  transform: translateY(-1px);
}

.theme-toggle-icon {
  width: 20px;
  height: 20px;
  display: block;
  position: relative;
  border-radius: 50%;
  background: transparent;
  transition: transform 0.2s ease;
}

.theme-toggle-icon::before,
.theme-toggle-icon::after {
  content: "";
  position: absolute;
  display: block;
  transition: transform 0.2s ease, opacity 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.theme-toggle-icon::before {
  inset: 1px;
  border-radius: 50%;
  background: currentColor;
}

.theme-toggle-icon::after {
  width: 18px;
  height: 18px;
  top: -1px;
  right: -3px;
  border-radius: 50%;
  background: #ffffff;
}

:root[data-theme="dark"] .theme-toggle {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .theme-toggle-icon {
  transform: rotate(45deg);
}

:root[data-theme="dark"] .theme-toggle-icon::before {
  inset: 4px;
  background: currentColor;
  box-shadow:
    0 -9px 0 -3px currentColor,
    0 9px 0 -3px currentColor,
    9px 0 0 -3px currentColor,
    -9px 0 0 -3px currentColor,
    6px 6px 0 -4px currentColor,
    -6px -6px 0 -4px currentColor,
    6px -6px 0 -4px currentColor,
    -6px 6px 0 -4px currentColor;
}

:root[data-theme="dark"] .theme-toggle-icon::after {
  opacity: 0;
}

:root[data-theme="dark"] .sidebar-toggle {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  box-shadow: 0 16px 32px rgba(0, 0, 0, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

:root[data-theme="dark"] .sidebar-toggle span {
  background: #ffffff;
}

:root[data-theme="dark"] .theme-toggle:hover,
:root[data-theme="dark"] .theme-toggle:focus-visible,
:root[data-theme="dark"] .sidebar-toggle:hover,
:root[data-theme="dark"] .sidebar-toggle:focus-visible {
  border-color: rgba(var(--primary-green-rgb), 0.42);
  background: rgba(255, 255, 255, 0.16);
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28), 0 0 0 5px rgba(var(--primary-green-rgb), 0.12);
}

.app-dashboard > .dashboard-shell > .selector:not(.detail-header) {
  display: none;
}

.app-dashboard .calculator,
.app-dashboard .site-disclaimer,
.app-dashboard .explanation,
.app-dashboard .seo-content {
  width: min(100%, 1220px);
  justify-self: center;
}

.app-dashboard .calculator {
  border-radius: 16px;
  box-shadow: 0 24px 70px rgba(var(--heading-text-rgb), 0.09);
}

.app-dashboard .detail-header {
  border-radius: 16px;
  padding: clamp(22px, 3vw, 34px);
}

.app-dashboard .detail-topbar {
  display: none;
}

:root[data-theme="dark"] .app-dashboard {
  background:
    radial-gradient(circle at 20% 0%, rgba(var(--primary-green-rgb), 0.16), transparent 28%),
    linear-gradient(135deg, #061412 0%, var(--page-bg) 60%, #0b1816 100%);
}

:root[data-theme="dark"] .dashboard-topbar,
:root[data-theme="dark"] .selector,
:root[data-theme="dark"] .calculator,
:root[data-theme="dark"] .explanation,
:root[data-theme="dark"] .seo-content,
:root[data-theme="dark"] .site-disclaimer,
:root[data-theme="dark"] .form,
:root[data-theme="dark"] .result,
:root[data-theme="dark"] .summary-visual-card,
:root[data-theme="dark"] .content-card,
:root[data-theme="dark"] .faq-item,
:root[data-theme="dark"] .related-links a,
:root[data-theme="dark"] .trust-card,
:root[data-theme="dark"] .scenario-section,
:root[data-theme="dark"] .formula-section,
:root[data-theme="dark"] .calculator-chart-section,
:root[data-theme="dark"] .calculator-chart-card,
:root[data-theme="dark"] .table-wrap {
  background: rgba(13, 36, 33, 0.88);
  border-color: var(--line);
  color: var(--text);
}

:root[data-theme="dark"] .health-dashboard,
:root[data-theme="dark"] .health-dashboard .form,
:root[data-theme="dark"] .health-score-card {
  background:
    linear-gradient(145deg, rgba(var(--primary-green-rgb), 0.1), rgba(13, 36, 33, 0.96)),
    var(--surface);
}

:root[data-theme="dark"] .input-wrap,
:root[data-theme="dark"] .mini-field input,
:root[data-theme="dark"] .scenario-input-card,
:root[data-theme="dark"] .scenario-card,
:root[data-theme="dark"] .formula-grid div,
:root[data-theme="dark"] .health-suggestions article,
:root[data-theme="dark"] table {
  background: #0a1f1c;
  border-color: var(--line);
  color: var(--text);
}

:root[data-theme="dark"] th,
:root[data-theme="dark"] tbody tr:hover {
  background: #102b27;
}

:root[data-theme="dark"] .score-ring {
  background:
    radial-gradient(circle at center, #0a1f1c 0 58%, transparent 59%),
    conic-gradient(var(--accent) var(--score-percent), #243f3a 0);
}

:root[data-theme="dark"] .mini-donut {
  background:
    radial-gradient(circle at center, #0a1f1c 0 54%, transparent 56%),
    conic-gradient(var(--gold) var(--expense-percent), var(--accent) 0);
}

:root[data-theme="dark"] .runway-meter {
  background: #1d403a;
}

:root[data-theme="dark"] .primary-action,
:root[data-theme="dark"] .form button,
:root[data-theme="dark"] .scenario-form button,
:root[data-theme="dark"] .best-badge {
  color: #062f2a;
}

:root[data-theme="dark"] .intro h1,
:root[data-theme="dark"] .intro h2,
:root[data-theme="dark"] .app-dashboard .detail-hero h1,
:root[data-theme="dark"] .health-dashboard > .intro h2,
:root[data-theme="dark"] .health-dashboard .form-section h2 {
  color: var(--heading-text);
}

.app-dashboard .detail-hero {
  max-width: 860px;
}

.app-dashboard .detail-hero .eyebrow {
  color: var(--primary-green);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.app-dashboard .detail-hero h1 {
  color: var(--heading-text);
  font-size: clamp(2.25rem, 3.45vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
}

.app-dashboard .detail-hero p:last-child {
  color: var(--muted-text);
  font-size: 1.08rem;
  line-height: 1.7;
}

.health-dashboard {
  grid-template-columns: minmax(0, 1.45fr) minmax(340px, 0.95fr);
  gap: 22px;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(20px);
  padding: clamp(22px, 3vw, 34px);
}

.health-dashboard > .intro {
  grid-column: 1 / -1;
  max-width: 800px;
}

.health-dashboard > .intro h2 {
  color: var(--heading-text);
  font-size: clamp(2.25rem, 3.45vw, 3.25rem);
  font-weight: 700;
  line-height: 1.1;
}

.detail-header + .health-dashboard > .intro h2 {
  font-size: clamp(2.25rem, 2.7vw, 2.5rem);
  line-height: 1.18;
}

.health-dashboard > .intro p:last-child {
  color: var(--muted-text);
  font-size: 1.08rem;
  line-height: 1.7;
}

.health-dashboard .form {
  grid-column: 1;
  gap: 22px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(251, 254, 253, 0.92)),
    #ffffff;
  padding: 22px;
}

.health-dashboard .form-section {
  gap: 16px;
}

.health-dashboard .form-section h2 {
  color: var(--heading-text);
  font-size: 1.02rem;
  font-weight: 700;
  line-height: 1.2;
}

.health-dashboard .form-grid {
  gap: 16px;
}

.health-dashboard .field {
  gap: 10px;
}

.health-dashboard label {
  color: var(--heading);
  font-size: 0.92rem;
  font-weight: 760;
}

.health-dashboard .input-wrap {
  min-height: 62px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.health-dashboard .input-wrap span {
  color: var(--accent);
  font-weight: 850;
}

.health-dashboard input {
  font-size: 1.14rem;
  font-weight: 720;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.preset-chips button {
  min-height: 30px;
  border: 1px solid var(--light-border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 10px;
  font: inherit;
  font-size: 0.78rem;
  font-weight: 760;
}

.preset-chips button:hover,
.preset-chips button:focus-visible {
  border-color: var(--active-border);
  background: var(--soft-green);
  color: var(--accent-dark);
}

:root[data-theme="dark"] .preset-chips button {
  border-color: rgba(var(--primary-green-rgb), 0.34);
  background: rgba(var(--primary-green-rgb), 0.14);
  color: #e5f3f0;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
}

:root[data-theme="dark"] .preset-chips button:hover,
:root[data-theme="dark"] .preset-chips button:focus-visible {
  border-color: var(--active-border);
  background: rgba(var(--primary-green-rgb), 0.24);
  color: #ffffff;
}

.health-dashboard .results {
  grid-column: 2;
  align-self: start;
  gap: 16px;
}

.health-score-card {
  min-height: 260px;
  justify-items: center;
  text-align: center;
  border-color: rgba(var(--primary-green-rgb), 0.18);
  background:
    linear-gradient(145deg, rgba(var(--primary-green-rgb), 0.12), rgba(255, 255, 255, 0.96)),
    #ffffff;
}

.score-ring {
  width: 154px;
  height: 154px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #ffffff 0 58%, transparent 59%),
    conic-gradient(var(--accent) var(--score-percent), #e5ece9 0);
  box-shadow: inset 0 0 0 1px rgba(var(--primary-green-rgb), 0.08), 0 20px 38px rgba(var(--primary-green-rgb), 0.13);
}

.score-ring span {
  color: var(--heading);
  font-size: 2.5rem;
  font-weight: 900;
  line-height: 1;
}

.health-score-card[data-score-category="fair"] .score-ring,
.health-score-card[data-score-category="needs-attention"] .score-ring {
  background:
    radial-gradient(circle at center, #ffffff 0 58%, transparent 59%),
    conic-gradient(var(--gold) var(--score-percent), #e5ece9 0);
}

.health-dashboard .result.primary strong {
  color: var(--heading);
}

.summary-visual-card {
  min-height: 116px;
  display: flex;
  align-items: center;
  gap: 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.9);
  padding: 16px;
  box-shadow: var(--small-shadow);
}

.summary-visual-card span,
.summary-visual-card strong {
  display: block;
}

.summary-visual-card span {
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.35;
}

.summary-visual-card strong {
  margin-top: 4px;
  color: var(--heading);
  font-size: 1.12rem;
  line-height: 1.2;
}

.health-pending .summary-visual-card,
.health-pending .result-grid,
.health-pending + .table-section .table-wrap,
.health-pending + .table-section .health-suggestions {
  display: none;
}

.calculator-note,
.last-updated {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.65;
}

.calculator-note {
  border: 1px solid rgba(var(--primary-green-rgb), 0.14);
  border-radius: 8px;
  background: rgba(var(--soft-green-rgb), 0.46);
  padding: 12px 14px;
}

.site-footer-links {
  width: min(100%, 1220px);
  justify-self: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.72);
  padding: 14px;
}

.site-footer-links a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--accent-dark);
  padding: 8px 12px;
  font-size: 0.9rem;
  font-weight: 700;
  text-decoration: none;
}

.mini-donut {
  width: 72px;
  height: 72px;
  flex: 0 0 auto;
  border-radius: 50%;
  background:
    radial-gradient(circle at center, #ffffff 0 54%, transparent 56%),
    conic-gradient(var(--gold) var(--expense-percent), var(--accent) 0);
}

.runway-card {
  display: grid;
}

.runway-meter {
  width: 100%;
  height: 12px;
  overflow: hidden;
  border-radius: 999px;
  background: #e7efec;
}

.runway-meter span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), #10b981);
  transition: width 0.25s ease;
}

.health-dashboard .result-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.health-dashboard .result {
  min-height: 112px;
  border-radius: 16px;
}

.health-dashboard .table-section,
.health-dashboard .formula-section,
.health-dashboard .insight-box {
  grid-column: 1 / -1;
  border-radius: 16px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

.explanation {
  width: min(100%, 920px);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--small-shadow);
  padding: 22px 28px;
}

.site-disclaimer {
  width: min(100%, 920px);
  display: grid;
  gap: 8px;
  border: 1px solid rgba(var(--primary-green-rgb), 0.14);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(228, 245, 240, 0.72), rgba(255, 255, 255, 0.86)),
    #ffffff;
  color: var(--muted);
  padding: 18px 22px;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.055);
}

.site-disclaimer h2 {
  margin: 0;
  color: var(--accent-dark);
  font-size: 1rem;
  line-height: 1.3;
}

.site-disclaimer p {
  margin: 0;
  font-size: 0.92rem;
  line-height: 1.65;
}

.page-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.page-nav a,
.related-links a {
  color: var(--accent-dark);
  font-size: 0.92rem;
  font-weight: 600;
  text-decoration: none;
}

.page-nav a {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(var(--primary-green-rgb), 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.74);
  padding: 9px 11px;
}

.page-nav a:hover,
.related-links a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.related-chips a:hover,
.related-chips a:focus-visible {
  background: rgba(228, 245, 240, 0.78);
  color: var(--accent-dark);
  text-decoration: none;
}

.seo-content {
  width: min(100%, 920px);
  display: grid;
  gap: 16px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--small-shadow);
  padding: 24px 28px;
}

.seo-content h2,
.seo-content h3 {
  margin: 0;
  color: var(--text);
  line-height: 1.25;
}

.seo-content h2 {
  font-size: 1.35rem;
}

.seo-content h3 {
  font-size: 1.05rem;
}

.seo-content p,
.seo-content li {
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.7;
}

.seo-content p,
.seo-content ul,
.seo-content ol {
  margin: 0;
}

.seo-content ul,
.seo-content ol {
  padding-left: 20px;
}

.content-grid,
.related-links {
  display: grid;
  gap: 12px;
}

.content-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.content-card,
.faq-item {
  display: grid;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  padding: 14px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.035);
}

.related-links {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.related-links a {
  border: 1px solid rgba(216, 227, 224, 0.9);
  border-radius: 8px;
  background: #ffffff;
  padding: 12px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.035);
}

@media (max-width: 820px) {
  .page {
    place-items: start center;
    gap: 18px;
    padding: 18px 12px;
  }

  .calculator {
    grid-template-columns: 1fr;
    gap: 20px;
    padding: 20px;
  }

  .selector {
    padding: 18px;
  }

  .site-header {
    align-items: flex-start;
    gap: 12px;
  }

  .detail-topbar {
    align-items: flex-start;
    gap: 12px;
  }

  .home-logo {
    width: 166px;
  }

  .page-logo {
    width: 160px;
  }

  .site-nav {
    gap: 5px;
  }

  .site-nav a,
  .site-nav button {
    min-height: 40px;
    padding: 8px 9px;
    font-size: 0.86rem;
  }

  .category-filter {
    gap: 6px;
  }

  .category-filter-tab {
    flex: 1 1 auto;
    min-height: 40px;
    padding: 8px 10px;
    font-size: 0.86rem;
  }

  .popular-grid,
  .tile-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-grid,
  .tile-grid.one-col {
    grid-template-columns: 1fr;
  }

  .health-feature-card {
    grid-template-columns: 1fr;
  }

  .health-feature-card small {
    grid-column: 1;
    grid-row: auto;
    justify-self: start;
  }

  .calculator-tile {
    min-height: 68px;
    padding: 11px 44px 11px 12px;
  }

  .calculator-tile strong {
    max-width: none;
  }

  .popular-tile {
    min-height: 76px;
    padding: 12px 50px 12px 12px;
  }

  .health-tile {
    min-height: 112px;
    padding-right: 72px;
  }

  .health-tile strong {
    max-width: 100%;
  }

  .trust-grid {
    grid-template-columns: 1fr;
  }

  .health-suggestions {
    grid-template-columns: 1fr;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .form button {
    min-height: 56px;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .chart-section,
  .table-section,
  .scenario-section,
  .formula-section {
    padding: 16px;
  }

  .scenario-input-grid,
  .scenario-card-grid {
    grid-template-columns: 1fr;
  }

  .calculator-chart-grid {
    grid-template-columns: 1fr;
  }

  .scenario-form button {
    width: 100%;
    justify-self: stretch;
  }

  .formula-grid {
    grid-template-columns: 1fr;
  }

  .content-grid,
  .related-links {
    grid-template-columns: 1fr;
  }

  .explanation {
    padding: 22px;
  }

  .seo-content {
    padding: 20px;
  }

  .site-disclaimer {
    padding: 18px;
  }

  .table-toggle {
    justify-self: stretch;
    width: 100%;
  }
}

@media (max-width: 420px) {
  .page {
    gap: 14px;
    padding: 12px 10px;
  }

  .selector,
  .calculator {
    padding: 14px;
  }

  .brand-lockup {
    padding: 6px;
  }

  .home-logo {
    width: 66px;
  }

  .page-logo {
    width: 58px;
  }

  .site-header,
  .detail-topbar {
    align-items: center;
  }

  .site-nav,
  .detail-nav {
    justify-content: flex-end;
    max-width: calc(100% - 70px);
  }

  .site-nav a,
  .site-nav button {
    min-height: 36px;
    padding: 7px 8px;
    font-size: 0.8rem;
  }

  .hero-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .primary-action,
  .secondary-action {
    width: 100%;
  }

  .category-filter {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-filter-tab {
    width: 100%;
    min-height: 38px;
    padding: 8px;
    font-size: 0.82rem;
  }

  .intro h1,
  .intro h2 {
    font-size: clamp(1.75rem, 8.8vw, 2rem);
    line-height: 1.18;
  }

  .detail-hero .eyebrow {
    margin-bottom: 12px;
  }

  .detail-hero h1 {
    font-size: clamp(2.125rem, 9vw, 2.375rem);
    line-height: 1.12;
  }

  .detail-hero p:last-child {
    margin-top: 12px;
  }

  .popular-grid,
  .category-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .calculator-category {
    padding: 0;
  }

  .category-heading h2 {
    font-size: 1.25rem;
  }

  .category-heading p {
    font-size: 0.9rem;
  }

  .tile-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .calculator-tile {
    min-height: 68px;
    padding: 11px 44px 11px 12px;
  }

  .calculator-tile::before {
    width: 30px;
    height: 30px;
    top: 10px;
    right: 10px;
  }

  .calculator-tile::after {
    width: 10px;
    height: 10px;
    top: 20px;
    right: 21px;
  }

  .calculator-tile span {
    font-size: 1.02rem;
  }

  .calculator-tile strong {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .popular-tile {
    min-height: 76px;
    padding: 12px 50px 12px 12px;
  }

  .popular-tile::before {
    width: 38px;
    height: 38px;
    top: 12px;
    right: 12px;
  }

  .popular-tile::after {
    width: 13px;
    height: 13px;
    top: 23px;
    right: 25px;
  }

  .popular-tile span {
    font-size: 1.08rem;
  }

  .popular-tile strong {
    font-size: 0.82rem;
    line-height: 1.35;
  }

  .health-tile {
    min-height: 128px;
    padding: 14px 58px 14px 14px;
  }

  .health-tile::before {
    width: 42px;
    height: 42px;
    top: 12px;
    right: 12px;
  }

  .health-tile::after {
    width: 13px;
    height: 13px;
    top: 24px;
    right: 27px;
  }

  .health-tile span {
    font-size: 1.4rem;
  }

  .health-tile strong,
  .health-tile small {
    font-size: 0.9rem;
  }

  .form {
    gap: 14px;
    padding: 14px;
  }

  .input-wrap {
    min-height: 52px;
    padding: 0 12px;
  }

  .form button {
    min-height: 54px;
  }

  .scenario-input-card {
    grid-template-columns: 1fr;
  }

  .result {
    min-height: 96px;
    padding: 14px;
  }

  .result strong,
  .result.primary strong {
    font-size: clamp(0.95rem, 4.7vw, 1.3rem);
  }

  .site-disclaimer {
    padding: 16px;
  }

  .seo-content {
    padding: 16px;
  }
}

@media (max-width: 980px) {
  .app-dashboard {
    grid-template-columns: 1fr;
  }

  .app-sidebar {
    width: min(82vw, 300px);
    height: 100dvh;
    min-height: 100dvh;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 40;
    padding-top: 82px;
    transform: translateX(-100%);
    transition: transform 0.22s ease;
    box-shadow: 24px 0 54px rgba(6, 78, 59, 0.22);
  }

  .app-dashboard.sidebar-open::before {
    opacity: 1;
    pointer-events: auto;
  }

  .app-dashboard.sidebar-open .app-sidebar {
    transform: translateX(0);
  }

  .dashboard-shell {
    padding: 14px;
  }

  .dashboard-topbar {
    border-radius: 14px;
  }

  .sidebar-toggle {
    display: inline-grid;
  }

  .topbar-logo {
    display: inline-flex;
  }

  .topbar-links {
    overflow-x: auto;
    justify-content: flex-start;
  }

  .health-dashboard {
    grid-template-columns: 1fr;
  }

  .health-dashboard .form,
  .health-dashboard .results {
    grid-column: 1;
  }

  .health-dashboard .results {
    position: static;
  }
}

@media (max-width: 640px) {
  .dashboard-topbar {
    align-items: center;
    gap: 12px;
  }

  .topbar-links {
    display: none;
  }

  .topbar-logo {
    width: 164px;
  }

  .theme-toggle {
    width: 38px;
    height: 38px;
  }

  .health-dashboard > .intro h2 {
    font-size: clamp(2.125rem, 9vw, 2.375rem);
    line-height: 1.12;
  }

  .detail-header + .health-dashboard > .intro h2 {
    font-size: clamp(1.75rem, 8vw, 2rem);
    line-height: 1.18;
  }

  .calculator:not(.health-dashboard) > .intro h2 {
    font-size: clamp(1.75rem, 8vw, 2rem);
    line-height: 1.18;
  }

  .health-dashboard > .intro p:last-child,
  .app-dashboard .detail-hero p:last-child {
    font-size: 1.0625rem;
  }

  .health-dashboard .form-grid,
  .health-dashboard .result-grid {
    grid-template-columns: 1fr;
  }

  .score-ring {
    width: 132px;
    height: 132px;
  }
}
