:root{--bg: #f4f5f7;--surface: #ffffff;--text: #191f28;--muted: #6b7684;--line: #e5e8eb;--primary: #e5323f;--primary-weak: #fdecee;--ok: #1f9d55;--danger: #e5484d;--warn: #f08c00;--warn-weak: #fff4e5;--radius: 14px;--tabbar-h: 60px;color-scheme:light;font-family:-apple-system,BlinkMacSystemFont,Apple SD Gothic Neo,Pretendard,Noto Sans KR,sans-serif;-webkit-text-size-adjust:100%}@media (prefers-color-scheme: dark){:root{--bg: #101113;--surface: #1c1d21;--text: #f2f4f6;--muted: #9aa1ab;--line: #2c2e33;--primary: #ff5c66;--primary-weak: #3a1a1e;--ok: #3cc47a;--warn-weak: #3a2a10;color-scheme:dark}}*{box-sizing:border-box}html,body{margin:0;background:var(--bg);color:var(--text)}body{font-size:16px;line-height:1.45;-webkit-tap-highlight-color:transparent}a{color:inherit;text-decoration:none}h1,h2{margin:0}.app{max-width:640px;margin:0 auto;padding-bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 24px)}.pad{padding:12px 16px}.stack{display:flex;flex-direction:column;gap:12px}.muted{color:var(--muted)}.small{font-size:13px}.error{color:var(--danger);margin:0}.splash{padding:40vh 0;text-align:center;color:var(--muted)}.page-header{position:sticky;top:0;z-index:10;display:grid;grid-template-columns:80px 1fr 80px;align-items:center;padding:calc(env(safe-area-inset-top) + 8px) 8px 8px;background:var(--bg)}.page-header h1{font-size:18px;text-align:center}.ph-side{display:flex;align-items:center;gap:4px}.ph-side.right{justify-content:flex-end}.icon-btn{background:none;border:0;font-size:24px;color:var(--text);padding:4px 10px;line-height:1;cursor:pointer}.tabbar{position:fixed;left:0;right:0;bottom:0;z-index:20;display:grid;grid-template-columns:repeat(4,1fr);height:calc(var(--tabbar-h) + env(safe-area-inset-bottom));padding-bottom:env(safe-area-inset-bottom);background:var(--surface);border-top:1px solid var(--line)}.tab{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:12px;color:var(--muted)}.tab.active{color:var(--primary);font-weight:600}.tab-icon{font-size:20px}input,select,textarea{width:100%;font:inherit;font-size:16px;color:var(--text);background:var(--surface);border:1px solid var(--line);border-radius:10px;padding:10px 12px;min-height:44px}input:focus,select:focus{outline:2px solid var(--primary);outline-offset:-1px}input.big{font-size:22px;font-weight:700;text-align:right}.field{display:flex;flex-direction:column;gap:4px;min-width:0}.field>span{font-size:13px;color:var(--muted)}.row2{display:grid;grid-template-columns:1fr 1fr;gap:8px}.inline{display:flex;gap:6px}.inline select{width:80px;flex:none}.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:44px;padding:0 16px;border-radius:10px;border:1px solid transparent;font:inherit;font-weight:600;cursor:pointer;background:var(--primary-weak);color:var(--primary);white-space:nowrap}.btn.primary{background:var(--primary);color:#fff}.btn.ghost{background:transparent;border-color:var(--line);color:var(--text)}.btn.danger-ghost{background:transparent;border-color:var(--line);color:var(--danger)}.btn.small{min-height:36px;padding:0 10px;font-size:14px}.btn.block{width:100%}.btn:disabled{opacity:.45;cursor:default}.segmented{display:grid;grid-template-columns:repeat(3,1fr);background:var(--bg);border-radius:10px;padding:3px}.segmented.two{grid-template-columns:repeat(2,1fr)}.segmented button{border:0;background:transparent;font:inherit;padding:9px 0;border-radius:8px;color:var(--muted);cursor:pointer}.segmented button.on{background:var(--surface);color:var(--text);font-weight:600;box-shadow:0 1px 3px #0000001a}.chips{display:flex;flex-wrap:wrap;gap:6px}.chips.scroll{flex-wrap:nowrap;overflow-x:auto;scrollbar-width:none}.chip{flex:none;border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:999px;padding:7px 12px;font:inherit;font-size:14px;cursor:pointer}.chip.on{background:var(--text);border-color:var(--text);color:var(--surface)}.card-box{background:var(--surface);border-radius:var(--radius);padding:14px}.inset{background:var(--bg);border-radius:10px;padding:12px}.section-title{display:flex;justify-content:space-between;align-items:center;gap:8px}.list{list-style:none;margin:0;padding:0}.list-row{display:flex;align-items:center;gap:8px;padding:12px 0;border-bottom:1px solid var(--line)}.list li:last-child .list-row,.list li.list-row:last-child{border-bottom:0}.lr-main{flex:1;min-width:0}.lr-title{font-weight:600;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.lr-sub{font-size:13px;color:var(--muted)}.lr-amount{font-weight:700;text-align:right;white-space:nowrap}.day-group{background:var(--surface);border-radius:var(--radius);padding:4px 14px}.day-head{display:flex;justify-content:space-between;font-size:13px;color:var(--muted);padding:10px 0 2px}.day-group .list-row{padding:10px 0}.search-row{display:flex;gap:8px}.summary-line{display:flex;justify-content:space-between;align-items:baseline;padding:0 4px}.empty{text-align:center;padding:48px 0;color:var(--muted)}.store{font-size:20px;margin-top:4px}.big-amount{font-size:28px;font-weight:800;margin:4px 0 12px}.kv{display:grid;grid-template-columns:88px 1fr;gap:6px 8px;margin:0;font-size:15px}.kv dt{color:var(--muted)}.kv dd{margin:0}.form{display:flex;flex-direction:column;gap:12px}.item-edit{display:flex;flex-direction:column;gap:6px;padding-bottom:12px;border-bottom:1px dashed var(--line)}.item-main{display:flex;gap:6px;align-items:center}.item-main .grow{flex:1;min-width:0}.item-main .amount{width:120px;flex:none;text-align:right}.item-detail{display:grid;grid-template-columns:1fr 1fr;gap:8px}.warn{display:flex;flex-wrap:wrap;align-items:center;gap:8px;background:var(--warn-weak);color:var(--warn);border-radius:10px;padding:10px 12px;font-size:14px;font-weight:600}.sticky-actions{position:sticky;bottom:calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 8px)}.add-btn{display:flex;flex-direction:column;align-items:center;gap:4px;padding:28px 16px;background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);font:inherit;font-size:18px;font-weight:700;color:var(--text);cursor:pointer}.add-btn:disabled{opacity:.5}.add-icon{font-size:34px}.login{max-width:380px;margin:0 auto;padding:calc(env(safe-area-inset-top) + 18vh) 24px 24px;display:flex;flex-direction:column;gap:20px}.login h1{font-size:28px}.month-nav{display:flex;align-items:center;justify-content:center;gap:12px;font-size:17px}.bar{height:10px;border-radius:999px;background:var(--bg);overflow:hidden}.card-box .bar{background:var(--line)}.bar-fill{height:100%;border-radius:999px;background:var(--primary);transition:width .3s}.bar-fill.ok{background:var(--ok)}.bar-fill.warn{background:var(--warn)}.bar-fill.over{background:var(--danger)}.bar-fill.neutral{background:var(--muted);opacity:.45}.lvl-ok{color:inherit}.lvl-warn{color:var(--warn)}.lvl-over{color:var(--danger)}.kv3{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.delta-line{display:flex;justify-content:space-between;align-items:baseline}.delta{font-weight:600;white-space:nowrap}.delta.small{font-size:13px;font-weight:500}.delta.up{color:var(--danger)}.delta.down{color:var(--ok)}.delta.same{color:var(--muted)}.cat-row{display:flex;flex-direction:column;gap:6px;padding:4px 0 8px}.cat-head,.cat-sub{display:flex;justify-content:space-between;gap:8px}.cat-sub{font-size:13px;color:var(--muted)}.budget-row{display:grid;grid-template-columns:1fr 150px;align-items:center;gap:8px}.budget-row input{text-align:right}.scope-box{box-shadow:0 4px 20px #00000026}.notice{background:var(--primary-weak);color:var(--primary);border-radius:10px;padding:10px 12px;font-size:14px;font-weight:600}.overlay{position:fixed;top:0;right:0;bottom:0;left:0;z-index:50;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;background:color-mix(in srgb,var(--bg) 88%,transparent);-webkit-backdrop-filter:blur(2px);backdrop-filter:blur(2px)}.overlay p{margin:0}.spinner{width:40px;height:40px;margin-bottom:12px;border:4px solid var(--line);border-top-color:var(--primary);border-radius:50%;animation:spin .9s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}.cal{display:grid;grid-template-columns:repeat(7,1fr);gap:4px;padding:10px}.cal-head{text-align:center;font-size:12px;color:var(--muted);padding-bottom:4px}.cal-head.sun,.cal-day.sun{color:var(--danger)}.cal-head.sat,.cal-day.sat{color:#3b6fd8}.cal-cell{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:2px;min-height:52px;padding:6px 0 4px;border:0;border-radius:10px;background:transparent;color:var(--text);font:inherit;cursor:pointer}.cal-cell.empty{cursor:default}.cal-day{font-size:14px;line-height:1}.cal-cell.today .cal-day{font-weight:800;text-decoration:underline;text-underline-offset:3px}.cal-amt{font-size:10.5px;font-weight:600;letter-spacing:-.3px;white-space:nowrap}.cal-cell.lv1{background:color-mix(in srgb,var(--primary) 8%,transparent)}.cal-cell.lv2{background:color-mix(in srgb,var(--primary) 18%,transparent)}.cal-cell.lv3{background:color-mix(in srgb,var(--primary) 30%,transparent)}.cal-cell.lv4{background:color-mix(in srgb,var(--primary) 45%,transparent)}.cal-cell.sel{outline:2px solid var(--text);outline-offset:-2px}.cal-none{padding:8px 0 14px;margin:0}:root{--series: #3b6fd8}@media (prefers-color-scheme: dark){:root{--series: #6c9cf0}}.product-list{padding:0 14px}.badge{display:inline-block;margin-left:6px;padding:1px 6px;border-radius:6px;background:var(--bg);color:var(--muted);font-size:11px;font-weight:600;vertical-align:2px}.segmented.mini button{padding:5px 10px;font-size:13px}.chart{display:flex;flex-direction:column;gap:6px}.chart-tip{display:flex;align-items:baseline;gap:8px;min-height:22px}.chart-svg{width:100%;height:auto;touch-action:pan-y;-webkit-user-select:none;user-select:none}.chart-grid{stroke:var(--line);stroke-width:1}.chart-axis{fill:var(--muted);font-size:11px}.chart-line{fill:none;stroke:var(--series);stroke-width:2;stroke-linejoin:round;stroke-linecap:round}.chart-dot{fill:var(--series);stroke:var(--surface);stroke-width:2}.chart-cross{stroke:var(--muted);stroke-width:1;stroke-dasharray:3 3}.sheet-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:40;display:flex;align-items:flex-end;background:#00000059}.sheet{width:100%;max-width:640px;max-height:80vh;margin:0 auto;display:flex;flex-direction:column;gap:10px;padding:16px 16px calc(16px + env(safe-area-inset-bottom));background:var(--surface);border-radius:18px 18px 0 0}.sheet-list{overflow-y:auto;flex:1}.check-row{cursor:pointer}.check-row input{width:20px;min-height:20px;height:20px;flex:none;accent-color:var(--primary)}
