:root{--bg: #1c2422;--surface: #252f2c;--surface-2: #2f3b38;--border: #3a4844;--text: #f1f4f2;--text-2: #a9b6b1;--accent: #f3d36b;--accent-text: #1c2422;--plus: #86d6ac;--minus: #f2a08f;--danger: #ef6b64;--radius: 16px;--font: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;--chalk: "Caveat", "Segoe Print", cursive;color-scheme:dark}*{box-sizing:border-box}html,body{margin:0;background:var(--bg);color:var(--text);font-family:var(--font);-webkit-tap-highlight-color:transparent;overscroll-behavior:none}button,input{font:inherit;color:inherit}button{cursor:pointer;touch-action:manipulation}.sr-only{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0)}.app{max-width:520px;margin:0 auto;min-height:100dvh;display:flex;flex-direction:column;padding:env(safe-area-inset-top) 0 0}.top{position:relative;display:flex;align-items:center;gap:10px;padding:8px 16px 6px}.balance{flex:1;min-width:0;display:flex;align-items:center;justify-content:space-between;gap:10px;min-height:52px;padding:6px 6px 6px 14px;border-radius:var(--radius);background:var(--surface);border:1px solid var(--border)}.balance-label{font-family:var(--chalk);font-size:1.55rem;font-weight:700;line-height:1.1}.balance--even .balance-label{color:var(--plus)}.me{flex:none;padding:0;border:0;background:none;border-radius:50%}.menu{position:absolute;z-index:20;top:64px;right:16px;display:flex;flex-direction:column;min-width:220px;padding:6px;border-radius:14px;background:var(--surface-2);border:1px solid var(--border);box-shadow:0 10px 30px #0006}.menu button{min-height:44px;padding:0 12px;border:0;border-radius:10px;background:none;text-align:left}.menu button:active{background:var(--border)}.content{flex:1;padding:0 16px 12px}.avatar{display:inline-grid;place-items:center;flex:none;border-radius:50%;object-fit:cover;color:#fff;font-weight:700}.btn{min-height:52px;padding:0 18px;border:0;border-radius:14px;background:var(--surface-2);font-weight:700}.btn:disabled{opacity:.45}.btn--primary{flex:1;background:var(--accent);color:var(--accent-text);font-size:1.05rem}.btn--ghost{background:transparent;border:1px solid var(--border);color:var(--text-2)}.btn--danger{background:var(--danger);color:#fff}.btn--small{flex:none;min-height:40px;padding:0 12px;border-radius:10px;background:var(--accent);color:var(--accent-text);font-size:.85rem}.btn-amount{font-weight:600;opacity:.8}.icon-btn{width:44px;height:44px;border:0;border-radius:12px;background:var(--surface-2)}.entry{display:flex;flex-direction:column;gap:8px}.amount{display:flex;justify-content:center}.amount-value{font-family:var(--chalk);font-size:3rem;font-weight:700;line-height:1;font-variant-numeric:tabular-nums}.amount-value--empty{color:var(--text-2);opacity:.6}.row{display:flex;align-items:center;gap:10px}.row-label{width:64px;flex:none;font-size:.8rem;color:var(--text-2);line-height:1.15}.row-info{margin:0;color:var(--text-2)}.row-info strong{color:var(--text)}.seg{flex:1;min-width:0;display:flex;gap:3px;padding:3px;border-radius:12px;background:var(--surface);border:1px solid var(--border)}.seg button{flex:1 1 0;min-width:0;min-height:44px;display:flex;align-items:center;justify-content:center;gap:8px;padding:0 6px;border:0;border-radius:9px;background:transparent;color:var(--text-2);font-weight:600;font-size:.92rem;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.seg button.on{background:var(--accent);color:var(--accent-text)}.seg--people button{justify-content:flex-start;padding-left:6px}.share{display:flex;align-items:stretch;gap:6px}.share-step{width:44px;flex:none;border:0;border-radius:10px;background:var(--surface-2);font-size:1.3rem;font-weight:700}.share-label{flex:1;min-width:0;display:flex;justify-content:space-between;gap:6px;min-height:44px;white-space:nowrap;align-items:center;padding:0 10px;border:1px dashed var(--border);border-radius:10px;background:none;font-size:.85rem;color:var(--text-2)}.share-label strong{color:var(--text)}.chips{display:flex;gap:6px;overflow-x:auto;scrollbar-width:none;margin:0 -16px;padding:0 16px}.chips::-webkit-scrollbar{display:none}.chip{flex:none;min-height:36px;padding:0 12px;border-radius:999px;border:1px solid var(--border);background:transparent;color:var(--text-2);font-size:.88rem}.chip.on{border-color:var(--accent);color:var(--accent)}.chip--date{position:relative;display:inline-flex;align-items:center;color:var(--text);font-weight:600}.chip--date input{position:absolute;top:0;right:0;bottom:0;left:0;width:100%;opacity:0}.chip--input{flex:1;min-width:160px;display:inline-flex;align-items:center;gap:4px;padding:0 4px 0 12px;border-color:var(--accent)}.chip--input input{flex:1;min-width:0;border:0;outline:0;background:none;font-size:1rem}.chip--input button{width:32px;height:32px;border:0;border-radius:50%;background:var(--surface-2)}.keypad{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}.key{min-height:50px;border:0;border-radius:12px;background:var(--surface);font-size:1.5rem;font-weight:600}.key:active{background:var(--surface-2)}.key svg,.tabs svg{width:26px;height:26px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}.key--del{display:grid;place-items:center;color:var(--text-2)}.preview{margin:0;min-height:1.3em;text-align:center;color:var(--text-2);font-size:.92rem}.actions{display:flex;gap:8px}.history section+section{margin-top:6px}.day{margin:12px 0 6px;font-size:.78rem;font-weight:700;letter-spacing:.06em;text-transform:uppercase;color:var(--text-2)}.history ul{list-style:none;margin:0;padding:0;display:flex;flex-direction:column;gap:6px}.item{width:100%;display:flex;align-items:center;gap:12px;min-height:60px;padding:8px 12px;border:1px solid var(--border);border-radius:14px;background:var(--surface);text-align:left}.item-text{flex:1;min-width:0;display:flex;flex-direction:column;gap:2px}.item-title{font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.item-sub{font-size:.8rem;color:var(--text-2)}.tag{display:inline-block;margin-right:6px;padding:1px 7px;border-radius:999px;background:var(--surface-2);font-size:.75rem;font-weight:700;color:var(--accent)}.item-amounts{flex:none;display:flex;flex-direction:column;align-items:flex-end;gap:2px;font-variant-numeric:tabular-nums}.item-amount{font-weight:700}.item-effect{font-size:.8rem;color:var(--text-2)}.item-effect.plus{color:var(--plus)}.item-effect.minus{color:var(--minus)}.empty,.more{padding:32px 8px;text-align:center;color:var(--text-2)}.more{padding:16px 8px;font-size:.85rem}.tabs{position:sticky;bottom:0;display:flex;gap:6px;padding:6px 16px calc(6px + env(safe-area-inset-bottom));background:var(--bg);border-top:1px solid var(--border)}.tabs button{flex:1;min-height:52px;display:flex;align-items:center;justify-content:center;gap:8px;border:0;border-radius:12px;background:none;color:var(--text-2);font-weight:600}.tabs button.on{background:var(--surface);color:var(--text)}.sheet-backdrop{position:fixed;top:0;right:0;bottom:0;left:0;z-index:30;display:flex;align-items:flex-end;justify-content:center;background:#0000008c}.sheet{width:100%;max-width:520px;max-height:96dvh;overflow-y:auto;padding:12px 16px calc(16px + env(safe-area-inset-bottom));border-radius:22px 22px 0 0;background:var(--bg);border-top:1px solid var(--border)}.sheet-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:4px}.sheet-head h2{margin:0;font-family:var(--chalk);font-size:1.8rem}.toast{position:fixed;z-index:40;left:50%;bottom:calc(76px + env(safe-area-inset-bottom));transform:translate(-50%);display:flex;align-items:center;gap:14px;width:max-content;max-width:calc(100vw - 32px);padding:10px 10px 10px 16px;border-radius:14px;background:var(--text);color:var(--bg);font-weight:600;box-shadow:0 8px 24px #0006}.toast button{min-height:40px;padding:0 12px;border:0;border-radius:10px;background:var(--bg);color:var(--accent);font-weight:700}.banner{margin:0 16px 8px;padding:10px 12px;border-radius:12px;background:#4a2624;color:#ffd9d6}.lock,.loading{max-width:420px;margin:0 auto;min-height:100dvh;display:flex;flex-direction:column;justify-content:center;gap:14px;padding:24px 24px calc(24px + env(safe-area-inset-bottom));text-align:center}.loading{color:var(--text-2)}.brand{margin:0;font-family:var(--chalk);font-size:3.6rem;color:var(--accent)}.lock-hint{margin:0;color:var(--text-2)}.lock-error{min-height:1.3em;margin:0;color:var(--danger)}.dots{display:flex;justify-content:center;gap:18px}.dots span{width:16px;height:16px;border-radius:50%;border:2px solid var(--text-2)}.dots span.on{background:var(--accent);border-color:var(--accent)}.dots--error{animation:shake .35s}@keyframes shake{25%{transform:translate(-8px)}75%{transform:translate(8px)}}.who{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px;margin-top:8px}.who-btn{display:flex;flex-direction:column;align-items:center;gap:12px;padding:22px 8px;border:1px solid var(--border);border-radius:18px;background:var(--surface);font-size:1.15rem;font-weight:700}@media (prefers-reduced-motion: reduce){.dots--error{animation:none}}
