/* Leftover Planner — shared upgrades loaded on every page, after the page's own styles.
   Self-hosted fonts, accessible brand green, "Keep going" links and the tool search. */

/* ---------- fonts (self-hosted Geist; "optional" means no layout jump when it loads) ---------- */
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: optional; src: url(/assets/fonts/geist-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist"; font-style: normal; font-weight: 100 900; font-display: optional; src: url(/assets/fonts/geist-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: optional; src: url(/assets/fonts/geistmono-latin.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Geist Mono"; font-style: normal; font-weight: 100 900; font-display: optional; src: url(/assets/fonts/geistmono-latin-ext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

/* ---------- brand green dark enough for white text and small green text (WCAG AA) ---------- */
:root:not([data-theme="dark"]) { --brand: #047857; --brand-dark: #065f46; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --brand: #10b981; --brand-dark: #34d399; } }
.aj-kick { color: #b4441d; }
.sponsor { color: #6b7a73; }

/* ---------- "Keep going" related links (same look as the state pages) ---------- */
.related { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin: 14px 0; }
.related a { display: block; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 14px 16px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); transition: border-color .2s, transform .2s; }
.related a:hover { border-color: var(--brand); transform: translateY(-1px); }
.related b { display: block; font-weight: 600; }
.related span { display: block; font-size: .84rem; color: var(--muted); margin-top: 2px; }
.lp-next { margin: 28px 0 8px; }
.lp-next h2 { font-size: 1.15rem; margin: 0 0 4px; }
.lp-next > p { margin: 0; color: var(--muted); font-size: .92rem; }

/* ---------- search button in the header ---------- */
.lpf-btn { display: inline-flex; align-items: center; gap: 8px; margin-left: auto; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink2, var(--ink)); font: inherit; font-size: .9rem; cursor: pointer; line-height: 1; }
.lpf-btn:hover { border-color: var(--brand); color: var(--ink); }
.lpf-btn svg { width: 16px; height: 16px; flex: none; }
.lpf-btn kbd { font: 500 .72rem var(--mono, ui-monospace, monospace); padding: 2px 6px; border-radius: 6px; border: 1px solid var(--line); color: var(--muted); }
header.top .lpf-btn + .lang-btn { margin-left: 8px; }
@media (max-width: 720px) { .lpf-btn .lpf-lab, .lpf-btn kbd { display: none; } .lpf-btn { padding: 8px; } }

/* ---------- search dialog ---------- */
.lpf { border: 0; padding: 0; margin: 9vh auto auto; width: min(640px, calc(100vw - 24px)); max-height: 76vh; border-radius: 18px; background: var(--surface, #fff); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); overflow: hidden; }
.lpf::backdrop { background: rgba(10, 20, 16, .45); backdrop-filter: blur(2px); }
.lpf-in { display: flex; flex-direction: column; max-height: 76vh; }
.lpf-q { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.lpf-q svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.lpf-q input { flex: 1; border: 0; outline: 0; background: transparent; font: inherit; font-size: 1.05rem; color: var(--ink); padding: 4px 0; box-shadow: none !important; }
.lpf-q button { border: 1px solid var(--line); background: transparent; color: var(--muted); border-radius: 8px; padding: 4px 8px; font: inherit; font-size: .78rem; cursor: pointer; }
.lpf-list { overflow-y: auto; padding: 8px; }
.lpf-h { font-size: .72rem; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 10px 10px 6px; }
.lpf-r { display: grid; grid-template-columns: auto 1fr; gap: 2px 12px; align-items: center; padding: 10px; border-radius: 12px; color: var(--ink); text-decoration: none; }
.lpf-r i { grid-row: span 2; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; background: var(--brand-wash, #e2f5eb); color: var(--brand-dark, #065f46); font-style: normal; font-size: .9rem; font-weight: 700; }
.lpf-r b { font-weight: 600; }
.lpf-r small { color: var(--muted); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lpf-r[aria-selected="true"], .lpf-r:hover { background: var(--brand-wash, #e2f5eb); }
.lpf-r[aria-selected="true"] b { color: var(--brand-dark, #065f46); }
.lpf-none { padding: 22px 12px; color: var(--muted); text-align: center; }
.lpf-foot { display: flex; gap: 16px; padding: 10px 16px; border-top: 1px solid var(--line); font-size: .78rem; color: var(--muted); }
.lpf-foot kbd { font: 500 .72rem var(--mono, ui-monospace, monospace); padding: 1px 5px; border-radius: 5px; border: 1px solid var(--line); }
@media (max-width: 600px) { .lpf { margin-top: 12px; max-height: 88vh; } .lpf-in { max-height: 88vh; } .lpf-foot { display: none; } }

/* ---------- homepage: filter the calculators ---------- */
.tbx-find { position: relative; margin: 16px 0 4px; max-width: 460px; }
.tbx-find svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.tbx-find input { width: 100%; padding: 12px 14px 12px 42px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); font: inherit; font-size: 1rem; }
.tbx-find input:focus { outline: none; border-color: var(--brand); }
.tbx.filtering .tbx-tabs { display: none; }
.tbx.filtering .tbx-grid[hidden] { display: grid !important; }
.tbx.filtering .tbx-card.lpf-out { display: none; }
.tbx-none { display: none; padding: 18px; border: 1px dashed var(--line); border-radius: 14px; color: var(--muted); text-align: center; }
.tbx.filtering.empty .tbx-none { display: block; }

/* ---------- homepage: guides and "why trust it" ---------- */
.lp-sec { margin: 56px 0 0; }
.lp-sec .sec-kick { display: inline-block; margin-bottom: 6px; }
.lp-sec h2 { margin: 0 0 8px; font-size: clamp(1.6rem, 4vw, 2rem); font-weight: 650; letter-spacing: -.025em; line-height: 1.15; }
.lp-sec > p { margin: 0 0 18px; color: var(--muted); max-width: 62ch; }
.lp-guides { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 860px) { .lp-guides { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .lp-guides { grid-template-columns: 1fr; } }
.lp-guides a { display: flex; flex-direction: column; gap: 6px; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: var(--surface); color: var(--ink); text-decoration: none; box-shadow: var(--shadow); transition: border-color .2s, transform .2s; }
.lp-guides a:hover { border-color: var(--brand); transform: translateY(-2px); }
.lp-guides small { font-size: .74rem; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--brand-dark); }
.lp-guides b { font-size: 1.05rem; line-height: 1.3; }
.lp-guides span { color: var(--muted); font-size: .9rem; }
.lp-more { display: inline-block; margin-top: 14px; font-weight: 600; color: var(--brand-dark); }
.lp-trust { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.lp-trust div { padding: 18px; border-radius: 16px; background: var(--brand-wash, #e2f5eb); }
.lp-trust b { display: block; font-size: 1.02rem; margin-bottom: 4px; color: var(--ink); }
.lp-trust p { margin: 0; color: var(--ink2, var(--ink)); font-size: .92rem; line-height: 1.5; }
.lp-trust a { color: var(--brand-dark); }

/* search button inside the slim top bar used by a few tools */
.lpbar-in .lpf-btn { margin-left: auto; margin-right: 10px; padding: 5px 10px; font-size: .82rem; }
.lpbar-in .lpf-btn + .lpbar-all { margin-left: 0; }

/* planner pages: the planner fills <main> with script. Until it has, keep what follows invisible
   so it doesn't visibly jump down when the planner appears. */
#main:empty ~ * { visibility: hidden; }

/* pay stub box (copied from paystub.js so it is styled before that script runs) */
.stubbox{margin:2px 0 14px}.stubdrop{display:flex;align-items:center;gap:12px;flex-wrap:wrap;border:1.5px dashed color-mix(in srgb,currentColor 28%,transparent);border-radius:14px;padding:12px 14px;cursor:pointer;transition:border-color .2s,background .2s}
.stubdrop:hover,.stubdrop.over{border-color:var(--brand,#0a7);background:color-mix(in srgb,var(--brand,#0a7) 6%,transparent)}.stubdrop:focus-within{outline:2px solid var(--brand,#0a7);outline-offset:2px}
.stubic svg{width:26px;height:26px;color:var(--brand,#0a7);display:block}.stubtx{flex:1;min-width:200px;display:flex;flex-direction:column;gap:2px}.stubtx b{font-size:.98rem}.stubtx span{font-size:.84rem;opacity:.75;line-height:1.4;font-weight:400}
.stubbtn{font-weight:650;font-size:.86rem;padding:8px 12px;border-radius:999px;background:var(--brand,#0a7);color:var(--brand-ink,#fff);white-space:nowrap}.stubin{position:absolute;width:1px;height:1px;opacity:0;pointer-events:none}
.stubres{margin-top:10px;border:1px solid color-mix(in srgb,currentColor 16%,transparent);border-radius:14px;padding:12px 14px}.stubres h3{font-size:.95rem;margin:0 0 8px}.stubres .sg{display:grid;grid-template-columns:repeat(auto-fit,minmax(min(100%,190px),1fr));gap:6px 14px}
.stubres label{display:flex;gap:8px;align-items:baseline;font-size:.88rem;cursor:pointer}.stubres label b{margin-left:auto;font-variant-numeric:tabular-nums}.stubres .sn{font-size:.8rem;opacity:.7;margin:8px 0}
.stubres .sbtn{font:inherit;font-weight:650;font-size:.88rem;border:0;border-radius:999px;padding:9px 14px;background:var(--brand,#0a7);color:var(--brand-ink,#fff);cursor:pointer}
.stubcmp{width:100%;border-collapse:collapse;font-size:.88rem;margin:4px 0 8px;font-variant-numeric:tabular-nums}.stubcmp th,.stubcmp td{text-align:right;padding:5px 4px;border-bottom:1px solid color-mix(in srgb,currentColor 12%,transparent)}.stubcmp th:first-child,.stubcmp td:first-child{text-align:left}
.stubmsg{font-size:.86rem;line-height:1.45}.stubwarn{font-size:.82rem;opacity:.8;margin:0 0 6px}

/* car deal checker: example tag readable on its grey background */
#exTag { color: #b3170f; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* small phones: the search button stands in for "Calculators" so the language switch stays visible */
@media (max-width: 440px) {
  header.top nav [data-jump="toolbox"], header.top nav [data-jump="tools"] { display: none; }
  .lpbar-in .lpf-btn { padding: 5px; margin-right: 6px; }
}

/* ==== fx: start ==== */
/* Pointer and scroll effects added November 2026: lit card borders, screenshot tilt, button sheen,
   a travelling border light, and a soft pointer glow. Everything here is decoration only: it is skipped
   for people who ask for reduced motion, and removing this block changes nothing else. */
:root { --fx-c: rgb(5 150 105 / .95); --fx-ring: 1.5px; --fx-orbit: #6ee7b7; --fx-sheen: rgba(255, 255, 255, .42); --fx-glare: rgba(255, 255, 255, .10); }
/* Pointer-lit card borders: the edge nearest the pointer lights up, on the card under it and its neighbours. */
.fx-rel { position: relative; }
.fx-glow::after { content: ""; position: absolute; inset: calc(-1 * var(--fx-bw, 1px)); border-radius: inherit; padding: var(--fx-ring, 1px); pointer-events: none; z-index: 1;
  background: radial-gradient(var(--fx-rad, 280px) circle at var(--fx-x, -999px) var(--fx-y, -999px), var(--fx-c), transparent 100%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
  mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
  opacity: 0; transition: opacity .4s ease; }
.fx-glow.fx-glow-in::after { inset: 0; }
.fx-glow.fx-near::after { opacity: 1; }

/* Screenshots lean a few degrees toward the pointer, with a soft highlight. */
.fx-tilt { transform: perspective(1400px) rotateX(var(--fx-rx, 0deg)) rotateY(var(--fx-ry, 0deg)); transition: transform .6s cubic-bezier(.2, .7, .2, 1); }
.fx-tilt.fx-live { transition-duration: .14s; transition-timing-function: linear; }
.fx-glare::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none; z-index: 2;
  background: radial-gradient(520px circle at var(--fx-gx, 50%) var(--fx-gy, 50%), var(--fx-glare, rgba(255, 255, 255, .13)), transparent 60%);
  opacity: 0; transition: opacity .4s ease; }
.fx-glare.fx-live::after { opacity: 1; }

/* A band of light crosses the main buttons on hover, and once when they first come into view. */
.fx-sheen::after { content: ""; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(105deg, transparent 38%, var(--fx-sheen, rgba(255, 255, 255, .4)) 50%, transparent 62%) no-repeat; background-size: 260% 100%; background-position: 165% 0; }
.fx-sheen:hover::after, .fx-sheen.fx-go::after { animation: fx-sheen .9s cubic-bezier(.3, .6, .2, 1) 1; }
@keyframes fx-sheen { from { background-position: 165% 0; } to { background-position: -65% 0; } }

/* One slow light travels round the border of the flagship block (wide screens only). */
@property --fx-a { syntax: "<angle>"; inherits: false; initial-value: 0deg; }
@media (min-width: 900px) {
  .fx-orbit::before { content: ""; position: absolute; inset: calc(-1 * var(--fx-bw, 1px)); border-radius: inherit; padding: var(--fx-ring, 1px); pointer-events: none; z-index: 1;
    background: conic-gradient(from var(--fx-a), transparent 0 62%, var(--fx-orbit) 80%, transparent 96%);
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor;
    mask: linear-gradient(#000 0 0) content-box exclude, linear-gradient(#000 0 0);
    animation: fx-orbit 9s linear infinite; animation-play-state: paused; opacity: 0; transition: opacity .8s ease; }
  .fx-orbit.fx-orbit-in::before { inset: 0; }
  .fx-orbit.fx-on::before { animation-play-state: running; opacity: 1; }
}
@keyframes fx-orbit { to { --fx-a: 360deg; } }

/* Screenshots ease from slightly zoomed to their real size as they scroll into view. */
@supports (animation-timeline: view()) {
  .fx-settle { animation: fx-settle linear both; animation-timeline: view(); animation-range: entry 0% cover 42%; transform-origin: 50% 0; }
}
@keyframes fx-settle { from { transform: scale(1.07); } to { transform: scale(1); } }

/* Blocks below the first screen fade and rise in as they are reached. */
.fx-r { opacity: 0; transform: translateY(18px); transition: none !important; }
.fx-r.fx-in { opacity: 1; transform: none; transition: opacity .7s cubic-bezier(.2, .7, .2, 1) var(--fx-d, 0ms), transform .8s cubic-bezier(.2, .7, .2, 1) var(--fx-d, 0ms) !important; }

/* A soft light follows the pointer across dark pages. */
.fx-aura { position: fixed; left: 0; top: 0; width: 720px; height: 720px; margin: -360px 0 0 -360px; border-radius: 50%; pointer-events: none; z-index: 1;
  background: radial-gradient(closest-side, var(--fx-aura), transparent 100%); mix-blend-mode: screen; opacity: 0; transition: opacity .6s ease; will-change: transform; }
.fx-aura.fx-on { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .fx-glow::after, .fx-glare::after, .fx-sheen::after, .fx-orbit::before, .fx-aura { display: none !important; }
  .fx-tilt, .fx-settle { transform: none !important; animation: none !important; }
  .fx-r { opacity: 1 !important; transform: none !important; transition: none !important; }
}
@media print {
  .fx-glow::after, .fx-glare::after, .fx-sheen::after, .fx-orbit::before, .fx-aura { display: none !important; }
  .fx-tilt, .fx-settle, .fx-r { opacity: 1 !important; transform: none !important; animation: none !important; }
}
/* ==== fx: end ==== */
