/* Bundled faces, so the app looks the same on every phone and computer and
   works offline: Inter for text, Source Serif 4 Display for money. Both SIL
   Open Font License (web/fonts/LICENSE-*). */
@font-face { font-family: "Inter"; src: url("../fonts/inter-variable.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap; }
@font-face { font-family: "Source Serif Display"; src: url("../fonts/source-serif-4-display.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap; }

/* Hone Audit: a quiet private-bank workbench. One loud thing per screen
   (the amount owed back); everything else is paper, ink and hairlines.
   System faces render as SF Pro on Apple devices and Segoe/Roboto elsewhere. */
:root {
  --paper: #f3f5f2; --sheet: #ffffff; --ink: #101412; --ink-2: #48504c; --ink-3: #636c67;
  --rule: rgba(16, 20, 18, .09); --rule-2: rgba(16, 20, 18, .16); --glass: rgba(243, 245, 242, .82);
  --accent: #0d5a43; --accent-ink: #ffffff; --accent-soft: #e2ede8;
  --brass: #7d5f27; --brass-soft: #f2ebdd; --warn: #9b3b2b; --warn-soft: #f6e6e2;
  --shadow: 0 1px 2px rgba(16, 20, 18, .04), 0 12px 32px -12px rgba(16, 20, 18, .14);
  --shadow-lg: 0 24px 64px -24px rgba(16, 20, 18, .35);
  --display: "Inter", -apple-system, "SF Pro Display", BlinkMacSystemFont, "Segoe UI Variable Display", "Segoe UI", Roboto, system-ui, sans-serif;
  --text: "Inter", -apple-system, "SF Pro Text", BlinkMacSystemFont, "Segoe UI", Roboto, system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --r: 20px; --tabbar: 64px;
  --safe-t: env(safe-area-inset-top, 0px); --safe-b: env(safe-area-inset-bottom, 0px);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --paper: #0a0d0c; --sheet: #121715; --ink: #eef2ef; --ink-2: #b2bbb6; --ink-3: #7e8984;
  --rule: rgba(238, 242, 239, .08); --rule-2: rgba(238, 242, 239, .16); --glass: rgba(10, 13, 12, .78);
  --accent: #7fd6ae; --accent-ink: #0a0d0c; --accent-soft: #132720;
  --brass: #d9b66e; --brass-soft: #241e12; --warn: #f09a86; --warn-soft: #2a1612;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -16px rgba(0, 0, 0, .7);
  --shadow-lg: 0 24px 64px -24px rgba(0, 0, 0, .9); color-scheme: dark; } }
:root[data-theme="dark"] {
  --paper: #0a0d0c; --sheet: #121715; --ink: #eef2ef; --ink-2: #b2bbb6; --ink-3: #7e8984;
  --rule: rgba(238, 242, 239, .08); --rule-2: rgba(238, 242, 239, .16); --glass: rgba(10, 13, 12, .78);
  --accent: #7fd6ae; --accent-ink: #0a0d0c; --accent-soft: #132720;
  --brass: #d9b66e; --brass-soft: #241e12; --warn: #f09a86; --warn-soft: #2a1612;
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 16px 40px -16px rgba(0, 0, 0, .7);
  --shadow-lg: 0 24px 64px -24px rgba(0, 0, 0, .9); color-scheme: dark;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; min-height: 100%; }
body { background: var(--paper); color: var(--ink); font: 16px/1.5 var(--text); -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv05" 1, "cv08" 1; font-optical-sizing: auto; overscroll-behavior-y: none; }
[hidden] { display: none !important; }
a { color: var(--accent); }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.num { font-variant-numeric: tabular-nums; }
.muted { color: var(--ink-3); font-size: 14px; }

.shell { max-width: 1120px; margin: 0 auto; padding-inline: max(20px, env(safe-area-inset-left, 0px)); }

/* top bar */
.bar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 16px; justify-content: space-between;
  padding: calc(var(--safe-t) + 12px) 0 12px; background: var(--glass); backdrop-filter: saturate(1.6) blur(18px);
  -webkit-backdrop-filter: saturate(1.6) blur(18px); border-bottom: 1px solid var(--rule); margin-inline: -20px; padding-inline: 20px; }
.brand { display: flex; align-items: center; gap: 10px; font: 600 16px/1 var(--display); letter-spacing: -.01em; }
.brand img { border-radius: 7px; display: block; }
.tabs { display: flex; gap: 4px; background: var(--rule); padding: 3px; border-radius: 999px; }
.tabs a { text-decoration: none; color: var(--ink-2); font: 500 14px/1 var(--text); padding: 8px 16px; border-radius: 999px; transition: background .2s, color .2s; }
.tabs a[aria-current="page"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.bar-end { display: flex; align-items: center; gap: 10px; }
.private { font-size: 12.5px; color: var(--ink-3); display: flex; align-items: center; gap: 7px; white-space: nowrap; }
.private::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.chip-btn { border: 1px solid var(--rule-2); background: var(--sheet); border-radius: 999px; padding: 7px 14px; font-size: 14px; font-weight: 600; cursor: pointer; }
.chip-btn:hover { border-color: var(--accent); }

/* bottom tab bar (phones) */
.tabbar { display: none; }
@media (max-width: 720px) {
  .tabs, .private { display: none; }
  .tabbar { display: grid; grid-template-columns: repeat(3, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    padding: 6px 8px calc(var(--safe-b) + 6px); background: var(--glass); backdrop-filter: saturate(1.6) blur(18px);
    -webkit-backdrop-filter: saturate(1.6) blur(18px); border-top: 1px solid var(--rule); }
  .tabbar a { display: grid; justify-items: center; gap: 3px; padding: 6px 0; text-decoration: none; color: var(--ink-3);
    font: 600 11px/1 var(--text); letter-spacing: .01em; }
  .tabbar a[aria-current="page"] { color: var(--accent); }
  main { padding-bottom: calc(var(--tabbar) + var(--safe-b) + 24px); }
}
.ti { width: 24px; height: 24px; background: currentColor; -webkit-mask: var(--m) center / 24px no-repeat; mask: var(--m) center / 24px no-repeat; }
.ti-audit { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 3h12v18l-3-2-3 2-3-2-3 2z'/%3E%3Cpath d='M9 8h6M9 12h6'/%3E%3C/svg%3E"); }
.ti-history { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 12a9 9 0 1 0 3-6.7L3 8'/%3E%3Cpath d='M3 3v5h5M12 7v5l3 2'/%3E%3C/svg%3E"); }
.ti-help { --m: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M9.5 9.5a2.5 2.5 0 1 1 3.5 2.3c-.6.3-1 .9-1 1.6V14M12 17.5v.01'/%3E%3C/svg%3E"); }

/* views */
main { padding-top: 8px; }
.view { animation: rise .35s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes rise { from { transform: translateY(6px); opacity: .6; } to { transform: none; opacity: 1; } }
.intro { padding-block: 36px 24px; max-width: 760px; }
.intro.compact { padding-block: 28px 16px; }
h1 { font: 600 clamp(34px, 6vw, 56px)/1.03 var(--display); letter-spacing: -.035em; margin: 0 0 14px; text-wrap: balance; }
.intro.compact h1 { font-size: clamp(30px, 5vw, 40px); }
.lede { color: var(--ink-2); font-size: 17px; margin: 0; max-width: 62ch; }
.samples { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin-top: 18px; font-size: 14px; color: var(--ink-3); }
.link-btn { border: 0; background: none; padding: 4px 0; color: var(--accent); font-weight: 600; cursor: pointer; text-decoration: underline;
  text-decoration-thickness: 1px; text-underline-offset: 4px; }

.card { background: var(--sheet); border-radius: var(--r); box-shadow: var(--shadow); padding: 24px; margin-bottom: 16px; max-width: 760px; }
.step { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; }
.step b { font: 700 12px/1 var(--text); color: var(--accent); background: var(--accent-soft); border-radius: 999px; width: 26px; height: 26px;
  display: inline-grid; place-items: center; flex: none; }
.step h2, .h2 { font: 600 19px/1.25 var(--display); letter-spacing: -.015em; margin: 0; }
.card .h2 { margin-bottom: 12px; }

/* drop zone */
.drop { position: relative; display: grid; justify-items: center; text-align: center; gap: 6px; padding: 34px 18px;
  border: 1.5px dashed var(--rule-2); border-radius: 16px; cursor: pointer; transition: border-color .2s, background .2s, transform .2s; }
.drop:hover, .drop.over { border-color: var(--accent); background: var(--accent-soft); }
.drop.over { transform: scale(1.01); }
.drop:focus-within { outline: 2px solid var(--accent); outline-offset: 3px; }
.drop input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop-ic { width: 44px; height: 44px; border-radius: 14px; background: var(--accent-soft); display: grid; place-items: center; margin-bottom: 4px; }
.drop-ic::after { content: ""; width: 22px; height: 22px; background: var(--accent);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M7 9l5-5 5 5M4 16v3a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-3'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 16V4M7 9l5-5 5 5M4 16v3a1 1 0 0 0 1 1h14a1 1 0 0 0 1-1v-3'/%3E%3C/svg%3E") center / contain no-repeat; }
.drop strong { font: 600 17px/1.3 var(--display); }
.drop-sub { color: var(--ink-3); font-size: 14px; max-width: 40ch; }

.files { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 10px; }
.file { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto; gap: 12px; align-items: center;
  border: 1px solid var(--rule); border-radius: 14px; padding: 10px 10px 10px 12px; animation: rise .25s ease both; }
.file .ic { width: 38px; height: 46px; border-radius: 7px; background: var(--paper); border: 1px solid var(--rule-2); position: relative;
  display: grid; place-items: end center; padding-bottom: 6px; font: 700 8.5px/1 var(--text); letter-spacing: .06em; color: var(--ink-3); }
.file .ic.xlsx { color: var(--accent); }
.file .nm { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .sub { font-size: 13px; color: var(--ink-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file .sub.bad { color: var(--warn); white-space: normal; }
select, input[type="text"], input[type="search"] { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--rule-2); border-radius: 10px; padding: 8px 10px; }
select { max-width: 170px; }
.x { border: 0; background: none; color: var(--ink-3); font-size: 22px; line-height: 1; cursor: pointer; width: 34px; height: 34px; border-radius: 10px; }
.x:hover { color: var(--ink); background: var(--rule); }

.need { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-top: 16px; }
.need div { border-radius: 12px; padding: 10px 12px; background: var(--paper); font-size: 13px; color: var(--ink-3); }
.need b { display: flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; margin-bottom: 1px; }
.need b::before { content: ""; width: 9px; height: 9px; border-radius: 50%; border: 1.5px solid var(--ink-3); flex: none; transition: all .2s; }
.need .ok b { color: var(--ink); }
.need .ok b::before { background: var(--accent); border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

.field { display: grid; gap: 8px; font-weight: 600; font-size: 14px; }
.field input { width: 100%; font-size: 17px; font-weight: 400; padding: 13px 14px; }
.run { margin-top: 18px; display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.btn { font: 600 16px/1 var(--text); border: 0; border-radius: 999px; padding: 15px 26px; cursor: pointer; background: var(--accent);
  color: var(--accent-ink); display: inline-flex; align-items: center; justify-content: center; gap: 10px; text-decoration: none;
  transition: transform .15s, opacity .15s, box-shadow .2s; box-shadow: 0 8px 20px -10px var(--accent); }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn:disabled { opacity: .38; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--rule-2); box-shadow: none; }
.btn.danger { color: var(--warn); }
.hint { font-size: 14px; color: var(--ink-3); }
.err { background: var(--warn-soft); color: var(--warn); border-radius: 12px; padding: 12px 14px; font-size: 14px; margin-top: 14px; }
.spin { width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: turn .7s linear infinite; }
@keyframes turn { to { transform: rotate(1turn); } }

/* result */
.result-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding-top: 28px; flex-wrap: wrap; }
.eyebrow { font: 600 11px/1.2 var(--text); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.figure { font: 600 clamp(56px, 13vw, 120px)/.92 var(--display); letter-spacing: -.05em; margin: 16px 0 14px; white-space: nowrap;
  font-variant-numeric: tabular-nums; animation: rise .5s cubic-bezier(.2, .7, .2, 1) both; }
.figure small { font-size: .36em; color: var(--ink-3); vertical-align: .95em; margin-left: .06em; letter-spacing: -.02em; }
.stats { display: flex; flex-wrap: wrap; gap: 8px 26px; color: var(--ink-2); font-size: 15px; }
.stats b { font-weight: 600; color: var(--ink); }
.stats .neg { color: var(--brass); }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0 8px; }
.grid2 { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 16px; margin-top: 18px; align-items: start; }
@media (max-width: 860px) { .grid2 { grid-template-columns: 1fr; } }
@media (max-width: 560px) {
  .stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; font-size: 14px; }
  .actions { display: grid; grid-template-columns: 1fr 1fr; }
  .actions .btn { padding-inline: 12px; }
  .result-head .muted { font-size: 13px; }
}
.grid2 .card { max-width: none; margin: 0; }
.dl { display: grid; gap: 8px; }
.dl a { display: grid; grid-template-columns: 38px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 12px; border-radius: 14px;
  border: 1px solid var(--rule); text-decoration: none; color: var(--ink); transition: border-color .15s, background .15s; }
.dl a:hover { border-color: var(--accent); background: var(--accent-soft); }
.dl .ic { width: 38px; height: 38px; border-radius: 10px; background: var(--paper); display: grid; place-items: center; font: 700 9px/1 var(--text);
  letter-spacing: .05em; color: var(--ink-3); }
.dl b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl span { font-size: 13px; color: var(--ink-3); }
.dl-more summary { cursor: pointer; font-weight: 600; font-size: 14px; padding: 10px 12px; border-radius: 14px; border: 1px solid var(--rule); display: flex; justify-content: space-between; }
.dl-more[open] summary { margin-bottom: 8px; }
.dl em { font-style: normal; font-size: 12px; color: var(--ink-3); }
.findings { list-style: none; margin: 0; padding: 0; }
.findings li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 14px 0; border-top: 1px solid var(--rule); }
.findings li:first-child { border-top: 0; padding-top: 4px; }
.findings .t { font-weight: 600; font-size: 15px; }
.findings .m { grid-column: 1; font-size: 13px; color: var(--ink-3); }
.findings .a { font-weight: 600; font-size: 16px; text-align: right; }
.findings .a.neg { color: var(--brass); }
.bar-comp { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--rule); gap: 2px; margin: 12px 0 14px; }
.bar-comp span { display: block; height: 100%; }
.groups { display: grid; gap: 8px; margin-top: 4px; }
.groups div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 8px 0; border-top: 1px solid var(--rule); }
.fp { font: 500 12px/1.6 var(--mono); letter-spacing: .06em; color: var(--ink-2); word-break: break-all; margin-top: 8px; }

/* column matching */
.file.needs { border-color: color-mix(in oklab, var(--warn) 45%, var(--rule)); }
.link-btn.sm { font-size: 13px; padding: 2px 0 0; }
.map { grid-column: 1 / -1; border-top: 1px solid var(--rule); margin-top: 4px; padding-top: 12px; }
.map p { margin: 0 0 10px; font-size: 13px; color: var(--ink-3); }
.map-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px 14px; }
.map label { display: grid; gap: 5px; font-size: 13px; font-weight: 600; color: var(--ink-2); }
.map label em { font-style: normal; font-weight: 500; color: var(--ink-3); }
.map label.bad span { color: var(--warn); }
.map label.bad select { border-color: var(--warn); }
.map select { max-width: none; width: 100%; }

/* findings browser and recovery tracker */
.card.wide { max-width: none; margin: 22px 0 0; }
.fx-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.fx-tools { display: flex; flex-wrap: wrap; gap: 8px; margin: 4px 0 6px; }
.fx-tools input { flex: 1 1 150px; min-width: 0; }
.fx-tools select { flex: 0 1 150px; max-width: none; min-width: 0; }
.fx-tools input { font-size: 15px; }
.fx { list-style: none; margin: 0; padding: 0; }
.fi { border-top: 1px solid var(--rule); }
.fi:first-child { border-top: 0; }
.fi.empty { padding: 18px 0; color: var(--ink-3); font-size: 14px; }
.fi-row { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 14px 4px; border-radius: 10px; }
.fi-row:hover { background: color-mix(in oklab, var(--paper) 60%, transparent); }
.fi-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.fi .t { font-weight: 600; font-size: 15px; }
.fi .a { font-weight: 600; font-size: 16px; text-align: right; }
.fi .a.neg { color: var(--brass); }
.fi .m { font-size: 13px; color: var(--ink-3); min-width: 0; }
.pill { justify-self: end; align-self: start; height: fit-content; font: 600 11.5px/1 var(--text); padding: 5px 9px; border-radius: 999px; background: var(--rule); color: var(--ink-2); white-space: nowrap; }
.pill.st-claimed { background: var(--brass-soft); color: var(--brass); }
.pill.st-disputed { background: var(--warn-soft); color: var(--warn); }
.pill.st-recovered { background: var(--accent-soft); color: var(--accent); }
.pill.st-closed { text-decoration: line-through; }
.pill.st-neg { background: var(--brass-soft); color: var(--brass); }
.fi-body { padding: 0 4px 18px; }
.fi-body p { margin: 0 0 12px; color: var(--ink-2); font-size: 14.5px; }
.ev { list-style: none; margin: 8px 0 14px; padding: 0; display: grid; gap: 6px; }
.ev li { background: var(--paper); border-radius: 10px; padding: 8px 12px; font-size: 13px; display: grid; gap: 2px; }
.ev b { font: 600 12.5px/1.4 var(--mono); }
.ev span { color: var(--ink-3); overflow-wrap: anywhere; }
.seg { display: flex; flex-wrap: wrap; gap: 4px; background: var(--paper); padding: 4px; border-radius: 12px; width: fit-content; max-width: 100%; }
.seg button { border: 0; background: none; padding: 8px 12px; border-radius: 9px; font-size: 13.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; }
.seg button[aria-pressed="true"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); }
.got { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-size: 14px; color: var(--ink-2); }
.got input { width: 130px; font-variant-numeric: tabular-nums; }
.more { margin-top: 12px; }
.rec-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; }
.rec-fig { font: 500 17px/1.3 var(--display); color: var(--ink-2); margin-top: 8px; }
.rec-fig b { font: 600 28px/1 var(--display); letter-spacing: -.02em; color: var(--accent); margin-right: 4px; }
.rec-bar { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--rule); margin: 16px 0 12px; gap: 2px; }
.rec-bar span { display: block; height: 100%; transition: width .4s cubic-bezier(.2, .7, .2, 1); }
.rec-bar .r, .rec-legend .r::before { background: var(--accent); }
.rec-bar .p, .rec-legend .p::before { background: var(--brass); }
.rec-bar .c, .rec-legend .c::before { background: var(--ink-3); }
.rec-legend .o::before { background: var(--rule-2); }
.rec-legend { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13.5px; color: var(--ink-3); }
.rec-legend span { display: flex; align-items: center; gap: 7px; }
.rec-legend span::before { content: ""; width: 9px; height: 9px; border-radius: 3px; }
.rec-legend b { color: var(--ink); font-weight: 600; }
.vendors { list-style: none; margin: 8px 0 0; padding: 0; }
.vendors li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px 12px; align-items: center; padding: 14px 0; border-top: 1px solid var(--rule); }
.v-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.v-actions a.chip-btn { text-decoration: none; color: var(--ink); }
.vendors li:first-child { border-top: 0; }
.vendors b { display: block; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vendors div span { font-size: 12.5px; color: var(--ink-3); }
.vendors .num { font-weight: 600; }
.vendors .chip-btn { padding: 6px 12px; font-size: 13px; }
.vendors .done { color: var(--accent); font-weight: 600; font-size: 13px; padding: 6px 4px; }
.green { color: var(--accent); }
.totals { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; max-width: 760px; margin-bottom: 16px; }
.totals div { background: var(--sheet); border-radius: 16px; box-shadow: var(--shadow); padding: 16px 18px; display: grid; gap: 4px; }
.totals b { font: 600 24px/1.1 var(--display); letter-spacing: -.02em; }
.totals span { font-size: 13px; color: var(--ink-3); }
@media (max-width: 560px) { .totals { grid-template-columns: 1fr 1fr; } .totals div:first-child { grid-column: 1 / -1; } }
.backup { margin-top: 8px; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 2px solid var(--accent); outline-offset: 2px; }
.sign { margin-top: 16px; border-top: 1px solid var(--rule); padding-top: 14px; }
.sign summary { cursor: pointer; font-weight: 600; font-size: 14px; display: flex; gap: 10px; align-items: baseline; }
.sign summary .muted { font-weight: 500; font-size: 13px; }
.sign p { margin: 8px 0 12px; }
.sign-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.sign-grid .field input { font-size: 16px; padding: 11px 12px; }
input[type="email"], input[type="tel"] { font: inherit; color: var(--ink); background: var(--paper); border: 1px solid var(--rule-2); border-radius: 10px; padding: 8px 10px; }
@media (max-width: 560px) { .sign-grid { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .fx-tools select { flex: 1 1 40%; } .seg button { padding: 8px 10px; }
  .actions { grid-template-columns: 1fr 1fr; } .actions .btn:first-child { grid-column: 1 / -1; } }

/* history */
.history { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 10px; max-width: 760px; }
.history li { background: var(--sheet); border-radius: 16px; box-shadow: var(--shadow); display: grid; grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center; gap: 12px; padding: 14px 10px 14px 18px; }
.history button.open { all: unset; cursor: pointer; display: grid; gap: 2px; min-width: 0; }
.history .c { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.history .w { font-size: 13px; color: var(--ink-3); }
.history .v { font-weight: 600; }
.empty-state { color: var(--ink-3); max-width: 760px; }

/* help */
.kinds { display: grid; gap: 12px; margin: 0; }
.kinds div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; padding-top: 12px; border-top: 1px solid var(--rule); }
.kinds div:first-child { border-top: 0; padding-top: 0; }
.kinds dt { font-weight: 600; }
.kinds dd { margin: 0; color: var(--ink-2); font-size: 15px; }
@media (max-width: 560px) { .kinds div { grid-template-columns: 1fr; gap: 2px; } .need { grid-template-columns: 1fr; }
  .file { grid-template-columns: 38px minmax(0, 1fr) auto; } .file .x { grid-column: 3; grid-row: 1; }
  .file select { grid-column: 2 / -1; grid-row: 2; max-width: none; } }
.tmpl { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 8px; margin-top: 10px; }
.tmpl button { display: flex; justify-content: space-between; align-items: center; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--rule);
  background: var(--paper); cursor: pointer; font-size: 15px; text-align: left; }
.tmpl button:hover { border-color: var(--accent); }
.tmpl button::after { content: "CSV"; font: 700 10px/1 var(--text); letter-spacing: .08em; color: var(--ink-3); }

/* report sheet */
.sheet { position: fixed; inset: 0; z-index: 50; background: var(--paper); display: grid; grid-template-rows: auto 1fr;
  animation: up .35s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
.sheet-bar { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: calc(var(--safe-t) + 10px) 16px 10px;
  border-bottom: 1px solid var(--rule); background: var(--glass); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  font: 600 15px/1 var(--display); }
#sheet-title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: center; }
.sheet-end { display: flex; gap: 8px; }
.sheet iframe { width: 100%; height: 100%; border: 0; background: var(--paper); }

.toast { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 24px); transform: translateX(-50%); z-index: 60; background: var(--ink); color: var(--paper);
  padding: 12px 18px; border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); display: flex; gap: 12px; align-items: center;
  animation: up .3s ease both; max-width: calc(100vw - 32px); }
.toast button { border: 0; background: none; color: var(--accent); font-weight: 700; cursor: pointer; }
@media (max-width: 720px) { .toast { bottom: calc(var(--tabbar) + var(--safe-b) + 16px); } }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* privacy and support pages */
.doc { max-width: 760px; padding-block: calc(var(--safe-t) + 24px) 48px; }
.doc .card h2 { margin-top: 18px; }
.doc .card h2:first-child { margin-top: 0; }

/* ── calm layout: one thing at a time ─────────────────────────────── */
#result { max-width: 820px; }
.sumline { margin: 0; color: var(--ink-2); font-size: 16px; }
.sumline .neg { color: var(--brass); font-weight: 600; }
.need { display: block; margin-top: 14px; }
.need:empty { display: none; }
.need p { margin: 0; }
.have { display: flex; flex-wrap: wrap; gap: 6px; }
.have span { font-size: 13px; font-weight: 600; color: var(--accent); background: var(--accent-soft); border-radius: 999px; padding: 5px 11px; }
.tip { margin-top: 10px !important; font-size: 13.5px; color: var(--ink-3); }
.subbtn { all: unset; box-sizing: border-box; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  font-size: 13px; color: var(--ink-3); border-radius: 6px; }
.subbtn:hover { color: var(--ink); }
.subbtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.chev-s { width: 7px; height: 7px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(-45deg); flex: none; transition: transform .2s; }
.subbtn[aria-expanded="true"] .chev-s { transform: rotate(45deg); }
.rtabs { display: flex; gap: 4px; background: var(--rule); padding: 4px; border-radius: 14px; margin: 22px 0 12px; width: fit-content; max-width: 100%; }
.rtabs button { border: 0; background: none; padding: 9px 16px; border-radius: 10px; font-size: 14.5px; font-weight: 600; color: var(--ink-2); cursor: pointer; display: flex; gap: 8px; align-items: center; }
.rtabs button span { font-size: 12px; font-weight: 600; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.rtabs button[aria-selected="true"] { background: var(--sheet); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.panel { margin-top: 0; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 6px; }
.panel-head p { margin: 0; font-size: 14px; color: var(--ink-3); }
.sub-h { font: 600 12px/1.2 var(--text); letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); margin: 26px 0 8px; }
.rows div { display: flex; justify-content: space-between; gap: 12px; font-size: 14px; padding: 9px 0; border-top: 1px solid var(--rule); }
.rows div:first-child { border-top: 0; }
.rows em { font-style: normal; color: var(--ink-3); font-size: 12.5px; margin-left: 6px; }
.fine { margin: 18px 0 0; font-size: 13px; }
.panel .dl-more { margin-top: 8px; }
.vendors li { display: block; padding: 0; }
.vhead { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: minmax(0, 1fr) auto 12px; gap: 12px; align-items: center; padding: 14px 4px; border-radius: 10px; }
.vhead:hover { background: color-mix(in oklab, var(--paper) 60%, transparent); }
.vhead:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.vn { min-width: 0; display: grid; gap: 2px; }
.vn b { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vn span { font-size: 12.5px; color: var(--ink-3); }
.vn span.ok { color: var(--accent); }
.vhead .num { font-weight: 600; }
.chev { width: 8px; height: 8px; border-right: 1.5px solid var(--ink-3); border-bottom: 1.5px solid var(--ink-3); transform: rotate(45deg); margin-top: -4px; transition: transform .2s; }
.vendors li.open .chev { transform: rotate(-135deg); margin-top: 4px; }
.v-actions { padding: 0 4px 14px; }
.chip-btn.primary { background: var(--accent); color: var(--accent-ink) !important; border-color: var(--accent); }
@media (max-width: 560px) {
  .rtabs { width: 100%; } .rtabs button { flex: 1; justify-content: center; padding: 9px 8px; }
  .actions { grid-template-columns: 1fr 1fr; } .actions .btn:first-child { grid-column: auto; }
  .fx-tools select { flex: 0 1 120px; }
}

.win { margin: -4px 0 12px !important; font-size: 13.5px !important; color: var(--accent) !important; }
.win.late { color: var(--brass) !important; }
.win-pick { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); margin-left: auto; }
.win-pick select { font-size: 13px; padding: 5px 8px; max-width: none; }
.v-actions { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

/* ── for everyone: readable text, reachable targets ─────────────────── */
.eyebrow { font-size: 12px; }
.pill { font-size: 12px; }
.dl .ic { font-size: 10px; }
.tabbar a { font-size: 12px; }
.result-h { margin: 22px 0 0; font: inherit; }
.result-h:focus { outline: none; }
.result-h .eyebrow { display: block; }
.result-h .figure { display: block; }
.steps3 { list-style: none; counter-reset: s; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; padding: 0; margin: 22px 0 0; max-width: 640px; }
.steps3 li { counter-increment: s; background: var(--sheet); border-radius: 14px; box-shadow: var(--shadow); padding: 12px 14px; display: grid; gap: 2px; }
.steps3 li::before { content: counter(s); font: 700 12px/1 var(--text); color: var(--accent); background: var(--accent-soft); border-radius: 999px; width: 22px; height: 22px; display: grid; place-items: center; margin-bottom: 6px; }
.steps3 b { font: 600 15px/1.25 var(--display); }
.steps3 span { font-size: 13px; color: var(--ink-3); }
.where { margin: 10px 0 0; font-size: 14px; text-align: center; }
.where a { font-weight: 600; }
@media (max-width: 560px) {
  .steps3 { grid-template-columns: 1fr; gap: 8px; }
  .steps3 { gap: 6px; margin-top: 18px; }
  .steps3 li { grid-template-columns: 26px minmax(0, 1fr); column-gap: 10px; align-items: center; padding: 2px 0;
    background: none; box-shadow: none; border-radius: 0; }
  .steps3 li::before { grid-row: span 2; margin: 0; }
}
/* Touch screens: every control at least 44 points (Apple HIG, WCAG 2.5.5). */
@media (pointer: coarse), (max-width: 720px) {
  .chip-btn, .bar-end .chip-btn, #new, .rtabs button, .seg button, .link-btn, .sign summary, .dl-more summary, select, input[type="text"],
  input[type="search"], input[type="email"], input[type="tel"], .win-pick select { min-height: 44px; }
  .chip-btn { display: inline-flex; align-items: center; justify-content: center; }
  .link-btn { display: inline-flex; align-items: center; }
  .seg button { min-width: 44px; }
  .sign summary { align-items: center; }
  .x { width: 44px; height: 44px; }
  .kinds a, .muted a, .where a, .tip a { display: inline-block; padding: 12px 0; margin: -12px 0; }
}

/* ── money as the hero: serif figures, spending at a glance ──────────────
   Numbers are set in the system serif (New York on Apple devices), like a
   private bank's statement; everything else stays in the system sans. */
:root {
  --serif: "Source Serif Display", "New York", ui-serif, "Iowan Old Style", "Georgia", serif;
  --c-food: #2f7d5b; --c-supplies: #a88336; --c-rent: #3f5d7a; --c-services: #7a4f6d; --c-software: #3f7f89;
  --c-marketing: #b0603f; --c-insurance: #6b6f3a; --c-travel: #5a6ca6; --c-payroll: #5f6763; --c-taxes: #973a2c;
  --c-loans: #7a634a; --c-fees: #c2410c; --c-other: #b9bfbb;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --c-food: #6fcf9f; --c-supplies: #dcb766; --c-rent: #86a7cc; --c-services: #c393b6; --c-software: #7cc4cc;
  --c-marketing: #e89a78; --c-insurance: #b7bb78; --c-travel: #9cabe3; --c-payroll: #a3aca7; --c-taxes: #ef8f7c;
  --c-loans: #c7a988; --c-fees: #fb923c; --c-other: #4a524e; } }
:root[data-theme="dark"] {
  --c-food: #6fcf9f; --c-supplies: #dcb766; --c-rent: #86a7cc; --c-services: #c393b6; --c-software: #7cc4cc;
  --c-marketing: #e89a78; --c-insurance: #b7bb78; --c-travel: #9cabe3; --c-payroll: #a3aca7; --c-taxes: #ef8f7c;
  --c-loans: #c7a988; --c-fees: #fb923c; --c-other: #4a524e;
}
.figure, .rec-fig b, .totals b, .donut-c b, .sp-total { font-family: var(--serif); font-weight: 400; letter-spacing: -.02em; }
.figure { letter-spacing: -.035em; }
.figure small { font-family: var(--serif); }
.result-h .eyebrow { color: var(--brass); }
.result-h::after { content: ""; display: block; width: 56px; height: 1px; margin-top: 4px;
  background: linear-gradient(90deg, var(--brass), transparent); }

/* spending */
.spend { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 28px; align-items: center; }
@media (max-width: 640px) { .spend { grid-template-columns: 1fr; gap: 18px; justify-items: center; } .spend .legend { width: 100%; } }
.donut { position: relative; width: 240px; height: 240px; }
.donut svg { width: 100%; height: 100%; transform: rotate(-90deg); overflow: visible; }
.donut circle { fill: none; stroke-width: 5.2; cursor: pointer; transition: stroke-dasharray .9s cubic-bezier(.2, .8, .2, 1), stroke-width .25s, opacity .25s; }
.donut circle.track { stroke: var(--rule); cursor: default; }
.donut circle.dim { opacity: .28; }
.donut circle.on { stroke-width: 6.6; }
.donut-c { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; pointer-events: none; padding: 40px; }
.donut-c span { font-size: 12px; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-3); }
.donut-c b { display: block; font-size: 30px; line-height: 1.1; margin: 6px 0 2px; font-variant-numeric: tabular-nums; }
.donut-c em { font-style: normal; font-size: 13px; color: var(--ink-3); }
.legend { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.legend button { all: unset; box-sizing: border-box; width: 100%; cursor: pointer; display: grid; grid-template-columns: 12px minmax(0, 1fr) auto 44px;
  gap: 10px; align-items: center; padding: 9px 8px; border-radius: 10px; font-size: 14.5px; min-height: 44px; }
.legend button:hover, .legend button[aria-pressed="true"] { background: var(--paper); }
.legend button:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.legend i { width: 12px; height: 12px; border-radius: 4px; background: var(--c); }
.legend .lb { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.legend .pc { color: var(--ink-3); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.legend .num { font-weight: 600; }
.cat-other i { background: repeating-linear-gradient(45deg, var(--c-other) 0 3px, transparent 3px 6px); box-shadow: inset 0 0 0 1px var(--c-other); }
.sort-me { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; background: var(--brass-soft);
  color: var(--ink); border-radius: 14px; padding: 12px 14px; margin: 0 0 18px; font-size: 14.5px; }
.sort-me b { color: var(--brass); }
.drill { margin-top: 22px; border-top: 1px solid var(--rule); padding-top: 16px; animation: rise .3s ease both; }
.drill-h { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.drill-h h3 { margin: 0; font: 600 17px/1.3 var(--display); display: flex; align-items: center; gap: 10px; }
.drill-h h3 i { width: 12px; height: 12px; border-radius: 4px; background: var(--c); }
.payees { list-style: none; margin: 0; padding: 0; }
.payees li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 14px; padding: 12px 0; border-top: 1px solid var(--rule); }
.payees li:first-child { border-top: 0; }
.payees .pn { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.payees .pm { font-size: 12.5px; color: var(--ink-3); }
.payees .pbar { grid-column: 1 / -1; height: 4px; border-radius: 999px; background: var(--rule); overflow: hidden; }
.payees .pbar span { display: block; height: 100%; background: var(--c); border-radius: 999px; transform-origin: left; animation: grow .7s cubic-bezier(.2, .8, .2, 1) both; }
@keyframes grow { from { transform: scaleX(0); } }
.payees .pc-tools { grid-column: 1 / -1; display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.payees select { font-size: 13px; padding: 5px 8px; max-width: 220px; }
.payees .rn { display: flex; gap: 6px; align-items: center; }
.payees .rn input { font-size: 14px; padding: 6px 8px; width: 200px; max-width: 60vw; }
.not-spend { margin: 16px 0 0; font-size: 13px; color: var(--ink-3); }

/* celebration: real money back, never streaks or nags */
.confetti { position: fixed; inset: 0; pointer-events: none; z-index: 70; }
.fi.won { animation: won 1.1s ease both; }
@keyframes won { 0% { background: var(--accent-soft); } 100% { background: transparent; } }
@media (pointer: coarse), (max-width: 720px) { .payees select, .payees .chip-btn, .payees .rn input { min-height: 44px; } }
@media (max-width: 560px) {
  .rtabs { overflow-x: auto; scrollbar-width: none; }
  .rtabs::-webkit-scrollbar { display: none; }
  .rtabs button { padding: 9px 6px; font-size: 14px; gap: 5px; flex: 1 0 auto; }
  .legend button { grid-template-columns: 12px minmax(0, 1fr) auto 36px; }
  .legend .lb { white-space: normal; line-height: 1.25; }
}

/* ── every screen size ─────────────────────────────────────────────────
   Phones from a folded cover screen (280) up, phones on their side, tablets
   and wide desktops. Narrow widths also cover large system text, which
   leaves the same little room. */

/* The headline figure never takes over a short screen (phones on their side). */
.figure { font-size: clamp(46px, min(15.5vw, 18vh), 120px); }
@media (max-height: 500px) {
  .bar { position: static; }            /* keep the little height for content */
  .intro { padding-block: 20px 12px; }
  .result-head { padding-top: 14px; }
}

/* Results tabs: four side by side where they fit, a 2×2 grid where they don't. */
@media (max-width: 420px) {
  .rtabs { display: grid; grid-template-columns: 1fr 1fr; width: 100%; overflow: visible; }
  .rtabs button { justify-content: center; padding: 9px 6px; }
  .rtabs button:only-child, .rtabs button:nth-child(3):last-child { grid-column: 1 / -1; }
}

/* Very narrow (folded phones, very large text): stack the side-by-side pieces. */
@media (max-width: 345px) {
  .shell { padding-inline: max(14px, env(safe-area-inset-left, 0px)); }
  .bar { margin-inline: -14px; padding-inline: 14px; }
  .actions { grid-template-columns: 1fr; }
  .actions .btn { width: 100%; }
  .card { padding: 18px 16px; }
  h1 { font-size: clamp(28px, 9.5vw, 34px); }
  .result-head { flex-direction: column; align-items: flex-start; gap: 8px; }
  .fx-tools { flex-direction: column; }
  .fx-tools select { flex: 1 1 auto; width: 100%; }
  .legend button { grid-template-columns: 12px minmax(0, 1fr) auto; }
  .legend .pc { display: none; }
  .donut { width: min(240px, 78vw); height: min(240px, 78vw); }
  .donut-c b { font-size: 24px; }
  .sort-me { flex-direction: column; align-items: stretch; }
  .payees .pc-tools select { max-width: 100%; flex: 1 1 100%; }
  .v-actions .win-pick { margin-left: 0; }
  .history li { grid-template-columns: minmax(0, 1fr) auto; }
  .history .v { grid-column: 1; grid-row: 2; }
}

/* Wide screens: use the room. Tablet landscape and desktop get two columns:
   the question and the steps beside the files; the headline figure beside
   the findings. */
@media (min-width: 1100px) {
  .shell { max-width: 1240px; }
  #compose { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); column-gap: 48px; align-items: start; }
  #compose .intro { grid-row: 1 / span 3; position: sticky; top: 90px; padding-top: 56px; }
  #compose .card { max-width: none; }
  #compose .intro + .card { margin-top: 56px; }
  #compose .steps3 { grid-template-columns: 1fr; max-width: 420px; }
  #result:not([hidden]) { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 8fr); column-gap: 48px; align-items: start; max-width: none; }
  .r-side { position: sticky; top: 76px; }
  .r-side .figure { font-size: clamp(64px, 6.4vw, 108px); }
  .r-main { padding-top: 28px; }
  .r-main .rtabs { margin-top: 0; }
  .r-side .card.wide { margin-top: 18px; }
  .view > .intro.compact, #history, .totals, .empty-state, #view-history .card, #view-help .card { max-width: 900px; }
}
@media (min-width: 1600px) {
  body { font-size: 17px; }
  .shell { max-width: 1360px; }
}
/* The delete button in History keeps its full touch size next to long amounts. */
.history li { grid-template-columns: minmax(0, 1fr) auto 44px; }
.history .x { width: 44px; height: 44px; min-width: 44px; flex: none; }
@media (max-width: 345px) { .history li { grid-template-columns: minmax(0, 1fr) 44px; } .history .x { grid-column: 2; grid-row: 1 / span 2; } }

/* ── typography and alignment ──────────────────────────────────────────
   Figures line up in columns (tabular) only where they're amounts; running
   text keeps natural spacing, so dates and invoice numbers read cleanly. */
.num, .figure, .a, .fi .a, .findings .a, .vendors .num, .rows b, .totals b, .legend .num, .legend .pc,
.payees .num, .rec-fig b, .rec-legend b, .history .v, .donut-c b, .got input { font-variant-numeric: tabular-nums; }
h1 { letter-spacing: -.028em; }
.intro.compact h1 { letter-spacing: -.025em; }
.step h2, .h2, .drop strong, .drill-h h3 { letter-spacing: -.012em; }
.eyebrow, .sub-h { letter-spacing: .12em; }
.ev b { font: 600 13px/1.4 var(--text); font-variant-numeric: tabular-nums; }
.chip-btn, .btn, .rtabs button, .seg button, .pill { white-space: nowrap; }
.rtabs button { align-items: baseline; }
.rtabs button span { font-size: 12.5px; }
.sumline { margin-top: 12px; }
.result-h::after { margin-top: 8px; }
.samples { display: grid; grid-template-columns: auto; justify-items: start; gap: 2px; }
.samples > span { margin-bottom: 2px; }
.samples .link-btn { padding: 6px 0; }
@media (min-width: 561px) { .samples { display: flex; flex-wrap: wrap; column-gap: 18px; } .samples > span { flex-basis: 100%; } }
.file select { max-width: 230px; }
.panel-head { align-items: center; }
.panel-head p { flex: 1; }
@media (max-width: 560px) {
  .v-actions .win-pick { margin-left: 0; width: 100%; justify-content: space-between; }
  .file select { max-width: none; }
}
/* Samples as quiet chips: tidy on every width, easy to tap. */
.samples { display: flex !important; flex-wrap: wrap; align-items: center; gap: 8px; }
.samples > span { flex-basis: 100%; margin: 0 0 2px; }
.samples .link-btn { text-decoration: none; border: 1px solid var(--rule-2); background: var(--sheet); border-radius: 999px;
  padding: 9px 15px; font-size: 14px; font-weight: 600; color: var(--accent); min-height: 40px; display: inline-flex; align-items: center; }
.samples .link-btn:hover { border-color: var(--accent); background: var(--accent-soft); }
@media (pointer: coarse), (max-width: 720px) { .samples .link-btn { min-height: 44px; } }

/* The report and letters viewer never grows wider than the screen, whatever the title. */
.sheet { grid-template-columns: minmax(0, 1fr); }
.sheet-bar { min-width: 0; }
#sheet-title { flex: 1 1 auto; }
/* No lonely last words: balanced headings, tidy paragraphs. */
h1, h2, h3, .drop strong, .sumline { text-wrap: balance; }
p, .drop-sub, .lede, dd, .fi-body p { text-wrap: pretty; }
@media (max-width: 560px) {
  .file .x { align-self: start; margin-top: -4px; }
}
.tagline { color: var(--brass); margin: 0 0 12px; }

/* ── for me and my home, or for my business ─────────────────────────── */
.modes { position: relative; display: inline-grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; background: var(--rule);
  padding: 4px; border-radius: 999px; margin: 0 0 18px; max-width: 100%; isolation: isolate; }
/* One pill glides to the chosen side. */
.modes::before { content: ""; position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 6px); border-radius: 999px;
  background: var(--sheet); box-shadow: 0 1px 2px rgba(0, 0, 0, .06), 0 4px 12px -6px rgba(0, 0, 0, .18);
  transform: translateX(calc(100% + 4px)); transition: transform .42s cubic-bezier(.3, 1.3, .5, 1); }
html[data-mode="personal"] .modes::before { transform: none; }
.modes button { border: 0; background: none; border-radius: 999px; padding: 9px 18px; font: 600 14px/1.2 var(--text); color: var(--ink-3);
  cursor: pointer; white-space: nowrap; transition: color .25s; }
.modes button[aria-checked="true"] { color: var(--ink); }
.modes button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
@media (pointer: coarse), (max-width: 720px) { .modes button { min-height: 44px; } }
@media (max-width: 560px) { .modes { display: grid; width: 100%; } .modes button { padding: 9px 8px; font-size: 13.5px; } }
@media (max-width: 345px) { .modes { grid-auto-flow: row; border-radius: 16px; } .modes::before { display: none; }
  .modes button { border-radius: 12px; } .modes button[aria-checked="true"] { background: var(--sheet); box-shadow: 0 1px 3px rgba(0, 0, 0, .1); } }
html[data-mode="personal"] .b-only, html:not([data-mode="personal"]) .p-only { display: none !important; }

.recurring { border: 1px solid var(--rule); border-radius: 16px; padding: 16px 18px; margin: 0 0 20px; }
.rec-sum h3 { margin: 0 0 4px; font: 600 17px/1.3 var(--display); letter-spacing: -.012em; }
.rec-sum p { margin: 0 0 10px; color: var(--ink-2); font-size: 14.5px; }
.recurring ul { list-style: none; margin: 0 0 10px; padding: 0; }
.recurring li { display: flex; justify-content: space-between; gap: 12px; padding: 9px 0; border-top: 1px solid var(--rule); font-size: 14.5px; }
.recurring li:first-child { border-top: 0; }
.recurring .rn-name { min-width: 0; font-weight: 600; }
.recurring em { display: block; font-style: normal; font-weight: 400; font-size: 12.5px; color: var(--ink-3); }
.recurring .num { text-align: right; font-weight: 600; white-space: nowrap; }
.recurring .muted { margin: 10px 0 0; }

/* ── finish: quiet, precise motion and phone rows ───────────────────────
   Everything here is off when the device asks for reduced motion (above). */
.swap { animation: swap .45s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes swap { from { opacity: 0; transform: translateY(4px); filter: blur(2px); } to { opacity: 1; transform: none; filter: none; } }

/* Lists arrive one after another, never all at once. */
.findings li, .history li, .recurring li { animation: rise .45s cubic-bezier(.2, .7, .2, 1) backwards; }
:is(.findings, .history, .recurring ul) > :nth-child(2) { animation-delay: 40ms; }
:is(.findings, .history, .recurring ul) > :nth-child(3) { animation-delay: 80ms; }
:is(.findings, .history, .recurring ul) > :nth-child(4) { animation-delay: 120ms; }
:is(.findings, .history, .recurring ul) > :nth-child(5) { animation-delay: 160ms; }
:is(.findings, .history, .recurring ul) > :nth-child(n+6) { animation-delay: 200ms; }

/* Everything that can be pressed answers the finger. */
.samples .link-btn, .rtabs button, .seg button, .tmpl button, .chip-btn, .history button.open, .x, .modes button, .tabbar a, .tabs a {
  transition: transform .15s, background-color .2s, border-color .2s, color .2s; -webkit-tap-highlight-color: transparent; }
.samples .link-btn:active, .rtabs button:active, .seg button:active, .tmpl button:active, .chip-btn:active, .x:active, .tabbar a:active { transform: scale(.96); }
.tabbar a .ti { transition: transform .3s cubic-bezier(.3, 1.4, .5, 1); }
.tabbar a[aria-current="page"] .ti { transform: translateY(-1px) scale(1.08); }
@media (hover: hover) and (pointer: fine) {
  .history li { transition: box-shadow .25s, transform .25s; }
  .history li:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg); }
}

/* A file's line stays one line; the arrow stays beside it. */
.file .subbtn { max-width: 100%; }
.file .subbtn .t { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@media (max-width: 560px) {
  /* The name already says CSV or Excel, so the tile gives its room to the words. */
  .file { grid-template-columns: minmax(0, 1fr) auto; column-gap: 8px; row-gap: 10px; padding: 12px 8px 12px 14px; }
  .file .ic { display: none; }
  .file .x { grid-column: 2; grid-row: 1; align-self: start; margin-top: -2px; }
  .file select { grid-column: 1 / -1; grid-row: 2; margin-right: 6px; }
}

/* History rows: the date and count wrap as whole phrases. */
.history .nw { white-space: nowrap; }
.history .w { line-height: 1.45; }
.totals div { align-content: start; }
