
:root{font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;color:#171717;background:#f7f7f8}
*{box-sizing:border-box} body{margin:0;padding:env(safe-area-inset-top) 14px env(safe-area-inset-bottom);min-height:100vh}
main{max-width:520px;margin:0 auto;min-height:100vh;display:flex;flex-direction:column;gap:12px;padding:14px 0}
header{padding:8px 4px 2px} h1{font-size:24px;margin:0 0 4px} .date{color:#666;font-size:14px}
.total{background:#fff;border-radius:18px;padding:17px 18px;box-shadow:0 1px 4px #0000000a}
.total-label{font-size:13px;color:#666}.amount{font-size:34px;font-weight:750;letter-spacing:-1px;margin-top:3px}
.month{font-size:13px;color:#666;margin-top:3px}
.actions{display:grid;grid-template-columns:1fr;gap:10px}
.action{border:0;border-radius:16px;padding:16px 18px;display:flex;align-items:center;justify-content:space-between;text-align:left;background:#fff;box-shadow:0 1px 4px #0000000a;color:#171717;min-height:68px}
.action:active{transform:scale(.99);background:#ededf0}.action strong{font-size:17px}.price{font-size:16px;font-weight:700}
.plus{color:#fff;background:#222}.plus:active{background:#444}
.content-title{display:flex;align-items:center;justify-content:space-between;margin:4px 3px 8px;font-size:16px;font-weight:700}
.history{background:#fff;border-radius:18px;padding:15px;flex:1;min-height:160px}
.entry{display:flex;justify-content:space-between;gap:10px;padding:10px 0;border-bottom:1px solid #eee}.entry:last-child{border-bottom:0}
.entry-name{font-weight:600;font-size:14px}.entry-date{font-size:12px;color:#777;margin-top:3px}.entry-value{font-weight:700;white-space:nowrap;font-size:14px}
.empty{font-size:14px;color:#777;padding:18px 0;text-align:center}
.tools{display:flex;gap:8px;flex-wrap:wrap}.small{border:0;background:#e9e9ec;border-radius:10px;padding:9px 11px;font-size:12px;color:#333}
.note{font-size:11px;color:#777;line-height:1.45;padding:0 3px}
dialog{border:0;border-radius:22px;padding:22px;width:min(92vw,360px);box-shadow:0 10px 50px #0003}
dialog::backdrop{background:#0006} dialog h2{font-size:20px;margin:0 0 6px} .sub{font-size:13px;color:#666;margin-bottom:16px}
#customAmount{width:100%;font-size:28px;padding:12px;border:1px solid #ddd;border-radius:12px;text-align:right}
.keypad{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;margin-top:12px}.key{border:0;border-radius:12px;padding:15px;background:#f0f0f2;font-size:21px}
.dialog-actions{display:flex;gap:8px;margin-top:14px}.dialog-actions button{flex:1;border:0;border-radius:12px;padding:13px;font-weight:650}.cancel{background:#eee}.save{background:#222;color:#fff}
@media(min-height:760px){.actions{grid-template-columns:1fr}.history{min-height:200px}}

[hidden]{display:none!important}button{cursor:pointer;font-family:inherit}button:disabled{opacity:.5;cursor:wait}.topline{display:flex;justify-content:space-between;align-items:center}.auth-card{background:#fff;border-radius:18px;padding:24px;margin-top:15vh}.auth-card label{display:block;font-size:14px;margin:18px 0 6px}.auth-card input{width:100%;font:inherit;font-size:16px;border:1px solid #ddd;border-radius:12px;padding:13px}.auth-card button{width:100%;margin-top:20px}.status{font-size:13px;line-height:1.5;padding:10px 3px;overflow-wrap:anywhere}.status.error{color:#b42318}.status.success{color:#217044}.auth-card h1{margin-bottom:8px}main.loading>section,main.loading>.tools{pointer-events:none;opacity:.5}

.period-filters{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px;padding:12px;background:#f7f7f8;border-radius:12px;margin:12px 0 16px}
.period-filters label{display:flex;flex-direction:column;gap:6px;font-size:12px;font-weight:600;color:#666;min-width:0}
.period-filters select{width:100%;min-width:0;padding:11px 8px;border:1px solid #ddd;border-radius:9px;background:#fff;color:#171717;font:inherit;font-size:16px}
.record-month+.record-month{margin-top:22px;padding-top:20px;border-top:2px solid #e5e5e9}
.record-month-heading{padding:12px;background:#f3f3f5;border-radius:10px;margin-bottom:6px}
.record-month-title{font-weight:750;font-size:16px}.record-month-summary{font-size:13px;color:#555;margin-top:4px}

@media (display-mode:standalone){main{padding-bottom:max(14px,env(safe-area-inset-bottom))}body{overscroll-behavior-y:none}}

.entry{align-items:center}.entry-info{flex:1;min-width:0}.entry-actions{display:flex;flex-direction:column;align-items:flex-end;gap:7px;flex-shrink:0}
.entry-delete{border:0;border-radius:8px;padding:8px 14px;background:#fff0f0;color:#c62828;font-size:12px;font-weight:600}.entry-delete:active{background:#ffdede}

.custom-label{display:block;font-size:13px;font-weight:600;color:#555;margin:12px 0 6px}
#customName{width:100%;font:inherit;font-size:16px;padding:12px;border:1px solid #ddd;border-radius:12px}
#customDialog{max-height:90vh;max-height:90dvh;overflow-y:auto}
.entry-name{overflow-wrap:anywhere}
