* {box-sizing:border-box}
html,body {margin:0;height:100%;background:var(--canvas);color:var(--ink);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",system-ui,sans-serif;font-variant-numeric:tabular-nums}
body {display:grid;place-items:center}
button,input,select {font:inherit;color:inherit;font-variant-numeric:tabular-nums}
button {border:0;background:transparent;padding:0;min-height:44px;min-width:44px;cursor:pointer;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
button:active {opacity:.78}button:focus-visible,input:focus-visible,select:focus-visible {outline:2px solid var(--brand);outline-offset:1px}
#app {width:min(100%,480px);height:100vh;height:100dvh;display:flex;flex-direction:column;background:var(--surface);padding-top:env(safe-area-inset-top)}
#screen {overflow-y:auto;flex:1;min-height:0;overscroll-behavior:contain;scrollbar-width:thin;padding-bottom:12px}
@media(min-width:600px){#app{border-inline:1px solid var(--rule)}}
header,.part {padding:0 16px}.part+.part{margin-top:16px}
header {padding-top:8px}h1,h2,h3,p {margin:0}h1 {font-size:30px;line-height:1.2;letter-spacing:-1px;margin:8px 0 14px}h2{font-size:20px;letter-spacing:-.55px;line-height:1.3;margin:16px 0 8px}h3{font-size:16px;margin:16px 0 6px}
p,small,.field {color:var(--secondary)}p,small{font-size:14px;line-height:1.45}small{display:block}header p{margin:-6px 0 16px}
.brandline,.brand,.between,.actions,.amounts,.cellnav,.barlabel {display:flex;align-items:center;gap:8px}
.brandline,.between,.cellnav,.barlabel {justify-content:space-between}.brandline {min-height:52px}.brand{font-size:19px;font-weight:700;letter-spacing:-.65px}.brand img{width:32px;height:32px}
.text,.hit {color:var(--brand);font-weight:600;display:inline-flex;align-items:center;justify-content:center;gap:4px}.hit{width:44px}.ico{width:21px;height:21px;flex:none}.actions {gap:2px}.cellnav h1{font-size:26px;margin:4px 0;letter-spacing:-1px}
.calendar {padding:0 12px 12px}.week,.grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}.week{color:var(--secondary);font-weight:600;font-size:12px;text-align:center;padding:5px 0}
.day,.blank {height:51px;border-top:1px solid var(--rule)}
.day{display:flex;flex-direction:column;align-items:center;min-width:0;padding:3px 0 1px;font-size:14px;font-weight:600;line-height:17px}
.day strong{font-size:12px;line-height:14px;font-weight:650;letter-spacing:-.4px}.day.active{background:var(--selected);border-radius:8px;box-shadow:inset 0 0 0 2px var(--brand);color:var(--brand)}
@media(max-width:340px){.calendar{padding-inline:5px}.day,.blank{height:48px}.day strong{font-size:11px;line-height:13px}}
@media(min-width:420px){.calendar{padding-inline:16px}.day,.blank{height:55px}}
.divider{height:8px;background:var(--canvas)}.between h2{margin:0}.between{min-height:48px}.amounts{flex-wrap:wrap;font-size:14px;font-weight:650;margin-bottom:4px;gap:4px 12px}.inc{color:var(--income)}.exp{color:var(--expense)}.accent{color:var(--accent)}.danger,.error{color:var(--danger)}
.tx,.linkrow,.kv {width:100%;text-align:left;border-bottom:1px solid var(--rule);display:flex;align-items:center;gap:8px;min-height:51px;padding:7px 0;font-size:16px}
.tx{min-height:56px;flex-wrap:wrap}.tx .detail{flex:1;min-width:min(94px,45%)}.detail b,.linkrow span,.kv span{overflow-wrap:anywhere}.tx small{font-size:13px;margin-top:2px}.tx strong,.kv strong{margin-left:auto;font-size:16px;max-width:100%;overflow-wrap:anywhere}.tx strong{letter-spacing:-.35px}.linkrow{font-weight:550}.linkrow>.ico:last-child{margin-left:auto;color:var(--brand);width:17px}.kv{justify-content:space-between;flex-wrap:wrap}
.tile{width:32px;height:32px;border-radius:10px;display:inline-grid;place-items:center;flex:none}.k0{color:var(--c0);background:var(--b0)}.k1{color:var(--c1);background:var(--b1)}.k2{color:var(--c2);background:var(--b2)}.k3{color:var(--c3);background:var(--b3)}.k4{color:var(--c4);background:var(--b4)}
footer{padding:6px 16px max(6px,env(safe-area-inset-bottom));border-top:1px solid var(--rule);background:var(--surface)}
.tabs{display:flex;justify-content:space-around}.tab{display:grid;place-content:center;justify-items:center;font-size:11px;gap:2px;color:var(--secondary);min-width:75px}.tab.current{font-weight:700;color:var(--brand)}
.primary,.secondary{width:100%;min-height:48px;border-radius:12px;font-weight:650;display:flex;align-items:center;justify-content:center;gap:6px;font-size:17px}.primary{background:var(--brand);color:var(--onBrand)}.secondary{color:var(--brand);background:var(--selected)}.critical{background:var(--danger);color:var(--surface)}footer .primary{margin-bottom:4px}
.summary{padding:16px;background:var(--canvas);margin:6px 0 12px}.hero{font-size:30px;line-height:1.22;font-weight:680;letter-spacing:-1px;overflow-wrap:anywhere;margin-top:4px}.summary .kv:last-child{border:0}
.seg{display:flex;background:var(--canvas);padding:3px;border-radius:10px;margin:8px 0 14px}.seg button{flex:1;font-size:15px;font-weight:600;border-radius:8px;color:var(--secondary)}.seg .selected{background:var(--brand);color:var(--onBrand)}
.field{display:block;font-size:14px;font-weight:550;margin:10px 0}.field input,.field select{display:block;width:100%;max-width:100%;min-width:0;height:46px;border:1px solid var(--boundary);border-radius:10px;background:var(--surface);color:var(--ink);padding:6px 10px;font-size:17px;margin-top:4px}
.note,.empty,.error{padding:10px 0}.empty{padding:20px 0}.error{font-weight:550}.error:empty{display:none}
.barlabel{font-size:15px;margin:14px 0 6px;flex-wrap:wrap}.track{height:8px;border-radius:8px;background:var(--rule);overflow:hidden}.track i{display:block;height:100%;border-radius:inherit}
dialog{color:var(--ink);background:var(--surface);border:0;border-radius:20px 20px 0 0;width:min(100%,480px);max-width:100%;max-height:94vh;max-height:94dvh;margin:auto auto 0;padding:0;overflow:hidden}
dialog::backdrop{background:rgb(10 22 38 / 38%)}dialog[open]{display:flex;flex-direction:column;animation:rise .2s ease-out}
.sheethead,.sheetbody,.sheetfoot{padding:0 20px}.sheethead{display:flex;align-items:center;justify-content:space-between}.sheethead h2{font-size:24px;margin:12px 0}.sheetbody{overflow-y:auto;min-height:0}.sheetfoot{padding-block:10px max(12px,env(safe-area-inset-bottom));border-top:1px solid var(--rule)}
dialog[open]{margin-bottom:var(--keyboard,0px);max-height:calc(94dvh - var(--keyboard,0px))}
.blank{background:var(--canvas)}
.grip{height:4px;width:36px;background:var(--boundary);border-radius:4px;margin:8px auto 0;flex:none}
#notice{position:fixed;z-index:3;left:50%;transform:translateX(-50%);bottom:calc(112px + env(safe-area-inset-bottom));border-radius:10px;background:var(--ink);color:var(--surface);font-size:14px;padding:8px 16px;max-width:90%;pointer-events:none}#notice:empty{display:none}
@keyframes rise{from{transform:translateY(24px);opacity:.65}to{transform:none;opacity:1}}@media(prefers-reduced-motion:reduce){*,*::before,*::after{animation:none!important;transition:none!important;scroll-behavior:auto!important}}

