/* The Finances page (budget.html). Colors, fonts and the navigation bar come from styles.css. */

/* Lined up with the left of the navigation bar rather than centred */
.budget { max-width: 824px; margin: 0; padding: 32px 16px 64px 20px; color: var(--ink-2); }
.budget h1 { margin: 0 0 6px; font-size: 32px; line-height: 1.2; color: var(--ink); letter-spacing: -0.02em; }
.budget-head p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--muted); }
/* The gray band sits behind just the heading and intro here, ending in its
   line above Monthly budget. It reaches the full width of the window without
   making the page scroll sideways (the shadow spreads it, the clip keeps it
   to the band's height). */
body.finances::before { display: none; }
/* The heading and intro drift down as you scroll (see budget.js): they're
   cut off at the band's bottom line so they sink out of sight there */
.budget-head { position: relative; padding-bottom: 28px; clip-path: inset(-100vh -100vmax 0 -100vmax); }
.budget-head > * { will-change: transform, opacity; }
/* On desktops the window's width includes the scrollbar, so the layer
   below can overhang by that much; don't let that scroll sideways */
html:has(body.finances) { overflow-x: clip; }
/* Bills and coins in the band, to the right of the heading. They sit in a
   layer covering the band from edge to edge of the window, which cuts off
   whatever is past the edges, so they can never widen the page. The column
   starts 20px from the window's left and ends 16px short of its right (or
   of 824px), so in the layer the column's right end is at
   min(100vw, 824px) - 16px. */
.budget-head > .money {
  position: absolute; top: -32px; bottom: 0; left: -20px; right: calc(-16px - max(0px, 100vw - 824px));
  z-index: 0; overflow: hidden; pointer-events: none; will-change: auto;
}
.budget-head > h1, .budget-head > p { position: relative; z-index: 1; }
.money-item { position: absolute; display: block; height: auto; opacity: 0.1; will-change: transform; }
.bill-1 { left: calc(min(100vw, 824px) + 4px); top: 10px; width: 250px; }
.bill-2 { left: calc(min(100vw, 824px) + 284px); top: 70px; width: 200px; opacity: 0.08; }
.coin-tilted { left: calc(min(100vw, 824px) - 126px); top: 96px; width: 74px; }
.coin-edge { left: calc(min(100vw, 824px) + 272px); top: 4px; width: 64px; opacity: 0.12; }
/* Narrower screens: at the right of the window, behind the end of the intro */
@media (max-width: 1100px) {
  .bill-1 { left: auto; right: -44px; top: 6px; width: 210px; }
  .bill-2, .coin-edge { display: none; }
  .coin-tilted { left: auto; right: 186px; top: 104px; width: 60px; }
}
.budget-head::before, .budget-head::after {
  content: ""; position: absolute; left: 0; right: 0; z-index: -1;
  clip-path: inset(0 -100vmax);
}
.budget-head::before { top: -32px; bottom: 0; background: var(--bg-band); box-shadow: 0 0 0 100vmax var(--bg-band); }
.budget-head::after { bottom: 0; height: 1px; background: var(--card-border); box-shadow: 0 0 0 100vmax var(--card-border); }
.budget-head + .plan-row { margin-top: 28px; }
/* On phones the Back row above the heading (nav.js) sits on the same band
   (on wider screens it floats over the band instead) */
@media (max-width: 720px) {
  body.finances .back-row { background: var(--bg-band); }
}

/* A band between the budget and the calculators, like the heading's: the
   same gray across the full width of the window, with a line above and
   below. The shadows spread it to the window's edges and the clips keep
   them to the band's height, so it never makes the page scroll sideways
   (anything in the band is cut off at its lines). */
.divider-band {
  position: relative; height: 260px; margin: 48px 0 24px;
  background: var(--bg-band); box-shadow: 0 0 0 100vmax var(--bg-band); clip-path: inset(0 -100vmax);
}
.divider-band::before, .divider-band::after {
  content: ""; position: absolute; left: 0; right: 0; height: 1px;
  background: var(--card-border); box-shadow: 0 0 0 100vmax var(--card-border); clip-path: inset(0 -100vmax);
}
.divider-band::before { top: 0; }
.divider-band::after { bottom: 0; }
/* The pictures sit in a layer reaching the window's edges (the column math
   is the heading's, see .budget-head > .money), which cuts off anything
   past them */
.band-art {
  position: absolute; top: 0; bottom: 0; left: -20px; right: calc(-16px - max(0px, 100vw - 824px));
  overflow: hidden; pointer-events: none;
}
.band-item { position: absolute; display: block; height: auto; opacity: 0.1; will-change: transform; }
/* Coins floating around the blueprint: small ones far back, bigger ones
   closer. Solid (see #band-solid), so one in front hides what's behind it. */
.band-defs { position: absolute; width: 0; height: 0; }
.band-coin { opacity: 1; filter: url(#band-solid); }
.coin-1 { left: 4%; top: 30px; width: 80px; }
.coin-2 { left: 13%; top: 150px; width: 46px; }
.coin-3 { left: 21%; top: 64px; width: 120px; }
.coin-4 { left: 1%; top: 168px; width: 70px; }
.coin-5 { left: 30%; top: 186px; width: 54px; }
.coin-6 { left: auto; right: 3%; top: 36px; width: 110px; }
.coin-7 { left: auto; right: 15%; top: 18px; width: 50px; }
.coin-8 { left: auto; right: 21%; top: 158px; width: 70px; }
.coin-9 { left: auto; right: 6%; top: 168px; width: 90px; }
.coin-10 { left: auto; right: 29%; top: 96px; width: 44px; }
/* Closer coins in front of farther ones */
.coin-2, .coin-5, .coin-7, .coin-10 { z-index: 1; }
.coin-1, .coin-4, .coin-8, .coin-9 { z-index: 2; }
.coin-3, .coin-6 { z-index: 3; }
/* The car loan page's road, along the bottom of the heading's band from
   edge to edge of the window (the layer the bills use on the other pages),
   with a dashed line; the car is 300 wide on it (220 on phones) */
.head-road {
  position: absolute; left: 0; right: 0; bottom: 4px; height: 120px; will-change: transform;
  background: linear-gradient(to right, rgba(40, 40, 40, 0.09) 50%, transparent 50%) 0 108px / 24px 1.5px repeat-x;
}
.car-drive { position: absolute; left: 0; top: 0; width: 300px; height: 114.5px; overflow: visible; will-change: transform; }
@media (max-width: 720px) {
  /* On phones the words run across the window: room for the road below */
  .budget-head.head-road-room { padding-bottom: 96px; }
  .head-road { height: 88px; background-position: 0 79px; }
  .car-drive { width: 220px; height: 84px; }
}
/* The calculators as cards, on the hub and under each calculator */
.calc-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.calc-card {
  display: flex; flex-direction: column; gap: 4px; padding: 14px 16px; border: 1px solid var(--card-border); border-radius: 14px;
  background: var(--card); color: var(--ink); text-decoration: none; transition: border-color 0.15s ease, transform 0.15s ease;
}
.calc-card b { font-size: 15px; font-weight: 700; }
.calc-card span { font-size: 13px; line-height: 1.45; color: var(--muted); }
.calc-card .calc-card-go { display: inline-flex; align-items: center; gap: 6px; margin-top: auto; padding-top: 8px; font-weight: 700; color: var(--ink); }
.calc-card:hover { border-color: var(--ink); }
.calc-card:hover .calc-card-go svg { transform: translateX(2px); }
.calc-card .calc-card-go svg { transition: transform 0.15s ease; }
.calc-card:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
/* A calculator's page: where it sits (the breadcrumb), and how it works */
.crumbs { position: relative; z-index: 1; margin: 0 0 10px; font-size: 13px; color: var(--muted); }
.crumbs a { color: var(--ink-2); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span[aria-current] { color: var(--ink); font-weight: 500; }
.calc-guide p { max-width: 68ch; margin: 0 0 12px; font-size: 15px; line-height: 1.65; color: var(--ink-2); }
.calc-guide .faq-title { margin-top: 22px; }
.faq { margin-top: 10px; border-bottom: 1px solid var(--line); }
.faq details { border-top: 1px solid var(--line); padding: 12px 0; }
.faq summary { cursor: pointer; font-size: 15px; font-weight: 700; color: var(--ink); }
.faq details p { margin: 8px 0 0; }
/* The mortgage page's blueprint, in the heading's band to the right of the
   words (in the layer the bills use on the other pages), cut off at the
   band's line; on narrower screens it sits behind the end of the words */
.head-blueprint { position: absolute; left: calc(min(100vw, 824px) - 30px); top: 6px; width: 400px; height: auto; overflow: visible; will-change: transform; }
@media (max-width: 1100px) { .head-blueprint { left: auto; right: -70px; width: 340px; top: 18px; } }
/* The credit card page's card machine, in the same place, in a taller
   band so all of it shows */
.budget-head.head-tall { padding-bottom: 110px; }
.head-machine { position: absolute; left: calc(min(100vw, 824px) - 10px); top: 10px; width: 340px; height: auto; overflow: visible; will-change: transform; }
/* (Fainter where it's behind the words) */
@media (max-width: 1100px) { .head-machine { left: auto; right: -40px; width: 300px; top: 20px; opacity: 0.5; } }
/* The savings page's jar, in the same place. When the page opens coins
   drop in one by one (each from above the jar, by its --dx, --dy and
   --turn, after its --wait), the tag's bar fills a step as each lands, the
   goal line darkens and a check draws. Shown full for people whose device
   asks for less motion. */
.head-jar { position: absolute; left: calc(min(100vw, 824px) + 10px); top: 12px; width: 300px; height: auto; overflow: visible; will-change: transform; }
@media (max-width: 1100px) { .head-jar { left: auto; right: 10px; width: 270px; top: 14px; opacity: 0.5; } }
.head-jar .jar-coin { transform-box: fill-box; transform-origin: center; animation: jar-drop 0.6s var(--wait) both; }
@keyframes jar-drop {
  from { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--turn)); animation-timing-function: ease-in; }
  8% { opacity: 1; }
  80% { transform: translate(0, 0) rotate(0); animation-timing-function: ease-out; }
  90% { transform: translate(0, -4px); }
  to { opacity: 1; transform: none; }
}
.head-jar .jar-bar { transform-box: fill-box; transform-origin: left center; animation: jar-fill 4s 1.28s steps(8, start) both; }
@keyframes jar-fill { from { transform: scaleX(0); } to { transform: none; } }
.head-jar .jar-check { stroke-dasharray: 22; animation: jar-check 0.4s 4.7s ease-out both; }
@keyframes jar-check { from { stroke-dashoffset: 22; } to { stroke-dashoffset: 0; } }
.head-jar .jar-goal { animation: jar-goal 0.8s 4.6s; }
@keyframes jar-goal { 30%, 70% { stroke-opacity: 0.8; } }
@media (prefers-reduced-motion: reduce) { .head-jar * { animation: none !important; } }
/* The inflation page's balloon. When the page opens it grows in steps as
   the year counts up, swells once, then bobs on its string a few times and
   settles. Without the animation (for people whose device asks for less
   motion) it shows the end: full size and the latest year. */
/* Large, its foot at the band's line with the string running on past it,
   cut off there (as the Capitol is on the Congress page) */
.head-balloon { position: absolute; left: calc(min(100vw, 824px) + 60px); bottom: -90px; width: 200px; height: auto; overflow: visible; will-change: transform; }
@media (max-width: 1100px) { .head-balloon { left: auto; right: 30px; width: 190px; bottom: -86px; opacity: 0.5; } }
.head-balloon .bal-years text { font: 500 20px var(--mono); fill: #282828; fill-opacity: 0.45; }
.head-balloon .bal-step { opacity: 0; }
.head-balloon .bal-s5 { opacity: 1; }
.head-balloon .bal-balloon, .head-balloon .bal-float { transform-box: fill-box; transform-origin: 50% 100%; }
.head-balloon .bal-balloon { animation: bal-grow 9s both; }
.head-balloon .bal-float { animation: bal-bob 2.4s 4.4s 3 ease-in-out; }
.head-balloon .bal-s0 { animation: bal-s0 9s both; }
.head-balloon .bal-s1 { animation: bal-s1 9s both; }
.head-balloon .bal-s2 { animation: bal-s2 9s both; }
.head-balloon .bal-s3 { animation: bal-s3 9s both; }
.head-balloon .bal-s4 { animation: bal-s4 9s both; }
.head-balloon .bal-s5 { animation: bal-s5 9s both; }
@keyframes bal-grow {
  0% { transform: scale(0.35); } 8.9% { transform: scale(0.5); } 17.8% { transform: scale(0.62); } 26.7% { transform: scale(0.75); }
  35.6% { transform: scale(0.88); } 43.3% { transform: scale(1); } 46% { transform: scale(1.04); } 49%, to { transform: none; }
}
@keyframes bal-bob { 25% { transform: translateY(-5px) rotate(-1.5deg); } 50% { transform: none; } 75% { transform: translateY(-4px) rotate(1.2deg); } }
@keyframes bal-s0 { 0%, 8.8% { opacity: 1; } 8.9%, to { opacity: 0; } }
@keyframes bal-s1 { 0%, 8.8% { opacity: 0; } 8.9%, 17.7% { opacity: 1; } 17.8%, to { opacity: 0; } }
@keyframes bal-s2 { 0%, 17.7% { opacity: 0; } 17.8%, 26.6% { opacity: 1; } 26.7%, to { opacity: 0; } }
@keyframes bal-s3 { 0%, 26.6% { opacity: 0; } 26.7%, 35.5% { opacity: 1; } 35.6%, to { opacity: 0; } }
@keyframes bal-s4 { 0%, 35.5% { opacity: 0; } 35.6%, 43.2% { opacity: 1; } 43.3%, to { opacity: 0; } }
@keyframes bal-s5 { 0%, 43.2% { opacity: 0; } 43.3%, to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .head-balloon * { animation: none !important; } }
/* Coins around the balloon, solid like the Finances band's (see
   #infl-solid), drifting as the page scrolls by their data-depth (see
   budget.js). Only where there's room beside the words. */
.infl-coin { opacity: 1; filter: url(#infl-solid); }
.infl-coin-1 { left: calc(min(100vw, 824px) + 0px); top: 40px; width: 56px; }
.infl-coin-2 { left: calc(min(100vw, 824px) + 262px); top: 126px; width: 40px; }
.infl-coin-3 { left: calc(min(100vw, 824px) + 300px); top: 24px; width: 34px; }
.infl-coin-4 { left: calc(min(100vw, 824px) + 36px); top: 128px; width: 40px; rotate: 30deg; }
.infl-coin-5 { left: calc(min(100vw, 824px) + 346px); top: 96px; width: 52px; rotate: -20deg; }
.infl-coin-6 { left: calc(min(100vw, 824px) + 404px); top: 26px; width: 30px; rotate: -35deg; }
.infl-coin-7 { left: calc(min(100vw, 824px) + 418px); top: 140px; width: 46px; rotate: 160deg; }
.infl-coin-8 { left: calc(min(100vw, 824px) - 20px); top: 4px; width: 30px; rotate: 15deg; }
@media (max-width: 1100px) { .infl-coin { display: none; } }
/* The student loan page's stack of books, large and to the right with its
   foot at the band's line (like the inflation page's balloon). When the page
   opens the top book slides off, then the next, about a second apart, until
   one is left; then the cap drops onto it and the tassel swings. Without
   the animation (for people whose device asks for less motion) it shows
   the end: one book and the cap. */
.head-books { position: absolute; left: calc(min(100vw, 824px) - 24px); bottom: -2px; width: 410px; height: auto; overflow: visible; will-change: transform; }
@media (max-width: 1100px) { .head-books { left: auto; right: 10px; width: 330px; bottom: -2px; opacity: 0.5; } }
/* Coins and rolled diplomas around it, sized, turned and drifting like the
   Finances band's coins (their data-depth, data-turn and data-rot, see
   budget.js), and solid like them (see #slb-solid); only where there's room
   beside the words */
.slb-coin { opacity: 1; filter: url(#slb-solid); }
.slb-coin-9 { left: calc(min(100vw, 824px) + 176px); top: 14px; width: 34px; }
.slb-coin-5 { left: calc(min(100vw, 824px) + 226px); top: 4px; width: 44px; }
.slb-coin-2 { left: calc(min(100vw, 824px) + 318px); top: 22px; width: 46px; }
.slb-coin-4 { left: calc(min(100vw, 824px) - 50px); top: 150px; width: 50px; }
.slb-coin-8 { left: calc(min(100vw, 824px) + 270px); top: 108px; width: 50px; }
.slb-coin-6 { left: calc(min(100vw, 824px) + 404px); top: 30px; width: 60px; }
.slb-coin-7 { left: calc(min(100vw, 824px) + 50px); top: 102px; width: 64px; }
.slb-coin-3 { left: calc(min(100vw, 824px) + 390px); top: 138px; width: 70px; }
.slb-coin-1 { left: calc(min(100vw, 824px) - 10px); top: 24px; width: 80px; }
.slb-coin-10 { left: calc(min(100vw, 824px) + 138px); top: 70px; width: 58px; }
.slb-dip-1 { left: calc(min(100vw, 824px) - 74px); top: 176px; width: 96px; }
.slb-dip-2 { left: calc(min(100vw, 824px) + 352px); top: 74px; width: 108px; }
/* On wide windows (where they have room not to bunch up), more in the
   space to the right of the stack (which ends about 1230px from the
   window's left): each this share of that space in from the window's
   right edge */
.slb-wide { display: none; }
@media (min-width: 1700px) {
  .slb-wide { display: block; left: auto; }
  .slb-r-5 { right: calc((100vw - 1230px) * 0.7); top: 150px; width: 46px; }
  .slb-r-4 { right: calc((100vw - 1230px) * 0.5); top: 170px; width: 56px; }
  .slb-r-2 { right: calc((100vw - 1230px) * 0.3); top: 130px; width: 70px; }
  .slb-r-3 { right: calc((100vw - 1230px) * 0.42); top: 40px; width: 120px; }
  .slb-r-1 { right: calc((100vw - 1230px) * 0.06); top: 34px; width: 96px; }
}
@media (max-width: 1100px) { .slb-coin { display: none; } }
.head-books .slb-b2, .head-books .slb-b3, .head-books .slb-b4, .head-books .slb-b5, .head-books .slb-b6 { opacity: 0; }
.head-books .slb-book { transform-box: fill-box; transform-origin: center; }
.head-books .slb-b2 { animation: slb-b2 9s both; }
.head-books .slb-b3 { animation: slb-b3 9s both; }
.head-books .slb-b4 { animation: slb-b4 9s both; }
.head-books .slb-b5 { animation: slb-b5 9s both; }
.head-books .slb-b6 { animation: slb-b6 9s both; }
.head-books .slb-cap { animation: slb-cap 9s both; }
.head-books .slb-tassel { transform-origin: 539px 231px; animation: slb-tassel 9s both; }
@keyframes slb-cap {
  0%, 60% { opacity: 0; transform: translateY(-150px); }
  61% { opacity: 1; transform: translateY(-150px); animation-timing-function: ease-in; }
  66% { transform: none; } 68% { transform: translateY(-6px); } 70%, to { opacity: 1; transform: none; }
}
@keyframes slb-tassel { 0%, 66% { transform: none; } 70% { transform: rotate(20deg); } 74% { transform: rotate(-14deg); } 78% { transform: rotate(9deg); } 82% { transform: rotate(-4deg); } 86%, to { transform: none; } }
@keyframes slb-b6 { 0%, 11.1% { opacity: 1; transform: none; } 17.0%, to { opacity: 0; transform: translate(60px, -14px) rotate(8deg); } }
@keyframes slb-b5 { 0%, 22.2% { opacity: 1; transform: none; } 28.1%, to { opacity: 0; transform: translate(-60px, -14px) rotate(-8deg); } }
@keyframes slb-b4 { 0%, 33.3% { opacity: 1; transform: none; } 39.2%, to { opacity: 0; transform: translate(60px, -14px) rotate(8deg); } }
@keyframes slb-b3 { 0%, 44.4% { opacity: 1; transform: none; } 50.3%, to { opacity: 0; transform: translate(-60px, -14px) rotate(-8deg); } }
@keyframes slb-b2 { 0%, 55.6% { opacity: 1; transform: none; } 61.5%, to { opacity: 0; transform: translate(60px, -14px) rotate(8deg); } }
@media (prefers-reduced-motion: reduce) { .head-books * { animation: none !important; } }
/* The gas cost page's pump, large and to the right with its foot at the
   band's line. When the page opens fuel pulses along the hose, the display
   counts up and the gauge's needle swings from E to F, then the pump clicks
   off. Without the animation (for people whose device asks for less
   motion) it shows the end: the gauge on F and the full total. */
.head-pump { position: absolute; left: calc(min(100vw, 824px) + 10px); bottom: -2px; width: 310px; height: auto; overflow: visible; will-change: transform; }
@media (max-width: 1100px) { .head-pump { left: auto; right: 10px; width: 270px; bottom: -2px; opacity: 0.5; } }
.head-pump .gp-label { font: 500 6px var(--mono); fill: #282828; fill-opacity: 0.45; }
.head-pump .gp-ef { font-size: 8px; }
.head-pump .gp-display text { font: 500 11px var(--mono); fill: #282828; fill-opacity: 0.6; }
.head-pump .gp-display .gp-gal { font-size: 8px; }
.head-pump .gp-step { opacity: 0; }
.head-pump .gp-s5 { opacity: 1; }
.head-pump .gp-flow { stroke-dasharray: 3 9; opacity: 0; animation: gp-flow 9s linear both; }
.head-pump .gp-needle { transform-origin: 600px 118px; transform: rotate(60deg); animation: gp-needle 9s both; }
.head-pump .gp-click { transform-box: fill-box; transform-origin: center; opacity: 0; animation: gp-click 9s both; }
.head-pump .gp-s0 { animation: gp-s0 9s both; }
.head-pump .gp-s1 { animation: gp-s1 9s both; }
.head-pump .gp-s2 { animation: gp-s2 9s both; }
.head-pump .gp-s3 { animation: gp-s3 9s both; }
.head-pump .gp-s4 { animation: gp-s4 9s both; }
.head-pump .gp-s5 { animation: gp-s5 9s both; }
@keyframes gp-flow { 0%, 8% { stroke-dashoffset: 0; opacity: 0; } 10% { opacity: 0.7; } 70% { stroke-dashoffset: -240; opacity: 0.7; } 74%, to { stroke-dashoffset: -252; opacity: 0; } }
@keyframes gp-needle { 0%, 8% { transform: rotate(-62deg); } 70% { transform: rotate(58deg); } 72% { transform: rotate(62deg); } 74%, to { transform: rotate(60deg); } }
@keyframes gp-click { 0%, 71% { opacity: 0; transform: scale(0.6); } 73% { opacity: 1; transform: none; } 80%, to { opacity: 0; transform: scale(1.2); } }
@keyframes gp-s0 { 0%, 9.9% { opacity: 1; } 10%, to { opacity: 0; } }
@keyframes gp-s1 { 0%, 9.9% { opacity: 0; } 10%, 21.9% { opacity: 1; } 22%, to { opacity: 0; } }
@keyframes gp-s2 { 0%, 21.9% { opacity: 0; } 22%, 33.9% { opacity: 1; } 34%, to { opacity: 0; } }
@keyframes gp-s3 { 0%, 33.9% { opacity: 0; } 34%, 45.9% { opacity: 1; } 46%, to { opacity: 0; } }
@keyframes gp-s4 { 0%, 45.9% { opacity: 0; } 46%, 57.9% { opacity: 1; } 58%, to { opacity: 0; } }
@keyframes gp-s5 { 0%, 57.9% { opacity: 0; } 58%, to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .head-pump * { animation: none !important; } }
/* The electricity page's power lines, large and to the right with their
   feet at the band's line. When the page opens pulses run along the wire to
   the house, one after another (five over about 7 seconds), and its
   windows light up as the first arrives and stay
   lit. Without the animation (for people whose device asks for less
   motion) it shows the end: the windows lit. */
.head-power { position: absolute; left: calc(min(100vw, 824px) + 4px); bottom: -2px; width: 400px; height: auto; overflow: visible; will-change: transform; }
@media (max-width: 1100px) { .head-power { left: auto; right: 0; width: 330px; bottom: -2px; opacity: 0.5; } }
.head-power .pl-win { fill: #FA3600; fill-opacity: 0.55; animation: pl-win 0.5s 3.8s ease-out both; }
.head-power .pl-pulse, .head-power .pl-glow { fill: none; stroke: #FA3600; stroke-linecap: round; stroke-dasharray: 5 95; opacity: 0; animation: pl-run 3.5s linear both; }
.head-power .pl-pulse { stroke-width: 2.4; }
.head-power .pl-glow { stroke-width: 6; stroke-opacity: 0.2; }
.head-power .pl-d0 { animation-delay: 0.5s; }
.head-power .pl-d1 { animation-delay: 1.3s; }
.head-power .pl-d2 { animation-delay: 2.1s; }
.head-power .pl-d3 { animation-delay: 2.9s; }
.head-power .pl-d4 { animation-delay: 3.7s; }
@keyframes pl-run { from { stroke-dashoffset: 100; opacity: 0; } 3% { opacity: 1; } 97% { stroke-dashoffset: 0; opacity: 1; } to { stroke-dashoffset: 0; opacity: 0; } }
@keyframes pl-win { from { fill: #E4E3DC; fill-opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .head-power * { animation: none !important; } }
@media (max-width: 720px) {
  .divider-band { height: 180px; margin: 32px 0 16px; }
  .head-blueprint { right: -110px; width: 300px; top: 40px; }
  /* On phones, below the words, in the middle */
  .budget-head.head-tall { padding-bottom: 196px; }
  .head-machine { left: auto; right: 50%; margin-right: -115px; width: 230px; top: auto; bottom: 6px; opacity: 1; }
  .head-jar { left: auto; right: 50%; margin-right: -110px; width: 220px; top: auto; bottom: 8px; opacity: 1; }
  .head-balloon { right: 10px; width: 170px; bottom: -78px; }
  .head-books { left: auto; right: 50%; margin-right: -130px; width: 260px; bottom: 4px; opacity: 1; }
  .head-pump { left: auto; right: 50%; margin-right: -120px; width: 240px; bottom: 4px; opacity: 1; }
  .head-power { left: auto; right: 50%; margin-right: -150px; width: 300px; bottom: 4px; opacity: 1; }
  /* Five of them, smaller, near the edges */
  .coin-1 { left: 2%; top: 14px; width: 54px; }
  .coin-3 { left: 6%; top: 104px; width: 72px; }
  .coin-6 { right: 2%; top: 12px; width: 66px; }
  .coin-9 { right: 4%; top: 116px; width: 56px; }
  .coin-4 { left: 30%; top: 140px; width: 40px; }
  .coin-2, .coin-5, .coin-7, .coin-8, .coin-10 { display: none; }
}

/* Monthly budget sits on the page's own background, with a column to its
   right (typical households, then advertising space). The row reaches past
   the page's column to make room for it; narrower screens stack them. */
/* Monthly budget and the Mortgage calculator have no box around them: they
   sit on the page background with no outline, their content lined up with
   their edges */
.plan-row > .panel { margin-top: 0; }
#plan, #mortgage { background: none; border: 0; border-radius: 0; padding-left: 0; padding-right: 0; }
.ad-space { display: none; }
@media (min-width: 1180px) {
  .budget { --ad-gap: 24px; --ad-col: 325px; }
  .plan-row { display: flex; align-items: stretch; gap: var(--ad-gap); width: calc(100% + var(--ad-gap) + var(--ad-col)); }
  .plan-row > .panel { flex: none; width: calc(100% - var(--ad-gap) - var(--ad-col)); }
  /* The column at the budget's right: typical households, then the
     advertising space */
  .plan-side { flex: none; width: var(--ad-col); display: flex; flex-direction: column; gap: 16px; }
  .plan-side > .panel { margin-top: 0; padding: 18px 16px; }
  .ad-space { display: block; flex: 1; }
  /* Narrow there: no bars, and the shares sit under the dollars */
  .plan-side .typical-table th:last-child, .plan-side .typical-table td:last-child { display: none; }
  .plan-side .typical-table th { white-space: normal; }
  .plan-side .panel-head h2 { font-size: 18px; }
}

.panel {
  /* Jumped to from the Finances menu: clear of the sticky navigation bar */
  scroll-margin-top: 76px;
  margin-top: 20px; padding: 24px; border-radius: 20px; background: var(--bg) var(--grain);
  border: 1px solid var(--card-border);
}
.panel-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px 16px; margin-bottom: 16px; }
.panel h2 { margin: 0; font-size: 20px; color: var(--ink); letter-spacing: -0.01em; }

/* Money inputs: a $ inside the box */
.money-input {
  display: flex; align-items: center; gap: 4px; min-height: 40px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card);
  font-family: var(--mono); color: var(--muted);
}
.money-input:focus-within { outline: 2px solid var(--ink-2); outline-offset: -1px; border-color: transparent; }
.money-input input {
  width: 100%; min-width: 0; border: 0; outline: none; background: transparent;
  font-family: var(--mono); font-size: 15px; color: var(--ink); text-align: right;
}
/* No up/down arrows in the number boxes */
.money-input input::-webkit-outer-spin-button,
.money-input input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.money-input input[type="number"] { -moz-appearance: textfield; appearance: textfield; }

.income {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 12px 14px; margin-bottom: 18px; border-radius: 12px; background: var(--surface);
}
.income-label { font-size: 15px; font-weight: 700; color: var(--ink); }
.income .money-input { width: 170px; }

/* Spending lines: name, amount, tracked price, remove */
.lines-head, .line {
  display: grid; grid-template-columns: minmax(0, 1.4fr) 130px minmax(0, 1.4fr) 40px; gap: 8px; align-items: center;
}
.lines-head {
  padding: 0 0 6px; font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted);
}
.lines { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.line input[type="text"], .line select {
  width: 100%; min-width: 0; min-height: 40px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card);
  font-family: inherit; font-size: 14px; color: var(--ink);
}
.line select { color: var(--ink-2); cursor: pointer; }
.line input[type="text"]:focus, .line select:focus { outline: 2px solid var(--ink-2); outline-offset: -1px; border-color: transparent; }
.remove-line {
  width: 40px; height: 40px; border: 0; border-radius: 8px; background: transparent;
  color: var(--muted); cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.remove-line:hover { background: var(--surface); color: var(--down); }
.add-line {
  display: inline-flex; align-items: center; gap: 8px; min-height: 40px; margin-top: 10px; padding: 0 14px;
  border: 1px dashed var(--border); border-radius: 8px; background: transparent;
  font-family: inherit; font-size: 14px; font-weight: 500; color: var(--ink-2); cursor: pointer;
}
.add-line:hover { border-color: var(--ink-2); color: var(--ink); }
/* Only the phone table uses these (see the phone styles below) */
.sheet-tab, .lines-count, .track-label, .track-text { display: none; }
.track-wrap { display: contents; }

/* Totals and where the money goes */
.summary { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.summary-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 15px; }
.summary-row span:last-child { font-family: var(--mono); color: var(--ink); }
.summary-row.total { margin-top: 4px; padding-top: 10px; border-top: 1px solid var(--line); font-weight: 700; color: var(--ink); }
.summary-row.total.over span:last-child { color: var(--down); }
.summary-row.total.under span:last-child { color: var(--up); }
.split { display: flex; height: 14px; margin-top: 14px; border-radius: 999px; overflow: hidden; background: var(--surface); }
.split span { height: 100%; }
.split span + span { border-left: 2px solid var(--card); }
.split-legend { list-style: none; margin: 10px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; }
.split-legend li { display: flex; align-items: center; gap: 6px; }
.split-legend i { width: 10px; height: 10px; border-radius: 3px; flex: none; }
.split-legend b { font-family: var(--mono); font-weight: 500; color: var(--ink); }

/* Part 2 */
.range-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); }
.range-tabs button {
  min-height: 36px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent;
  font-family: inherit; font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer;
}
.range-tabs button[aria-pressed="true"] { background: var(--color-1); color: #FFFFFF; font-weight: 700; }
.moved-intro { margin: -6px 0 14px; font-size: 14px; color: var(--muted); }
.headline {
  margin-bottom: 16px; padding: 14px 16px; border-radius: 12px; background: var(--surface);
  font-size: 15px; line-height: 1.6;
}
.headline b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.headline .up { color: var(--down); }
.headline .down { color: var(--up); }

.table-wrap { overflow-x: auto; }
.moved-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.moved-table th {
  padding: 8px; text-align: right; font-size: 11px; font-weight: 700;
  letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--line);
}
.moved-table th:first-child, .moved-table td:first-child { text-align: left; }
.moved-table td { padding: 10px 8px; text-align: right; border-bottom: 1px solid var(--line); font-family: var(--mono); white-space: nowrap; }
.moved-table td:first-child { font-family: inherit; white-space: normal; }
.moved-table .line-item { display: block; font-size: 12px; color: var(--muted); }
.moved-table .line-item a { color: inherit; }
.moved-table tfoot td { font-weight: 700; color: var(--ink); border-bottom: 0; }
/* Costs going up are bad news for a budget, so up is red here */
.moved-table .up { color: var(--down); }
.moved-table .down { color: var(--up); }
.moved-table .muted { color: var(--muted); font-family: inherit; }
.note { margin: 12px 0 0; font-size: 13px; line-height: 1.6; color: var(--muted); }
/* Links in notes (the GeoNames credit) use the slate accent, not browser blue */
.note a { color: var(--color-1); text-underline-offset: 2px; }

/* ---------- Is your pay keeping up? ---------- */
.keep-pick { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px; margin-bottom: 16px; }
.keep-pick > .field { flex: 1 1 220px; }
.keep-own { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr 110px; gap: 12px; }
.keep-chart { display: block; width: 100%; height: auto; margin: 4px 0 6px; }
.kc-grid { stroke: var(--line); stroke-width: 1; }
.kc-grid.is-base { stroke: var(--border); }
.kc-axis { font-family: var(--mono); font-size: 11px; fill: var(--muted); }
.kc-line { fill: none; stroke-width: 2.5; stroke-linejoin: round; stroke-linecap: round; }
.kc-cost { stroke: var(--color-1); }
.kc-pay { stroke: var(--slate); }
.kc-pay.is-own { stroke-dasharray: 6 5; }
.kc-gap { stroke: none; }
.kc-gap.is-ahead { fill: color-mix(in srgb, var(--up) 18%, transparent); }
.kc-gap.is-behind { fill: color-mix(in srgb, var(--down) 18%, transparent); }
.keep-key { list-style: none; margin: 0 0 14px; padding: 0; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 13px; color: var(--ink-2); }
.keep-key li { display: flex; align-items: center; gap: 6px; }
.keep-key i { width: 16px; height: 3px; border-radius: 2px; }
.keep-key .kk-pay { background: var(--slate); }
.keep-key .kk-cost { background: var(--color-1); }
.keep-key .kk-ahead, .keep-key .kk-behind { height: 10px; width: 12px; border-radius: 3px; }
.keep-key .kk-ahead { background: color-mix(in srgb, var(--up) 30%, transparent); }
.keep-key .kk-behind { background: color-mix(in srgb, var(--down) 30%, transparent); }
.keep-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 8px; }
.keep-when { grid-column: 1 / -1; margin: 0; font-size: 12px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.keep-fact { padding: 10px 12px; border-radius: 10px; background: var(--surface); }
.keep-fact span { display: block; font-size: 12px; line-height: 1.4; color: var(--muted); }
.keep-fact b { display: block; margin-top: 2px; font-family: var(--mono); font-size: 16px; font-weight: 500; color: var(--ink); }
/* Less left over, or more hours of work, is bad news: red, as for costs */
.keep-fact b.up { color: var(--down); }
.keep-fact b.down { color: var(--up); }
@media (max-width: 560px) {
  .keep-own { grid-template-columns: 1fr 1fr; }
  .keep-own > .field:last-child { grid-column: 1 / -1; }
}

/* ---------- Your pay / Buying power: the toggle at the card's top ---------- */
.money-views { display: flex; gap: 4px; width: max-content; max-width: 100%; margin-bottom: 18px; padding: 4px; border-radius: 12px; background: var(--surface); }
.money-view {
  min-height: 36px; padding: 0 16px; border: 0; border-radius: 9px; background: transparent;
  font-family: inherit; font-size: 13px; font-weight: 500; color: var(--ink-2); cursor: pointer;
}
.money-view:hover { color: var(--ink); }
.money-view[aria-selected="true"] { background: var(--card); color: var(--ink); font-weight: 700; box-shadow: 0 1px 2px rgba(27, 26, 23, 0.14); }
.money-view:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- Buying power ---------- */
.power-inputs { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.1fr); gap: 12px; margin-bottom: 16px; }
@media (max-width: 760px) { .power-inputs { grid-template-columns: 1fr 1fr; } }
@media (max-width: 420px) { .power-inputs { grid-template-columns: 1fr; } }

/* The ZIP box's rent line, with its button */
.zip-rent { display: block; margin-top: 4px; }
.zip-rent .link-btn { padding: 0; font-size: 12px; }
.zip-rent .link-btn:disabled { color: var(--muted); cursor: default; }

/* ---------- Credit card payoff ---------- */
.cc-inputs { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 560px) { .cc-inputs { grid-template-columns: 1fr; } }
#cc-apr-hint { margin: 6px 0 12px; }
.cc-quick { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.cc-chip {
  min-height: 32px; padding: 0 12px; border: 1px solid var(--border); border-radius: 999px; background: var(--card);
  font: 500 12.5px var(--sans); color: var(--ink-2); cursor: pointer;
}
.cc-chip:hover { background: var(--nav-fill); color: var(--ink); }
.cc-chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--bg); font-weight: 700; }
.cc-chip:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.cc-min { stroke: var(--color-2); stroke-dasharray: 6 5; }
.keep-key .kk-min { background: var(--color-2); }
#cc-add-budget { margin-top: 14px; }

/* The card: the site's charcoal, with red-orange foil. It's a physical
   object, so its colors are its own. */
.cc-top { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: 28px; align-items: center; margin-bottom: 4px; }
.cc-how { margin: 0 0 6px; font-size: 14px; color: var(--ink-2); }
.cc-controls .field-hint { margin: 0 0 14px; }
.cc-quick-label { margin-bottom: 6px; font-size: 13px; font-weight: 700; color: var(--ink); }
.cc-status { margin: 4px 0 0; }
.cc-controls #cc-add-budget { margin-top: 12px; }
@media (max-width: 760px) { .cc-top { grid-template-columns: 1fr; gap: 16px; } }
.cc-stage { touch-action: pan-y; padding: 14px 4px 4px; }
.cc-scene {
  --px: 0; --py: 0; --gx: 50%; --gy: 50%; --heat: 0.7;
  --foil: #FCEDE4; --foil-dim: #E2B39C; --card-a: #2C2B28; --card-b: #191816; --card-c: #24231F;
  position: relative; width: min(540px, 100%); margin: 0 auto; aspect-ratio: 856 / 540;
  perspective: 1100px; container-type: inline-size;
}
.cc-shadow {
  position: absolute; left: 8%; right: 8%; bottom: -9%; height: 22%; border-radius: 50%;
  background: rgba(27, 26, 23, 0.4); filter: blur(20px); opacity: 0.8;
  transform: translate3d(calc(var(--px) * -30px), calc(var(--py) * -8px), 0) scale(calc(1 - var(--py) * 0.06));
}
.cc-tilt {
  position: absolute; inset: 0; transform-style: preserve-3d;
  transform: rotateX(calc(var(--py) * -14deg)) rotateY(calc(var(--px) * 14deg));
}
.cc-flip { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform 0.9s cubic-bezier(0.3, 0.7, 0.2, 1); }
.cc-scene.is-flipped .cc-flip { transform: rotateY(180deg); }
.cc-face { position: absolute; inset: 0; transform-style: preserve-3d; backface-visibility: hidden; -webkit-backface-visibility: hidden; --dir: 1; }
.cc-face > * { backface-visibility: hidden; -webkit-backface-visibility: hidden; }
.cc-back { transform: rotateY(180deg); --dir: -1; }
.cc-base {
  position: absolute; inset: 0; border-radius: 4.2cqw; overflow: hidden;
  background: linear-gradient(135deg, var(--card-a) 0%, var(--card-b) 58%, var(--card-c) 100%);
  box-shadow: inset 0 0 0 1px rgba(246, 176, 143, 0.2), inset 0 1.2cqw 2cqw rgba(255, 255, 255, 0.06);
}
.cc-back .cc-base { background: linear-gradient(160deg, var(--card-b) 0%, #2B2A27 100%); }
.cc-contours {
  position: absolute; left: -6%; top: -6%; width: 112%; height: 112%; fill: none; stroke: #FA3600; stroke-width: 1.3; opacity: 0.6;
  transform: translate(calc(var(--px) * var(--dir) * -16px), calc(var(--py) * -11px));
}
/* The sheen warms with the interest rate */
.cc-sheen {
  position: absolute; inset: 0; mix-blend-mode: screen; background-size: 260% 100%;
  background-image: linear-gradient(112deg, transparent 32%, rgba(255, calc(220 - var(--heat) * 120), calc(180 - var(--heat) * 140), calc(0.08 + var(--heat) * 0.1)) 46%, rgba(255, 255, 255, 0.06) 50%, transparent 64%);
  background-position: calc(50% + var(--px) * var(--dir) * -45%) 0;
}
.cc-glare { position: absolute; inset: 0; mix-blend-mode: overlay; background: radial-gradient(circle at var(--gx) var(--gy), rgba(255, 255, 255, 0.28), rgba(255, 255, 255, 0) 46%); }
/* Layers float at depth --z, nearer ones sliding further */
.cc-layer {
  position: absolute; filter: drop-shadow(0 0.7cqw 0.9cqw rgba(0, 0, 0, 0.38));
  transform: translate3d(calc(var(--px) * var(--dir, 1) * var(--z) * -0.1px), calc(var(--py) * var(--z) * -0.08px), calc(var(--z) * 1px));
}
.cc-brand { left: 7cqw; top: 6.4cqw; font: 800 4.4cqw/1 var(--sans); letter-spacing: 0.14em; color: var(--foil); }
.cc-brand span { color: #FF6A33; }
.cc-tier { right: 7cqw; top: 5.4cqw; text-align: right; font: 500 3.4cqw var(--mono); color: var(--foil); }
.cc-emv {
  left: 7cqw; top: 19cqw; width: 12.5cqw; height: 9.6cqw; border-radius: 1.8cqw;
  background:
    linear-gradient(90deg, transparent 32%, rgba(80, 30, 10, 0.45) 32% 34%, transparent 34% 66%, rgba(80, 30, 10, 0.45) 66% 68%, transparent 68%),
    linear-gradient(0deg, transparent 32%, rgba(80, 30, 10, 0.45) 32% 34%, transparent 34% 66%, rgba(80, 30, 10, 0.45) 66% 68%, transparent 68%),
    linear-gradient(135deg, #F8D2B8, #C98A68 52%, #EDB99B);
}
.cc-number { left: 7cqw; top: 32cqw; font: 500 8.4cqw/1 var(--mono); letter-spacing: 0.04em; white-space: nowrap; color: var(--foil);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.55), 0 -1px 0 rgba(255, 255, 255, 0.2); }
/* Typing on the card: the numbers are boxes, underlined, outlined when in use */
.cc-field { display: block; cursor: text; }
.cc-entry { display: inline-flex; align-items: baseline; white-space: nowrap; }
.cc-entry input {
  width: 4ch; min-width: 2ch; padding: 0 0.1em; margin: 0 0.05em; border: 0; border-bottom: 0.25cqw dashed var(--foil-dim); border-radius: 0;
  background: transparent; color: inherit; font: inherit; letter-spacing: inherit; text-shadow: inherit; -moz-appearance: textfield; appearance: textfield;
}
.cc-entry input::-webkit-outer-spin-button, .cc-entry input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.cc-entry input:hover { border-bottom-color: var(--foil); }
.cc-entry input:focus { outline: 0.4cqw solid #FF6A33; outline-offset: 0.5cqw; border-bottom-color: transparent; border-radius: 0.6cqw; }
.cc-number small, .cc-meta small, .cc-fine small, .cc-tier small { display: block; margin-bottom: 0.8cqw; font: 600 max(10px, 2.2cqw) var(--mono); letter-spacing: 0.16em; text-transform: uppercase; color: var(--foil-dim); text-shadow: none; }
.cc-meta { left: 7cqw; right: 7cqw; bottom: 6.4cqw; display: flex; gap: 6cqw; font-family: var(--mono); text-transform: uppercase; }
.cc-meta b, .cc-meta .cc-entry { display: block; font-weight: 500; font-size: 3.4cqw; letter-spacing: 0.04em; color: var(--foil); }
.cc-meta .cc-entry { display: inline-flex; }
.cc-stamp {
  right: 6cqw; top: 22cqw; padding: 1cqw 2cqw; border: 0.5cqw solid #FA3600; border-radius: 1cqw; transform-origin: center;
  font: 800 2.6cqw var(--sans); letter-spacing: 0.12em; text-transform: uppercase; color: #FA3600; rotate: -8deg;
}
.cc-stripe { left: 0; right: 0; top: 8cqw; height: 10cqw; background: #0E0E0C; filter: none; }
.cc-fine { left: 7cqw; right: 21cqw; top: 21.5cqw; font: 400 2.55cqw/1.4 var(--sans); color: var(--foil); }
.cc-fine p { margin: 0 0 1.1cqw; }
.cc-fine .cc-fine-foot { font-size: 2.1cqw; color: var(--foil-dim); }
.cc-holo {
  right: 7cqw; top: 25cqw; width: 11cqw; height: 11cqw; border-radius: 50%;
  background: conic-gradient(from calc(40deg + var(--px) * 140deg), #F6B08F, #FA3600, #F8D2B8, #C98A68, #F6B08F);
  box-shadow: inset 0 0 0 0.5cqw rgba(255, 255, 255, 0.35);
}
/* The time machine: the balance at the month picked stands in for today's */
.cc-scene.is-time .cc-number.cc-field { visibility: hidden; }
.cc-then { pointer-events: none; }
.cc-meta small { white-space: nowrap; }
.cc-progress { left: 7cqw; right: 7cqw; bottom: 3.2cqw; height: 0.7cqw; border-radius: 1cqw; background: rgba(252, 237, 228, 0.15); overflow: hidden; filter: none; }
.cc-progress i { display: block; height: 100%; width: 0; background: #FF6A33; }
.cc-stamp.is-done { color: #9FE3B8; border-color: #9FE3B8; }
.cc-time { display: flex; align-items: center; gap: 10px; max-width: min(540px, 100%); margin: 14px auto 0; }
/* The month slider, in the site's colors: a thin stone track that fills
   red-orange up to a red-orange handle with a white ring */
:is(.cc-time, .afford-share) input[type="range"] {
  --fill: 0%;
  flex: 1; min-width: 0; height: 28px; margin: 0; background: transparent; cursor: pointer;
  -webkit-appearance: none; appearance: none;
}
:is(.cc-time, .afford-share) input[type="range"]::-webkit-slider-runnable-track {
  height: 4px; border-radius: 2px;
  background: linear-gradient(to right, #FA3600 var(--fill), var(--border) var(--fill));
}
:is(.cc-time, .afford-share) input[type="range"]::-moz-range-track { height: 4px; border-radius: 2px; background: var(--border); }
:is(.cc-time, .afford-share) input[type="range"]::-moz-range-progress { height: 4px; border-radius: 2px; background: #FA3600; }
:is(.cc-time, .afford-share) input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; appearance: none; width: 18px; height: 18px; margin-top: -7px; border-radius: 50%;
  background: #FA3600; border: 3px solid #FFFFFF; box-shadow: 0 1px 3px rgba(27, 26, 23, 0.35);
  transition: transform 0.12s ease;
}
:is(.cc-time, .afford-share) input[type="range"]::-moz-range-thumb {
  width: 12px; height: 12px; border-radius: 50%;
  background: #FA3600; border: 3px solid #FFFFFF; box-shadow: 0 1px 3px rgba(27, 26, 23, 0.35);
}
:is(.cc-time, .afford-share) input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.15); }
:is(.cc-time, .afford-share) input[type="range"]:focus-visible { outline: none; }
:is(.cc-time, .afford-share) input[type="range"]:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
:is(.cc-time, .afford-share) input[type="range"]:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 3px var(--bg), 0 0 0 5px var(--ink); }
/* What Can I Afford?: the share slider, its value beside its name */
.afford-share .field-label { display: flex; justify-content: space-between; gap: 8px; }
.afford-share .field-label b { font: 500 14px var(--mono); color: var(--ink); }
.afford-share input[type="range"] { width: 100%; }
.afford-share .cc-quick { margin: 6px 0 4px; }
.mort-views { margin-bottom: 14px; }
.cc-month-label { flex: none; min-width: 9ch; text-align: right; font: 500 12.5px var(--mono); color: var(--ink-2); }
.cc-marker line { stroke: var(--ink); stroke-width: 1; stroke-dasharray: 3 3; }
.cc-marker circle { fill: #FA3600; stroke: var(--card); stroke-width: 2; }
.cc-flip-btn { margin-top: 8px !important; }

/* Touch screens: at least 16px, so they're easy to tap and phones don't zoom
   the page when one is chosen */
@media (pointer: coarse) {
  .cc-tier, .cc-meta b, .cc-meta .cc-entry { font-size: max(16px, 3.4cqw); }
  .cc-meta { gap: 4cqw; bottom: 5cqw; }
  .cc-entry input { padding-block: 1cqw; }
  /* (and the rest moves up to make room) */
  .cc-emv { top: 14cqw; width: 10.5cqw; height: 7.5cqw; }
  .cc-number { top: 22.5cqw; font-size: 7.2cqw; }
}
/* Taps go only to the boxes on the side facing you: some browsers let the
   card's hidden back (or its decoration) catch them otherwise */
.cc-scene * { pointer-events: none; }
.cc-scene:not(.is-flipped) .cc-front .cc-field, .cc-scene:not(.is-flipped) .cc-front .cc-field * { pointer-events: auto; }
.cc-flip-btn { display: block; margin: 14px auto 0; font-size: 13px; }
@media (prefers-reduced-motion: reduce) { .cc-flip { transition-duration: 0.01s; } }

/* ---------- Car loan calculator ---------- */
/* The term, picked like a gear */
.car-gears { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: var(--surface); width: max-content; max-width: 100%; }
.car-gear {
  min-width: 52px; min-height: 44px; display: flex; flex-direction: column; align-items: center; justify-content: center;
  border: 0; border-radius: 9px; background: transparent; color: var(--ink-2); cursor: pointer; font-family: var(--mono);
}
.car-gear b { font-size: 15px; font-weight: 500; line-height: 1; }
.car-gear small { font-size: 10px; color: var(--muted); }
.car-gear:hover { color: var(--ink); }
.car-gear[aria-checked="true"] { background: var(--color-1); color: #FFFFFF; }
.car-gear[aria-checked="true"] small { color: #D9D9D2; }
.car-gear:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* The cluster: a dark dashboard with cream numbers and red-orange needles */
.car-cluster {
  --dash: #1E1D1A; --dial-ink: #F4E9DF; --dial-dim: #A8A096; --needle: #FA3600;
  padding: 18px 16px 16px; border-radius: 22px; color: var(--dial-ink);
  background: radial-gradient(ellipse 80% 60% at 50% 0, #2E2D29, var(--dash) 70%);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06), 0 10px 30px rgba(27, 26, 23, 0.25);
}
.car-dials { display: grid; grid-template-columns: 1fr 1.5fr 1fr; align-items: end; gap: 6px; }
.car-dial { position: relative; touch-action: none; cursor: grab; border-radius: 50%; }
.car-dial.is-dragging { cursor: grabbing; }
.car-dial[role="img"] { cursor: default; }
.car-dial:focus-visible { outline: 2px solid #FF6A33; outline-offset: 2px; }
.car-dial svg { display: block; width: 100%; height: auto; overflow: visible; }
.g-face { fill: rgba(255, 255, 255, 0.03); stroke: rgba(255, 255, 255, 0.07); }
.g-rim { fill: none; stroke: rgba(244, 233, 223, 0.25); stroke-width: 1.2; }
.g-zone { fill: none; stroke-width: 8; }
.g-zone.is-hot { stroke: rgba(250, 54, 0, 0.55); }
.g-zone.is-warn { stroke: rgba(230, 170, 60, 0.55); }
.g-zone.is-ok { stroke: rgba(110, 190, 140, 0.45); }
.g-tick { stroke: var(--dial-ink); stroke-width: 2; }
.g-tick.is-minor { stroke: var(--dial-dim); stroke-width: 1; }
.g-num { fill: var(--dial-dim); font: 600 15px var(--mono); text-anchor: middle; }
.g-needle { transition: transform 0.6s cubic-bezier(0.3, 1.4, 0.5, 1); }
.car-dial.is-dragging .g-needle { transition: none; }
.g-needle path { fill: var(--needle); filter: drop-shadow(0 0 4px rgba(250, 54, 0, 0.6)); }
.g-hub { fill: #3A3934; stroke: var(--dial-ink); stroke-width: 1.5; }
.g-value { fill: var(--dial-ink); font: 600 27px var(--mono); text-anchor: middle; }
.car-dial-main .g-value { font-size: 30px; }
.car-dial-side .g-value { font-size: 24px; }
.g-label { fill: var(--dial-dim); font: 600 12.5px var(--sans); text-anchor: middle; letter-spacing: 0.12em; text-transform: uppercase; }
.car-dial.is-off .g-needle, .car-dial.is-off .g-value { opacity: 0.35; }
.car-readouts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; margin-top: 10px; }
.car-readouts div { padding: 8px 10px; border-radius: 10px; background: rgba(0, 0, 0, 0.35); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.06); min-width: 0; }
.car-readouts small { display: block; font: 600 9.5px var(--sans); letter-spacing: 0.1em; text-transform: uppercase; color: var(--dial-dim); }
.car-readouts b { display: block; margin-top: 2px; font: 500 15px var(--mono); color: #FFD9B8; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* Warning lights: dim until they apply */
.car-lights { list-style: none; margin: 12px 0 0; padding: 0; display: grid; grid-template-columns: 1fr; gap: 6px; }
.car-light { display: grid; grid-template-columns: auto 1fr; column-gap: 8px; align-items: center; opacity: 0.4; }
.car-light i { width: 10px; height: 10px; border-radius: 50%; background: #5A574F; }
.car-light-name { font: 700 11px var(--sans); letter-spacing: 0.08em; text-transform: uppercase; }
.car-light-text { grid-column: 2; font-size: 12px; line-height: 1.35; color: var(--dial-dim); }
.car-light.is-on { opacity: 1; }
.car-light.is-on i { background: #FFB020; box-shadow: 0 0 8px 2px rgba(255, 176, 32, 0.6); }
.car-light.is-on .car-light-name { color: #FFC857; }
.car-worth { stroke: var(--slate); }
/* Savings goal: the progress bar, and the chart's lines */
.save-modes { margin: 4px 0 14px; }
/* (a little smaller than the other calculators' big number: it's often
   words, like "2 years 8 months") */
#save-big { font-size: 30px; }
.save-when { margin: 4px 0 10px; font-size: 14px; color: var(--ink-2); }
/* ---------- Inflation and student loan payoff ---------- */
.infl-swap { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start; margin: -4px 0 14px; }
.infl-dot { fill: var(--color-1); stroke: var(--card); stroke-width: 2; }
.sl-terms { margin-bottom: 6px; }
/* ---------- Gas cost and the debt payoff planner ---------- */
.gas-check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink-2); cursor: pointer; }
.gas-check input { width: 16px; height: 16px; accent-color: var(--ink); }
/* One row per debt: its name, balance, rate and minimum, and a remove button */
.dp-rows { display: flex; flex-direction: column; gap: 10px; margin: 4px 0 10px; }
.dp-row { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 0.8fr) minmax(0, 0.9fr) 32px; gap: 8px; align-items: end; }
.dp-cell { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.dp-label { font-size: 12px; font-weight: 700; color: var(--muted); }
.dp-row .money-input { width: auto; }
.dp-remove {
  display: grid; place-items: center; width: 32px; height: 40px; border: 0; border-radius: 8px;
  background: transparent; color: var(--muted); cursor: pointer;
}
.dp-remove:hover { color: var(--ink); background: var(--surface); }
.dp-remove:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.dp-add { margin-bottom: 20px; }
.dp-order { margin: 6px 0 0; padding-left: 20px; font-size: 14px; line-height: 1.7; color: var(--ink-2); }
.dp-order-title { margin-top: 16px; }
/* ---------- Rent, electricity and take-home pay ---------- */
.ra-range { width: 100%; accent-color: var(--ink); }
.pc-hourly { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pc-hourly[hidden] { display: none; }
.pc-split { margin-bottom: 0; }
/* Phones: name across the top, the three amounts in a row below it */
@media (max-width: 560px) {
  .dp-row { grid-template-columns: repeat(3, minmax(0, 1fr)) 28px; gap: 6px; padding-bottom: 10px; border-bottom: 1px solid var(--line); }
  .dp-row .money-input { padding: 0 8px; gap: 4px; }
  .dp-remove { width: 28px; }
  .dp-row .dp-name { grid-column: 1 / -1; }
}
.save-progress { height: 10px; border-radius: 5px; background: var(--surface); overflow: hidden; }
.save-progress i { display: block; height: 100%; width: 0; border-radius: 5px; background: var(--color-1); transition: width 0.3s ease; }
.save-progress-label { margin: 6px 0 14px; font-size: 13px; color: var(--muted); }
.save-bal { stroke: var(--color-1); }
.save-put { stroke: var(--slate); stroke-dasharray: 6 5; }
.save-goal-line { stroke: #FA3600; stroke-width: 1.5; stroke-dasharray: 3 4; }
.keep-key .kk-goal { background: #FA3600; }
/* Rent vs. buy: renting's line, and where you'd move out */
.rb-rent-line { stroke: var(--slate); }
.rb-stay-line { stroke: #FA3600; stroke-width: 1.5; stroke-dasharray: 3 4; }
.car-owed { stroke: var(--color-1); }
#car-add-budget { margin-top: 14px; }
/* The cluster gets the larger share of the row */
.calc.car-calc { grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); }
@media (max-width: 760px) {
  .calc.car-calc { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .car-dials { grid-template-columns: 1fr 1fr; }
  .car-dial-main { grid-column: 1 / -1; order: -1; max-width: 300px; justify-self: center; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { .g-needle { transition: none; } }

/* ---------- Your spending vs typical households ---------- */
.typical-pick { max-width: 420px; margin-bottom: 16px; }
.typical-table td:nth-child(2), .typical-table td:nth-child(3) { white-space: nowrap; }
.typical-share { display: block; font-size: 12px; color: var(--muted); }
.typical-share::after { content: " of spending"; }
.th-sub { display: block; margin-top: 2px; font-size: 10px; font-weight: 500; letter-spacing: 0.02em; text-transform: none; color: var(--muted); }
.typical-key-note { margin: -8px 0 14px; font-size: 13px; color: var(--ink-2); }
.typical-key-note b { color: var(--ink); }
/* Narrow: the shares just say "%" (the note above says what of) */
.plan-side .typical-share::after { content: ""; }
@media (max-width: 560px) { .typical-share::after { content: ""; } }
@media (max-width: 560px) { .typical-table th { white-space: normal; } }
.typical-bars { width: 30%; min-width: 90px; }
.typical-bars i { display: block; height: 7px; border-radius: 4px; }
.typical-bars i + i { margin-top: 3px; }
.typical-bars .is-you, .typical-legend .is-you { background: var(--color-1); }
.typical-bars .is-them, .typical-legend .is-them { background: var(--slate); opacity: 0.6; }
.typical-legend { display: inline-flex; align-items: center; gap: 5px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.typical-legend i { display: inline-block; width: 10px; height: 6px; border-radius: 3px; }
.typical-legend i + * { margin-right: 4px; }
@media (max-width: 560px) {
  .typical-table th:last-child, .typical-table td:last-child { display: none; }
}

/* ---------- Share as a picture ---------- */
.moved-send-btn { display: inline-flex; align-items: center; gap: 6px; margin: -4px 0 12px; font-size: 13px; }
.send-moved { margin-bottom: 16px; padding: 14px; border-radius: 14px; background: var(--surface); }
.send-moved-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.send-moved-title { font-size: 14px; font-weight: 700; color: var(--ink); }
.send-preview { display: block; width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); background: var(--card); aspect-ratio: 16 / 9; }
.send-moved-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.send-dollars { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); cursor: pointer; }
.send-moved .field-hint { margin: 8px 0 0; }
.send-status { margin: 4px 0 0; font-size: 13px; color: var(--ink-2); min-height: 1em; }

/* ---------- Mortgage calculator ---------- */
/* Payment colors, from the site's palette (styles.css): principal in
   charcoal, interest in red-orange, taxes in stone gray, then a pale gray,
   a light orange and a mid gray */
.budget {
  --m-principal: #282828; --m-interest: #FA3600; --m-tax: #72726F;
  --m-insurance: #B3B3AF; --m-pmi: #FC8C66; --m-hoa: #4A4A47;
}
.calc { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.calc-inputs { display: flex; flex-direction: column; gap: 12px; }
.field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.field-label { font-size: 13px; font-weight: 700; color: var(--ink); }
.field-hint { font-size: 12px; line-height: 1.5; color: var(--muted); }
.field-hint b { font-family: var(--mono); font-weight: 500; color: var(--ink); }
.field-optional { font-weight: 500; color: var(--muted); }
.field-text {
  width: 100%; min-height: 40px; padding: 0 10px;
  border: 1px solid var(--border); border-radius: 8px; background: var(--card);
  font-family: var(--mono); font-size: 15px; color: var(--ink); letter-spacing: 0.05em;
}
.field-text:focus { outline: 2px solid var(--ink-2); outline-offset: -1px; border-color: transparent; }
.field-pair { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.money-input.pct input { text-align: right; }
.money-input.pct span { white-space: nowrap; font-size: 12px; }
.field-select {
  min-height: 40px; padding: 0 10px; border: 1px solid var(--border); border-radius: 8px;
  background: var(--card); font-family: inherit; font-size: 14px; color: var(--ink); cursor: pointer;
}
.field-select:focus { outline: 2px solid var(--ink-2); outline-offset: -1px; border-color: transparent; }
.more-costs { border-top: 1px solid var(--line); padding-top: 10px; }
.more-costs summary { cursor: pointer; font-size: 14px; font-weight: 700; color: var(--ink-2); padding: 4px 0; }
.more-costs[open] summary { margin-bottom: 10px; }
.more-costs .field-pair { margin-bottom: 10px; }

/* The results sit on the page, with no box around them */
.calc-results { display: flex; flex-direction: column; gap: 12px; }
.calc-big { display: flex; flex-direction: column; gap: 2px; }
.calc-big-label { font-size: 13px; font-weight: 700; color: var(--muted); }
.calc-big-value { font-family: var(--mono); font-size: 40px; font-weight: 500; letter-spacing: -0.03em; line-height: 1.1; color: var(--ink); }
.calc-results .split { margin-top: 0; background: var(--card); }
.calc-results .split-legend { margin-top: 0; }
.calc-facts { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }
.calc-facts div { display: flex; flex-direction: column; gap: 2px; }
.calc-facts dt { font-size: 12px; color: var(--muted); }
.calc-facts dd { margin: 0; font-family: var(--mono); font-size: 15px; font-weight: 500; color: var(--ink); }
/* The note and the "Add to my budget" button sit on the page too: plain
   text, and a button with no box (underlined on hover) */
.calc-results .headline { margin: 0; padding: 0; border-radius: 0; background: none; font-size: 14px; }
.calc-results .add-line { margin-top: 0; align-self: flex-start; padding: 0; border: 0; background: none; }
.calc-results .add-line:hover { text-decoration: underline; text-underline-offset: 3px; }

.sub-title { margin: 24px 0 10px; font-size: 15px; color: var(--ink); }
.amort { position: relative; cursor: crosshair; border-radius: 6px; }
.amort:focus-visible { outline: 2px solid var(--ink-2); outline-offset: 4px; }
.amort svg { display: block; width: 100%; height: 148px; }
/* Year labels under the bars: first at the left edge, last at the right */
.amort-axis {
  position: relative; height: 18px; margin-top: 6px;
  font-family: var(--mono); font-size: 11px; color: var(--muted);
}
.amort-axis span { position: absolute; top: 0; white-space: nowrap; }
.amort-axis .first { left: 0; }
.amort-axis .mid { transform: translateX(-50%); }
.amort-axis .last { right: 0; }
/* While a year is shown, the other years fade */
.amort rect { transition: opacity 0.1s ease; }
.amort.hovering rect:not(.on) { opacity: 0.35; }

/* The numbers for the year being hovered */
.amort-tip {
  position: absolute; top: 0; z-index: 2; min-width: 220px;
  padding: 10px 12px; border-radius: 10px; background: var(--ink); color: #FFFFFF;
  box-shadow: 0 8px 24px rgba(27, 26, 23, 0.2); pointer-events: none;
  font-size: 12px; line-height: 1.5;
}
.amort-tip-title { margin-bottom: 4px; font-weight: 700; }
.amort-tip-row { display: flex; align-items: center; gap: 6px; }
.amort-tip-row i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.amort-tip-row span { flex: 1; color: rgba(255, 255, 255, 0.75); }
.amort-tip-row b { font-family: var(--mono); font-weight: 500; }
.amort-tip-row:nth-child(4) { margin-top: 4px; padding-top: 4px; border-top: 1px solid rgba(255, 255, 255, 0.15); }

@media (max-width: 720px) {
  .calc { grid-template-columns: minmax(0, 1fr); }
}

/* Phones: the budget as ruled tables, styled like the Glossary's folders:
   a dark heading bar, then one row per line (number, name, amount, remove)
   with the tracked price in small type under the name */
@media (max-width: 640px) {
  #plan { --sheet: #F0F0EA; }
  #plan .sheet-tab, #plan .lines-head {
    display: flex; justify-content: space-between; align-items: center; height: 30px; padding: 0 14px;
    background: var(--ink); color: var(--bg); border: 1px solid var(--ink);
    font: 700 11px/1 var(--mono); letter-spacing: 0.04em; text-transform: uppercase;
  }
  #plan .lines-head span:nth-child(n+2):not(.lines-count) { display: none; }
  #plan .lines-count { display: inline; font-weight: 400; opacity: 0.7; }

  /* A row: number, name, amount, remove */
  #plan .income, #plan .line {
    display: grid; grid-template-columns: 22px minmax(0, 1fr) auto 28px; column-gap: 8px; align-items: center;
    margin: 0; padding: 10px 6px 10px 14px; border-radius: 0; gap: 0 8px;
    background: var(--sheet) var(--grain); border: 1px solid var(--ink); border-top: 0;
  }
  #plan .income { margin-bottom: 18px; }
  #plan .income::before, #plan .line::before { font: 11px var(--mono); color: var(--muted); }
  #plan .income::before { content: "01"; }
  #plan .lines { gap: 0; counter-reset: line; }
  #plan .line::before { counter-increment: line; content: counter(line, decimal-leading-zero); }
  #plan .income-label { font-size: 14px; font-weight: 500; }
  #plan .income-label { grid-column: 2; }
  #plan .income .money-input { grid-column: 3 / 5; justify-self: end; padding-right: 8px; }

  /* Fields read as text: the name plain, the amount underlined */
  #plan .line .line-name {
    grid-column: 2; grid-row: 1; min-height: 0; padding: 2px 0; border: 0; border-radius: 0;
    background: transparent; font-size: 14px; font-weight: 500;
  }
  #plan .money-input { width: auto; min-height: 0; padding: 0; gap: 2px; font-size: 14px; border: 0; border-radius: 0; background: transparent; }
  #plan .money-input input {
    width: 7ch; padding: 0 0 1px; font-size: 14px; font-weight: 500;
    border-bottom: 1px dashed var(--border);
  }
  #plan .line .money-input { grid-column: 3; grid-row: 1; }
  #plan .money-input:focus-within { outline: 0; }
  #plan .line .line-name:focus, #plan .money-input input:focus { outline: 2px solid var(--ink-2); outline-offset: 2px; border-radius: 2px; }
  #plan .line .remove-line { grid-column: 4; grid-row: 1; width: 28px; height: 28px; }

  /* The tracked price under the name */
  #plan .track-wrap {
    grid-column: 2 / 4; grid-row: 2; display: flex; align-items: center; gap: 5px; margin-top: 4px;
    font: 11px var(--mono); color: var(--muted);
  }
  #plan .track-wrap { position: relative; justify-self: start; max-width: 100%; }
  #plan .track-label { display: inline; }
  #plan .track-text { display: inline; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
  #plan .untracked .track-label { display: none; }
  /* The list sits invisibly over the label and the choice, so tapping either opens it */
  #plan .line .line-track {
    position: absolute; inset: -6px 0; width: 100%; height: auto; min-height: 0; opacity: 0; font-size: 16px;
  }
  #plan .track-wrap:focus-within { outline: 2px solid var(--ink-2); outline-offset: 2px; border-radius: 2px; }

  /* Add a line: the table's last row */
  #plan .add-line {
    display: flex; width: 100%; margin: 0; padding: 0 14px; min-height: 44px;
    border: 1px solid var(--ink); border-top: 0; border-radius: 0; background: var(--sheet) var(--grain);
    color: var(--ink);
  }

  /* The summary as a short table, Left over in a dark bar */
  #plan .summary { padding-top: 0; border-top: 0; }
  #plan .summary-row {
    margin: 0; padding: 10px 14px; font-size: 14px; font-weight: 500;
    background: var(--sheet) var(--grain); border: 1px solid var(--ink); border-top: 0;
  }
  #plan .summary-row.total { background: var(--ink); color: var(--bg); }
  #plan .summary-row.total span:last-child { color: var(--bg); }
  #plan .summary-row.total.over span:last-child { color: #FF8A65; }
}
}

/* Section names that follow you down the page (see budget.js). The pin is a
   zero-height strip that sticks below the navigation bar until its section
   ends, then scrolls up with it; the name shows as a bar across the top of
   the section. */
.section-pin { position: sticky; top: 60px; height: 0; z-index: 5; }
.section-pin span {
  position: absolute; top: 0; left: -24px; right: -24px;
  padding: 10px 24px; background: var(--bg) var(--grain); border-bottom: 1px solid var(--card-border);
  font-size: 14px; font-weight: 700; line-height: 1.35; color: var(--ink);
  opacity: 0; transform: translateY(4px); transition: opacity 0.2s ease, transform 0.2s ease;
  pointer-events: none;
}
.section-pin.shown span { opacity: 1; transform: none; pointer-events: auto; }
/* The bar matches the background it sits on, inside the section's border;
   on the open sections it lines up with the content */
#plan .section-pin span, #mortgage .section-pin span { left: 0; right: 0; padding-left: 0; padding-right: 0; background: var(--bg) var(--grain); }
