/* app.css — calculator app pages (and thank-you page) */
:root { --cyan-ink: #007f9b; --pos: #0f7a4f; --neg: #b0354a; --tint: #f0f5f8 }

/* slim header on tool pages */
.app-bar { background: var(--navy); color: #fff; position: sticky; top: 0; z-index: 50 }
.app-bar__in { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; min-height: 60px }
.app-bar a { color: #dbe5f0; text-decoration: none; font-weight: 600; font-size: .9rem }
.app-bar a:hover { color: #fff }
.app-bar__back { display: inline-flex; align-items: center; gap: .4rem }
.app-bar .brand { justify-self: center; gap: .55rem }
.app-bar .brand img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; object-position: 50% 20% }
.app-bar .brand strong { font: 700 .98rem var(--sans); color: #fff }
.app-bar__talk { justify-self: end }

/* hero */
.app-hero { text-align: center; padding: clamp(28px, 5vw, 52px) 0 18px }
.app-hero .eyebrow { color: var(--cyan-ink); margin-bottom: .6rem }
.app-hero h1 { font-size: clamp(1.9rem, 1.2rem + 2.6vw, 2.9rem); font-weight: 700; letter-spacing: -.02em; margin: 0 0 .3rem }
.app-hero__sub { font-size: 1.12rem; color: var(--navy-2); margin: 0 0 .8rem; font-weight: 500 }
.app-hero__desc { max-width: 60ch; margin: 0 auto 1.4rem; color: var(--muted) }
.switches { display: flex; flex-direction: column; align-items: center; gap: .7rem }
.seg { display: inline-flex; background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: 4px; gap: 2px }
.seg button { border: 0; background: none; border-radius: 999px; padding: .5rem 1rem; font: 600 .86rem var(--sans); color: var(--muted); cursor: pointer; min-height: 38px }
.seg button[aria-pressed=true] { background: var(--navy); color: #fff }
.seg--quiet { background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 0 }
.seg--quiet button { border-radius: 0; text-transform: uppercase; letter-spacing: .1em; font-size: .74rem; padding: .5rem .9rem }
.seg--quiet button[aria-pressed=true] { background: none; color: var(--navy); box-shadow: inset 0 -2px 0 var(--navy) }
.mode-line { font-size: .86rem; color: var(--muted); margin: .2rem 0 0 }

/* two-column app */
.app { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 24px; align-items: start; padding: 18px 0 8px; border-top: 1px solid var(--line); margin-top: 22px }
.inputs { position: sticky; top: 76px; max-height: calc(100vh - 92px); overflow-y: auto; display: grid; gap: 14px; padding: 4px 4px 12px 0; scrollbar-width: thin }
.in-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 16px 16px 6px; box-shadow: var(--shadow) }
.in-card > h2 { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; color: var(--muted); margin: 0 0 12px; font-weight: 700 }
.in-card .field { margin-bottom: 14px }
.in-card label { display: flex; align-items: center; gap: .4rem; font-size: .84rem }
.in-card .row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }
.hint, .live { display: block; font-size: .78rem; color: var(--muted); margin-top: 5px; line-height: 1.4 }
.live b { color: var(--ink); font-weight: 600 }
[data-detail] { display: none }
.is-detailed [data-detail] { display: block }
.is-detailed .in-card[data-detail] { display: block }
.detail-note { font-size: .82rem; color: var(--muted); text-align: center; margin: 0 }
.detail-note button { border: 0; background: none; color: var(--cyan-ink); font: inherit; font-weight: 600; text-decoration: underline; cursor: pointer; padding: 0 }
.in-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 0 4px }
.linkbtn { border: 0; background: none; color: var(--cyan-ink); font: 600 .84rem var(--sans); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px 0 }
.help { width: 20px; height: 20px; min-height: 20px; border-radius: 50%; border: 1px solid #c5cfda; background: #fff; font: 700 .7rem var(--sans); color: var(--muted); cursor: pointer; padding: 0; display: inline-grid; place-items: center; flex: none }
.helpbox { display: none; font-size: .8rem; line-height: 1.45; color: #33475c; background: var(--tint); border-radius: 10px; padding: .6rem .75rem; margin-top: 6px; font-weight: 400 }
.helpbox.is-open { display: block }
.helpbox a { color: var(--cyan-ink); font-weight: 600 }
input.money-in { font-variant-numeric: tabular-nums }

/* sliders */
.range { -webkit-appearance: none; appearance: none; width: 100%; height: 22px; min-height: 22px; padding: 0; border: 0; background: transparent; margin-top: 6px; box-shadow: none !important }
.range::-webkit-slider-runnable-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--navy) var(--pc, 50%), #d9e1e7 var(--pc, 50%)) }
.range::-moz-range-track { height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--navy) var(--pc, 50%), #d9e1e7 var(--pc, 50%)) }
.range::-webkit-slider-thumb { -webkit-appearance: none; width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 2px solid var(--navy); margin-top: -7px; cursor: pointer }
.range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%; background: #fff; border: 2px solid var(--navy); cursor: pointer }

/* results */
.results { display: grid; gap: 16px; min-width: 0 }
.q { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: clamp(18px, 2.4vw, 26px); box-shadow: var(--shadow) }
.q__head { display: flex; align-items: center; gap: .7rem; margin-bottom: .6rem }
.q__num { width: 30px; height: 30px; border-radius: 50%; background: var(--tint); color: var(--navy); font-weight: 700; display: grid; place-items: center; flex: none; font-size: .9rem }
.q__head h2 { margin: 0; font-size: clamp(1.2rem, 1rem + .8vw, 1.5rem); flex: 1 }
.badge { display: inline-flex; align-items: center; gap: .4rem; font-size: .76rem; font-weight: 700; padding: .25rem .65rem; border-radius: 999px; background: #e6f4ee; color: var(--pos) }
.badge::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor }
.badge.is-neg { background: #fbe9ec; color: var(--neg) }
.badge.is-warn { background: #fff4e0; color: #8a5a12 }
.q__answer { font-size: clamp(1.25rem, 1.05rem + .9vw, 1.65rem); line-height: 1.25; color: var(--navy); margin: .6rem 0 .4rem; font-weight: 500 }
.q__answer b { color: var(--cyan-ink); font-weight: 700 }
.q__answer b.neg { color: var(--neg) }
.q__sub { font-size: .9rem; color: var(--muted); margin: 0 0 1rem }
.q__label { font-size: .7rem; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 .6rem }
.q__big { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); font-weight: 700; color: var(--navy); letter-spacing: -.02em; line-height: 1.05; margin: .1rem 0 .3rem; font-variant-numeric: tabular-nums }
.q__note { font-size: .88rem; margin: .8rem 0 0; color: #33475c }
.q__note.pos { color: var(--pos) } .q__note.neg { color: var(--neg) }
.q__compare { background: var(--tint); border-radius: 12px; padding: .8rem 1rem; font-size: .88rem; margin-top: 1rem; color: #33475c }
.q__compare label { display: inline; font-weight: 600 }
.q__compare input { display: inline-block; width: 70px; min-height: 32px; padding: .2rem .4rem; margin: 0 .3rem; font-size: .88rem }
.q .help-inline { margin-left: auto }

.donut-wrap { display: grid; grid-template-columns: 170px 1fr; gap: 20px; align-items: center }
.donut svg { width: 100%; height: auto; display: block }
.donut .d-l { font: 600 9px var(--sans); fill: var(--muted) }
.donut .d-v { font: 700 15px var(--sans); fill: var(--navy) }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 7px; font-size: .86rem }
.legend li { display: grid; grid-template-columns: 12px 1fr auto; gap: 9px; align-items: center }
.legend i { width: 12px; height: 12px; border-radius: 3px }
.legend b { font-weight: 600; font-variant-numeric: tabular-nums; text-align: right }
.legend small { color: var(--muted); font-weight: 400; margin-left: 4px }
.legend li.is-total { border-top: 1px solid var(--line); padding-top: 7px; font-weight: 700 }

.bars { display: grid; gap: 10px }
.bar { display: grid; grid-template-columns: 150px 1fr 90px; gap: 12px; align-items: center; font-size: .86rem }
.bar__t { height: 12px; background: #edf1f4; border-radius: 6px; overflow: hidden }
.bar__t span { display: block; height: 100%; background: #9fb3c4; border-radius: 6px }
.bar.is-key .bar__t span { background: var(--navy) }
.bar.is-cyan .bar__t span { background: var(--cyan-ink) }
.bar.is-neg .bar__t span { background: var(--neg) }
.bar b { text-align: right; font-variant-numeric: tabular-nums }

.cols-chart { display: flex; align-items: flex-end; gap: 6px; height: 170px; padding-top: 22px; border-bottom: 1px solid var(--line) }
.col { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; align-items: center; height: 100%; position: relative; min-width: 0 }
.col span { width: 100%; max-width: 40px; background: #9fb3c4; border-radius: 4px 4px 0 0; min-height: 2px }
.col.is-mark span { background: var(--navy) }
.col.is-neg span { background: var(--neg) }
.col b { font-size: .66rem; font-weight: 600; color: var(--muted); margin-bottom: 3px; white-space: nowrap }
.col small { position: absolute; bottom: -20px; font-size: .68rem; color: var(--muted) }
.cols-foot { height: 20px }

.multi { display: grid; grid-template-columns: 1fr auto; gap: 20px; align-items: center }
.multi__x { text-align: center; min-width: 110px }
.multi__x b { display: block; font-size: 2.6rem; font-weight: 600; color: var(--cyan-ink); line-height: 1; letter-spacing: -.03em }
.multi__x small { font-size: .7rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted) }

.warnings { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px }
.warnings li { background: #fff4e0; color: #7a4d0c; border-radius: 10px; padding: .6rem .8rem; font-size: .86rem }
.warnings:empty { display: none }

/* adviser card */
.adviser { background: var(--navy); color: #fff; border-radius: 18px; padding: clamp(20px, 3vw, 30px) }
.adviser .eyebrow { color: var(--gold) }
.adviser h2 { color: #fff; font-size: clamp(1.4rem, 1.1rem + 1.2vw, 1.9rem); font-weight: 600; margin: 0 0 .5rem }
.adviser p { color: rgba(255, 255, 255, .8); max-width: 58ch }
.adviser__actions { display: flex; flex-wrap: wrap; gap: .7rem; margin: 1rem 0 .4rem }
.adviser__actions .btn-ghost { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .35) }
.adviser__filled { font-size: .84rem; color: rgba(255, 255, 255, .7) !important; margin: 0 }
.adviser__who { display: flex; gap: 14px; align-items: center; border-top: 1px solid rgba(255, 255, 255, .14); margin-top: 1.2rem; padding-top: 1.2rem }
.adviser__who img { width: 64px; height: 64px; border-radius: 50%; object-fit: cover; object-position: 50% 20%; border: 2px solid rgba(255, 255, 255, .3); flex: none }
.adviser__who b { display: block; letter-spacing: .1em; text-transform: uppercase; font-size: .82rem }
.adviser__who span { display: block; font-size: .84rem; color: rgba(255, 255, 255, .72) }
.adviser__quote { font-size: 1.05rem; margin: 1rem 0 .4rem !important; color: #fff !important }
.adviser__fallback { font-size: .78rem; color: rgba(255, 255, 255, .6) !important; margin: 0 }
.adviser__fallback a { color: #fff }

/* extra tools */
.more { background: #fff; border: 1px solid var(--line); border-radius: 18px; padding: 0 clamp(16px, 2.4vw, 24px); box-shadow: var(--shadow) }
.more > details { border-bottom: 1px solid var(--line) }
.more > details:last-child { border-bottom: 0 }
.more summary { list-style: none; cursor: pointer; padding: 18px 0; font-weight: 700; color: var(--navy); display: flex; justify-content: space-between; align-items: center }
.more summary::-webkit-details-marker { display: none }
.more summary::after { content: "+"; font-size: 1.3rem; color: var(--cyan-ink); font-weight: 400 }
.more details[open] summary::after { content: "\2212" }
.more .inner { padding: 0 0 20px }
.cmp-actions { display: flex; flex-wrap: wrap; gap: .5rem; margin-bottom: 1rem }
.tbl { width: 100%; border-collapse: collapse; font-size: .88rem; font-variant-numeric: tabular-nums }
.tbl th, .tbl td { padding: .55rem .4rem; border-bottom: 1px solid var(--line); text-align: left; font-weight: 400 }
.tbl td { text-align: right }
.tbl tr.total th, .tbl tr.total td { font-weight: 700; color: var(--navy); border-top: 1.5px solid var(--navy) }
.tbl--cmp th:not(:first-child), .tbl--cmp td { text-align: right }
.tbl--grid th, .tbl--grid td { text-align: right; white-space: nowrap }
.tbl--grid th:first-child, .tbl--grid td:first-child { text-align: left }
.tbl--grid thead th { font-size: .74rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); border-bottom: 1.5px solid var(--navy) }
.scroll-x { overflow-x: auto }
.sub-h { font-size: .95rem; margin: 1.2rem 0 .5rem; color: var(--navy) }
.res-actions { display: flex; flex-wrap: wrap; gap: .6rem }

/* explain */
.explain { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; padding: 28px 0 8px }
.explain h2 { font-size: 1.05rem; margin-bottom: .6rem }
.explain ul { margin: 0; padding-left: 1.1rem; font-size: .88rem; color: #33475c; display: grid; gap: .45rem }
.disclaimer { text-align: center; font-size: .8rem; color: var(--muted); padding: 10px 0 0; max-width: 70ch; margin: 0 auto }

/* mobile sticky bar */
.result-bar { position: fixed; left: 12px; right: 84px; bottom: max(12px, env(safe-area-inset-bottom)); z-index: 44; display: flex; align-items: center; justify-content: space-between; gap: 10px; background: var(--navy); color: #fff; border-radius: 14px; padding: 10px 10px 10px 16px; box-shadow: 0 12px 30px -10px rgba(0, 0, 0, .45); transform: translateY(140%); transition: transform .25s ease }
.result-bar.is-shown { transform: none }
.result-bar span { font-size: .8rem; color: rgba(255, 255, 255, .75) }
.result-bar b { display: block; color: #fff; font-size: 1rem }
.result-bar button { border: 0; background: var(--gold); color: var(--navy); font: 700 .84rem var(--sans); border-radius: 10px; padding: .6rem .8rem; cursor: pointer; white-space: nowrap }

@media (max-width: 899px) {
  .app { grid-template-columns: 1fr }
  .inputs { position: static; max-height: none; overflow: visible; padding: 0 }
  .explain { grid-template-columns: 1fr; gap: 18px }
}
@media (max-width: 560px) {
  .app-bar__in { grid-template-columns: auto 1fr auto }
  .app-bar .brand strong { display: none }
  .donut-wrap { grid-template-columns: 1fr }
  .donut { max-width: 190px; margin: 0 auto }
  .bar { grid-template-columns: 1fr 80px; }
  .bar__t { grid-column: 1 / -1; order: 3 }
  .multi { grid-template-columns: 1fr }
  .in-card .row2 { grid-template-columns: 1fr }
  .seg button { padding: .45rem .8rem; font-size: .82rem }
  .col b { font-size: .58rem }
}
@media (min-width: 900px) { .result-bar { display: none } }

/* thank-you page */
.ty { padding: clamp(32px, 6vw, 72px) 0 }
.ty__card { max-width: 640px; margin: 0 auto; background: #fff; border: 1px solid var(--line); border-radius: 20px; padding: clamp(24px, 4vw, 40px); box-shadow: var(--shadow) }
.ty__tick { width: 52px; height: 52px; border-radius: 50%; background: #e6f4ee; color: var(--pos); display: grid; place-items: center; margin-bottom: 1rem }
.ty__tick svg { width: 26px; height: 26px }
.ty .eyebrow { color: var(--cyan-ink) }
.ty h1 { font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.2rem); font-weight: 700 }
.ty__lead { font-size: 1.05rem; color: #33475c }
.ty__steps { padding-left: 1.2rem; display: grid; gap: .6rem; color: #33475c; font-size: .95rem }
.ty__steps b { color: var(--navy) }

@media print {
  .app-bar, .inputs, .app-hero .switches, .adviser, .more, .result-bar, .wa-float, .site-footer, .res-actions, .slidein { display: none !important }
  .app { display: block; border: 0 }
  .q { box-shadow: none; break-inside: avoid }
}
@media (max-width: 560px) {
  .q__head { flex-wrap: wrap; row-gap: .4rem }
  .q__head .badge { order: 3; margin-left: 40px }
}
