html{background:#faf7f0;min-height:100%}body{margin:0!important;background:#faf7f0!important}.layout{display:block!important;margin:0!important;padding:0!important;max-width:none!important}.intro,.phone>div.status:first-child{display:none!important}.phone{width:100%!important;max-width:560px!important;margin:0 auto!important;border:0!important;border-radius:0!important;box-shadow:none!important;min-height:100dvh;padding-top:max(16px,env(safe-area-inset-top))!important;padding-left:max(16px,env(safe-area-inset-left))!important;padding-right:max(16px,env(safe-area-inset-right))!important;padding-bottom:0!important}.layout>.phone{padding-left:0!important;padding-right:0!important}.app{min-height:0!important;padding:48px 20px 24px!important}.nav{position:sticky!important;bottom:0!important;z-index:20;margin-top:24px!important;background:#faf7f0!important;padding-bottom:max(16px,env(safe-area-inset-bottom))!important}.nav a,.nav button{min-height:44px;display:inline-flex;flex-direction:column;justify-content:center;align-items:center}input,select,textarea{font-size:16px!important}dialog{max-width:calc(100vw - 32px);max-height:80dvh;overflow:auto}button,a{-webkit-tap-highlight-color:transparent}img,svg{max-width:100%}.install-note{font-size:12px;line-height:1.7;padding:10px 16px;background:#f2eee7;color:#665f59;border-radius:12px;margin:10px 0}.install-note button{float:right;border:0;background:none;padding:4px 8px;color:inherit}@media(display-mode:standalone){.install-note{display:none}}
/* Shared settings visual language */
a.top-settings,a.settings-top,a[aria-label="設定"]{width:44px;height:44px;border-radius:14px;background:#F2EEE7;color:#76624F!important;display:inline-flex;align-items:center;justify-content:center;padding:0!important;text-decoration:none;flex-shrink:0}a.top-settings{top:8px!important}.settings-page{color:#34312D;font:15px -apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN",sans-serif}.settings-header{display:flex;align-items:center;gap:12px;margin:8px 0 24px}.settings-header h1{font-size:22px;font-weight:600;margin:0}.settings-back{width:44px;height:44px;display:grid;place-items:center;color:#76624F;background:#F2EEE7;border-radius:14px;text-decoration:none;font-size:26px}.settings-hero{padding:22px;border-radius:22px;background:#DCD0BA;margin-bottom:28px}.settings-hero img{width:48px;height:48px;border-radius:14px;float:right}.settings-hero h2{font-size:20px;margin:0 0 10px;font-weight:600}.settings-hero p{font-size:12px;line-height:1.8;color:#655C50;margin:0}.settings-label{font-size:12px;color:#81786D;margin:24px 8px 10px}.settings-list{border-radius:18px;overflow:hidden;background:#F2EEE7}.settings-item{display:flex;gap:14px;align-items:center;padding:18px 16px;color:#34312D;text-decoration:none;border-bottom:1px solid #E6DFD5}.settings-item:last-child{border-bottom:0}.settings-symbol{width:38px;height:38px;border-radius:12px;display:grid;place-items:center;background:#E5D8C5;color:#76624F;font-size:19px}.settings-item:nth-child(2) .settings-symbol{background:#EAD1D6}.settings-item:nth-child(3) .settings-symbol{background:#DED6E9}.settings-copy{flex:1}.settings-copy strong{font-size:14px;font-weight:500;display:block}.settings-copy small{font-size:11px;color:#81786D;display:block;margin-top:5px;line-height:1.5}.settings-arrow{color:#9A9084;font-size:22px}.settings-footer{text-align:center;font-size:11px;color:#9A9084;padding:28px 0}.settings-page .nav{display:flex;justify-content:space-around;align-items:center;border-top:1px solid #E6DFD5;padding-top:12px;gap:6px}.settings-page .nav a{font-size:11px;color:#81786D;text-decoration:none}.settings-page .nav .plus{background:#76624F;color:white;border-radius:15px;width:46px;font-size:26px}.settings-item:focus-visible,.settings-back:focus-visible{outline:3px solid #BBAE9B;outline-offset:-3px}

#update-note{display:block!important}

/* Keep navigation at the viewport edge even when the ledger is empty. */
.phone:has(.nav){padding-bottom:calc(100px + env(safe-area-inset-bottom,0px))!important;box-sizing:border-box}
.phone .nav{position:fixed!important;left:50%!important;right:auto!important;bottom:0!important;transform:translateX(-50%);width:100%;max-width:560px;box-sizing:border-box;z-index:100;margin:0!important;padding:12px 12px calc(12px + env(safe-area-inset-bottom,0px))!important;border-top:1px solid #E6DFD5;background:#FAF7F0!important}

.budget-page-header{display:flex;align-items:center;justify-content:space-between;gap:16px;margin:8px 0 20px}.budget-page-header h1{font-size:22px;font-weight:600;margin:0;color:#34312D}.budget-page-header .settings-top{position:static!important;margin-left:auto;transform:none}

.budget-warning,.allocation-message:has(+ .total){line-height:1.7}.budget-warning{background:#F4E2D9;border:1px solid #E7C8B9;color:#8A5545;padding:16px;border-radius:16px;font-size:13px;line-height:1.8}.allocation-message{padding:12px 14px;border-radius:12px;background:#F2EEE7}

#show-categories.dot-circle{width:84px;height:auto;min-height:76px;border-radius:14px;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:7px;background:transparent;padding:5px 0;flex-shrink:0}.category-dot-symbol{position:relative;width:48px;height:48px;border-radius:50%;background:#FAF7F0}#category-toggle-label{font-size:11px;line-height:1.5;white-space:nowrap;color:#655C50}#show-categories:focus-visible{outline:2px solid #76624F;outline-offset:3px}

/* One shared navigation component across all main screens. */
.phone .nav.app-nav{display:grid!important;grid-template-columns:repeat(5,minmax(0,1fr));align-items:center;gap:0;padding-top:10px!important;box-shadow:0 -4px 20px #76624f06}
.phone .app-nav .nav-item{display:flex!important;flex-direction:column;align-items:center;justify-content:center;gap:4px;min-width:0;min-height:62px;margin:0;padding:4px 0!important;border:0;border-radius:14px;background:transparent;color:#939B9B!important;font:11px -apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN",sans-serif;text-decoration:none;transition:background .12s,color .12s,transform .12s;touch-action:manipulation}
.phone .app-nav .nav-icon{display:grid;place-items:center;width:32px;height:32px;border-radius:10px;transition:background .12s}
.phone .app-nav svg{width:23px;height:23px;display:block}
.phone .app-nav .nav-label{line-height:1.2;font-size:11px;white-space:nowrap}
.phone .app-nav .is-current{color:#76624F!important;font-weight:600}
.phone .app-nav .is-current:not(.nav-create) .nav-icon{background:#EDE5D9}
.phone .app-nav .nav-create .nav-icon{width:46px;height:46px;background:#76624F;border-radius:15px;color:#fff;box-shadow:0 2px 5px #76624f14}
.phone .app-nav .nav-create svg{width:27px;height:27px;stroke-width:1.8}
.phone .app-nav .nav-create .nav-label{display:none}
.phone .app-nav .nav-create.is-current .nav-icon{box-shadow:0 0 0 3px #DCD0BA;background:#65513F}
.phone .app-nav .nav-item:active,.phone .app-nav .nav-item.is-pressed{transform:scale(.94);background:#EDE5D9;color:#76624F!important}
.phone .app-nav .nav-item:focus-visible{outline:2px solid #9D8872;outline-offset:-2px}
@media(prefers-reduced-motion:reduce){.phone .app-nav .nav-item,.phone .app-nav .nav-icon{transition:none}}

.save-feedback[hidden]{display:none!important}.save-feedback{position:fixed;left:50%;bottom:calc(104px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);width:calc(100% - 32px);max-width:520px;z-index:110;display:flex;align-items:center;gap:10px;padding:16px 12px;border:1px solid #D3DBC8;border-radius:18px;background:#EDF1E7;color:#47533F;box-shadow:0 8px 24px #34312d12;animation:feedback-appear .18s ease-out}.feedback-check{width:30px;height:30px;border-radius:50%;background:#6B7D60;color:white;display:grid;place-items:center;flex-shrink:0}.feedback-copy{flex:1;min-width:0}.feedback-copy strong{display:block;font-size:14px;line-height:1.5}.feedback-copy span{display:block;font-size:11px;color:#6C7664;margin-top:3px}.save-feedback a{font-size:12px;color:#47533F;white-space:nowrap;padding:8px 0}.save-feedback button{background:transparent;color:#6C7664;font-size:20px;padding:8px;min-height:44px}.save.is-saved{background:#6B7D60!important}.save:disabled{opacity:1}.save:active{transform:scale(.98)}.status.is-error{font-size:13px;padding:12px;border-radius:12px;background:#F4E9E6;color:#9D5E5E}@keyframes feedback-appear{from{opacity:0;translate:0 8px}to{opacity:1;translate:0 0}}@media(prefers-reduced-motion:reduce){.save-feedback{animation:none}}

/* Shared type scale and page alignment. */
:root{--app-font:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Noto Sans JP",sans-serif;--page-title:22px;--section-title:16px;--body-size:14px;--caption-size:12px}
body{font-family:var(--app-font)!important;font-size:var(--body-size)!important;color:#34312D;line-height:1.6}
button,input,select,textarea{font-family:var(--app-font)!important}
.phone{padding-left:20px!important;padding-right:20px!important}
.layout>.phone{padding-left:0!important;padding-right:0!important}
.phone .app{padding:24px 20px!important}
.phone header{display:flex;align-items:center;justify-content:space-between;gap:12px;min-height:44px;margin:8px 0 24px!important}
.phone header h1,.phone .panel>.top h2{font-size:var(--page-title)!important;font-weight:600!important;line-height:1.35!important;letter-spacing:0!important;margin:0!important}
.phone .panel>.top{min-height:44px;margin:0 0 24px!important;align-items:center}
.phone h2,.phone .section h3,.phone .fixed-heading h2{font-size:var(--section-title)!important;font-weight:600;line-height:1.5}
.phone .note,.phone .muted,.phone .eyebrow,.phone .label,.phone .settings-label{font-size:var(--caption-size)!important;line-height:1.7}
.phone .top-settings{top:24px!important;right:20px!important}
.phone .tx .icon{width:36px!important;height:36px!important;border-radius:12px;display:grid;place-items:center;flex-shrink:0}
.phone .tx .icon svg{width:23px;height:23px}
.phone .tx strong{font-size:14px!important;font-weight:500!important;line-height:1.5}
.phone .tx small{font-size:12px!important;line-height:1.5}
.phone .tx .amount{font-size:14px!important;font-weight:500}
.phone .settings-header{justify-content:flex-start}

#home .top .home-tree{display:none}

/* Align nested home/details headers with standalone budget/manage headers. */
.layout>.phone>.app{padding-top:8px!important}
.layout>.phone>.app>.top-settings{top:8px!important}
.layout>.phone>.app>.panel>.top{height:44px;min-height:44px;margin-top:0!important;margin-bottom:24px!important}
.phone>header{height:44px;margin-top:8px!important;margin-bottom:24px!important}

.detail-view-toggle{display:grid;grid-template-columns:1fr 1fr;background:#F2EEE7;padding:4px;border-radius:13px;margin-bottom:18px;gap:4px}.detail-view-toggle button{border:0;background:none;border-radius:10px;padding:10px;color:#81786D;font-size:13px}.detail-view-toggle button[aria-pressed=true]{background:#76624F;color:white}.calendar-toolbar{display:grid;grid-template-columns:36px 1fr 36px auto;align-items:center;gap:4px;margin:22px 0 18px}.calendar-toolbar button{background:none;border:0;color:#76624F;min-height:40px;border-radius:10px;padding:4px;font-size:24px}.calendar-toolbar #calendar-month{font-size:17px;color:#34312D;font-weight:600}.calendar-toolbar #calendar-today{font-size:12px;background:#F2EEE7;padding:8px 10px;margin-left:5px}.calendar-weekdays,.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:3px}.calendar-weekdays{margin-bottom:8px;text-align:center;font-size:12px;color:#81786D}.calendar-weekdays span:first-child,.calendar-day.sunday{color:#AD7777}.calendar-weekdays span:last-child,.calendar-day.saturday{color:#8097A3}.calendar-day{min-height:52px;padding:6px 0;border:0;border-radius:12px;background:transparent;color:#34312D;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;font-size:14px}.calendar-day small{font-size:9px;color:#81786D;max-width:100%;overflow:hidden;white-space:nowrap}.calendar-day[aria-current=date]{box-shadow:inset 0 0 0 1px #BBAE9B}.calendar-day[aria-pressed=true]{background:#76624F;color:white!important}.calendar-day[aria-pressed=true] small{color:white}.calendar-day:active{background:#DCD0BA}.calendar-all{display:block;margin:12px 0 20px auto;border:0;background:none;font-size:12px;color:#76624F;padding:8px}.calendar-selection{display:flex;align-items:center;justify-content:space-between;gap:10px;border-top:1px solid #E6DFD5;padding-top:18px;margin-top:18px}.calendar-selection h3{font-size:15px;margin:0;font-weight:600}.calendar-selection>span{font-size:12px;color:#76624F}.calendar-record{text-decoration:none;color:#34312D}.calendar-empty{font-size:13px;color:#81786D;padding:16px 0;line-height:1.7}.calendar-picker{font-size:12px;color:#81786D;display:flex;align-items:center;gap:12px;margin-bottom:12px}.calendar-picker[hidden],#calendar-panel[hidden]{display:none!important}.calendar-picker input{min-width:0;width:100%;padding:8px;background:#F2EEE7;border:0;border-radius:10px}#calendar-filters{flex-wrap:wrap;gap:6px}#calendar-filters button{flex:0 1 auto!important;padding:8px 12px!important;font-size:12px}button:focus-visible{outline:2px solid #9D8872;outline-offset:2px}

.calendar-review{display:flex;align-items:center;gap:12px;padding:15px;border-radius:16px;background:#F2EEE7;color:#34312D;text-decoration:none;margin:0 0 22px;border:1px solid #E6DFD5}.review-icon{display:grid;place-items:center;width:38px;height:38px;background:#E5D8C5;border-radius:12px;flex-shrink:0;color:#76624F}.review-icon svg{width:23px;height:23px}.review-copy{flex:1;min-width:0}.review-copy strong{display:block;font-size:14px;font-weight:500}.review-copy small{display:block;font-size:11px;line-height:1.6;color:#81786D;margin-top:3px}.review-arrow{font-size:23px;color:#9A9084}.calendar-review:active{background:#EDE5D9}.calendar-review:focus-visible{outline:2px solid #9D8872;outline-offset:2px}.calendar-all{margin-bottom:10px}

/* Update notice is independent of the page header and settings button. */
#update-note{position:fixed;left:50%;bottom:calc(108px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);width:calc(100% - 32px);max-width:520px;box-sizing:border-box;z-index:115;display:flex!important;align-items:center;gap:10px;margin:0;padding:12px 14px;border:1px solid #DCD0BA;border-radius:16px;background:#F2EEE7;box-shadow:0 8px 24px #34312d12;font-size:12px}
#update-note button{float:none;flex-shrink:0;border-radius:10px;min-height:40px;padding:8px 12px;background:#76624F;color:white}
#update-note .update-dismiss{background:transparent;color:#81786D;font-size:20px;padding:6px}
body:has(#save-feedback:not([hidden])) #update-note{display:none!important}

.phone header .entry-notebook{display:flex;align-items:center;justify-content:flex-start;width:44px;height:44px;margin:0!important;color:#76624F}.entry-notebook svg{width:28px;height:28px;display:block}

#entry .field #memo{text-align:center!important}#entry .field #memo::placeholder{text-align:center}

.category-icon-options{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:8px;margin:12px 0 20px}.category-icon-choice{display:grid;place-items:center;padding:8px 0;border-radius:10px;border:2px solid transparent;background:#F2EEE7;color:#76624F;min-height:40px}.category-icon-choice svg{width:23px;height:23px}.category-icon-choice[aria-pressed=true]{border-color:#76624F;background:#DCD0BA}.category-preview-icon{display:grid;place-items:center;width:32px;height:32px;border-radius:10px;background:color-mix(in srgb,var(--color) 40%,#FAF7F0);color:#76624F;flex-shrink:0}.category-preview-icon svg{width:21px;height:21px}

/* A clear amount field without changing the rest of the entry layout. */
#entry .amount{margin:22px 0 20px;padding:18px 14px!important;border:1.5px solid #CDBDAA;border-radius:18px;background:#F2EEE7;gap:8px}
#entry .amount:focus-within{border-color:#76624F;box-shadow:0 0 0 3px #76624F12}
#entry .amount input{width:100%;min-width:0;font-size:36px!important;line-height:1.3;background:transparent!important;border:0;outline:none}
#entry .amount input::placeholder{color:#A99B8B;opacity:1}
#entry .amount>span{color:#76624F;font-size:24px}

/* Shared rounded close control for form dialogs. */
dialog{position:fixed}dialog .modal-close{position:absolute;right:16px;top:16px;width:38px;height:38px;padding:0;display:flex;align-items:center;justify-content:center;border:0;border-radius:13px;background:var(--theme-surface,#EDE7DD);color:var(--theme-accent,#76624F);cursor:pointer;transition:transform .12s}dialog .modal-close:active{transform:scale(.9)}dialog form>h2,dialog>h2{padding-right:40px;min-height:32px;display:flex;align-items:center}dialog .modal-close:focus-visible{outline:2px solid var(--theme-accent,#76624F);outline-offset:3px}

.quick-add-category{display:block;width:100%;margin:12px 0 20px;padding:12px;border:1px dashed var(--theme-accent,#76624F);border-radius:13px;background:var(--theme-surface,#EDE7DD);color:var(--theme-accent,#76624F);font:inherit;cursor:pointer}.quick-category-overlay{border:0;padding:0;margin:auto;width:100vw;max-width:none;height:100dvh;max-height:none;background:transparent}.quick-category-overlay iframe{width:100%;height:100%;border:0}.quick-category-overlay::backdrop{background:#34312D55}

.family-switch{width:50px;height:30px;border:0;border-radius:20px;background:var(--theme-card,#DCD0BA);padding:4px;flex-shrink:0;cursor:pointer}.family-switch span{display:block;width:22px;height:22px;border-radius:50%;background:white;box-shadow:0 1px 3px #0002;transition:transform .15s}.family-switch[aria-checked=true]{background:var(--theme-accent,#76624F)}.family-switch[aria-checked=true] span{transform:translateX(20px)}.budget-scope{display:flex;gap:5px;padding:5px;background:var(--theme-surface,#EDE7DD);border-radius:15px;margin:0 0 18px}.budget-scope[hidden],#personal-budget-content[hidden],#family-budget-content[hidden]{display:none}.budget-scope button{flex:1;border:0;padding:11px;border-radius:11px;color:var(--theme-accent,#76624F);background:transparent;font:inherit}.budget-scope button[aria-pressed=true]{background:var(--theme-accent,#76624F);color:white}.family-budget-card{background:var(--theme-card,#DCD0BA);border-radius:20px;padding:24px;margin:20px 0}.family-budget-card strong{display:block;font-size:32px;font-weight:500;margin:12px 0}.family-budget-card small{color:var(--theme-accent,#76624F)}

.monthly-budget-editor{background:var(--theme-card,#DCD0BA)!important;border-radius:20px;padding:18px 20px!important}.monthly-budget-editor label{color:var(--theme-accent,#76624F);font-size:13px}.monthly-budget-input{display:flex;align-items:center;gap:10px;border:1px solid var(--theme-card,#DCD0BA);background:var(--theme-bg,#FAF7F0);border-radius:14px;padding:12px 14px;margin-top:12px}.monthly-budget-input>span{font-size:25px;color:var(--theme-accent,#76624F)}.monthly-budget-input #total{flex:1;width:0;min-width:0;background:transparent!important;border:0!important;font-size:28px;text-align:left;padding:0;color:var(--theme-accent,#76624F)!important}.monthly-budget-input small{font-size:11px;white-space:nowrap;color:var(--theme-accent,#76624F)}.monthly-budget-input:focus-within{outline:2px solid var(--theme-accent,#76624F);outline-offset:2px}.monthly-budget-input #total:focus{outline:0}

.budget-scope{gap:12px;padding:0;background:transparent;border-radius:0}.budget-scope button{display:flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--theme-card,#DCD0BA);border-radius:18px;padding:15px;background:var(--theme-bg,#FAF7F0);color:var(--theme-accent,#76624F)}.budget-scope button[aria-pressed=true]{background:var(--theme-card,#DCD0BA);border-color:var(--theme-accent,#76624F);color:var(--theme-accent,#76624F)}.budget-scope svg{width:20px;height:20px;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round}

.detail-ledger-tabs{display:flex;gap:6px;padding:5px;background:var(--theme-surface,#EDE7DD);border-radius:15px;margin:0 0 16px}.detail-ledger-tabs[hidden]{display:none}.detail-ledger-tabs button{flex:1;border:0;border-radius:11px;padding:10px;background:transparent;color:var(--theme-accent,#76624F);font:inherit}.detail-ledger-tabs button[aria-pressed=true]{background:var(--theme-accent,#76624F);color:white}.record-ledger-label{display:inline-block;margin-left:7px;font-size:10px;font-weight:400;color:var(--theme-accent,#76624F);background:var(--theme-surface,#EDE7DD);border-radius:6px;padding:3px 5px;vertical-align:middle}

/* Rounded detail selector and recurring day picker */
.detail-ledger-tabs{gap:5px;border-radius:18px;padding:5px}.detail-ledger-tabs button{border-radius:12px;padding:12px;font-size:14px;transition:background .15s,color .15s}
.fixed-day-toggle{display:block;width:100%;padding:13px 16px;border:1px solid var(--theme-card,#DCD0BA);border-radius:14px;background:var(--theme-surface,#EDE7DD);color:var(--theme-accent,#76624F);font:inherit;text-align:center}.fixed-day-picker{margin:8px 0 14px;padding:14px;border-radius:18px;background:var(--theme-surface,#EDE7DD)}.fixed-day-picker[hidden]{display:none}.fixed-day-picker p{margin:0 0 12px;text-align:center;font-size:14px;color:var(--theme-accent,#76624F)}.fixed-day-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}.fixed-day-picker button{min-height:36px;border:0;border-radius:10px;background:var(--theme-bg,#FAF7F0);color:var(--theme-accent,#76624F);font:inherit;font-size:14px;padding:5px}.fixed-day-picker button[aria-pressed=true]{background:var(--theme-accent,#76624F);color:#fff}.fixed-day-options{display:flex;gap:8px;margin-top:10px}.fixed-day-options button{flex:1}.fixed-day-picker small{display:block;margin-top:10px;font-size:11px;line-height:1.5;color:var(--theme-accent,#76624F)}

#entry>.amount+#keypad{margin:12px 0 22px}
