:root{--paper:#f5f4ef;--ink:#333b35;--muted:#798077;--line:#dddfd6;--green:#536653;--light:#e9ede3;--red:#a84b3c}*{box-sizing:border-box}body{margin:0;background:var(--paper);color:var(--ink);font-family:system-ui,-apple-system,"Segoe UI","Microsoft JhengHei",sans-serif;font-size:14px;line-height:1.6}button,input,select{font:inherit}button{cursor:pointer;color:inherit;border:1px solid var(--line);background:transparent;padding:9px 14px;border-radius:6px}button:hover{background:var(--light)}button:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:3px solid #859b79;outline-offset:2px}input,select{border:1px solid var(--line);border-radius:5px;padding:9px;background:#fff;color:var(--ink);min-width:0;width:100%}input[type=checkbox]{width:20px;height:20px;accent-color:var(--green)}header{max-width:1440px;margin:auto;padding:25px 40px;border-bottom:1px solid var(--line);display:flex;justify-content:space-between;align-items:center}.brand{text-decoration:none;color:var(--ink);font-size:21px;letter-spacing:3px;font-weight:600}.brand span{display:block;font-size:9px;letter-spacing:2.5px;margin-top:1px}.tools{display:flex;align-items:center;gap:8px}.tools input{width:auto}main{max-width:1440px;padding:0 40px;margin:auto}.intro{padding:54px 0 38px;display:flex;align-items:end;justify-content:space-between;gap:20px}.eyebrow{font-size:10px;letter-spacing:2px;color:var(--green);font-weight:600}h1{font-family:Georgia,"Noto Serif TC",serif;font-size:36px;font-weight:500;letter-spacing:2px;margin:10px 0}h2{font-size:19px;font-weight:600;margin:0}h3{font-size:22px;font-weight:500;margin:4px 0}p{margin:5px 0}.muted,.legend{color:var(--muted);font-size:12px}.save-status{font-size:12px;color:var(--green)}.period-bar{display:flex;justify-content:space-between;align-items:center;gap:12px;border-block:1px solid var(--line);padding:20px 0}.period-nav{display:flex;align-items:center;gap:20px}.period-nav button{border:0;font-size:20px}.metrics{display:grid;grid-template-columns:repeat(5,1fr);padding:28px 0}.metric{padding:0 20px;border-left:1px solid var(--line)}.metric:first-child{padding-left:0;border:0}.metric strong{display:block;font-size:27px;font-weight:500;letter-spacing:-1px}.metric small{font-size:11px;color:var(--muted)}.negative{color:var(--red)}.goal{background:var(--light);padding:25px 28px;display:flex;gap:30px;align-items:center;justify-content:space-between;border-radius:8px}.goal-track{flex:1;max-width:400px}progress{appearance:none;width:100%;height:6px;border:0;border-radius:10px;background:#d5ddcf}progress::-webkit-progress-bar{background:#d5ddcf;border-radius:10px}progress::-webkit-progress-value{background:var(--green);border-radius:10px}.section-heading{display:flex;justify-content:space-between;align-items:center;margin:32px 0 18px;gap:10px}.weekdays,.calendar{display:grid;grid-template-columns:repeat(7,minmax(0,1fr))}.weekdays{text-align:center;color:var(--muted);font-size:11px;padding-bottom:12px}.calendar{border-top:1px solid var(--line);border-left:1px solid var(--line)}.day{padding:10px 8px;min-height:190px;border-right:1px solid var(--line);border-bottom:1px solid var(--line);background:#fafaf6}.day.blank{background:transparent}.day.today{background:#eef1e8}.day-head{display:flex;justify-content:space-between;margin:0 4px 9px}.day-head strong{font-weight:500}.day-head small{font-size:10px;color:var(--green)}.entry{width:100%;display:flex;justify-content:space-between;gap:3px;font-size:11px;border:0;padding:5px 4px;border-radius:3px;text-align:left;white-space:nowrap}.entry .amount{color:var(--muted)}.entry.done .amount{color:var(--green)}.fixed-list{display:grid;grid-template-columns:repeat(3,1fr);gap:12px}.fixed-card{text-align:left;padding:17px;background:#fafaf6}.fixed-card strong{display:block;font-size:16px}.fixed-card span{display:block;color:var(--muted);font-size:12px}.help{margin:30px 0;color:var(--muted);font-size:12px;max-width:900px}.help summary{cursor:pointer;color:var(--ink)}footer{border-top:1px solid var(--line);padding:24px 0 35px;font-size:12px}footer span{float:right;color:var(--muted)}dialog{border:1px solid var(--line);border-radius:12px;padding:24px;width:620px;max-width:calc(100% - 24px);max-height:90dvh;color:var(--ink);background:var(--paper)}dialog::backdrop{background:#27332466}.dialog-heading,.dialog-actions{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:20px}.dialog-heading button{border:0}.dialog-actions{justify-content:flex-end;margin:22px 0 0}.primary{background:var(--green);color:white;border-color:var(--green)}.primary:hover{background:#435441}.fields{display:grid;grid-template-columns:1fr 1fr;gap:14px;margin:16px 0}label{display:block;font-size:12px;color:var(--muted)}label input,label select{display:block;margin-top:5px}.check{display:flex;gap:10px;align-items:center;color:var(--ink);margin:14px 0}.check input{margin:0}.detail-row{border-bottom:1px solid var(--line);padding:14px 0}.detail-row .fields{margin:7px 0}.row-top{display:flex;gap:10px;align-items:center}.row-top select{flex:1}.remove{font-size:12px;color:var(--red)}.error{color:var(--red);font-size:12px}.toast{position:fixed;bottom:24px;left:50%;transform:translateX(-50%);background:var(--ink);color:white;padding:12px 22px;border-radius:8px;max-width:90%;z-index:10}.hint{font-size:12px;color:var(--muted);margin:10px 0}.mobile-date{display:none}
@media(min-width:1500px){main,header{max-width:1500px}}@media(max-width:1050px){main{padding:0 20px}header{padding:20px}.metric{padding:0 12px}.metric strong{font-size:23px}.entry{font-size:10px}.day{padding:8px 3px}.goal{gap:15px}}@media(max-width:700px){header{padding:18px 16px}.brand{font-size:18px}header button{font-size:12px;padding:7px 10px}main{padding:0 16px}.intro{padding:30px 0 24px;display:block}h1{font-size:29px}.save-status{display:block;margin-top:15px}.period-bar{align-items:start;flex-direction:column}.period-bar .tools{width:100%;flex-wrap:wrap}.period-bar input{flex:1}.period-nav{width:100%;justify-content:space-between}.metrics{grid-template-columns:repeat(2,1fr);gap:20px 0}.metric{padding:0 12px}.metric:nth-child(odd){border:0;padding-left:0}.metric:last-child{grid-column:1/-1}.metric strong{font-size:28px}.goal{padding:20px;flex-wrap:wrap;gap:15px}.goal-track{flex-basis:100%;order:3;max-width:none}.goal h3{font-size:20px}.goal>button{margin-left:auto}.section-heading{align-items:start;flex-direction:column}.weekdays{display:none}.calendar{grid-template-columns:1fr;border-left:0;border-top:0;gap:10px}.day.blank{display:none}.day{border:1px solid var(--line);border-radius:7px;min-height:0;padding:12px}.day-head{margin-bottom:8px}.mobile-date{display:inline}.day-entries{display:grid;grid-template-columns:repeat(2,1fr);gap:6px}.entry{font-size:13px;padding:9px;background:#f0f1e9}.fixed-list{grid-template-columns:1fr}.fields{gap:10px}.legend{font-size:11px}dialog{padding:18px}footer span{float:none;display:block;margin-top:5px}}@media(prefers-reduced-motion:no-preference){button{transition:background .15s}}

.cloud-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;border-bottom:1px solid var(--line);padding:10px 0;color:var(--green);font-size:12px}.cloud-actions{display:flex;flex-wrap:wrap;gap:8px}.cloud-banner button{font-size:12px}button:disabled{opacity:.5;cursor:wait}#cloud a{color:var(--green)}#cloudMessage{overflow-wrap:anywhere}header{gap:12px;flex-wrap:wrap}header .tools{flex-wrap:wrap}@media(max-width:700px){header .tools{gap:5px}header .tools button{padding:6px 8px;font-size:11px}.cloud-banner{align-items:start}}

/* Daily card: the default home contains one day and four entry points. */
[hidden]{display:none!important}
body{font-size:16px}label,.hint,.help{font-size:.875rem}.muted,.save-status{font-size:.875rem}
header{max-width:1160px;padding:25px 32px}main{max-width:1160px;padding:0 32px}
header .tools button{font-size:.875rem}.brand span{font-size:.625rem}
.more-menu{position:relative}.more-menu summary{list-style:none;cursor:pointer;font-size:.875rem;padding:9px 14px;color:var(--muted)}.more-menu summary::-webkit-details-marker{display:none}.more-actions{position:absolute;right:0;top:45px;z-index:3;width:170px;background:#fff;border:1px solid var(--line);border-radius:8px;padding:7px;box-shadow:0 10px 30px #26362512}.more-actions button{display:block;width:100%;text-align:left;border:0}
.daily-view{max-width:620px;margin:0 auto;padding:38px 0 20px}.daily-intro{text-align:center;color:var(--muted);font-size:.875rem;letter-spacing:2px;margin:0 0 24px}
.daily-card{background:#fdfdf9;border:1px solid #dedfd6;border-radius:18px;box-shadow:0 8px 28px #3b473508;padding:32px}
.card-heading{display:flex;align-items:center;justify-content:space-between;gap:20px;padding-bottom:26px;border-bottom:1px solid var(--line)}
.day-badge{font-size:.875rem;color:var(--green);margin:0 0 6px}.card-heading h1{font:500 2.5rem/1.3 Georgia,"Noto Serif TC",serif;letter-spacing:1px;margin:0 0 8px}.card-heading .muted{margin:0}
.date-jump{font-size:.75rem;text-align:right;color:var(--muted)}.date-jump input{font-size:.875rem;width:155px;padding:7px;background:transparent}
.daily-entries{display:grid;grid-template-columns:1fr 1fr;gap:12px;padding:26px 0}
.daily-entry{display:flex;gap:12px;align-items:center;text-align:left;min-height:96px;padding:16px;border:1px solid var(--line);border-radius:10px;background:#f8f9f3}
.entry-symbol{display:grid;place-items:center;width:36px;height:36px;flex-shrink:0;border:1px solid #dfe5d8;border-radius:50%;font-size:.875rem;color:var(--green)}.daily-entry-copy{flex:1;min-width:0}.daily-entry-copy strong{display:block;font-size:1rem;font-weight:500}.daily-entry-copy>span{display:block;font-size:.8125rem;color:var(--muted);margin-top:5px}.entry-status{font-size:1rem;color:var(--muted)}.daily-entry.done .entry-status{color:var(--green)}.daily-entry.done{background:#edf1e7}
.card-bottom{display:flex;align-items:end;justify-content:space-between;gap:12px;padding-top:20px;border-top:1px solid var(--line)}.card-note{font-size:.75rem;color:var(--muted);max-width:135px}.daily-total{text-align:right}.daily-total>p{font-size:.8125rem;color:var(--muted);margin:0 0 4px}.daily-total strong{display:block;font-size:2rem;font-weight:500;letter-spacing:-.5px;margin-bottom:6px}.daily-total .budget-note{font-size:.75rem;margin:0;color:var(--muted)}
.day-navigation{display:flex;justify-content:space-between;gap:10px;margin:20px 0 0}.day-navigation button{font-size:.875rem;border:0;padding:10px 16px}.day-navigation #dayToday{border:1px solid var(--line)}.midnight-note{text-align:center;font-size:.75rem;color:var(--muted);margin:19px 0 0}
.cloud-banner{max-width:620px;margin:8px auto 0;padding:14px 0;border:0;font-size:.75rem}.cloud-banner p{margin:0}.cloud-banner .save-status{font-size:.75rem;color:var(--muted)}footer{max-width:620px;margin:0 auto;padding:18px 0 24px;color:var(--muted)}
#overview{padding-top:30px}.period-nav button{font-size:.875rem}#overview .entry{font-size:.8125rem}#overview .metric strong{font-size:1.5rem}
@media(max-width:700px){header{padding:18px 20px;flex-wrap:nowrap}main{padding:0 20px}.brand{font-size:18px}.brand span{font-size:8px}header .tools{flex-wrap:nowrap;gap:2px}header .tools button,.more-menu summary{font-size:.8125rem;padding:8px 10px}.daily-view{padding-top:28px}.daily-intro{margin-bottom:20px}.daily-card{padding:22px 18px;border-radius:15px}.card-heading{gap:12px;padding-bottom:22px}.card-heading h1{font-size:2rem}.date-jump input{width:135px;font-size:.8125rem}.daily-entries{gap:10px;padding:22px 0}.daily-entry{min-height:96px;padding:14px 10px;gap:9px}.entry-symbol{display:none}.daily-entry-copy strong{font-size:1rem}.daily-entry-copy>span{font-size:.8125rem}.card-note{max-width:94px;font-size:.75rem}.daily-total strong{font-size:1.8rem}.card-bottom{padding-top:20px}.day-navigation{margin-top:16px}.cloud-banner{font-size:.75rem}.cloud-banner .save-status{font-size:.75rem}footer{font-size:.75rem}footer span{float:right;margin:0}.card-heading .muted{font-size:.8125rem}}
@media(max-width:700px){.card-heading h1{font-size:1.7rem;white-space:nowrap}.date-jump input{width:128px;font-size:.875rem}.daily-entry-copy>span,.daily-total>p{font-size:.875rem}}
@media(max-width:360px){main{padding:0 12px}header{padding:16px 12px}.date-jump input{width:124px}.card-heading h1{font-size:1.5rem}.daily-total strong{font-size:1.6rem}}

/* Bookmarks and an app-sized canvas: only the active panel can scroll. */
html,body{height:100%;margin:0}body{overflow:hidden}
main.app-shell{width:100%;max-width:680px;height:100vh;height:100dvh;margin:0 auto;padding: max(10px,env(safe-area-inset-top)) max(14px,env(safe-area-inset-right)) max(12px,env(safe-area-inset-bottom)) max(14px,env(safe-area-inset-left));display:flex;flex-direction:column}
.bookmark-tabs{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:6px;align-items:end;padding:0 8px;flex:0 0 48px}
.bookmark-tabs button{height:41px;min-width:0;padding:8px 6px;font-size:.875rem;border:1px solid transparent;border-bottom:0;border-radius:9px 9px 0 0;color:var(--muted);background:#eceee6;position:relative}
.bookmark-tabs button[aria-selected=true]{height:48px;background:#fdfdf9;color:var(--ink);border-color:var(--line);font-weight:600}
.bookmark-tabs button[aria-selected=true]::after{content:"";position:absolute;bottom:-1px;left:0;right:0;height:2px;background:#fdfdf9;z-index:1}
.bookmark-tabs button:focus-visible{outline-offset:-4px}
.app-shell .daily-view{width:100%;max-width:none;margin:0;padding:0;flex:1;min-height:0;display:flex;flex-direction:column;gap:10px;overflow:auto;overscroll-behavior:contain}
.app-shell .daily-card{flex:1;min-height:360px;display:flex;flex-direction:column;padding:clamp(14px,2.8dvh,24px);border-radius:12px;box-shadow:none;background:#fdfdf9}
.app-shell .card-heading{flex-shrink:0;gap:10px;padding-bottom:clamp(10px,2dvh,18px)}
.app-shell .card-heading h1{font-size:clamp(1.5rem,4.2dvh,2.2rem);white-space:nowrap;line-height:1.25;margin:0 0 5px}
.app-shell .day-badge{font-size:.75rem;line-height:1.2;margin:0 0 5px}
.app-shell .card-heading .muted{font-size:.8125rem;line-height:1.4}
.app-shell .date-jump{font-size:.75rem}.app-shell .date-jump input{width:132px;font-size:.875rem;padding:7px 6px;min-height:36px}
.app-shell .daily-entries{flex:1;min-height:140px;grid-template-rows:repeat(2,minmax(56px,1fr));gap:10px;padding:clamp(10px,2.2dvh,20px) 0}
.app-shell .daily-entry{min-height:56px;padding:12px;gap:10px}
.app-shell .daily-entry-copy strong{font-size:1rem}.app-shell .daily-entry-copy>span{font-size:.875rem;line-height:1.4;margin-top:4px}
.app-shell .card-bottom{flex-shrink:0;justify-content:flex-end;padding-top:clamp(9px,1.8dvh,16px)}
.app-shell .daily-total>p{font-size:.875rem;line-height:1.45;margin:0 0 3px}.app-shell .daily-total strong{font-size:clamp(1.6rem,4.6dvh,2rem);line-height:1.2;margin:4px 0 5px}.app-shell .daily-total .budget-note{font-size:.75rem;line-height:1.4;margin:0}
.app-shell .day-navigation{margin:0;flex:0 0 44px;gap:8px}.app-shell .day-navigation button{flex:1;min-width:0;min-height:44px;padding:8px;font-size:.875rem}.app-shell .day-navigation #dayToday{background:#fdfdf9}
.tab-panel{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:22px 16px;background:#fdfdf9;border:1px solid var(--line);border-radius:12px;scrollbar-gutter:stable}
#overview.tab-panel{padding-top:18px}.panel-title{margin-bottom:24px}.panel-title h2{font-size:1.4rem;font-weight:500}.panel-title .muted{margin-top:6px}
.settings-block{padding:0 0 22px;margin:0 0 22px;border-bottom:1px solid var(--line)}.settings-block:last-child{border:0;margin-bottom:0;padding-bottom:0}.settings-block h3,.about-copy h3{font-size:1rem;font-weight:600;margin:0 0 8px}.settings-block>button{margin-top:12px;min-height:44px}.settings-block .fixed-list{grid-template-columns:1fr;margin-top:14px;gap:8px}.settings-block .fixed-card{padding:12px}.settings-block .fixed-card span{font-size:.875rem}
.settings-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:16px}.settings-actions button{min-height:44px;font-size:.875rem}.settings-actions button:first-child{grid-column:1/-1;background:var(--green);color:white;border-color:var(--green)}
.settings-block .cloud-banner{max-width:none;margin:0;padding:0;align-items:start;font-size:.875rem}.settings-block .save-status{font-size:.8125rem;margin:5px 0 0;display:block}.settings-block .cloud-banner p{font-size:.875rem;line-height:1.6}
.about-copy p{font-size:1rem;line-height:1.85;margin:0 0 18px}.about-copy h3:not(:first-child){margin-top:28px}#aboutView .help{font-size:.875rem;line-height:1.8;margin:24px 0}#aboutView .help p{margin:12px 0}#aboutView footer{margin:0;max-width:none;font-size:.75rem}
.app-shell .period-bar{padding-top:0;border-top:0}.app-shell .period-nav{gap:10px}.app-shell .period-nav button{padding:8px;font-size:.875rem}.app-shell .period-nav h2{font-size:1.1rem}.app-shell .period-bar .tools{flex-wrap:wrap}.app-shell .period-bar input{max-width:100%}
dialog{max-height:calc(100dvh - 24px);overflow:auto}.toast{bottom:max(16px,env(safe-area-inset-bottom));font-size:.875rem}
@media(max-width:360px){main.app-shell{padding-left:10px;padding-right:10px}.app-shell .daily-card{padding:14px}.app-shell .date-jump input{width:124px}.app-shell .card-heading h1{font-size:1.5rem}.app-shell .daily-entry{padding:10px}.bookmark-tabs{gap:4px}}
@media(max-height:620px){main.app-shell{padding-top:8px;padding-bottom:8px}.bookmark-tabs{flex-basis:44px}.bookmark-tabs button{height:38px}.bookmark-tabs button[aria-selected=true]{height:44px}.app-shell .daily-card{min-height:310px;padding:14px}.app-shell .daily-entries{min-height:128px;gap:8px;padding:10px 0}.app-shell .card-heading{padding-bottom:10px}.app-shell .card-heading h1{font-size:1.5rem}.app-shell .card-bottom{padding-top:9px}.app-shell .day-navigation{flex-basis:40px}.app-shell .day-navigation button{min-height:40px}}
@media(max-height:480px){.app-shell .daily-card{min-height:250px;padding:12px}.app-shell .day-badge{display:none}.app-shell .daily-entries{min-height:108px;padding:8px 0;gap:6px;grid-template-rows:repeat(2,minmax(44px,1fr))}.app-shell .daily-entry{min-height:44px;padding:8px}.app-shell .daily-entry-copy>span{margin-top:0}.app-shell .daily-total strong{font-size:1.4rem}.app-shell .daily-total .budget-note{display:none}.app-shell .card-heading{padding-bottom:8px}.app-shell .card-heading h1{font-size:1.25rem}.app-shell .card-heading .muted{font-size:.75rem}}
