/* Free calculators page (tools.html). Uses the money blue + gold tokens from styles.css. */
.tools-hero .wrap { grid-template-columns: 1fr; padding-bottom: 56px; }
.tools-hero .copy { padding-bottom: 0; }

.calcs { display: grid; gap: 28px; padding-top: 48px; }
.calc { background: #fff; border: 1px solid rgba(11, 40, 78, .1); border-radius: 22px; padding: 32px; min-width: 0; }
.calc .bar { width: 36px; height: 3px; background: var(--gold); margin-bottom: 16px; }
.calc h2 { color: var(--ink); }
.calc .intro { color: var(--muted); max-width: 60ch; }

.fields { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 20px 0 22px; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.wide { grid-column: 1 / -1; }
.field label { font-weight: 600; font-size: .95rem; color: var(--ink); }
.field label small { font-weight: 500; color: var(--muted); font-size: .85rem; }
.in { display: flex; align-items: center; border: 1.5px solid rgba(11, 40, 78, .2); border-radius: 12px; background: #fff; overflow: hidden; }
.in:focus-within { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(29, 103, 177, .18); }
.in input, .in select { flex: 1; min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; padding: 12px 14px; font: 500 1.05rem var(--sans); color: var(--text); }
.in select { cursor: pointer; font-size: 1rem; }
.in .pre, .in .post { color: var(--muted); font-weight: 600; padding: 0 12px; }
.in .pre { padding-right: 0; }

.result { background: var(--ink); color: #fff; border-radius: 16px; padding: 24px 26px; }
.r-label { display: block; font: 600 .78rem/1.3 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--mist); }
.big { display: block; font: 700 clamp(2.1rem, 7vw, 3.4rem)/1.1 var(--serif); color: var(--gold); margin: 8px 0 2px; overflow-wrap: anywhere; }
.r-sub { display: block; color: #d6e4f3; margin-bottom: 4px; }
.split { display: flex; flex-wrap: wrap; gap: 14px 36px; margin: 16px 0 10px; }
.split b { display: block; font: 600 1.35rem/1.2 var(--serif); color: #fff; overflow-wrap: anywhere; }
.split span { font-size: .85rem; color: #d6e4f3; }
.why { color: #d6e4f3; margin: 10px 0 0; max-width: 64ch; }

.tax { width: 100%; border-collapse: collapse; margin-top: 18px; font-size: .95rem; }
.tax caption { text-align: left; font-weight: 600; color: var(--mist); padding-bottom: 6px; font-size: .85rem; letter-spacing: .06em; text-transform: uppercase; }
.tax th, .tax td { padding: 9px 8px; border-top: 1px solid rgba(255, 255, 255, .12); text-align: right; overflow-wrap: anywhere; }
.tax th[scope="row"] { text-align: left; font-weight: 500; color: #d6e4f3; }
.tax thead th { color: var(--mist); font-weight: 600; font-size: .82rem; border-top: 0; }
.tax td { color: #fff; font-weight: 600; }

.calc .note { font-size: .88rem; color: var(--muted); margin: 14px 0 0; max-width: 80ch; }
.calc .note a { color: var(--brand); }
.watch { display: flex; flex-direction: column; gap: 6px; margin-top: 20px; padding-top: 18px; border-top: 1px solid rgba(11, 40, 78, .1); }
.w-label { font: 600 .78rem/1 var(--sans); letter-spacing: .12em; text-transform: uppercase; color: var(--brand); }
.watch a { color: var(--ink); font-weight: 600; text-decoration-color: var(--gold); text-underline-offset: 3px; }
.w-date { font-size: .85rem; color: var(--muted); margin-top: -4px; }

.sources { margin-top: 26px; }
.sources h3 { font: 600 1rem var(--sans); color: var(--ink); margin-bottom: 4px; }
.sources ul { padding-left: 18px; margin: 0; }
.sources li { margin-bottom: 6px; overflow-wrap: anywhere; }
.sources a { color: var(--brand); }

@media (max-width: 600px) {
  .calc { padding: 22px 18px; border-radius: 18px; }
  .result { padding: 20px 18px; }
  .tax { font-size: .85rem; }
  .tax th, .tax td { padding: 8px 4px; }
}

/* phone: each tax row becomes a small block, label on top, the two numbers side by side */
@media (max-width: 600px) {
  .tax thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tax tr { display: grid; grid-template-columns: 1fr 1fr; gap: 2px 12px; padding: 10px 0; border-top: 1px solid rgba(255, 255, 255, .12); }
  .tax th, .tax td { border: 0; padding: 0; text-align: left; }
  .tax th[scope="row"] { grid-column: 1 / -1; font-size: .85rem; }
  .tax td { font-size: 1.05rem; }
  .tax td::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 500; color: var(--mist); }
}

/* Calculator 1: own amount first and biggest */
.own-box { margin: 22px 0 6px; }
.own-box label { display: block; font: 600 clamp(1.25rem, 3.6vw, 1.6rem)/1.25 var(--serif); color: var(--ink); margin-bottom: 10px; }
.own-in { border-width: 2px; border-color: var(--gold); border-radius: 16px; }
.own-in input { font: 700 clamp(2rem, 7vw, 2.8rem)/1.1 var(--serif); color: var(--ink); padding: 12px 10px; }
.own-in .pre { font: 700 clamp(1.6rem, 6vw, 2.2rem) var(--serif); color: var(--ink); padding-left: 16px; }
.own-in .post { white-space: nowrap; }
.chips.mini { margin: 8px 0 0; gap: 6px; }
.chips.mini .chip { padding: 5px 14px; font-size: .85rem; }
.pay-box { background: #F5F8FC; border: 1px solid rgba(11, 40, 78, .1); border-radius: 16px; padding: 18px 20px; margin-bottom: 22px; }
.pay-box .fields { margin: 12px 0 8px; }
.pb-h { font-weight: 600; color: var(--ink); }
.pb-h small { color: var(--muted); font-weight: 500; }
.pb-note { font-size: .9rem; color: var(--muted); margin: 0; }
.slider { width: 100%; accent-color: var(--brand); margin: 10px 0 0; height: 28px; cursor: pointer; }
.ticks { display: flex; justify-content: space-between; font-size: .75rem; color: var(--muted); }
.cmp-h { font: 600 1.1rem/1.3 var(--sans); color: var(--ink); margin: 28px 0 12px; }
.cmp { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; }
.cmp-card { border: 1px solid rgba(11, 40, 78, .12); border-radius: 14px; padding: 14px; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cmp-card.own { background: var(--ink); color: #fff; border-color: var(--ink); }
.c-amt { font-size: .85rem; font-weight: 600; color: var(--muted); }
.cmp-card.own .c-amt { color: var(--gold); }
.c-total { font: 700 1.3rem/1.2 var(--serif); color: var(--ink); overflow-wrap: anywhere; margin: 2px 0 4px; }
.cmp-card.own .c-total { color: #fff; }
.c-in, .c-gr { font-size: .8rem; color: var(--muted); }
.cmp-card.own .c-in, .cmp-card.own .c-gr { color: #d6e4f3; }
@media (max-width: 600px) { .cmp { grid-template-columns: 1fr 1fr; } .cmp-card.own { grid-column: 1 / -1; } }
.chart { margin: 22px 0 0; }
.chart figcaption { font-weight: 600; color: var(--ink); font-size: .95rem; display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; margin-bottom: 10px; }
.key { font-weight: 500; color: var(--muted); font-size: .85rem; display: inline-flex; align-items: center; gap: 6px; }
.key i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; }
.key i + i, .key .k-gr { margin-left: 8px; }
.k-in { background: var(--brand); }
.k-gr { background: var(--gold); }
#s-chart { width: 100%; height: auto; display: block; overflow: visible; }
.ch-lab { font: 500 13px var(--sans); fill: var(--muted); }
.ch-lab.ch-own { font-weight: 700; fill: var(--ink); }
.ch-val { font: 600 13px var(--sans); fill: var(--ink); }
.ch-bg { fill: rgba(11, 40, 78, .06); }
.ch-in { fill: var(--brand); }
.ch-gr { fill: var(--gold); }

/* Calculator 2: Social Security */
.rules-line { background: rgba(233, 185, 78, .14); border-left: 3px solid var(--gold); border-radius: 0 10px 10px 0; padding: 10px 14px; color: var(--ink); font-size: .95rem; max-width: 72ch; }
.rules-line a { color: var(--brand); font-weight: 600; }
.lab { font-weight: 600; font-size: .95rem; color: var(--ink); }
.seg { display: inline-flex; flex-wrap: wrap; border: 1.5px solid rgba(11, 40, 78, .2); border-radius: 999px; padding: 3px; gap: 3px; align-self: flex-start; }
.seg label { position: relative; padding: 7px 16px; border-radius: 999px; cursor: pointer; font-weight: 600; font-size: .92rem; color: var(--muted); }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg label:has(input:checked) { background: var(--ink); color: #fff; }
.seg label:has(input:focus-visible) { outline: 2px solid var(--brand); outline-offset: 2px; }
.hint { font-size: .85rem; color: var(--muted); }
a.hint { color: var(--brand); }
.ss-top { margin-top: 10px; }
.big-s { font-size: clamp(1.5rem, 5vw, 2.2rem) !important; }
.big-s.gold { color: var(--gold) !important; }

.ss-table { width: 100%; border-collapse: collapse; margin-top: 22px; font-size: .92rem; }
.ss-table caption { text-align: left; font-weight: 600; color: var(--ink); padding-bottom: 8px; font-size: 1rem; }
.ss-table th, .ss-table td { padding: 9px 8px; border-top: 1px solid rgba(11, 40, 78, .1); text-align: right; white-space: nowrap; }
.ss-table thead th { font-size: .78rem; color: var(--muted); font-weight: 600; white-space: normal; vertical-align: bottom; border-top: 0; }
.ss-table th[scope="row"] { text-align: left; font-weight: 600; color: var(--ink); white-space: normal; }
.ss-table td:last-child { color: var(--brand); font-size: .85rem; white-space: normal; }
.ss-table tr.hl { background: rgba(233, 185, 78, .14); }
.ss-table .tag { display: block; font-size: .72rem; font-weight: 600; color: var(--ink); letter-spacing: .04em; text-transform: uppercase; opacity: .75; }
.ss-totals td.best { font-weight: 700; color: var(--ink); box-shadow: inset 0 -3px 0 var(--gold); }
.ss-totals td:last-child { color: inherit; font-size: inherit; }

/* phone: the claiming-age table becomes cards; the totals table stays a small table */
@media (max-width: 720px) {
  .ss-table:not(.ss-totals) thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .ss-table:not(.ss-totals) tbody { display: grid; gap: 10px; }
  .ss-table:not(.ss-totals) tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; border: 1px solid rgba(11, 40, 78, .12); border-radius: 14px; padding: 12px 14px; }
  .ss-table:not(.ss-totals) tr.hl { border-color: var(--gold); }
  .ss-table:not(.ss-totals) th, .ss-table:not(.ss-totals) td { border: 0; padding: 0; text-align: left; white-space: normal; }
  .ss-table:not(.ss-totals) th[scope="row"] { grid-column: 1 / -1; font: 600 1.15rem var(--serif); }
  .ss-table:not(.ss-totals) td { font-weight: 600; color: var(--ink); }
  .ss-table:not(.ss-totals) td::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 500; color: var(--muted); }
  .ss-table:not(.ss-totals) td:last-child { grid-column: 1 / -1; }
  .ss-table:not(.ss-totals) td:last-child::before { display: none; }
  .ss-totals { font-size: .8rem; }
  .ss-totals th, .ss-totals td { padding: 7px 4px; }
}

/* ===== Hub (tools.html) and calculator pages (calc/*.html) ===== */
.hub-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 20px; }
.hub-card { display: flex; flex-direction: column; background: #fff; border: 1px solid rgba(11, 40, 78, .1); border-radius: 18px; overflow: hidden; text-decoration: none; color: inherit; transition: transform .2s ease, box-shadow .2s ease; min-width: 0; }
.hub-card:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(11, 40, 78, .12); }
.hub-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; object-position: center 0%;  /* top of the photo: his whole head always shows */ background: var(--ink); }
.hc-txt { padding: 18px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.hc-txt h3 { font: 600 1.12rem/1.3 var(--sans); color: var(--ink); margin: 0 0 6px; }
.hc-txt p { color: var(--muted); font-size: .95rem; margin: 0 0 14px; flex: 1; }
.hc-go { font-weight: 600; color: var(--brand); text-decoration: underline; text-decoration-color: var(--gold); text-underline-offset: 3px; }

.calc-page { padding-top: 22px; padding-bottom: 20px; }
.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 18px; }
.crumbs a { color: var(--brand); }
.calc-intro { display: grid; grid-template-columns: 180px 1fr; gap: 28px; align-items: center; margin-bottom: 28px; }
.calc-intro img { width: 180px; height: 180px; border-radius: 50%; object-fit: cover; object-position: center 8%; background: var(--ink); }
.calc-intro h1 { font-size: clamp(1.9rem, 4.4vw, 2.9rem); color: var(--ink); }
.calc-intro .lead { margin: 0; }
@media (max-width: 700px) { .calc-intro { grid-template-columns: 1fr; gap: 16px; } .calc-intro img { width: 120px; height: 120px; } }
.calc-page .calc { margin-bottom: 8px; }
.after { padding: 28px 0 10px; }
.coffee { margin: 0 0 22px; font-size: .95rem; }
.coffee a { color: var(--brand); font-weight: 600; }
.more { padding: 30px 0 40px; }
.more h2 { font-size: 1.6rem; color: var(--ink); margin-bottom: 18px; }
.all-calcs { color: var(--brand); font-weight: 600; display: inline-block; margin-top: 18px; }
.note.rules { padding-left: 18px; }
.note.rules li { margin-bottom: 6px; }
.note.limit { color: var(--ink); }

/* simple data table that becomes cards on phones (401(k), RMD) */
.cards-table { width: 100%; border-collapse: collapse; margin-top: 22px; font-size: .92rem; }
.cards-table caption { text-align: left; font-weight: 600; color: var(--ink); padding-bottom: 8px; font-size: 1rem; }
.cards-table th, .cards-table td { padding: 9px 8px; border-top: 1px solid rgba(11, 40, 78, .1); text-align: right; }
.cards-table thead th { font-size: .78rem; color: var(--muted); font-weight: 600; vertical-align: bottom; border-top: 0; }
.cards-table th[scope="row"] { text-align: left; font-weight: 600; color: var(--ink); }
.cards-table tr.hl { background: rgba(233, 185, 78, .14); }
@media (max-width: 720px) {
  .cards-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .cards-table tbody { display: grid; gap: 10px; }
  .cards-table tr { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; border: 1px solid rgba(11, 40, 78, .12); border-radius: 14px; padding: 12px 14px; }
  .cards-table tr.hl { border-color: var(--gold); }
  .cards-table th, .cards-table td { border: 0; padding: 0; text-align: left; overflow-wrap: anywhere; }
  .cards-table th[scope="row"] { grid-column: 1 / -1; font: 600 1.1rem var(--serif); }
  .cards-table td { font-weight: 600; color: var(--ink); }
  .cards-table td::before { content: attr(data-label); display: block; font-size: .72rem; font-weight: 500; color: var(--muted); }
}
