/* Layout: phone-width column, 4 pages (Log, Budget, Goals, History) switched by a fixed bottom tab bar */
:root{
  --bg:#EEF2F0; --surface:#FFFFFF; --ink:#13201A; --muted:#5B6B63; --line:#D5DED9;
  --accent:#1E6B47; --on-accent:#FFFFFF; --accent-soft:#DCEDE3; --warn:#B7791F; --bad:#B42318; --bad-soft:#FBE4E1;
  --display:"Bricolage Grotesque",ui-sans-serif,system-ui,sans-serif;
  --body:"IBM Plex Sans",ui-sans-serif,system-ui,sans-serif;
  --mono:"IBM Plex Mono",ui-monospace,Menlo,monospace;
  color-scheme:light;
}
@media (prefers-color-scheme:dark){:root:not([data-theme="light"]){
  --bg:#0F1613; --surface:#17211C; --ink:#E4ECE7; --muted:#93A59B; --line:#2A3832;
  --accent:#5CC48E; --on-accent:#0F1613; --accent-soft:#1D3328; --warn:#E0A84A; --bad:#F07467; --bad-soft:#3A1E1B; color-scheme:dark}}
:root[data-theme="dark"]{
  --bg:#0F1613; --surface:#17211C; --ink:#E4ECE7; --muted:#93A59B; --line:#2A3832;
  --accent:#5CC48E; --on-accent:#0F1613; --accent-soft:#1D3328; --warn:#E0A84A; --bad:#F07467; --bad-soft:#3A1E1B; color-scheme:dark}
*{box-sizing:border-box}
[hidden]{display:none!important}
html{-webkit-text-size-adjust:100%;overflow-x:hidden;overscroll-behavior:none;touch-action:pan-y}
html,body{max-width:100%;overflow-x:hidden}
body{overscroll-behavior:none;touch-action:pan-y;-webkit-tap-highlight-color:transparent}
body{margin:0;background:var(--bg);color:var(--ink);font:16px/1.5 var(--body);
  padding-inline:max(16px,env(safe-area-inset-left));
  padding-block:calc(env(safe-area-inset-top) + 16px) calc(env(safe-area-inset-bottom) + 96px)}
.wrap{max-width:640px;margin:0 auto}
#appView,#authView{display:flex;flex-direction:column;gap:22px}
h1,h2{font-family:var(--display);margin:0}
h1{font-size:1.9rem;font-weight:800;letter-spacing:-.02em;line-height:1.1}
h2{font-size:1.1rem;font-weight:600}
.num{font-family:var(--mono);font-variant-numeric:tabular-nums}
.label{font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted)}
.stack{display:flex;flex-direction:column;gap:12px}
.row{display:flex;gap:8px;align-items:center}
.row.wrap{flex-wrap:wrap}
.row.between{justify-content:space-between}
.card{background:var(--surface);border:1px solid var(--line);border-radius:14px;padding:14px}
label{display:flex;flex-direction:column;gap:4px}
button,input{font:inherit;color:var(--ink)}
button{cursor:pointer;border:1px solid var(--line);background:var(--surface);border-radius:10px;padding:8px 14px;min-height:40px}
button:disabled{opacity:.5}
button.primary{background:var(--accent);border-color:var(--accent);color:var(--on-accent);font-weight:600}
button.big{min-height:50px;font-size:1.05rem}
button.icon{font-size:1.3rem;width:44px;padding:0}
button:focus-visible,input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
input{background:var(--bg);border:1px solid var(--line);border-radius:10px;padding:10px;width:100%;min-width:0;font-size:16px}
input.date{width:auto;flex:0 0 auto}
.top{display:flex;justify-content:space-between;align-items:flex-end}
.amount{display:flex;align-items:center;gap:6px;font-family:var(--mono);font-size:2rem}
.amount span{color:var(--muted)}
.amount input{font-family:var(--mono);font-size:2rem;padding:6px 10px;background:transparent;border:0;border-bottom:2px solid var(--line);border-radius:0}
.amount input:focus{outline:none;border-bottom-color:var(--accent)}
.chips{display:flex;flex-wrap:wrap;gap:6px}
.chips button{min-height:36px;padding:6px 12px;border-radius:999px;font-size:.9rem}
.chips button[aria-checked="true"]{background:var(--accent-soft);border-color:var(--accent);color:var(--ink);font-weight:600}
.tip{background:var(--accent-soft);border-radius:12px;padding:12px 14px;display:flex;gap:10px;align-items:center;justify-content:space-between;flex-wrap:wrap}
.month{display:flex;align-items:center;justify-content:center;gap:10px}
.mLabel{min-width:9.5em;text-align:center;font-weight:600}
.summary{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;background:var(--line);border:1px solid var(--line);border-radius:14px;overflow:hidden}
.summary>div{background:var(--surface);padding:12px;min-width:0}
.summary .big{font-size:1.15rem;font-weight:500;overflow-wrap:anywhere}
.verdict{padding:12px 14px;border-radius:12px;background:var(--accent-soft);font-weight:500}
.verdict.over{background:var(--bad-soft);color:var(--bad)}
.cats{display:flex;flex-direction:column;gap:14px}
.cat{display:grid;grid-template-columns:1fr auto;gap:4px 12px}
.bar{grid-column:1/-1;height:8px;background:var(--line);border-radius:4px;overflow:hidden}
.bar i{display:block;height:100%;background:var(--accent);border-radius:4px}
.cat.near .bar i{background:var(--warn)}
.cat.over .bar i{background:var(--bad)}
.cat.over .left{color:var(--bad);font-weight:600}
.left{color:var(--muted);font-size:.85rem}
.goals{display:flex;flex-direction:column;gap:10px}
.goal{display:flex;flex-direction:column;gap:8px}
.goal .head{display:flex;justify-content:space-between;gap:8px;align-items:baseline}
.goal .note{font-size:.82rem;color:var(--muted)}
.goal .edit{display:flex;gap:6px}
.goalgroup{display:flex;flex-direction:column;gap:14px}
.goalgroup>.head{display:flex;justify-content:space-between;gap:8px;align-items:baseline;font-size:1.05rem}
.goalgroup .goal+.goal{border-top:1px solid var(--line);padding-top:12px}
.list{background:var(--surface);border:1px solid var(--line);border-radius:14px}
.item{display:grid;grid-template-columns:1fr auto auto;gap:4px 10px;align-items:center;padding:10px 12px;border-bottom:1px solid var(--line)}
.item:last-child{border-bottom:0}
.item .sub{font-size:.8rem;color:var(--muted);grid-column:1}
.item .what{overflow-wrap:anywhere}
.item .x{border:0;background:none;color:var(--muted);min-height:32px;padding:0 6px;grid-row:1/3;grid-column:3}
.item .amt{grid-row:1/3;grid-column:2}
.empty{padding:20px;color:var(--muted);text-align:center}
.status{margin:0;font-size:.88rem;color:var(--muted);min-height:1.3em}
.status.err{color:var(--bad)}
.brand{padding-top:10vh}
html.locked,html.locked body{overflow:hidden;overscroll-behavior:none}
dialog{position:fixed;inset:0;margin:0;border:0;padding:0;width:100%;max-width:100%;height:100%;max-height:100%;
  background:var(--bg);color:var(--ink);overflow:hidden;overscroll-behavior:none;touch-action:none}
dialog[open]{display:flex;flex-direction:column}
dialog::backdrop{background:rgba(0,0,0,.4)}
#settingsForm{display:flex;flex-direction:column;height:100%;min-height:0}
.sheetHead{flex:0 0 auto;display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:8px;
  padding:calc(env(safe-area-inset-top) + 8px) 12px 8px;background:var(--surface);border-bottom:1px solid var(--line)}
.sheetHead h2{text-align:center}
.sheetHead .link{border:0;background:none;color:var(--accent);padding:8px 6px;justify-self:start}
.sheetHead .link.strong{font-weight:600;justify-self:end}
.sheetBody{flex:1 1 auto;min-height:0;overflow-y:auto;overflow-x:hidden;touch-action:pan-y;-webkit-overflow-scrolling:touch;overscroll-behavior:contain;
  padding:16px max(16px,env(safe-area-inset-left)) calc(env(safe-area-inset-bottom) + 32px);max-width:640px;width:100%;margin:0 auto}
.budgetGrid{display:grid;grid-template-columns:minmax(0,1fr) 92px auto;gap:8px;align-items:center}
.budgetGrid .rm{border:0;background:none;color:var(--muted);min-width:40px;padding:0 6px}
.budgetGrid .rm.armed{color:var(--bad);font-weight:600;font-size:.85rem}
.addCat{border-style:dashed;color:var(--accent);font-weight:600}
hr{border:0;border-top:1px solid var(--line);width:100%;margin:4px 0}
@media (prefers-reduced-motion:no-preference){.bar i{transition:width .3s ease}}

.pay{display:flex;flex-direction:column;gap:0}
.pay .phead{display:flex;justify-content:space-between;align-items:baseline;gap:8px;padding-bottom:8px}
.pay .prow{display:flex;justify-content:space-between;align-items:center;gap:12px;padding:8px 0;border-top:1px solid var(--line)}
.pay .sub{font-size:.82rem;color:var(--muted)}
.pay .pnext{margin-top:14px;margin-bottom:4px}
.pay .pline{display:grid;grid-template-columns:4.2em 1fr;gap:10px;padding:5px 0;border-top:1px solid var(--line);align-items:baseline}
.pay .pfoot{margin-top:10px}
.pay .pamt{text-align:right;white-space:nowrap}
.pay .ptot{font-weight:600}
.pay .pgap{height:18px}

.page{gap:16px}
.tabs{position:fixed;left:0;right:0;bottom:0;z-index:5;display:grid;grid-template-columns:repeat(4,1fr);
  background:var(--surface);border-top:1px solid var(--line);padding-bottom:env(safe-area-inset-bottom)}
.tabs button{border:0;border-radius:0;background:none;color:var(--muted);display:flex;flex-direction:column;align-items:center;gap:2px;
  padding:8px 0 6px;min-height:58px;font-size:.75rem;font-weight:500}
.tabs .ti{font-size:1.25rem;line-height:1}
.tabs button[aria-current]{color:var(--accent);font-weight:600}
.sheetHead h2:focus{outline:none}

/* Settings layout: grouped sections, everything fits the screen width */
.sheetBody>*+*{margin-top:18px}
.sheetBody *{box-sizing:border-box;max-width:100%}
.sgroup h3{margin:0 0 6px 4px;font-size:.78rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);font-weight:600}
.sgroup .card{padding:12px}
.hint{margin:0;font-size:.82rem;color:var(--muted)}
button.full{width:100%}
button.danger{color:var(--bad)}
.sheetBody input{width:100%;min-width:0;display:block}
.sheetBody input[type="date"]{-webkit-appearance:none;appearance:none;min-height:44px;text-align:left}
.sheetBody input[type="date"]::-webkit-date-and-time-value{text-align:left}
.catHead,.budgetGrid{display:grid;grid-template-columns:minmax(0,1fr) 84px 40px;gap:8px;align-items:center}
.catHead{margin-bottom:-4px}
.budgetGrid input[data-amt]{text-align:right;font-family:var(--mono)}
.budgetGrid .rm{min-width:0;width:40px;padding:0;font-size:.95rem}
.budgetGrid .rm.armed{font-size:.7rem;line-height:1.1}

/* Category toggle on Log purchase */
.catToggle{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:10px;width:100%;min-height:46px;text-align:left}
.catToggle #catCurrent{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.catToggle .chev{color:var(--muted);transition:transform .2s ease}
.catToggle[aria-expanded="true"] .chev{transform:rotate(180deg)}
.chips[hidden]{display:none}

/* Next pay countdown */
.payCard{display:flex;flex-direction:column;gap:10px}
.payTop{display:flex;justify-content:space-between;align-items:flex-end;gap:12px}
.payWhen{font-family:var(--display,inherit);font-size:1.6rem;font-weight:800;line-height:1.1}
.payAmt{font-size:1.15rem;font-weight:500;color:var(--accent)}
.payBar{height:10px}
.payEnds{display:flex;justify-content:space-between;margin-top:-4px}
/* Segmented pay frequency picker */
.seg{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;background:var(--line);padding:3px;border-radius:12px;margin-top:4px}
.seg button{border:0;background:none;border-radius:9px;min-height:40px;padding:6px 4px;font-size:.88rem;color:var(--muted)}
.seg button[aria-checked="true"]{background:var(--surface);color:var(--ink);font-weight:600;box-shadow:0 1px 2px rgba(0,0,0,.12)}

/* Log purchase card */
.logCard{position:relative;overflow:hidden;padding:0 16px 16px;border-radius:20px;border-color:color-mix(in srgb,var(--accent) 25%,var(--line));
  box-shadow:0 1px 2px rgba(0,0,0,.04),0 8px 24px color-mix(in srgb,var(--accent) 12%,transparent)}
.logHead{display:flex;align-items:center;gap:8px;margin:0 -16px;padding:12px 16px;background:var(--accent-soft);
  font-family:var(--display);font-weight:800;font-size:1.05rem;color:var(--ink)}
.logDot{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--accent);color:var(--on-accent);font-size:1.1rem;line-height:1;font-family:var(--body)}
.logCard .amount{justify-content:center;padding:14px 0 6px;font-size:2.6rem}
.logCard .amount span{font-size:1.8rem;color:var(--accent);font-weight:500}
.logCard .amount input{font-size:2.8rem;text-align:left;width:6.2ch;flex:0 0 auto;border-bottom-width:3px;padding:2px 4px}
.logCard .amount input:focus{border-bottom-color:var(--accent)}
.logCard .catToggle{border-radius:12px;background:var(--bg)}
.logBtn{display:flex;align-items:center;justify-content:center;gap:10px;min-height:54px;border-radius:14px;font-size:1.1rem;letter-spacing:.01em;
  box-shadow:0 4px 14px color-mix(in srgb,var(--accent) 35%,transparent);transition:transform .08s ease,box-shadow .15s ease}
.logBtn:active{transform:scale(.98);box-shadow:0 2px 6px color-mix(in srgb,var(--accent) 30%,transparent)}
.logBtnIcon{display:grid;place-items:center;width:24px;height:24px;border-radius:50%;background:color-mix(in srgb,var(--on-accent) 22%,transparent);font-size:.9rem}

/* ===== Unified look: every section uses the Log card style ===== */
.card{border-radius:20px;box-shadow:0 1px 2px rgba(0,0,0,.04),0 6px 18px rgba(0,0,0,.04)}
.panel{padding:0;overflow:hidden}
.panelHead{display:flex;align-items:center;gap:8px;padding:12px 16px;background:var(--accent-soft);
  font-family:var(--display);font-weight:800;font-size:1.05rem}
.panelHead>span:nth-child(2){flex:1;min-width:0}
.panelDot{display:grid;place-items:center;width:26px;height:26px;border-radius:50%;background:var(--accent);color:var(--on-accent);
  font:600 .85rem/1 var(--body);flex:0 0 auto}
.panelEnd{font:500 .9rem var(--mono);color:var(--muted)}
.chipBtn{min-height:32px;padding:4px 12px;border-radius:999px;font:600 .8rem var(--body);background:var(--surface);border-color:color-mix(in srgb,var(--accent) 35%,var(--line));color:var(--accent)}
.sectionLabel{padding-left:4px;margin-bottom:-6px}

/* Month switcher pill */
.month{align-self:center;background:var(--surface);border:1px solid var(--line);border-radius:999px;padding:3px;gap:2px}
.month button{border:0;background:none;border-radius:999px;width:40px;min-height:36px;padding:0;font-size:1.4rem;line-height:1;color:var(--accent)}
.month button:active{background:var(--accent-soft)}
.mLabel{font-family:var(--display);font-size:1rem}

/* Home summary */
.summary{border-radius:20px;box-shadow:0 1px 2px rgba(0,0,0,.04),0 6px 18px rgba(0,0,0,.04)}
.summary>div{padding:14px 12px;text-align:center}
.summary .big{font-size:1.25rem;font-weight:600}
.summary>div:nth-child(2) .big{color:var(--accent)}
.verdict{border-radius:16px;padding:12px 16px;border-left:4px solid var(--accent)}
.verdict.over{border-left-color:var(--bad)}

/* Budget hero */
.hero{display:flex;flex-direction:column;gap:12px;padding:16px;
  background:linear-gradient(135deg,var(--accent-soft),var(--surface) 70%);border-color:color-mix(in srgb,var(--accent) 25%,var(--line))}
.heroTop{display:flex;justify-content:space-between;align-items:flex-end;gap:12px}
.heroBig{font-family:var(--display);font-size:2.2rem;font-weight:800;line-height:1.05;color:var(--accent);letter-spacing:-.02em}
.heroSide{text-align:right;font-size:.9rem}
.heroBar{height:12px;border-radius:6px}
.hero.near .heroBig{color:var(--warn)} .hero.near .bar i{background:var(--warn)}
.hero.over{background:linear-gradient(135deg,var(--bad-soft),var(--surface) 70%);border-color:color-mix(in srgb,var(--bad) 30%,var(--line))}
.hero.over .heroBig{color:var(--bad)} .hero.over .bar i{background:var(--bad)}

/* Categories */
.cats{gap:0}
.cat{grid-template-columns:1fr auto;padding:12px 16px;gap:6px 12px}
.cat+.cat{border-top:1px solid var(--line)}
.catName{display:flex;align-items:center;gap:8px;font-weight:600;min-width:0}
.catDot{width:10px;height:10px;border-radius:50%;background:var(--accent);flex:0 0 auto}
.cat.near .catDot{background:var(--warn)} .cat.over .catDot{background:var(--bad)}
.catAmt{font-size:.95rem}
.catAmt .sub,.pct{color:var(--muted);font-size:.8rem}
.pct{text-align:right}
.cat .left{grid-column:1}
.cat.over .pct{color:var(--bad);font-weight:600}

/* Goals */
.goals{gap:16px}
.goalgroup{gap:0}
.goalgroup>.goal{padding:14px 16px}
.goalgroup>.goal+.goal{border-top:1px solid var(--line);padding-top:14px}
.goal .head strong{font-weight:600}
.goal .bar{height:10px;border-radius:5px}
.gpct{font-size:.78rem;color:var(--muted);margin-top:-4px}
.goal.done .gpct{color:var(--accent);font-weight:600}
.goal .edit input{background:var(--bg);border-radius:12px;font-family:var(--mono)}
.goal .edit button{border-radius:12px;font-weight:600;color:var(--accent);border-color:color-mix(in srgb,var(--accent) 35%,var(--line))}

/* Pay plan inside panel */
#payPlan{padding:14px 16px}

/* Purchase lists */
.list.flat{border:0;border-radius:0;background:none}
.item{grid-template-columns:auto minmax(0,1fr) auto auto;gap:2px 12px;padding:12px 16px}
.item .dbadge{grid-row:1/3;grid-column:1;display:flex;flex-direction:column;align-items:center;justify-content:center;width:42px;height:42px;
  border-radius:12px;background:var(--accent-soft);line-height:1}
.dbadge b{font:700 1rem var(--display)}
.dbadge span{font-size:.62rem;text-transform:uppercase;letter-spacing:.06em;color:var(--muted);margin-top:2px}
.item .what{grid-column:2;font-weight:500}
.item .sub{grid-column:2}
.item .amt{grid-column:3;font-weight:600}
.item .x{grid-column:4;opacity:.55}

/* Header + tabs */
.top h1{font-size:2.1rem}
#settingsBtn{border-radius:50%;width:44px;height:44px;background:var(--surface);box-shadow:0 1px 2px rgba(0,0,0,.06)}
.tabs{left:12px;right:12px;bottom:calc(env(safe-area-inset-bottom) + 8px);padding:6px;border:1px solid var(--line);border-radius:22px;gap:4px;
  box-shadow:0 8px 28px rgba(0,0,0,.12);background:color-mix(in srgb,var(--surface) 92%,transparent);
  -webkit-backdrop-filter:blur(14px);backdrop-filter:blur(14px);max-width:616px;margin:0 auto}
.tabs button{border-radius:16px;min-height:52px;padding:6px 0 4px;transition:background .15s ease,color .15s ease}
.tabs button[aria-current]{background:var(--accent-soft)}
body{padding-bottom:calc(env(safe-area-inset-bottom) + 110px)}

/* Settings groups + sign-in */
.sgroup .card{padding:14px;border-radius:18px}
.sheetBody input,.logCard input:not(#fAmt){border-radius:12px}
#authForm{padding:18px}

/* Goal header: name and amount side by side, amount never wraps */
.goal .head{flex-wrap:nowrap;align-items:baseline}
.goal .head strong{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}
.goal .head .num{flex:0 0 auto;white-space:nowrap;font-size:.92rem}
.pay .phead .label{white-space:nowrap}

button.strongDanger{background:var(--bad-soft);border-color:color-mix(in srgb,var(--bad) 40%,var(--line));font-weight:600}

/* Header: greeting under the title, pushed down from the status bar */
.top{padding-top:14px;align-items:center}
.hello{margin-top:4px;font-size:.95rem;font-weight:500;color:var(--muted)}

/* Compact next-pay strip */
.payCard{padding:10px 14px;gap:8px;border-radius:16px}
.payCard .payTop{align-items:center}
.payLine{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap;min-width:0}
.payCard .payWhen{font-size:1.05rem;line-height:1.2}
.payCard .payLine .sub{font-size:.82rem;color:var(--muted)}
.payCard .payAmt{font-size:.95rem}
.payCard .payBar{height:5px;border-radius:3px}

/* Verdict card */
.verdict{display:flex;align-items:center;gap:12px;padding:12px 14px;border-radius:16px;border:1px solid var(--line);border-left-width:1px;
  background:var(--surface);color:var(--ink);font-weight:400;box-shadow:0 1px 2px rgba(0,0,0,.04)}
.vIcon{display:grid;place-items:center;flex:0 0 auto;width:34px;height:34px;border-radius:50%;background:var(--accent);color:var(--on-accent);font-weight:700}
.vTitle{font-family:var(--display);font-weight:800;font-size:1rem;line-height:1.2}
.vSub{font-size:.86rem;color:var(--muted);margin-top:2px}
.verdict.ok{background:var(--accent-soft);border-color:color-mix(in srgb,var(--accent) 25%,var(--line))}
.verdict.warn{background:color-mix(in srgb,var(--warn) 14%,var(--surface));border-color:color-mix(in srgb,var(--warn) 35%,var(--line))}
.verdict.warn .vIcon{background:var(--warn)}
.verdict.over{background:var(--bad-soft);border-color:color-mix(in srgb,var(--bad) 35%,var(--line));color:var(--ink)}
.verdict.over .vIcon{background:var(--bad)}
.verdict.over .vTitle{color:var(--bad)}
.verdict.idle .vIcon{background:var(--line);color:var(--muted)}

/* Add / edit goal sheet */
#goalForm{display:flex;flex-direction:column;height:100%;min-height:0}
.typeGrid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.typeGrid button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;min-height:56px;padding:10px 12px;border-radius:14px}
.typeGrid button b{font-weight:600;font-size:.95rem}
.typeGrid button span{font-size:.75rem;color:var(--muted)}
.typeGrid button[aria-checked="true"]{background:var(--accent-soft);border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
.addGoal{width:100%;min-height:50px;border-radius:16px;background:transparent}
.goal .edit .editGoal{flex:0 0 auto;width:44px;padding:0;color:var(--muted);font-weight:400}

/* Privacy lock switch */
.topBtns{display:flex;align-items:center;gap:10px}
.lockSwitch{border:0;background:none;padding:0;min-height:44px;display:grid;place-items:center}
.lsTrack{position:relative;display:block;width:62px;height:34px;border-radius:999px;background:var(--line);transition:background .2s ease;box-shadow:inset 0 1px 2px rgba(0,0,0,.08)}
.lsKnob{position:absolute;top:3px;left:3px;width:28px;height:28px;border-radius:50%;background:var(--surface);display:grid;place-items:center;
  box-shadow:0 1px 3px rgba(0,0,0,.2);transition:transform .2s ease}
.lsKnob svg{width:16px;height:16px;fill:none;stroke:var(--muted);stroke-width:2.2;stroke-linecap:round;stroke-linejoin:round}
.lsKnob svg rect{fill:currentColor;stroke:none}
.lsOpen{color:var(--muted)} .lsShut{display:none;color:var(--accent)} .lsShut path{stroke:var(--accent)}
.lockSwitch[aria-checked="true"] .lsTrack{background:var(--accent)}
.lockSwitch[aria-checked="true"] .lsKnob{transform:translateX(28px)}
.lockSwitch[aria-checked="true"] .lsOpen{display:none}
.lockSwitch[aria-checked="true"] .lsShut{display:block}

/* Hidden numbers: amounts become dots */
html.hideNums .num,html.hideNums .left{font-size:0!important;letter-spacing:0}
html.hideNums .num *,html.hideNums .left *{display:none!important}
html.hideNums .num::after{content:"••••";font-size:1rem;letter-spacing:.12em}
html.hideNums .summary .big::after{font-size:1.25rem}
html.hideNums .heroBig::after{font-size:2.2rem;letter-spacing:.08em}
html.hideNums .payAmt::after,html.hideNums .catAmt::after{font-size:.95rem}
html.hideNums .left::after{content:"•••• left";font-size:.85rem}
html.hideNums .cat.over .left::after{content:"•••• over"}
html.hideNums .vSub{font-size:0}
html.hideNums .vSub::after{content:"Numbers hidden";font-size:.86rem}
html.hideNums .status,html.hideNums #budgetTotal,html.hideNums #billTotal{visibility:hidden}
html.hideNums .goal .edit input{-webkit-text-security:disc}
html.hideNums .bar i{opacity:.25}

/* Goal balance editor */
.goal .edit{align-items:flex-end;gap:8px}
.balIn{flex:1 1 auto;min-width:0;gap:2px}
.balBox{display:flex;align-items:center;gap:4px;background:var(--bg);border:1px solid var(--line);border-radius:12px;padding-left:10px}
.balBox>span{color:var(--muted);font-family:var(--mono)}
.goal .edit .balBox input{border:0;background:none;padding:10px 10px 10px 0;font-family:var(--mono)}
.goal .edit .balBox:focus-within{border-color:var(--accent)}
.goal .edit .saveBal{min-height:44px;min-width:76px;background:var(--accent);border-color:var(--accent);color:var(--on-accent);font-weight:600}
.goal .edit .saveBal:disabled{background:var(--surface);border-color:var(--line);color:var(--muted);opacity:1}
.goal .edit .saveBal.saved{background:var(--accent-soft);border-color:var(--accent);color:var(--accent)}
.goal .edit .editGoal{min-height:44px}
html.hideNums .goal .edit .balBox input{-webkit-text-security:disc}

/* Page slide when swiping / switching tabs */
@media (prefers-reduced-motion:no-preference){
  .page.slideL{animation:slideL .22s ease-out}
  .page.slideR{animation:slideR .22s ease-out}
}
@keyframes slideL{from{opacity:0;transform:translateX(28px)}to{opacity:1;transform:none}}
@keyframes slideR{from{opacity:0;transform:translateX(-28px)}to{opacity:1;transform:none}}

/* Settings layout */
.sIntro{margin:0;font-size:.88rem;color:var(--muted);text-align:center}
.sheetBody>.sgroup{padding:0}
.sgroup.panel .sBody{padding:14px 16px}
.sTotal{font-weight:600;color:var(--ink);padding-top:8px;border-top:1px solid var(--line)}
.sTotal:empty{display:none}
.sDivider{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:.72rem;text-transform:uppercase;letter-spacing:.1em;margin-top:28px!important}
.sDivider::before,.sDivider::after{content:"";flex:1;border-top:1px solid var(--line)}
.sRow{display:flex;justify-content:space-between;align-items:baseline;gap:12px}
.sEmail{font-weight:500;overflow-wrap:anywhere;text-align:right}
.danger-zone>summary{list-style:none;cursor:pointer}
.danger-zone>summary::-webkit-details-marker{display:none}
.danger-zone .panelHead{background:var(--bad-soft)}
.danger-zone .panelDot{background:var(--bad)}
.danger-zone .chev{margin-left:auto;color:var(--muted);transition:transform .2s ease}
.danger-zone[open] .chev{transform:rotate(180deg)}

/* Sheet grab handle (swipe down to close) */
.sheetHead{position:relative;padding-top:calc(env(safe-area-inset-top) + 16px)}
.grab{position:absolute;left:50%;top:calc(env(safe-area-inset-top) + 5px);width:40px;height:5px;margin-left:-20px;border-radius:3px;background:var(--line)}
dialog{will-change:transform}

/* Line icons */
.ic{width:1em;height:1em;display:inline-block;vertical-align:middle;fill:none;stroke:currentColor;stroke-width:2;stroke-linecap:round;stroke-linejoin:round;flex:0 0 auto}
.panelDot .ic,.logDot .ic,.vIcon .ic{width:15px;height:15px}
.logBtnIcon .ic{width:14px;height:14px;stroke-width:2.6}
.tabs .ti .ic{width:22px;height:22px;stroke-width:1.8}
#settingsBtn .ic{width:22px;height:22px;stroke-width:1.8}
.chev .ic{width:16px;height:16px}
.item .x .ic,.budgetGrid .rm .ic{width:16px;height:16px}
.goal .edit .editGoal .ic{width:17px;height:17px}
.vIcon #i-dot{fill:currentColor}

/* Notification toggles */
.tgl{display:flex;flex-direction:row;align-items:center;justify-content:space-between;gap:12px;padding:4px 0;cursor:pointer}
.tgl+.tgl,.tglSub+.tgl{border-top:1px solid var(--line);padding-top:12px}
.tgl>span{display:flex;flex-direction:column;min-width:0}
.tgl b{font-weight:600}
.tgl small{font-size:.8rem;color:var(--muted)}
.sw{-webkit-appearance:none;appearance:none;flex:0 0 auto;width:50px!important;height:30px;border-radius:999px;background:var(--line);border:0;padding:0;position:relative;cursor:pointer;transition:background .2s ease;margin:0}
.sw::after{content:"";position:absolute;top:3px;left:3px;width:24px;height:24px;border-radius:50%;background:#fff;box-shadow:0 1px 3px rgba(0,0,0,.25);transition:transform .2s ease}
.sw:checked{background:var(--accent)}
.sw:checked::after{transform:translateX(20px)}
.tglSub{display:flex;flex-direction:column;gap:4px;padding:0 0 4px}
.seg4{grid-template-columns:repeat(4,minmax(0,1fr))}
#nDay{font:inherit;color:var(--ink);background:var(--bg);border:1px solid var(--line);border-radius:12px;padding:10px;min-height:44px;width:100%}

/* Spending calendar */
.cal{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:6px 2px;padding:14px 10px 12px}
.calWd{text-align:center;font-size:.66rem;color:var(--muted);font-weight:600;letter-spacing:.08em;padding-bottom:4px}
.calDay{display:flex;flex-direction:column;align-items:center;gap:4px;min-height:56px;padding:4px 0;border:0;border-radius:14px;background:none;min-width:0}
.calN{display:grid;place-items:center;width:28px;height:28px;border-radius:50%;font-size:.85rem;font-weight:600;line-height:1}
.calAmt{min-height:18px;padding:0 6px;border-radius:999px;font-size:.64rem;font-weight:600;line-height:18px;white-space:nowrap;max-width:100%;overflow:hidden}
.calAmt:empty{padding:0}
.calDay.l1 .calAmt{background:var(--accent);color:var(--on-accent)}
.calDay.l2 .calAmt{background:var(--warn);color:#fff}
.calDay.l3 .calAmt{background:var(--bad);color:#fff}
.calDay.future .calN{color:var(--muted);opacity:.55}
.calDay.today .calN{background:var(--ink);color:var(--surface)}
.calDay.sel{background:var(--bg);box-shadow:inset 0 0 0 1.5px var(--accent)}
.calDay:active{background:var(--bg)}
.calKey{grid-column:1/-1;display:flex;justify-content:center;gap:8px;flex-wrap:wrap;padding-top:10px;margin-top:4px;border-top:1px solid var(--line)}
.calKey span{display:inline-flex;align-items:center;gap:5px;font-size:.72rem;font-weight:600;padding:4px 10px 4px 6px;border-radius:999px}
.calKey .ic{width:14px;height:14px;padding:2px;border-radius:50%;color:#fff;stroke-width:3;box-sizing:content-box}
.calKey .k1{background:var(--accent-soft);color:var(--accent)} .calKey .k1 .ic{background:var(--accent)}
.calKey .k2{background:color-mix(in srgb,var(--warn) 16%,var(--surface));color:var(--warn)} .calKey .k2 .ic{background:var(--warn)}
.calKey .k3{background:var(--bad-soft);color:var(--bad)} .calKey .k3 .ic{background:var(--bad)}
.calHint{grid-column:1/-1;text-align:center;font-size:.72rem;color:var(--muted)}
html.hideNums .calAmt:not(:empty)::after{font-size:.6rem;letter-spacing:.05em;content:"•••"}
html.hideNums .calHint{visibility:hidden}
html.hideNums .calAmt:empty::after{content:none}

/* Income split editor */
.splitTop{padding:14px 16px 0;display:flex;flex-direction:column;gap:8px}
.splitEd{margin:12px 16px 0;padding:12px;border-radius:16px;background:var(--bg);display:flex;flex-direction:column;gap:8px}
.splitPool{display:flex;justify-content:space-between;align-items:baseline;font-size:.88rem;color:var(--muted);padding-bottom:6px;border-bottom:1px solid var(--line)}
.splitPool b{color:var(--ink);font-size:1rem}
.splitRow{display:grid;grid-template-columns:minmax(0,1fr) 84px 76px;gap:8px;align-items:center}
.splitName{font-weight:500;display:flex;flex-direction:column;min-width:0;overflow-wrap:anywhere}
.splitName small{font-size:.7rem;color:var(--muted)}
.pctBox{display:flex;align-items:center;background:var(--surface);border:1px solid var(--line);border-radius:12px;padding-right:10px}
.pctBox:focus-within{border-color:var(--accent)}
.pctBox input{border:0;background:none;text-align:right;font-family:var(--mono);padding:9px 4px 9px 8px}
.pctBox span{color:var(--muted);font-family:var(--mono)}
.splitAmt{text-align:right;font-size:.85rem;color:var(--muted)}
.splitFoot{display:flex;flex-direction:column;gap:8px;padding-top:6px;border-top:1px solid var(--line)}
.splitBarWrap{height:8px;border-radius:4px;background:var(--line);overflow:hidden}
.splitBarWrap i{display:block;height:100%;width:0;background:var(--warn);border-radius:4px;transition:width .2s ease}
.splitBarWrap i.full{background:var(--accent)} .splitBarWrap i.over{background:var(--bad)}
.splitTotal{font-size:.85rem;font-weight:600}
.splitTotal.bad{color:var(--bad)}
.splitFoot .row{flex-wrap:wrap}

.calDay.l0 .calAmt{background:var(--line);color:var(--muted)}
.calKey .k0{background:var(--bg);color:var(--muted)} .calKey .k0 .ic{background:var(--muted)}

/* Fixed bills sit under the day's spending as a small grey pill, never coloured */
.calDay{gap:3px}
.calBill{min-height:15px;padding:0 5px;border-radius:999px;font-size:.56rem;line-height:15px;background:var(--line);color:var(--muted);white-space:nowrap;max-width:100%;overflow:hidden}
html.hideNums .calBill::after{font-size:.5rem;content:"•••"}

.calHead{cursor:pointer;-webkit-user-select:none;user-select:none}
.calHead:active{filter:brightness(.97)}
.calAll{display:inline-flex;align-items:center;min-height:28px}

/* Launch splash */
.splash{position:fixed;inset:0;z-index:100;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:40px;
  background:radial-gradient(120% 80% at 50% 35%,#2A8A5C 0%,#1E6B47 55%,#14492F 100%);color:#fff;transition:opacity .4s ease,transform .4s ease}
.splash.out{opacity:0;transform:scale(1.04);pointer-events:none}
.splashMark{display:flex;flex-direction:column;align-items:center;gap:10px}
.splashMark img{width:104px;height:104px;border-radius:26px;box-shadow:0 12px 40px rgba(0,0,0,.35),0 0 0 1px rgba(255,255,255,.12);margin-bottom:8px}
.splashName{font-family:var(--display);font-weight:800;font-size:2.1rem;letter-spacing:-.02em;line-height:1}
.splashTag{font-size:.95rem;opacity:.75}
.splashBar{width:120px;height:4px;border-radius:2px;background:rgba(255,255,255,.18);overflow:hidden}
.splashBar i{display:block;height:100%;width:40%;border-radius:2px;background:#6EE7A8}
@media (prefers-reduced-motion:no-preference){
  .splashMark{animation:splashIn .6s cubic-bezier(.2,.8,.2,1) both}
  .splashBar i{animation:splashLoad 1.1s ease-in-out infinite}
}
@keyframes splashIn{from{opacity:0;transform:translateY(12px) scale(.94)}to{opacity:1;transform:none}}
@keyframes splashLoad{0%{transform:translateX(-100%)}100%{transform:translateX(260%)}}
/* Splash loading bar: one sweep left to right, then stays full */
.splashBar i{width:100%;transform:translateX(-100%)}
@media (prefers-reduced-motion:no-preference){.splashBar i{animation:splashOnce 1s cubic-bezier(.4,0,.2,1) .1s forwards}}
@media (prefers-reduced-motion:reduce){.splashBar i{transform:none}}
@keyframes splashOnce{to{transform:translateX(0)}}
/* Splash: darker background, logo and text unchanged */
.splash{background:radial-gradient(120% 80% at 50% 35%,#16482F 0%,#0E2F1F 55%,#071A11 100%)}

/* Guest preview */
.guestCta{display:flex;flex-direction:column;gap:8px;text-align:center}
.orLine{display:flex;align-items:center;gap:10px;color:var(--muted);font-size:.8rem;margin:4px 0}
.orLine::before,.orLine::after{content:"";flex:1;border-top:1px solid var(--line)}
.guestBtn{min-height:50px;border-radius:14px;font-weight:600;color:var(--accent);border-color:color-mix(in srgb,var(--accent) 35%,var(--line));background:var(--surface)}
.guestBar{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:8px 8px 8px 14px;border-radius:14px;
  background:color-mix(in srgb,var(--warn) 16%,var(--surface));border:1px solid color-mix(in srgb,var(--warn) 35%,var(--line));font-size:.85rem}
.guestBar b{color:var(--warn)}

/* Goal rows v2: one slim balance field, small Edit link */
.gmeta{display:flex;justify-content:space-between;align-items:center;margin-top:-4px}
.gmeta .gpct{margin:0}
.goal .gmeta .editGoal{display:inline-flex;align-items:center;gap:5px;min-height:30px;width:auto;padding:0 4px;border:0;background:none;color:var(--muted);font-size:.8rem;font-weight:500}
.goal .gmeta .editGoal .ic{width:14px;height:14px}
.goal .edit{display:flex;align-items:center;gap:6px;height:46px;padding:0 4px 0 14px;border-radius:14px;background:var(--bg);border:1px solid var(--line);transition:border-color .15s ease}
.goal .edit:focus-within{border-color:var(--accent)}
.goal .edit .balLbl{font-size:.72rem;text-transform:uppercase;letter-spacing:.08em;color:var(--muted);flex:0 0 auto;margin-right:4px}
.goal .edit .cur{color:var(--muted);font-family:var(--mono)}
.goal .edit input{flex:1 1 auto;min-width:0;height:100%;border:0!important;background:none!important;padding:0;border-radius:0;font-family:var(--mono);font-size:1rem;outline:none!important;box-shadow:none}
.goal .edit input:focus-visible{outline:none}
.goal .edit .saveBal{flex:0 0 auto;min-height:36px;height:36px;min-width:0;padding:0 14px;border-radius:10px;font-size:.88rem}
html.hideNums .goal .edit input{-webkit-text-security:disc}
/* Splash: near-black with a subtle green tint */
.splash{background:radial-gradient(110% 70% at 50% 38%,#0F2419 0%,#08130D 55%,#030705 100%)}
/* Splash: flat black-green, no glow */
.splash{background:#07110C}

/* Colour themes (default green has no data-accent) */
:root[data-accent="blue"]{--accent:#1D5FBF; --accent-soft:#DCE7F8; --bg:#EEF1F6; --line:#D4DCE8; --on-accent:#FFFFFF}
@media (prefers-color-scheme:dark){:root[data-accent="blue"]:not([data-theme="light"]){--accent:#7AA9F2; --accent-soft:#1B2A40; --bg:#0E131B; --surface:#161D28; --line:#28344A; --muted:#94A2B8; --on-accent:#0E131B}}
:root[data-accent="blue"][data-theme="dark"]{--accent:#7AA9F2; --accent-soft:#1B2A40; --bg:#0E131B; --surface:#161D28; --line:#28344A; --muted:#94A2B8; --on-accent:#0E131B}
:root[data-accent="purple"]{--accent:#6B3FC4; --accent-soft:#E8DFF8; --bg:#F1EEF7; --line:#DDD5EA; --on-accent:#FFFFFF}
@media (prefers-color-scheme:dark){:root[data-accent="purple"]:not([data-theme="light"]){--accent:#AE92F0; --accent-soft:#2A2140; --bg:#110F18; --surface:#1A1724; --line:#2F2942; --muted:#A39CB8; --on-accent:#110F18}}
:root[data-accent="purple"][data-theme="dark"]{--accent:#AE92F0; --accent-soft:#2A2140; --bg:#110F18; --surface:#1A1724; --line:#2F2942; --muted:#A39CB8; --on-accent:#110F18}
:root[data-accent="pink"]{--accent:#C2386F; --accent-soft:#F9DDE8; --bg:#F7EEF1; --line:#EAD4DC; --on-accent:#FFFFFF}
@media (prefers-color-scheme:dark){:root[data-accent="pink"]:not([data-theme="light"]){--accent:#F08AB3; --accent-soft:#3A1E2B; --bg:#170F13; --surface:#22161C; --line:#3B2830; --muted:#B89CA8; --on-accent:#170F13}}
:root[data-accent="pink"][data-theme="dark"]{--accent:#F08AB3; --accent-soft:#3A1E2B; --bg:#170F13; --surface:#22161C; --line:#3B2830; --muted:#B89CA8; --on-accent:#170F13}
:root[data-accent="orange"]{--accent:#C2561A; --accent-soft:#FBE5D6; --bg:#F7F1EC; --line:#EADBD0; --on-accent:#FFFFFF}
@media (prefers-color-scheme:dark){:root[data-accent="orange"]:not([data-theme="light"]){--accent:#F29D62; --accent-soft:#3A2416; --bg:#16110D; --surface:#211913; --line:#3A2C22; --muted:#B8A595; --on-accent:#16110D}}
:root[data-accent="orange"][data-theme="dark"]{--accent:#F29D62; --accent-soft:#3A2416; --bg:#16110D; --surface:#211913; --line:#3A2C22; --muted:#B8A595; --on-accent:#16110D}
:root[data-accent="teal"]{--accent:#0F7C80; --accent-soft:#D6EEEE; --bg:#EDF3F3; --line:#D2E0E0; --on-accent:#FFFFFF}
@media (prefers-color-scheme:dark){:root[data-accent="teal"]:not([data-theme="light"]){--accent:#55C9CB; --accent-soft:#15302F; --bg:#0D1515; --surface:#141F1F; --line:#263838; --muted:#93AAAA; --on-accent:#0D1515}}
:root[data-accent="teal"][data-theme="dark"]{--accent:#55C9CB; --accent-soft:#15302F; --bg:#0D1515; --surface:#141F1F; --line:#263838; --muted:#93AAAA; --on-accent:#0D1515}
:root[data-accent="graphite"]{--accent:#3A4450; --accent-soft:#E3E7EB; --bg:#F0F1F3; --line:#D9DDE2; --on-accent:#FFFFFF}
@media (prefers-color-scheme:dark){:root[data-accent="graphite"]:not([data-theme="light"]){--accent:#B9C4D0; --accent-soft:#252B32; --bg:#0F1114; --surface:#181B1F; --line:#2C3239; --muted:#9AA3AD; --on-accent:#0F1114}}
:root[data-accent="graphite"][data-theme="dark"]{--accent:#B9C4D0; --accent-soft:#252B32; --bg:#0F1114; --surface:#181B1F; --line:#2C3239; --muted:#9AA3AD; --on-accent:#0F1114}

/* Appearance picker */
.swatches{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:8px}
.swatch{display:flex;flex-direction:column;align-items:center;gap:5px;border:0;background:none;padding:4px 0;min-height:0;font-size:.68rem;color:var(--muted)}
.swatch i{display:grid;place-items:center;width:36px;height:36px;border-radius:50%;box-shadow:inset 0 0 0 1px rgba(0,0,0,.08);color:#fff}
.swatch i .ic{width:16px;height:16px;stroke-width:3;opacity:0}
.swatch[aria-checked="true"]{color:var(--ink);font-weight:600}
.swatch[aria-checked="true"] i{box-shadow:0 0 0 2px var(--surface),0 0 0 4px var(--ink)}
.swatch[aria-checked="true"] i .ic{opacity:1}

/* Feedback */
#fbText{width:100%;font:inherit;color:var(--ink);background:var(--bg);border:1px solid var(--line);border-radius:12px;padding:10px 12px;resize:vertical;min-height:96px;font-size:16px}
#fbText:focus{outline:none;border-color:var(--accent)}
.fbList{display:flex;flex-direction:column}
.fbItem{padding:12px 16px;display:flex;flex-direction:column;gap:6px;align-items:flex-start}
.fbItem+.fbItem{border-top:1px solid var(--line)}
.fbItem.done{opacity:.55}
.fbTop{display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.fbTag{font-size:.7rem;font-weight:700;text-transform:uppercase;letter-spacing:.06em;padding:2px 8px;border-radius:999px;background:var(--accent-soft);color:var(--accent)}
.fbTag.change{background:color-mix(in srgb,var(--warn) 16%,var(--surface));color:var(--warn)}
.fbTag.problem{background:var(--bad-soft);color:var(--bad)}
.fbMsg{white-space:pre-wrap;overflow-wrap:anywhere}

/* Settings menu (iOS-style list) */
.sMenu{display:flex;flex-direction:column;gap:18px}
.sMenuGroup{background:var(--surface);border:1px solid var(--line);border-radius:18px;overflow:hidden}
.sMenuGroup button{display:flex;align-items:center;gap:12px;width:100%;border:0;border-radius:0;background:none;padding:12px 14px;min-height:62px;text-align:left}
.sMenuGroup button+button{border-top:1px solid var(--line)}
.sMenuGroup button:active{background:var(--bg)}
.mIc{display:grid;place-items:center;width:34px;height:34px;border-radius:10px;background:var(--accent-soft);color:var(--accent);flex:0 0 auto}
.mIc .ic{width:18px;height:18px}
.mTx{flex:1;min-width:0;display:flex;flex-direction:column}
.mTx b{font-weight:600}
.mTx small{font-size:.8rem;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.mChev{color:var(--muted)} .mChev .ic{transform:rotate(-90deg);width:18px;height:18px}
.sheetHead .backBtn{display:inline-flex;align-items:center;gap:2px;padding-left:0}
.sheetHead .backBtn .ic{transform:rotate(90deg);width:20px;height:20px}
.sSaved{text-align:center;color:var(--accent);font-weight:600;margin:0}
html.hideNums .mTx small{visibility:hidden}

/* Legal links */
.linkList{display:flex;flex-direction:column}
.linkList a{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:12px 16px;color:var(--ink);text-decoration:none}
.linkList a+a{border-top:1px solid var(--line)}
.linkList a span{display:flex;flex-direction:column}
.linkList a b{font-weight:600}
.linkList a small{font-size:.8rem;color:var(--muted)}
.linkList a:active{background:var(--bg)}
.legalLine{text-align:center;font-size:.78rem}
.legalLine a{color:var(--accent)}

/* Compact calendar */
.cal{gap:3px 2px;padding:10px 8px 10px}
.calWd{font-size:.6rem;padding-bottom:2px}
.calDay{min-height:44px;gap:2px;padding:3px 0 2px;border-radius:12px}
.calN{width:24px;height:24px;font-size:.76rem}
.calAmt{min-height:15px;line-height:15px;padding:0 5px;font-size:.58rem}
.calAmt:empty{min-height:0;height:0}
.calBill{min-height:12px;line-height:12px;padding:0 4px;font-size:.5rem}
.calDay.today .calN{box-shadow:0 0 0 2px var(--accent-soft)}
.calKey{gap:6px;padding-top:8px;margin-top:2px}
.calKey span{font-size:.64rem;padding:2px 8px 2px 3px;gap:4px}
.calKey .ic{width:10px;height:10px;padding:2px}
.calHint{font-size:.66rem;margin-top:-2px}

/* "+" chip to add a category */
.chips .addChip{display:inline-grid;place-items:center;width:36px;min-width:36px;padding:0;border-style:dashed;color:var(--accent);border-color:color-mix(in srgb,var(--accent) 45%,var(--line));background:transparent}
.chips .addChip .ic{width:16px;height:16px;stroke-width:2.6}

/* Drag to reorder goals */
.goal .head{gap:8px}
.dragHandle{flex:0 0 auto;display:grid;place-items:center;width:30px;height:30px;min-height:30px;padding:0;margin:-4px 0 -4px -6px;border:0;background:none;
  color:var(--muted);cursor:grab;touch-action:none;-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.dragHandle .ic{width:18px;height:18px}
.goal.dragging{position:relative;z-index:3;background:var(--surface);box-shadow:0 10px 28px rgba(0,0,0,.18);border-radius:14px;transition:none}
.goal.dragging .dragHandle{color:var(--accent);cursor:grabbing}
.goalgroup>.goal{transition:transform .12s ease}

/* Goal rows v3: clean, left-aligned layout */
.goalgroup>.goal{display:flex;flex-direction:column;gap:10px;padding:14px 16px}
.gTop{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:8px}
.gTop .dragHandle{margin:0 0 0 -8px;width:32px;height:32px}
.gName{display:flex;flex-direction:column;min-width:0}
.gName strong{font-weight:600;font-size:1rem;line-height:1.25;overflow-wrap:anywhere}
.gName small{font-size:.78rem;color:var(--muted);line-height:1.3;margin-top:1px}
.gTop .editGoal{display:grid;place-items:center;width:32px;height:32px;min-height:32px;padding:0;border:0;border-radius:50%;background:none;color:var(--muted)}
.gTop .editGoal:active{background:var(--bg)}
.gTop .editGoal .ic{width:16px;height:16px}
.gNums{display:flex;align-items:baseline;gap:6px;padding-left:32px}
.gCur{font-size:1.15rem;font-weight:600}
.gTgt{font-size:.85rem;color:var(--muted)}
.gPct{margin-left:auto;font-size:.8rem;color:var(--muted)}
.goal.done .gPct{color:var(--accent);font-weight:600}
.goalgroup>.goal>.bar{margin-left:32px;height:8px;border-radius:4px}
.goalgroup>.goal>.edit{margin-left:32px}
.goal .gmeta,.goal>.head,.goal>.note,.goal>.gpct{display:none}
@media (max-width:360px){.gNums,.goalgroup>.goal>.bar,.goalgroup>.goal>.edit{padding-left:0;margin-left:0}}
html.hideNums .gPct:empty::after{content:none}
.gNums>span{white-space:nowrap}
.gNums{flex-wrap:wrap;row-gap:2px}

/* Goal cards v4: compact rows, tap to update */
.goalgroup>.goal{gap:8px;padding:12px 14px}
.gRow{display:grid;grid-template-columns:auto minmax(0,1fr) auto auto;align-items:center;gap:10px;cursor:pointer;-webkit-tap-highlight-color:transparent}
.gIc{display:grid;place-items:center;width:38px;height:38px;border-radius:12px;background:var(--accent-soft);color:var(--accent)}
.gIc .ic{width:19px;height:19px}
.goal.isDebt .gIc{background:var(--bad-soft);color:var(--bad)}
.goal.done .gIc{background:var(--accent);color:var(--on-accent)}
.gName small{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.gAmt{display:flex;flex-direction:column;align-items:flex-end;line-height:1.15}
.gAmt .gCur{font-size:1.05rem;font-weight:600}
.gAmt .gTgt{font-size:.74rem;color:var(--muted)}
.goal.isDebt .gAmt .gCur{color:var(--bad)}
.goal.isDebt.done .gAmt .gCur{color:var(--accent)}
.gRow .dragHandle{margin:0 -6px 0 -2px;width:28px;height:32px}
.gBarRow{display:flex;align-items:center;gap:10px;padding-left:48px}
.gBarRow .bar{flex:1;height:6px;border-radius:3px;margin:0}
.gBarRow .gPct{font-size:.72rem;color:var(--muted);margin:0;min-width:2.8em;text-align:right}
.goal.done .gBarRow .gPct{color:var(--accent);font-weight:600}
.gMore{display:none;flex-direction:column;gap:8px;padding-left:48px}
.goal.open .gMore{display:flex;animation:gOpen .18s ease-out}
@keyframes gOpen{from{opacity:0;transform:translateY(-4px)}to{opacity:1;transform:none}}
.gMore .edit{margin:0!important}
.gMore .editGoal{align-self:flex-start;display:inline-flex;align-items:center;gap:6px;border:0;background:none;color:var(--accent);font-weight:600;font-size:.85rem;padding:2px 0;min-height:30px}
.gMore .editGoal .ic{width:15px;height:15px}
.goal.open{background:color-mix(in srgb,var(--accent-soft) 35%,var(--surface))}
.goal .gTop,.goal>.gNums,.goal>.bar,.goal>.edit{display:none}
@media (max-width:360px){.gBarRow,.gMore{padding-left:0}}
html.hideNums .gBarRow .gPct:empty::after{content:none}

/* Plan builder */
#planForm{display:flex;flex-direction:column;height:100%;min-height:0}
.planCta{display:flex;align-items:center;gap:12px;width:100%;padding:14px;border-radius:18px;text-align:left;min-height:68px;
  background:linear-gradient(135deg,var(--accent-soft),var(--surface));border:1px solid color-mix(in srgb,var(--accent) 35%,var(--line))}
.planCta .mIc{background:var(--accent);color:var(--on-accent)}
.bigMoney{display:flex;align-items:center;gap:6px;background:var(--bg);border:1px solid var(--line);border-radius:14px;padding:0 14px}
.bigMoney span{font:500 1.4rem var(--mono);color:var(--accent)}
.bigMoney input{border:0!important;background:none!important;font:600 1.6rem var(--mono);padding:10px 0;outline:none}
.bigMoney:focus-within{border-color:var(--accent)}
.planPick{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.planPick button{display:flex;flex-direction:column;align-items:flex-start;gap:2px;text-align:left;padding:10px 12px;border-radius:14px;min-height:92px}
.planPick b{font-weight:700}
.planPick .tag{font:600 .78rem var(--mono);color:var(--accent)}
.planPick small{font-size:.74rem;color:var(--muted);line-height:1.3}
.planPick button[aria-checked="true"]{background:var(--accent-soft);border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}
.pctEdit{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px}
.pctEdit input{text-align:center;font-family:var(--mono)}
.pctBar{display:flex;height:30px;border-radius:10px;overflow:hidden;gap:2px}
.pctBar i{display:grid;place-items:center;font-style:normal;font-size:.68rem;font-weight:700;color:#fff;min-width:0;white-space:nowrap;overflow:hidden}
.pctBar .n{background:var(--accent)} .pctBar .w{background:var(--warn)} .pctBar .s{background:color-mix(in srgb,var(--accent) 55%,#1E4FA8)}
.hint.bad{color:var(--bad);font-weight:600}
.checks{display:flex;flex-direction:column}
.checks label{flex-direction:row;align-items:center;gap:12px;padding:10px 0;cursor:pointer}
.checks label+label{border-top:1px solid var(--line)}
.checks input{width:22px!important;height:22px;flex:0 0 auto;accent-color:var(--accent);margin:0}
.checks span{display:flex;flex-direction:column;font-weight:500}
.checks small{font-size:.76rem;color:var(--muted);font-weight:400}
.planPreview{padding:6px 16px 12px}
.ppSec+.ppSec{border-top:1px solid var(--line);margin-top:6px;padding-top:6px}
.ppHead{display:flex;justify-content:space-between;padding:6px 0 2px}
.ppHead b{font-family:var(--display)}
.ppRow{display:flex;justify-content:space-between;font-size:.9rem;color:var(--muted);padding:2px 0}
#pWarn{text-align:center}

/* Plan builder: needs as tappable chips */
.needChips{display:flex;flex-wrap:wrap;gap:8px}
.needChips label{position:relative;display:inline-flex;flex-direction:row;cursor:pointer}
.needChips input{position:absolute;opacity:0;width:1px!important;height:1px;pointer-events:none}
.needChips span{display:inline-flex;align-items:center;gap:6px;min-height:38px;padding:6px 14px;border-radius:999px;border:1px solid var(--line);background:var(--surface);font-size:.9rem;font-weight:500;color:var(--muted);transition:background .12s,border-color .12s,color .12s}
.needChips input:checked+span{background:var(--accent-soft);border-color:var(--accent);color:var(--ink);font-weight:600}
.needChips input:checked+span::before{content:"✓";color:var(--accent);font-weight:800}
.needChips input:focus-visible+span{outline:2px solid var(--accent);outline-offset:2px}

/* Install guide */
.installCta{display:flex;align-items:center;gap:14px;width:100%;padding:12px 14px;border-radius:18px;text-align:left;min-height:68px;
  background:var(--surface);border:1px solid color-mix(in srgb,var(--accent) 35%,var(--line))}
.installCta img{width:44px;height:44px;border-radius:11px;flex:0 0 auto}
.installCta span{flex:1;display:flex;flex-direction:column;min-width:0}
.installCta b{font-weight:600}
.installCta small{font-size:.8rem;color:var(--muted)}
.installCta>.ic{transform:rotate(-90deg);color:var(--muted);width:18px;height:18px}
.guideForm{display:flex;flex-direction:column;height:100%;min-height:0}
.guideBody{display:flex;flex-direction:column;gap:14px}
.gCarousel{display:flex;overflow-x:auto;scroll-snap-type:x mandatory;-webkit-overflow-scrolling:touch;scrollbar-width:none;
  border-radius:22px;background:#07110C;aspect-ratio:9/16;max-height:calc(100dvh - 300px);margin:0 auto;width:100%;touch-action:pan-x pan-y;overscroll-behavior-x:contain}
.gCarousel::-webkit-scrollbar{display:none}
.gCarousel img{flex:0 0 100%;width:100%;height:100%;object-fit:contain;scroll-snap-align:center;scroll-snap-stop:always;user-select:none;-webkit-user-drag:none}
@supports (aspect-ratio:9/16){.gCarousel{width:min(100%, calc((100dvh - 300px) * 9 / 16))}}
.gDots{display:flex;justify-content:center;gap:6px}
.gDots i{width:7px;height:7px;border-radius:4px;background:var(--line);transition:width .2s ease,background .2s ease}
.gDots i.on{width:22px;background:var(--accent)}
.gNav{display:grid;grid-template-columns:1fr 2fr;gap:10px}
.gNav button{min-height:50px;border-radius:14px;font-weight:600}
#gVideo{display:block;width:100%;max-height:calc(100dvh - 260px);aspect-ratio:9/16;object-fit:contain;border-radius:22px;background:#07110C}
.guideFoot{text-align:center}
/* Install guide spacing */
#guideSteps{display:flex;flex-direction:column;gap:18px}
#guideSteps[hidden]{display:none}
.guideBody{gap:18px;padding-top:20px}
.gCarousel{flex:0 0 auto;max-height:calc(100dvh - 340px)}
@supports (aspect-ratio:9/16){.gCarousel{width:min(100%, calc((100dvh - 340px) * 9 / 16))}}
.gDots{margin:2px 0}
.gNav{margin-top:2px}
.guideFoot{margin-top:4px;font-size:.82rem}
#closeGuideBtn:focus-visible{outline:none}

/* Sign-in screen layout */
#authView{gap:16px;padding-top:4vh}
.authBrand{display:flex;align-items:center;gap:14px;padding:0 2px 6px}
.authBrand img{width:56px;height:56px;border-radius:14px;flex:0 0 auto;box-shadow:0 6px 18px rgba(0,0,0,.25)}
.authBrand h1{font-size:2rem;line-height:1.05}
.authBrand .hint{margin-top:2px}
#authForm{padding:18px;gap:14px;border-radius:22px}
.authBtns{display:flex;flex-direction:column;gap:10px;margin-top:4px}
.authBtns button{width:100%;min-height:50px;border-radius:14px}
#authStatus:empty{display:none}
#authForm .legalLine{margin:0;font-size:.76rem;line-height:1.45}
.guestCta{gap:10px}
.orLine{margin:0}
.guestBtn{min-height:50px}
.guestCta .hint{margin:0}
.installCta{margin-top:4px}

/* Swipe hint */
.gCarousel{touch-action:pan-x;cursor:grab}
.gSwipe{display:flex;align-items:center;justify-content:center;gap:8px;margin:-6px 0 0;font-size:.82rem;color:var(--muted)}
.gSwipe .ic{width:18px;height:18px;color:var(--accent)}
@media (prefers-reduced-motion:no-preference){.gSwipe .ic{animation:swipeHint 1.6s ease-in-out infinite}}
@keyframes swipeHint{0%,100%{transform:translateX(6px)}50%{transform:translateX(-6px)}}

/* Setspace credit at the bottom of the sign-in screen (logo tinted by theme via mask) */
.madeBy{display:flex;flex-direction:column;align-items:center;gap:8px;margin-top:auto;padding:28px 0 8px;color:var(--muted)}
.madeBy span{font-size:.66rem;text-transform:uppercase;letter-spacing:.18em}
.ssLogo{display:block;width:120px;height:auto;opacity:.85}
@media (prefers-color-scheme:light){:root:not([data-theme="dark"]) .ssLogo{filter:invert(1);opacity:.7}}
:root[data-theme="light"] .ssLogo{filter:invert(1);opacity:.7}
#authView{min-height:calc(100dvh - env(safe-area-inset-top) - 32px)}

/* Delete-account exit survey */
.delSurvey{display:flex;flex-direction:column;gap:12px;padding:14px;border-radius:16px;background:var(--bg);border:1px solid color-mix(in srgb,var(--bad) 30%,var(--line))}
.delQ{margin:0;display:flex;flex-direction:column;gap:2px}
.delQ small{color:var(--muted);font-size:.8rem}
.delReasons{display:flex;flex-direction:column}
.delReasons label{flex-direction:row;align-items:center;gap:12px;padding:10px 2px;cursor:pointer}
.delReasons label+label{border-top:1px solid var(--line)}
.delReasons input{width:20px!important;height:20px;flex:0 0 auto;accent-color:var(--bad);margin:0}
#delDetails{width:100%;font:inherit;font-size:16px;color:var(--ink);background:var(--surface);border:1px solid var(--line);border-radius:12px;padding:10px 12px;resize:vertical}
.delBtns{display:grid;grid-template-columns:1fr 1fr;gap:8px}
.delBtns button{min-height:46px;border-radius:12px;font-weight:600}
.fbTag.deletion{background:var(--bad-soft);color:var(--bad)}

/* Reset / delete list */
.dangerList{padding:0}
.dangerList .panelHead{background:var(--bad-soft)} .dangerList .panelDot{background:var(--bad)}
.dRow{display:flex;align-items:center;gap:12px;width:100%;border:0;border-radius:0;background:none;padding:12px 16px;min-height:64px;text-align:left}
.dRow+.dRow{border-top:1px solid var(--line)}
.dRow:active{background:var(--bg)}
.dIc{display:grid;place-items:center;width:36px;height:36px;border-radius:10px;background:var(--bg);color:var(--muted);flex:0 0 auto}
.dIc .ic{width:18px;height:18px}
.dTx{flex:1;display:flex;flex-direction:column;min-width:0}
.dTx b{font-weight:600}
.dTx small{font-size:.8rem;color:var(--muted)}
.dChev{color:var(--muted)} .dChev .ic{transform:rotate(-90deg);width:18px;height:18px}
.dRow.bad b{color:var(--bad)} .dRow.bad .dIc{background:var(--bad-soft);color:var(--bad)}
#resetStatus:empty{display:none}
#resetStatus{padding:0 16px 12px}
/* Delete account sheet */
.delForm{display:flex;flex-direction:column;height:100%;min-height:0}
.delHero{display:flex;flex-direction:column;align-items:center;text-align:center;gap:8px;padding:8px 4px 4px}
.delBadge{display:grid;place-items:center;width:72px;height:72px;border-radius:50%;background:var(--bad-soft);color:var(--bad);margin-bottom:4px}
.delBadge .ic{width:34px;height:34px}
.delHero h3{margin:0;font-family:var(--display);font-size:1.5rem}
.delHero p{margin:0;color:var(--muted);font-size:.92rem}
.delList{list-style:none;margin:8px 0 4px;padding:6px 14px;width:100%;text-align:left;background:var(--surface);border:1px solid var(--line);border-radius:16px}
.delList li{display:flex;align-items:center;gap:12px;padding:9px 0;font-weight:500}
.delList li+li{border-top:1px solid var(--line)}
.delList .ic{width:18px;height:18px;color:var(--bad);flex:0 0 auto}
.delCopy{display:inline-flex;align-items:center;justify-content:center;gap:8px;width:100%;min-height:48px;border-radius:14px;font-weight:600;color:var(--accent);border-color:color-mix(in srgb,var(--accent) 35%,var(--line))}
.delCopy .ic{width:18px;height:18px}
.delChips span{font-size:.86rem}
.delChips input:checked+span{background:var(--bad-soft);border-color:var(--bad);color:var(--ink)}
.delChips input:checked+span::before{color:var(--bad)}
#delDetails{width:100%;font:inherit;font-size:16px;color:var(--ink);background:var(--bg);border:1px solid var(--line);border-radius:12px;padding:10px 12px;resize:vertical}
#delType{font-family:var(--mono);letter-spacing:.12em;text-transform:uppercase}
.dangerDot{background:var(--bad)!important}
.delGo{width:100%;min-height:52px;border-radius:14px;font-weight:700;background:var(--bad);border-color:var(--bad);color:#fff}
.delGo:disabled{background:var(--bad-soft);border-color:var(--bad-soft);color:color-mix(in srgb,var(--bad) 60%,var(--muted));opacity:1}
.delKeep{width:100%;min-height:48px;border-radius:14px;font-weight:600}
