/* ── HDB Calculator SG ──
   Teal palette (#0D9488). Inter + system fonts. Responsive. No external dependencies.
   Favicon: favicon.ico, favicon.svg, favicon-16.png, favicon-32.png */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  --teal:       #0D9488;
  --teal-dark:  #0F766E;
  --teal-darker:#115E59;
  --teal-light: #CCFBF1;
  --teal-bg:    #F0FDFA;
  --ink:        #134E4A;
  --text:       #374151;
  --heading:    #111827;
  --muted:      #6B7280;
  --line:       #E5E7EB;
  --soft:       #F3F4F6;
  --soft-hover: #F9FAFB;
  --amber:      #B45309;
  --amber-bg:   #FFFBEB;
  --amber-text: #78350F;
  --green:      #047857;
  --green-bg:   #ECFDF5;
  --green-text: #065F46;
  --red:        #B91C1C;
  --red-bg:     #FEF2F2;
  --red-text:   #7F1D1D;
  --white:      #FFFFFF;
  --radius:     10px;
  --radius-sm:  8px;
  --shadow-sm:  0 1px 3px rgba(0,0,0,.06);
  --shadow-md:  0 4px 22px rgba(15,118,110,.08);
  --shadow-lg:  0 8px 32px rgba(15,118,110,.12);
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  font-family: 'Inter', system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 16px;
  color: var(--text);
  background: var(--white);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5 {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  letter-spacing: -.02em;
}

a { color: var(--teal-dark); text-decoration: none; }
a:hover { text-decoration: underline; }

img { max-width: 100%; height: auto; }

/* ── HEADER ── */
header.site {
  border-bottom: 1px solid var(--line);
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(6px);
  background: rgba(255,255,255,.96);
}

.nav-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  min-height: 80px;
  gap: 16px;
}

header.site .logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  margin-right: auto;
  flex-shrink: 0;
}

.logo-img {
  height: 110px;
  width: auto;
  max-width: 360px;
  display: block;
  object-fit: contain;
  transition: opacity .2s, transform .2s;
}
.logo:hover .logo-img {
  opacity: .82;
  transform: scale(1.03);
}
@media (max-width: 700px) {
  .logo-img { height: 60px; max-width: 200px; }
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text);
  padding: 4px 8px;
}

nav.main {
  display: flex;
  align-items: center;
  gap: 2px;
}

nav.main a {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
  transition: background .15s, color .15s;
}

nav.main a:hover,
nav.main a.active {
  background: var(--teal-light);
  color: var(--teal-darker);
  text-decoration: none;
}

nav.main a.active { font-weight: 700; }

@media (max-width: 700px) {
  .nav-toggle { display: block; }
  nav.main {
    display: none;
    position: absolute;
    top: 80px;
    left: 0;
    right: 0;
    background: var(--white);
    border-bottom: 1px solid var(--line);
    flex-direction: column;
    padding: 8px 0;
    box-shadow: var(--shadow-md);
  }
  nav.main.open { display: flex; }
  nav.main a { padding: 10px 20px; width: 100%; }
}

/* ── HERO ── */
.hero {
  background: var(--teal-bg);
  padding: 48px 20px 40px;
  text-align: center;
}

.hero-inner { max-width: 680px; margin: 0 auto; }
.hero h1 { font-size: 1.9rem; color: var(--heading); margin-bottom: 12px; line-height: 1.25; }
.hero p { font-size: 1.05rem; color: var(--text); line-height: 1.6; }
.hero .badges { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 18px; }
.badge { background: var(--white); border: 1px solid var(--teal-light); color: var(--teal-dark); font-size: .82rem; font-weight: 600; padding: 6px 14px; border-radius: 20px; box-shadow: 0 1px 4px rgba(0,0,0,.06); }

/* ── WRAP ── */
.wrap { max-width: 800px; margin: 0 auto; padding: 0 20px; }
.wrap-wide { max-width: 960px; margin: 0 auto; padding: 0 20px; }

/* ── CARDS ── */
.card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px 30px;
  box-shadow: var(--shadow-sm);
}

/* ── CALC CARD ── */
.calc-card { margin-top: 28px; }

/* ── FORM ── */
.section-label {
  font-weight: 700;
  color: var(--heading);
  font-size: 1rem;
  margin: 24px 0 14px;
}
.section-label:first-child { margin-top: 0; }

.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 600; font-size: .9rem; color: var(--text); margin-bottom: 4px; }

.input-prefix { display: flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--white); }
.input-prefix:focus-within { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-light); }
.input-prefix span { padding: 0 0 0 12px; color: var(--muted); font-size: 1rem; }
.input-prefix input { border: none; outline: none; font-size: 1rem; padding: 10px 12px 10px 6px; width: 100%; background: transparent; }

input[type="number"], input[type="email"], select {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  font-size: 1rem;
  width: 100%;
  outline: none;
  transition: border-color .2s;
  font-family: inherit;
  background: var(--white);
}
input:focus, select:focus { border-color: var(--teal); box-shadow: 0 0 0 2px var(--teal-light); }

select { cursor: pointer; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B7280' stroke-width='1.5' fill='none'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

.hint { font-size: .82rem; color: var(--muted); margin-top: 3px; }

.row { display: flex; gap: 14px; }
.row .field { flex: 1; }
@media (max-width: 500px) { .row { flex-direction: column; gap: 0; } }

.seg { display: inline-flex; border: 1px solid var(--line); border-radius: var(--radius-sm); overflow: hidden; }
.seg button { padding: 9px 18px; border: none; background: var(--white); font-size: .88rem; font-weight: 500; cursor: pointer; color: var(--text); transition: background .15s, color .15s; font-family: inherit; }
.seg button.active { background: var(--teal); color: var(--white); }
.seg button:not(:last-child) { border-right: 1px solid var(--line); }

.btn {
  background: var(--teal);
  color: var(--white);
  border: none;
  border-radius: var(--radius-sm);
  padding: 13px 28px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .2s;
  font-family: inherit;
  display: inline-block;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(13,148,136,.25);
}

.btn:hover {
  background: var(--teal-dark);
  text-decoration: none;
  transform: translateY(-1px) scale(1.015);
  box-shadow: 0 6px 18px rgba(13,148,136,.35);
}
.btn:active { transform: scale(.97); box-shadow: none; }

.result { margin-top: 20px; }

/* ── PROSE (article content) ── */
.prose { color: var(--text); font-size: 1rem; line-height: 1.75; }
.prose h2 { font-size: 1.45rem; color: var(--heading); margin: 36px 0 14px; line-height: 1.3; }
.prose h3 { font-size: 1.15rem; color: var(--heading); margin: 28px 0 10px; line-height: 1.3; }
.prose h4 { font-size: 1rem; color: var(--heading); margin: 22px 0 8px; }
.prose p { margin: 16px 0; }
.prose ul, .prose ol { margin: 12px 0; padding-left: 24px; }
.prose li { margin: 6px 0; }

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  font-size: .9rem;
  line-height: 1.5;
  display: block;
  overflow-x: auto;
}
@media (min-width: 640px) { .prose table { display: table; } }
.prose th, .prose td {
  border: 1px solid var(--line);
  padding: 10px 14px;
  text-align: left;
  vertical-align: top;
}
.prose th {
  background: var(--teal-bg);
  color: var(--teal-darker);
  font-weight: 700;
  white-space: nowrap;
}
.prose tr:nth-child(even) { background: var(--soft); }

.prose blockquote {
  border-left: 4px solid var(--teal);
  background: var(--teal-bg);
  margin: 20px 0;
  padding: 14px 18px;
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink);
  font-size: .95rem;
  line-height: 1.6;
}
.prose blockquote p { margin: 4px 0; }

.prose code {
  background: var(--soft);
  padding: 2px 6px;
  border-radius: 4px;
  font-size: .88em;
  font-family: ui-monospace, 'SF Mono', monospace;
  color: var(--teal-darker);
}

.prose img { max-width: 100%; height: auto; border-radius: var(--radius); margin: 16px 0; }
.prose hr { border: none; border-top: 2px solid var(--line); margin: 32px 0; }

.prose details.faq summary { cursor: pointer; font-weight: 600; padding: 8px 0; }
.prose .table-scroll { overflow-x: auto; margin: 16px 0; }

.callout {
  background: var(--teal-bg);
  border: 1px solid var(--teal-light);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 22px 0;
  font-size: .95rem;
  line-height: 1.6;
}
.callout strong { color: var(--teal-dark); }

/* ── TOC ── */
.toc {
  background: var(--soft);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 24px 0;
  font-size: .9rem;
}
.toc strong { display: block; margin-bottom: 8px; color: var(--heading); }
.toc a { display: block; padding: 3px 0; }
.toc a::before { content: "→ "; opacity: .5; }

/* ── GUIDES CARD GRID ── */
.guides-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin: 24px 0;
}
@media (max-width: 660px) { .guides-grid { grid-template-columns: 1fr; } }

.guide-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px 20px;
  display: flex;
  flex-direction: column;
  transition: box-shadow .2s, border-color .2s;
  text-decoration: none;
  color: var(--text);
  background: var(--white);
}
.guide-card:hover { box-shadow: var(--shadow-md); border-color: var(--teal-light); text-decoration: none; }

.guide-card .guide-tag {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 10px;
  border-radius: 12px;
  margin-bottom: 10px;
  width: fit-content;
}
.guide-card .guide-tag.t-loan { background: #E0F2FE; color: #0369A1; }
.guide-card .guide-tag.t-bto { background: #FEF3C7; color: #92400E; }
.guide-card .guide-tag.t-cpf { background: #CCFBF1; color: #0F766E; }
.guide-card .guide-tag.t-levy { background: #FEE2E2; color: #991B1B; }
.guide-card .guide-tag.t-grant { background: #EDE9FE; color: #6D28D9; }
.guide-card .guide-tag.t-guide { background: #FCE7F3; color: #9D174D; }

.guide-card h3 {
  font-size: 1.05rem;
  color: var(--heading);
  margin-bottom: 6px;
  line-height: 1.3;
}
.guide-card p {
  font-size: .88rem;
  color: var(--text);
  line-height: 1.5;
  margin-bottom: auto;
}
.guide-card .guide-meta {
  font-size: .82rem;
  color: var(--muted);
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.guide-card .guide-link {
  margin-top: 12px;
  font-weight: 700;
  font-size: .88rem;
  color: var(--teal-dark);
}

/* ── GUIDE FILTERS ── */
.guide-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 20px 0;
}
.guide-filter {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
  color: var(--text);
}
.guide-filter:hover { border-color: var(--teal-light); background: var(--teal-bg); }
.guide-filter.active { background: var(--teal); color: var(--white); border-color: var(--teal); }

/* ── BREADCRUMB ── */
.breadcrumb {
  font-size: .85rem;
  color: var(--muted);
  margin: 16px 0;
}
.breadcrumb a { color: var(--muted); }
.breadcrumb a:hover { color: var(--teal-dark); }
.breadcrumb span { color: var(--muted); }

/* ── ARTICLE META ── */
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: .85rem;
  color: var(--muted);
  margin: 8px 0 16px;
  align-items: center;
}
.article-meta .article-tag {
  display: inline-block;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  padding: 2px 10px;
  border-radius: 12px;
  background: var(--teal-light);
  color: var(--teal-darker);
}

/* ── FOOTER ── */
footer.site {
  background: #0F172A;
  margin-top: 64px;
  padding: 56px 24px 0;
}

.foot-inner {
  max-width: 1000px;
  margin: 0 auto;
}

.foot-grid {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 40px;
  align-items: start;
  margin-bottom: 40px;
}

@media (max-width: 860px) {
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
}

@media (max-width: 480px) {
  .foot-grid { grid-template-columns: 1fr; gap: 24px; }
}

.foot-col h4 {
  font-size: .75rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #94A3B8;
  margin-bottom: 16px;
  font-weight: 700;
}

.foot-col p {
  font-size: .85rem;
  color: #64748B;
  line-height: 1.7;
  margin-bottom: 0;
}

.foot-col a {
  display: block;
  font-size: .875rem;
  color: #CBD5E1;
  padding: 5px 0;
  transition: color .15s;
  text-decoration: none;
}
.foot-col a:hover { color: #5EEAD4; }

.foot-copy {
  font-size: .8rem;
  color: #475569;
  text-align: center;
  border-top: 1px solid #1E293B;
  padding: 20px 0;
  margin-top: 8px;
}

.foot-copy a { color: #475569; text-decoration: none; }
.foot-copy a:hover { color: #5EEAD4; }

.foot-disclaimer {
  font-size: .75rem;
  color: #334155;
  line-height: 1.6;
  text-align: center;
  border-top: 1px solid #1E293B;
  padding: 16px 0 32px;
  margin-top: 0;
}

/* ── CALCULATOR RESULT ── */
.headline {
  background: var(--teal-bg);
  border: 1px solid var(--teal-light);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin: 20px 0 24px;
  text-align: center;
}
.headline .num {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--teal-darker);
  line-height: 1.2;
  letter-spacing: -.02em;
}
.headline .lbl {
  font-size: .875rem;
  color: var(--muted);
  margin-top: 4px;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}
@media (max-width: 500px) { .stat-grid { grid-template-columns: 1fr; } }

.stat {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.stat .stat-icon { font-size: 1rem; margin-bottom: 2px; }
.stat .k {
  font-size: .8rem;
  color: var(--muted);
  line-height: 1.35;
  order: 1;
}
.stat .v {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--heading);
  letter-spacing: -.01em;
  order: 2;
}

.note {
  background: var(--teal-bg);
  border-left: 3px solid var(--teal);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  margin: 14px 0;
  font-size: .9rem;
  line-height: 1.55;
  color: var(--ink);
}
.note.bad {
  background: var(--red-bg);
  border-color: var(--red);
  color: var(--red-text);
}

.breakdown {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin: 12px 0;
  font-size: .9rem;
}
.breakdown > div {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 11px 16px;
  border-bottom: 1px solid var(--line);
}
.breakdown > div:last-child { border-bottom: none; }
.breakdown > div:nth-child(even) { background: var(--soft); }
.breakdown > div > span:first-child {
  color: var(--text);
  flex: 1;
}
.breakdown > div > span:last-child {
  font-weight: 600;
  color: var(--heading);
  white-space: nowrap;
  text-align: right;
  min-width: 90px;
}
.breakdown .minus { color: var(--red); }
.breakdown .total {
  background: var(--teal-bg);
  border-top: 2px solid var(--teal-light);
}
.breakdown .total span { font-weight: 700; color: var(--teal-darker); }

/* ── DATA TABLE ── */
.table-scroll { overflow-x: auto; margin: 16px 0; }
table.data { width: 100%; border-collapse: collapse; font-size: .9rem; }
table.data th, table.data td { border: 1px solid var(--line); padding: 10px 14px; text-align: left; }
table.data th { background: var(--teal-bg); color: var(--teal-darker); font-weight: 700; white-space: nowrap; }
table.data tr:nth-child(even) { background: var(--soft); }

/* ── FAQ ── */
.faq {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 10px 0;
  transition: border-color .15s, box-shadow .15s, background .15s;
}
.faq:hover {
  border-color: var(--teal-light);
  background: var(--teal-bg);
  box-shadow: 0 2px 10px rgba(13,148,136,.08);
}
.faq[open] {
  background: var(--teal-bg);
  border-color: var(--teal-light);
}
.faq summary {
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: '+';
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--teal);
  flex-shrink: 0;
  transition: transform .2s;
}
.faq[open] summary::after {
  content: '−';
}
.faq p { margin-top: 10px; font-size: .92rem; line-height: 1.65; color: var(--text); }

/* ── UTILITY ── */
.hidden { display: none; }

/* ── TOOLS GRID (legacy) ── */
.tools-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .tools-grid { grid-template-columns: 1fr; } }
.tool-link {
  border: 1px solid var(--line); border-radius: var(--radius); padding: 22px;
  text-decoration: none; color: var(--text); transition: box-shadow .2s, border-color .2s;
}
.tool-link:hover { box-shadow: var(--shadow-md); border-color: var(--teal-light); text-decoration: none; }
.tool-link h3 { font-size: 1rem; color: var(--heading); margin-bottom: 4px; }
.tool-link p { font-size: .85rem; color: var(--text); line-height: 1.5; }

/* ── PROCESS TIMELINE INFOGRAPHIC ── */
.process-timeline {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  margin: 24px 0 28px;
  position: relative;
  align-items: stretch;
}
.process-timeline::before {
  content: '';
  position: absolute;
  top: 28px;
  left: calc(10% + 14px);
  right: calc(10% + 14px);
  height: 2px;
  background: var(--teal-light);
  z-index: 0;
}
@media (max-width: 700px) {
  .process-timeline { grid-template-columns: 1fr; }
  .process-timeline::before { display: none; }
}
.pt-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 1;
}
.pt-dot {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--teal);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin-bottom: 10px;
  box-shadow: 0 2px 8px rgba(13,148,136,.3);
  border: 3px solid #fff;
  outline: 2px solid var(--teal-light);
}
.pt-dot.pt-last { background: var(--teal-darker); }
.pt-body {
  background: var(--white);
  border: 1px solid var(--teal-light);
  border-top: 3px solid var(--teal);
  border-radius: var(--radius-sm);
  padding: 12px 10px 10px;
  width: 100%;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.pt-title {
  font-weight: 700;
  color: var(--heading);
  font-size: .85rem;
  margin-bottom: 5px;
  line-height: 1.3;
}
.pt-desc {
  font-size: .78rem;
  color: var(--text);
  line-height: 1.5;
  flex: 1;
}
.pt-duration {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: .7rem;
  font-weight: 600;
  color: var(--teal-dark);
  background: var(--teal-bg);
  border: 1px solid var(--teal-light);
  border-radius: 6px;
  padding: 0 8px;
  margin-top: 8px;
  width: 100%;
  height: 28px;
  min-height: 28px;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
@media (max-width: 700px) {
  .pt-step { flex-direction: row; align-items: flex-start; text-align: left; gap: 14px; }
  .pt-body { padding: 12px 14px; }
  .pt-dot { margin-bottom: 0; flex-shrink: 0; }
  .pt-duration { align-self: flex-start; }
}

/* ── STAT ICON ── */
.stat-icon {
  font-size: 1.1rem;
  margin-bottom: 4px;
  display: block;
}

/* ── FOCUS STYLES (ARIA) ── */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}

/* ── CHART ── */
.chart-wrap {
  margin: 20px 0;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
}
.chart-title {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}
.chart-inner {
  display: flex;
  align-items: center;
  gap: 32px;
  flex-wrap: wrap;
}
.chart-canvas-wrap {
  width: 160px;
  height: 160px;
  flex-shrink: 0;
}
.chart-legend {
  flex: 1;
  min-width: 160px;
}
.chart-legend-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: .875rem;
}
.chart-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  flex-shrink: 0;
}
.chart-legend-label { color: var(--text); }
.chart-legend-val { margin-left: auto; font-weight: 700; color: var(--heading); }

/* ── RELATED TOOLS CTA ── */
.related-tools {
  background: var(--teal-bg);
  border: 1px solid var(--teal-light);
  border-radius: var(--radius);
  padding: 24px 28px;
  margin: 36px 0 8px;
}
.related-tools h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--teal-darker);
  margin-bottom: 14px;
}
.related-tools .tool-btns {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.related-tools .tool-btns a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--teal);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  padding: 9px 18px;
  border-radius: var(--radius-sm);
  text-decoration: none;
  transition: background .15s, transform .12s, box-shadow .15s;
  box-shadow: 0 2px 6px rgba(13,148,136,.2);
}
.related-tools .tool-btns a:hover {
  background: var(--teal-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(13,148,136,.3);
  text-decoration: none;
}
.related-tools .tool-btns a.secondary {
  background: var(--white);
  color: var(--teal-dark);
  border: 1px solid var(--teal-light);
  box-shadow: none;
}
.related-tools .tool-btns a.secondary:hover {
  background: var(--teal-light);
  color: var(--teal-darker);
}

/* ── RESULT FADE-IN ── */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
.result-visible {
  animation: fadeInUp .35s ease both;
}

/* ── FINANCIAL HEALTH METER ── */
.health-box {
  background: var(--soft);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin: 20px 0;
}
.health-box .health-title {
  font-size: .8rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 12px;
}
.health-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
  font-size: .88rem;
}
.health-row:last-child { margin-bottom: 0; }
.health-label { width: 120px; flex-shrink: 0; color: var(--text); font-weight: 500; }
.health-track {
  flex: 1;
  height: 8px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.health-fill {
  height: 100%;
  border-radius: 4px;
  transition: width .5s ease;
}
.health-fill.ok   { background: #10B981; }
.health-fill.warn { background: #F59E0B; }
.health-fill.over { background: #EF4444; }
.health-pct { width: 60px; text-align: right; font-weight: 700; font-size: .85rem; }
.health-pct.ok   { color: #059669; }
.health-pct.warn { color: #D97706; }
.health-pct.over { color: #DC2626; }
.health-verdict {
  margin-top: 12px;
  font-size: .85rem;
  padding: 8px 12px;
  border-radius: 6px;
  font-weight: 500;
}
.health-verdict.ok   { background: #ECFDF5; color: #065F46; }
.health-verdict.warn { background: #FFFBEB; color: #78350F; }
.health-verdict.over { background: #FEF2F2; color: #7F1D1D; }

/* ── TL;DR KEY TAKEAWAYS ── */
.tldr {
  background: var(--teal-bg);
  border: 1px solid var(--teal-light);
  border-left: 4px solid var(--teal);
  border-radius: var(--radius);
  padding: 20px 24px 16px;
  margin: 0 0 28px;
}
.tldr-title {
  font-size: .85rem;
  font-weight: 700;
  color: var(--teal-darker);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.tldr ul {
  margin: 0;
  padding: 0;
  list-style: none;
}
.tldr ul li {
  font-size: .925rem;
  color: var(--ink);
  line-height: 1.6;
  margin-bottom: 7px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}
.tldr ul li::before {
  content: "✓";
  color: var(--teal);
  font-weight: 700;
  flex-shrink: 0;
  margin-top: 1px;
}

/* ── TOOLTIPS ── */
.tip { display:inline-flex;align-items:center;justify-content:center;width:16px;height:16px;border-radius:50%;background:var(--line);color:var(--muted);font-size:.7rem;font-weight:700;cursor:help;margin-left:4px;position:relative; }
.tip:hover { background:var(--teal);color:#fff; }
.tip .tip-text { display:none;position:absolute;bottom:calc(100% + 6px);left:50%;transform:translateX(-50%);background:var(--heading);color:#fff;font-size:.75rem;padding:6px 10px;border-radius:6px;white-space:nowrap;z-index:10;font-weight:400; }
.tip:hover .tip-text { display:block; }