*{box-sizing:border-box;-webkit-tap-highlight-color:transparent}
html{color-scheme:light;-webkit-text-size-adjust:100%}
:root{--sheet-max:min(92dvh,var(--vvh,100dvh) - 8px);--save:#a8740f;--ink:#1c3242;--muted:#617380;--line:#e3e2da;--paper:#f6f5f0;--card:#fff;--navy:#1f3a4d;--gold:#e2b44c;--red:#b03a2e;--red-bg:#fbf0ee;--green:#2c6b44;--green-bg:#ecf5ef;--tabbar:64px}
body{margin:0;background:var(--paper);color:var(--ink);font:16px/1.45 "Inter","Segoe UI",system-ui,-apple-system,sans-serif;padding-bottom:calc(var(--tabbar) + env(safe-area-inset-bottom) + 92px)}
body.gated{padding-bottom:0}
.shell{width:min(1080px,100% - 32px);margin:auto}
h1,h2,h3,p{margin:0}
h1,h2{font-family:Georgia,"Times New Roman",serif;font-weight:400;letter-spacing:-.03em}
h1{font-size:30px;line-height:1.15}
h2{font-size:21px;line-height:1.25}
h3{font:600 13px/1.4 system-ui,sans-serif;color:var(--muted);text-transform:uppercase;letter-spacing:.06em;margin:18px 4px 6px}
a{color:var(--navy)}
.muted{color:var(--muted)}
.center{text-align:center}
.out{color:var(--red)}
.in{color:var(--green)}
.eyebrow{font:600 12px/1.5 system-ui,sans-serif;letter-spacing:.08em;text-transform:uppercase;color:var(--muted)}

header{background:#fdfcf8;border-bottom:1px solid var(--line);position:sticky;top:0;z-index:5;padding-top:env(safe-area-inset-top)}
.bar{display:flex;align-items:center;gap:10px;height:58px}
.brand{display:flex;align-items:center;gap:8px;text-decoration:none;color:var(--ink);font:bold 20px Georgia,serif;letter-spacing:-.5px;margin-right:auto}
.brand i{font-weight:400}
.mark{display:grid;place-items:center;background:var(--navy);color:#f3d58a;border-radius:9px;width:32px;height:32px;font:bold 21px/1 Georgia,serif;letter-spacing:0}
.home-foot{text-align:center;margin:6px 0 0}
.home-foot a{display:inline-flex;align-items:center;min-height:44px;padding:0 16px;color:var(--muted);font-size:14px;font-weight:600;text-decoration:none}
.home-foot a:hover{color:var(--navy)}
.heading{display:flex;align-items:baseline;justify-content:space-between;gap:12px;margin:18px 0 12px}
.who{font-size:13px;color:var(--muted);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

.tabs{position:fixed;left:0;right:0;bottom:0;z-index:6;display:grid;grid-template-columns:repeat(5,1fr);background:#fdfcf8;border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom);height:calc(var(--tabbar) + env(safe-area-inset-bottom))}
.tabs a{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;text-decoration:none;color:var(--muted);font-size:11.5px;font-weight:600}
.tabs svg,.icon-button svg,.menu svg{width:24px;height:24px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tabs a[aria-current]{color:var(--navy)}
.tabs a[aria-current] svg{stroke-width:2.3}
.tabs a[aria-current]::before{content:"";position:absolute;top:0;width:32px;height:3px;border-radius:0 0 3px 3px;background:var(--gold)}
.tabs a{position:relative}

button,.button{border:1px solid #cdd2cf;background:#fff;color:var(--navy);font:600 15px/1.25 inherit;font-family:inherit;border-radius:10px;min-height:44px;padding:10px 16px;cursor:pointer;text-decoration:none;display:inline-flex;align-items:center;justify-content:center;gap:6px;touch-action:manipulation}
button:active{transform:scale(.98)}
.primary{background:var(--navy);color:#fff;border-color:var(--navy)}
.danger{color:var(--red);border-color:#ecc9c4}
button.small{min-height:44px;min-width:44px;padding:4px 10px}
.icon-button{display:inline-grid;place-items:center;width:44px;height:44px;min-height:44px;padding:0;border-radius:50%;border:0;background:none;color:var(--navy);font-size:26px;line-height:1}
button:disabled{opacity:.45;cursor:default}
:focus-visible{outline:3px solid var(--gold);outline-offset:2px}
.fab{position:fixed;right:18px;bottom:calc(var(--tabbar) + env(safe-area-inset-bottom) + 16px);z-index:6;width:58px;height:58px;border-radius:50%;background:var(--navy);color:#fff;border:0;font-size:30px;font-weight:400;box-shadow:0 8px 22px #1c324255}
.add{background:var(--navy);color:#fff;border-color:var(--navy)}
.desktop-only{display:none}

.panel{background:var(--card);border:1px solid var(--line);box-shadow:0 1px 2px #1b1d210a,0 6px 18px #1b1d2112;border-radius:16px;padding:16px;margin-bottom:14px}
.panel>h2,.panel>.row{margin-bottom:10px}
.panel.empty{text-align:center;padding:28px 18px}
.panel.empty p{margin:8px 0 16px}
.row{display:flex;align-items:center;justify-content:space-between;gap:10px}
.row.start{justify-content:flex-start;flex-wrap:wrap;margin-top:10px}
.panel .row a{font-weight:600;font-size:15px;text-decoration:none}

.hero{background:linear-gradient(160deg,#27485f,var(--navy) 60%);color:#fff;border-radius:18px;padding:18px 18px 16px;margin-bottom:14px;box-shadow:0 1px 2px #1b1d2114,0 10px 24px #1b1d2126}
.hero.danger-zone{background:linear-gradient(160deg,#7d3028,#5f231e 65%)}
.hero-top{display:flex;align-items:center;justify-content:space-between;gap:10px}
.hero .eyebrow{color:#ffffffb3}
.hero .chip{flex:none;font-size:12px;font-weight:600;line-height:1;padding:6px 10px;border-radius:99px;background:#ffffff1f;color:#ffffffd9}
.hero strong{display:block;font:400 46px/1.05 Georgia,serif;letter-spacing:-.03em;font-variant-numeric:tabular-nums;margin:10px 0 12px}
.hero .standing{display:flex;flex-wrap:wrap;align-items:baseline;justify-content:space-between;gap:2px 12px;margin:0;padding-top:12px;border-top:1px solid #ffffff24;font-size:14px;color:#ffffffb3}
.hero .standing b{margin-left:6px;font-size:18px;font-weight:600;color:#fff;font-variant-numeric:tabular-nums}
.hero .to-come{font-size:13px;white-space:nowrap}
.flow{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}
.flow div{background:#ffffff14;border-radius:12px;padding:10px 12px 11px;display:flex;flex-direction:column;min-width:0}
.flow small{color:#ffffffb3;font-size:12.5px}
.flow .in,.flow .out{font-size:17px;font-weight:600;font-variant-numeric:tabular-nums}
.flow .in{color:#9fe0b5}
.flow .out{color:#ffb4aa}
.flow .track{height:4px;background:#ffffff26;margin:7px 0 6px}
.flow .track .in{background:#9fe0b5}
.flow .track .out{background:#ffb4aa}

.summary{display:grid;grid-template-columns:repeat(3,1fr);background:var(--card);border:1px solid var(--line);border-radius:16px;margin-bottom:14px}
.summary div{display:flex;flex-direction:column;padding:12px 14px;border-left:1px solid var(--line);font-weight:600;font-size:17px;min-width:0}
.summary div:first-child{border-left:0}
.summary small{font-size:12px;font-weight:500;color:var(--muted)}

.banner{width:100%;justify-content:space-between;background:#fdf3dc;border:1px solid #efd9a2;color:#6b4e0f;margin-bottom:14px;font-weight:500;border-radius:14px}

.list{display:flex;flex-direction:column}
.item{display:flex;align-items:center;gap:12px;width:100%;text-align:left;border:0;border-top:1px solid #efeee8;border-radius:0;background:none;padding:11px 2px;min-height:58px;font-weight:400;color:var(--ink)}
.list>.item:first-child{border-top:0}
.item .grow{flex:1;min-width:0;display:flex;flex-direction:column}
.item .grow b{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.item .grow small{color:var(--muted);font-size:13.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.item>span:last-child{font-weight:600;white-space:nowrap}
.item .dot{width:10px;height:10px;border-radius:50%;flex:none;background:#c5ccd0}
.item.out .dot{background:var(--red)}
.item.in .dot{background:var(--green)}
.item.scheduled .dot{background:none;border:2px dashed currentColor;width:12px;height:12px}
.item.scheduled.out .dot{color:var(--red)}
.item.scheduled.in .dot{color:var(--green)}
.item.plain .dot{display:none}
.item select{width:auto;max-width:132px;flex:none}
.item.plain .grow b{white-space:normal;overflow-wrap:anywhere}
.needs{color:#9a6b00;font-weight:600}
.review-row{display:flex;align-items:center;gap:8px;border-top:1px solid #efeee8}
.list>.review-row:first-child{border-top:0}
.review-row .item{border-top:0;flex:1;min-width:0}
.review-row .grow small{white-space:normal}
.review-bar{margin:0 0 6px}
.review-bar .muted{flex:1}
.verify{flex:none;width:44px;height:44px;border-radius:50%;padding:0;display:grid;place-items:center;font-size:18px;color:var(--green);border-color:#9cc3a8;background:var(--green-bg)}
.hint{font-weight:600}
.hint.ok{color:var(--green)}
.hint.warn{color:#9a6b00}
.hint-box{background:#f4f7f9;border:1px solid var(--line);border-radius:12px;padding:10px 12px;display:grid;gap:8px;justify-items:start}
.hint-box.warn{background:#fdf3dc;border-color:#efd9a2;color:#6b4e0f}
.hint-box p{margin:0}
.count{display:inline-grid;place-items:center;min-width:24px;height:24px;padding:0 7px;border-radius:12px;background:var(--navy);color:#fff;font:600 13px/1 system-ui,sans-serif;vertical-align:2px;margin-left:6px}
.day h3{display:flex;justify-content:space-between;gap:8px}
.add-pill{display:inline-flex;align-items:center;gap:8px}
.suggest-row{display:flex;align-items:center;gap:2px;border-top:1px solid #efeee8}
.suggest-row:first-child{border-top:0}
.suggest-row .item{border-top:0;flex:1;min-width:0}
.suggest-row .dismiss{flex:none;color:var(--muted);font-size:15px}
.suggest-row .dismiss:hover{color:var(--red);background:var(--red-bg)}
.add-pill b{display:inline-grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--navy);color:#fff;font-weight:400}

.meter{display:block;width:100%;text-align:left;border:0;border-top:1px solid #efeee8;border-radius:0;background:none;padding:12px 2px;font-weight:400;color:var(--ink)}
.panel>h2+.meter,.panel>.row+.meter{border-top:0}
.meter-row{display:flex;align-items:center;gap:8px;border-top:1px solid #efeee8}
.panel>h2+.meter-row{border-top:0}
.meter-row .meter{border-top:0;flex:1;min-width:0}
.edit{flex:none;min-height:44px;padding:6px 12px;font-size:14px}
#categoryList h3{margin:16px 0 4px}
.meter .row b{font-weight:600}
.meter small{color:var(--muted);font-size:13px}
.track{position:relative;display:block;height:10px;background:#eeede6;border-radius:6px;overflow:hidden;margin:6px 0 4px}
.track i{position:absolute;inset:0 auto 0 0;border-radius:6px}
.track .sched{background:#ead7a6}
.track .income{background:var(--green)}
.track .spent{background:var(--navy)}
.meter.over .spent{background:var(--red)}

.monthnav{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}
.monthnav h2{flex:1;text-align:center}
.calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px;margin:8px 0}
.dow{font-size:12px;font-weight:600;color:var(--muted);text-align:center;padding:2px 0}
.cell{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:2px;min-height:58px;padding:6px 2px;border:1px solid transparent;border-radius:12px;background:var(--card);font-weight:500;color:var(--ink);min-width:0;overflow:hidden}
.cell .num{font-size:15px;width:28px;height:28px;display:grid;place-items:center;border-radius:50%}
.cell.other{background:none;color:#a7b0b6}
.cell.today .num{background:var(--gold);color:var(--ink);font-weight:700}
.cell.selected{border-color:var(--navy);box-shadow:inset 0 0 0 1px var(--navy)}
.cell .bal{display:none}
.cell .chips{display:none}
.dots{display:flex;gap:3px;height:6px}
.dots i,.legend i{width:6px;height:6px;border-radius:50%;background:#9aa6ad}
.dots i.scheduled.out,.legend i.scheduled.out{background:var(--red)}
.dots i.scheduled.in,.legend i.scheduled.in{background:var(--green)}
.legend{display:flex;justify-content:center;gap:16px;font-size:13px;color:var(--muted);margin:6px 0 14px}
.legend span{display:flex;align-items:center;gap:6px}
.legend i{display:inline-block;width:8px;height:8px}

.searchbar{display:flex;gap:8px;margin-bottom:8px}
.searchbar input{flex:1;min-width:0}
.searchbar button.on{border-color:var(--navy);background:#eef2f5}
.filters{display:grid;grid-template-columns:1fr 1fr;gap:8px;margin-bottom:10px}
.day .list{background:var(--card);border:1px solid var(--line);border-radius:16px;padding:0 14px}

input,select{font:inherit;font-size:16px;border:1px solid #cdd2cf;border-radius:10px;padding:10px 12px;background:#fff;color:inherit;min-height:46px;width:100%;max-width:100%}
input[type=checkbox],input[type=radio]{width:20px;height:20px;min-height:0;accent-color:var(--navy);flex:none}
form.inline{display:grid;grid-template-columns:1fr auto;gap:8px;margin-bottom:8px}
form.inline input[name=pattern],form.inline input[name=name]{grid-column:1/-1}
form.inline input[name=priority]{width:80px}
#ruleForm{grid-template-columns:1fr auto auto}
details{margin-top:6px}
summary{cursor:pointer;font-weight:600;color:var(--navy);padding:10px 0;min-height:44px;display:flex;align-items:center}
code{font-size:13px;background:#f4f4ef;padding:2px 5px;border-radius:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}

@media (pointer:coarse){html:has(dialog[open]){overflow:hidden}}
dialog{border:0;padding:0;color:var(--ink);background:var(--card);width:100%;max-width:100%;max-height:var(--sheet-max);margin:auto auto var(--kb,0px);border-radius:20px 20px 0 0;box-shadow:0 -10px 40px #1c324230}
dialog::backdrop{background:#1c324266}
dialog[open]{animation:rise .2s ease-out}
@keyframes rise{from{transform:translateY(30px);opacity:.6}}
.editor{display:flex;flex-direction:column;max-height:var(--sheet-max)}
.kb .foot{padding-bottom:12px}
.editor h2{padding:20px 20px 0}
.editor h2::before{content:"";display:block;width:40px;height:4px;border-radius:2px;background:#d6d8d4;margin:-8px auto 14px}
.editor-body{padding:14px 20px;overflow-y:auto;display:grid;gap:14px;overscroll-behavior:contain}
.editor-body>*{min-width:0}
.editor label{display:grid;gap:5px;font-weight:600;font-size:14px}
.editor label small{font-weight:400;color:var(--muted)}
.editor label.check{display:flex;align-items:center;gap:10px;font-weight:500;font-size:15px;min-height:44px}
.editor .file input{padding:9px}
.pair{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.pair>label{min-width:0}
.segmented{display:grid;grid-template-columns:1fr 1fr;background:#eef0ee;border-radius:12px;padding:4px}
.segmented label{display:block!important;min-height:0!important}
.segmented input{position:absolute;opacity:0;pointer-events:none}
.segmented span{display:grid;place-items:center;min-height:44px;border-radius:9px;font-weight:600;color:var(--muted);cursor:pointer}
.segmented input:checked+span{background:#fff;color:var(--navy);box-shadow:0 1px 3px #1c324222}
.segmented input:focus-visible+span{outline:3px solid var(--gold)}
.more-options{display:grid;gap:14px;padding-top:6px}
.howto{margin:0;padding-left:20px;color:var(--muted)}
.menu{gap:8px}
.menu button{justify-content:flex-start;gap:14px;text-align:left;padding:14px;border-radius:14px;min-height:64px}
.menu button span{display:flex;flex-direction:column}
.menu small{font-weight:400;color:var(--muted);font-size:13.5px}
.foot{padding:12px 20px calc(12px + env(safe-area-inset-bottom));border-top:1px solid #efeee8}
.foot span{flex:1}
.foot.wrap{flex-wrap:wrap}
.error{color:var(--red);font-weight:600}

.steps ol{margin:0;padding:0;list-style:none;counter-reset:step}
.steps li{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:10px 0;border-top:1px solid #efeee8;counter-increment:step}
.steps li:first-child{border-top:0}
.steps li span::before{content:counter(step) ". ";color:var(--muted)}
.steps li.done span{color:var(--muted);text-decoration:line-through}
.steps li button{flex:none}
.steps em{font-style:normal;color:var(--green);font-weight:700}
.gate{margin-top:60px;max-width:440px}
.gate button{margin-top:14px;width:100%}
#notice{position:fixed;left:50%;bottom:calc(var(--tabbar) + env(safe-area-inset-bottom) + 86px);transform:translateX(-50%);background:var(--ink);color:#fff;border-radius:12px;padding:10px 16px;margin:0;width:max-content;max-width:calc(100% - 32px);z-index:7;box-shadow:0 6px 20px #0003}
#notice:empty{display:none}
[hidden]{display:none!important}

@media (min-width:820px){
 body{padding-bottom:40px}
 .bar{height:68px;gap:18px}
 .brand{margin-right:0;font-size:22px}
 .tabs{position:static;display:flex;height:auto;border:0;background:none;padding:0;margin-right:auto;gap:2px}
 .tabs a{flex-direction:row;gap:7px;font-size:15px;padding:9px 12px;border-radius:10px}
 .tabs a[aria-current]{background:#eef2f5}
 .tabs a[aria-current]::before{display:none}
 .tabs svg{width:19px;height:19px}
 .desktop-only{display:inline-flex}
 .mobile-only{display:none}
 h1{font-size:40px}
 .heading{margin:28px 0 16px}
 .split{display:grid;grid-template-columns:1.15fr 1fr;gap:16px;align-items:start}
 .panel{padding:20px 22px}
 .hero{display:grid;grid-template-columns:1fr auto;align-items:end;column-gap:32px;padding:24px 28px}
 .hero .flow{margin:0;min-width:340px}
 .hero strong{font-size:54px}
 .calendar{gap:5px}
 .cell{min-height:112px;align-items:stretch;padding:6px;border-color:var(--line);border-radius:10px;cursor:pointer}
 .cell.other{border-color:transparent}
 .cell .num{font-size:14px;width:26px;height:26px}
 .cell .bal{display:block;position:absolute;right:7px;top:9px;font-size:11.5px;color:var(--muted)}
 .cell{position:relative}
 .cell .chips{display:flex;flex-direction:column;gap:3px}
 .cell .chips small{font-size:11.5px;color:var(--muted)}
 .dots{display:none}
 .chip{display:flex;justify-content:space-between;gap:6px;padding:2px 6px;border-radius:6px;font-size:12px;border:1px solid transparent}
 .chip span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 .chip b{font-weight:600;white-space:nowrap}
 .chip.scheduled{border-style:dashed}
 .chip.scheduled.out{background:var(--red-bg);border-color:#dba39b;color:#7d2a22}
 .chip.scheduled.in{background:var(--green-bg);border-color:#9cc3a8;color:#245536}
 .chip.txn{background:#f4f4ef;color:#3a4a54}
 .filters{grid-template-columns:repeat(4,auto);justify-content:start}
 .filters select{width:auto}
 form.inline{grid-template-columns:1fr 200px auto}
 form.inline input[name=pattern],form.inline input[name=name]{grid-column:auto}
 #ruleForm{grid-template-columns:1fr 200px 90px auto}
 .day{display:grid;grid-template-columns:130px 1fr;gap:12px;align-items:start}
 .day h3{margin:22px 0 0;flex-direction:column;align-items:flex-end}
 .day .list{margin-top:10px}
 dialog{width:min(520px,100% - 32px);margin:auto;border-radius:18px;max-height:calc(100dvh - 48px)}
 .editor{max-height:calc(100dvh - 48px)}
 .editor h2::before{display:none}
 .foot{padding-bottom:14px}
 #notice{bottom:24px}
}
#budgetCategoryForm{grid-template-columns:1fr 110px auto;margin:0}
#budgetCategoryForm input[name=name]{grid-column:1/-1}
.refund-box{border-top:1px solid var(--line);padding-top:8px;display:grid;gap:10px}
#refundFields{display:grid;gap:10px}
#refundFields[hidden]{display:none}
.refund-tag{color:var(--muted);font-weight:600}
.item.refunded{opacity:.55}
.item.refunded .dot{background:#c5ccd0}
.refund-amount{display:flex;flex-direction:column;align-items:flex-end;line-height:1.2}
.refund-amount s{color:var(--muted);font-weight:400;font-size:13.5px}
.item.refunded .refund-amount s{font-size:inherit}
.amount-stack{display:flex;flex-direction:column;align-items:flex-end;line-height:1.25}
.amount-stack small{color:var(--muted);font-weight:400;font-size:13px}
.flow .of{color:#ffffff99;font-size:12.5px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.item.save .dot{background:var(--save)}
.item.scheduled.save .dot{background:none;color:var(--save)}
.item.save .out,.item.save .in,.save-note{color:var(--save)}
.payday h2{margin-bottom:6px}
.todo{display:flex;align-items:center;gap:12px;border-top:1px solid #efeee8;padding:12px 0}
.payday h2+.todo{border-top:0}
.todo .grow{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}
.todo small{color:var(--muted);font-size:13.5px}
.todo small.save-note{color:var(--save)}
.todo.big .amt{font:400 30px/1.15 Georgia,serif;letter-spacing:-.02em}
.todo button{flex:none}
.amount-stack .gross{color:var(--muted);font-weight:400}
.month-break{display:flex;align-items:baseline;justify-content:space-between;border-top:2px solid var(--line);margin-top:6px;padding:14px 2px 4px}
.month-break b{font:400 20px/1.2 Georgia,serif}
.month-break small{color:var(--muted);font-size:13px}
.month-break+.item{border-top:0}
.coming-more{margin:4px -16px -16px;border-top:1px solid #efeee8}
.coming-more .more{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:48px;border:0;border-radius:0 0 16px 16px;background:none;color:var(--navy);font-weight:600}
.coming-more .more:hover{background:var(--paper)}
.coming-more .more::after{content:'';width:6px;height:6px;border-right:2px solid;border-bottom:2px solid;transform:translateY(-2px) rotate(45deg)}
.date-tile{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;flex:none;width:44px;height:44px;border-radius:12px;background:var(--paper);line-height:1.1}
.date-tile small{font-size:10px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--muted)}
.date-tile b{font-size:16px;font-weight:600;font-variant-numeric:tabular-nums}
.item>.in,.item>.out,.amount-stack>.in,.amount-stack>.out{font-size:18px;font-variant-numeric:tabular-nums}
.amount-stack .gross{font-size:14px}
