:root{font-family:-apple-system,BlinkMacSystemFont,"Hiragino Sans","Yu Gothic",sans-serif;color:#172019;background:#f6f8f3;font-synthesis:none}*{box-sizing:border-box}body{margin:0;background:#f6f8f3}.app-shell{max-width:480px;min-height:100vh;margin:auto;padding:calc(18px + env(safe-area-inset-top)) 18px calc(88px + env(safe-area-inset-bottom))}.topbar{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:20px}.date{font-size:18px;font-weight:750}.top-actions{display:flex;align-items:center;gap:8px}.icon-button,.inbox{position:relative;border:1px solid #dfe6dc;background:#fff;color:#34483a;border-radius:999px;min-height:38px;padding:8px 12px;font:inherit}.icon-button{width:40px;padding:0}.notice-dot{position:absolute;right:4px;top:3px;width:8px;height:8px;border-radius:50%;background:#4e7a57}.inbox strong{font-variant-numeric:tabular-nums}.usable{background:#fff;border:1px solid #dfe6dc;border-radius:18px;padding:16px}.wallet-grid article{background:transparent;border:0;border-radius:0;padding:9px 4px 11px;border-bottom:1px solid #dfe6dc}.usable{display:grid;gap:6px}.usable strong{font-size:30px;letter-spacing:-.02em}.usable small,.convenience small{color:#6c786e;line-height:1.5}h2{font-size:15px;margin:26px 0 10px}.wallet-grid{display:grid;grid-template-columns:1fr 1fr;gap:10px}.wallet-grid article{display:grid;gap:8px}.wallet-grid strong{font-size:20px}.section-title{display:flex;align-items:end;justify-content:space-between}.section-title h2{margin-bottom:10px}.section-title strong{font-size:13px;color:#526657}.gauge{height:12px;background:#e2e8df;border-radius:999px;overflow:hidden;margin-bottom:8px}.gauge i{display:block;height:100%;background:#68866d;border-radius:inherit;transition:width .2s ease}nav{position:fixed;z-index:10;left:50%;bottom:0;transform:translateX(-50%);width:min(480px,100%);display:grid;grid-template-columns:repeat(4,1fr);padding:9px 12px calc(9px + env(safe-area-inset-bottom));background:rgba(255,255,255,.97);border-top:1px solid #dfe6dc}nav button{border:1px solid #dfe6dc;background:#f8faf7;border-radius:14px;min-height:48px;padding:9px 3px;color:#657168;font:inherit;font-size:13px;font-weight:650}nav button.active{border-color:#365f40;background:#365f40;color:#fff;font-weight:750}@media (prefers-reduced-motion:reduce){*{transition:none!important}}
.record-shell{padding-top:calc(12px + env(safe-area-inset-top))}.record-header{display:grid;grid-template-columns:42px 1fr 42px;align-items:center;margin-bottom:16px}.record-header h1{grid-column:2;text-align:center;font-size:20px;margin:0}.back{grid-column:1;border:0;background:transparent;font-size:36px;line-height:1;color:#274b31;padding:0}form{display:grid;gap:20px}fieldset{border:0;padding:0;margin:0}legend,.field>span{display:block;font-size:14px;font-weight:750;margin-bottom:9px}.choice-row,.choice-grid{display:grid;grid-auto-flow:column;grid-auto-columns:1fr;gap:8px}.choice-grid{grid-template-columns:1fr 1fr;grid-auto-flow:row}.choice{border:1px solid #d8e1d5;background:#fff;border-radius:13px;padding:12px 8px;min-height:46px;color:#34483a;font:inherit}.choice.selected{border-color:#5f8066;background:#edf4ec;color:#23442b;font-weight:750}.hint{display:block;color:#6c786e;margin-top:7px;line-height:1.45}.field{display:block}.amount-input{display:flex;align-items:center;background:#fff;border:1px solid #d8e1d5;border-radius:16px;padding:10px 14px}.amount-input span{font-size:24px}.amount-input input{width:100%;border:0;outline:0;background:transparent;text-align:right;font:inherit;font-size:30px;font-weight:750;color:#172019}.field textarea{width:100%;resize:none;border:1px solid #d8e1d5;border-radius:16px;background:#fff;padding:12px;font:inherit;color:#172019}.field small{font-weight:400;color:#6c786e}.reserved{display:flex;align-items:center;gap:9px;background:#fff;border:1px solid #d8e1d5;border-radius:14px;padding:13px}.reserved input{width:20px;height:20px;accent-color:#4e7a57}.save{border:0;border-radius:16px;background:#365f40;color:#fff;font:inherit;font-weight:750;min-height:54px}.form-error{min-height:20px;margin:-8px 0 -8px;color:#8a3f35;font-size:13px}.toast{position:fixed;left:50%;bottom:calc(82px + env(safe-area-inset-bottom));transform:translateX(-50%);background:#203d28;color:#fff;border-radius:999px;padding:10px 16px;font-size:14px}.empty-card{background:#fff;border:1px solid #dfe6dc;border-radius:18px;padding:20px;color:#6c786e}
.savings-shell{padding-bottom:92px}.saving-list{display:grid;gap:10px}.saving-card{width:100%;border:1px solid #dce7df;background:#fff;border-radius:16px;padding:15px;text-align:left;display:flex;justify-content:space-between;align-items:center;color:inherit}.saving-card span{display:grid;gap:4px}.saving-card small,.quiet,.transfer-summary small{color:#6c786f}.saving-card strong{font-size:18px}.saving-detail{background:#eef5ef;border-radius:20px;padding:20px;display:grid;gap:8px}.saving-detail>strong{font-size:32px}.saving-meta{display:grid;gap:6px;margin-top:8px;font-size:14px}.saving-actions{display:grid;grid-template-columns:1fr 1fr;gap:10px;margin-top:14px}.secondary{border:1px solid #b9cabc;background:#fff;border-radius:14px;padding:14px;font-weight:700}.transfer-summary{display:grid;gap:4px;background:#eef5ef;border-radius:16px;padding:15px;margin-bottom:16px}
.stepper{font-size:12px;text-align:center;color:#607267;margin-bottom:12px}.safety-card{border:1px solid #dbe6de;border-radius:16px;padding:14px;background:#f7faf7}.month-actions{display:flex;gap:10px;margin-top:18px}.month-actions .save{flex:1}.oneoff{display:grid;grid-template-columns:1fr 100px;gap:8px;margin:8px 0}.oneoff input{min-width:0;padding:10px;border:1px solid #ccd8cf;border-radius:10px}.oneoff input[type=date]{grid-column:1/-1}
.error-panel{margin:12px 0 0;border:1px solid #e0c9c4;background:#fff9f7;border-radius:16px;padding:14px;display:grid;gap:10px}.error-panel p{margin:0;color:#6f3d36;font-size:14px;line-height:1.5}.error-actions{display:grid;grid-template-columns:1fr 1fr;gap:8px}.error-actions button{min-height:44px;border-radius:12px;font:inherit;font-weight:700}.error-retry{border:0;background:#365f40;color:#fff}.error-details{border:1px solid #cdb9b5;background:#fff;color:#6f3d36}.error-report{white-space:pre-wrap;overflow-wrap:anywhere;background:#f4f5f2;border-radius:12px;padding:12px;font:12px/1.5 ui-monospace,SFMono-Regular,Menlo,monospace;color:#344039}.error-copy{border:1px solid #b9cabc;background:#fff;border-radius:12px;min-height:44px;font-weight:700}.copy-status{min-height:18px;color:#526657;font-size:12px}
.month-card{display:grid;gap:14px;background:#fff;border:1px solid #dfe6dc;border-radius:18px;padding:16px}.month-card h2{margin:0}.month-summary,.allocation-list{display:grid;gap:7px;font-size:14px;color:#526657}.allocation-list span{display:flex;justify-content:space-between;gap:12px}.full{width:100%}.review-note{margin:0;border-radius:12px;background:#eef4ed;padding:11px;color:#425c49;font-size:13px;line-height:1.5}.adjustment-list{display:grid;gap:10px;border-top:1px solid #e2e8df;padding-top:14px}.adjustment-list h2{font-size:14px}.adjustment-card{display:grid;grid-template-columns:1fr 100px;gap:10px;align-items:center;border:1px solid #dce7df;border-radius:14px;padding:12px}.adjustment-card>span{display:grid;gap:4px;min-width:0}.adjustment-card small{color:#6c786f;font-size:11px;line-height:1.4}.compact-amount{display:flex;align-items:center;border:1px solid #d8e1d5;border-radius:11px;padding:8px;background:#fff}.compact-amount input{width:100%;min-width:0;border:0;outline:0;text-align:right;font:inherit;font-weight:700}.usable-preview>strong,.final-month strong{font-size:32px}.final-month{display:grid;gap:6px}.final-month span{color:#526657}
.setup-shell{padding-top:max(56px,calc(28px + env(safe-area-inset-top)));padding-bottom:calc(34px + env(safe-area-inset-bottom))}.setup-header{display:flex;align-items:flex-start;justify-content:space-between;gap:14px;margin-bottom:18px}.setup-header h1{font-size:24px;margin:3px 0 0}.setup-kicker{font-size:12px;color:#607267;font-weight:750;letter-spacing:.04em}.setup-header .stepper{margin:5px 0 0;white-space:nowrap}.setup-card{display:grid;gap:14px;background:#fff;border:1px solid #dfe6dc;border-radius:18px;padding:16px}.setup-card h2{margin:0;font-size:17px}.setup-card .quiet{margin:0;line-height:1.55}.setup-grid,.setup-stack{display:grid;gap:12px}.plain-input,.day-input{width:100%;border:1px solid #d8e1d5;border-radius:14px;background:#fff;padding:12px;font:inherit;color:#172019}.day-input{display:flex;align-items:center;gap:8px}.day-input input{width:100%;border:0;outline:0;background:transparent;font:inherit;text-align:right}.fixed-edit-card,.short-edit-card{display:grid;gap:12px;border:1px solid #dce7df;border-radius:16px;padding:14px;background:#fafcf9}.fixed-edit-head,.short-edit-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.text-button{border:0;background:transparent;color:#607267;font:inherit;font-size:13px;padding:4px}.mini-toggle{display:flex;align-items:center;gap:6px;font-size:12px;color:#526657}.mini-toggle input{accent-color:#4e7a57}.short-edit-grid{display:grid;gap:10px}.empty-card.compact{padding:14px;font-size:13px}.setup-summary{display:grid;grid-template-columns:1fr 1fr;gap:8px}.setup-summary span{display:grid;gap:3px;border:1px solid #e1e8df;border-radius:12px;padding:11px;color:#607267;font-size:12px}.setup-summary b{color:#263d2d;font-size:14px}.observation-note{border-radius:16px;background:#eef4ed;padding:14px;color:#425c49}.observation-note p{margin:7px 0 0;font-size:13px;line-height:1.55}.setup-start{gap:16px}@media(min-width:420px){.setup-grid{grid-template-columns:1fr 1fr}.setup-grid .field:last-child:nth-child(odd){grid-column:1/-1}.short-edit-grid{grid-template-columns:1fr 1fr}.short-edit-grid .field:last-child{grid-column:1/-1}}
.history-link{border:1px solid #dfe6dc;background:#fff;color:#34483a;border-radius:999px;min-height:38px;padding:8px 10px;font:inherit;font-size:13px}.history-shell{padding-bottom:92px}.history-note{margin:0 0 14px;line-height:1.55}.history-list{display:grid;gap:9px}.history-card{width:100%;border:1px solid #dce7df;background:#fff;border-radius:16px;padding:14px;display:flex;align-items:center;justify-content:space-between;gap:14px;text-align:left;color:inherit}.history-main{display:grid;gap:3px;min-width:0}.history-main small{color:#6c786f;font-size:11px}.history-main b{font-size:15px}.history-main em{font-style:normal;color:#657168;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:270px}.history-card strong{font-size:17px;white-space:nowrap}.history-impact{margin:0;border-radius:12px;background:#eef4ed;padding:11px;color:#425c49;font-size:12px;line-height:1.55}.history-impact.past{background:#f3f4f1;color:#68706a}.text-danger{border:0;background:transparent;color:#8a3f35;font:inherit;font-size:13px;padding:10px 4px}.delete-confirm{display:grid;gap:9px;border:1px solid #e0c9c4;background:#fff9f7;border-radius:14px;padding:13px}.delete-confirm p{margin:0;color:#6f3d36;font-size:12px}.delete-confirm>div{display:grid;grid-template-columns:1fr 1fr;gap:8px}.delete-final{border:0;border-radius:14px;background:#8a3f35;color:#fff;font:inherit;font-weight:700;min-height:46px}@media(max-width:360px){.top-actions{gap:5px}.history-link,.inbox{padding-left:8px;padding-right:8px;font-size:12px}.date{font-size:16px}}
.later-list{display:grid;gap:9px;margin-top:14px}.inbox-add{margin-bottom:14px}.later-card{width:100%;border:1px solid #dce7df;background:#fff;border-radius:16px;padding:14px;display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left;color:inherit}.later-main{display:grid;gap:4px;min-width:0}.later-main small{color:#6c786f;font-size:11px}.later-main b{font-size:18px}.later-main em{font-style:normal;color:#657168;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:300px}.later-arrow{font-size:28px;line-height:1;color:#6c786f}.later-note{margin:0;line-height:1.55}.receipt-summary{display:grid;gap:5px;border-radius:16px;background:#eef4ed;padding:14px;color:#425c49}.receipt-summary span{font-size:12px;color:#607267}.receipt-summary b{font-size:15px}
.record-fixed{margin-bottom:22px}.record-section-head{display:flex;align-items:center;justify-content:space-between;gap:12px}.record-section-head h2{margin:0 0 9px}.fixed-mini-list,.fixed-list{display:grid;gap:9px}.fixed-mini-card{display:flex;align-items:center;justify-content:space-between;gap:10px;border:1px solid #dce7df;background:#fff;border-radius:14px;padding:12px}.fixed-mini-card>span{display:grid;gap:3px;min-width:0}.fixed-mini-card small{color:#6c786f;font-size:11px}.mini-action{border:1px solid #b9cabc;background:#fff;border-radius:11px;padding:9px 11px;font:inherit;font-size:12px;font-weight:700;color:#365f40;white-space:nowrap}.fixed-mini-status{font-size:11px;color:#6c786f;white-space:nowrap}.fixed-mini-status.done{color:#4e7a57}.fixed-list{margin-top:14px}.fixed-card{border:1px solid #dce7df;background:#fff;border-radius:16px;padding:12px;display:grid;gap:10px}.fixed-card.inactive{opacity:.65}.fixed-card-main{border:0;background:transparent;padding:2px;display:flex;align-items:center;justify-content:space-between;gap:12px;text-align:left;color:inherit}.fixed-card-main>span{display:grid;gap:4px;min-width:0}.fixed-card-main small{color:#6c786f;font-size:11px}.fixed-status{font-style:normal;font-size:11px;color:#6c786f;white-space:nowrap}.fixed-status.due{color:#6b4d24;font-weight:750}.fixed-status.done{color:#4e7a57;font-weight:750}.fixed-record-button{padding:10px 12px}.field .plain-input{display:block}.field>span small{font-weight:400;color:#6c786f}
.home-goal{margin-top:22px}.home-goal .section-title h2{margin-top:0}.home-goal .section-title strong{font-size:12px;font-weight:650;color:#607267}.home-progress{height:9px;background:#e3e9e1;border-radius:999px;overflow:hidden}.home-progress i{display:block;height:100%;background:#6f8a72;border-radius:inherit;transition:width .2s ease}.home-flowers{display:flex;justify-content:space-between;max-width:190px;margin-top:9px;font-size:15px;letter-spacing:.05em}.home-flowers span{color:#cbd5ca}.home-flowers span.bloomed{color:#58745e}.gauge-yellow i{background:#a59a55}.gauge-orange i{background:#ad7950}.gauge-red i{background:#9b6258}.usable small{display:block}.convenience{margin-top:4px}

/* UX polish */
button,input,textarea{touch-action:manipulation}
button:disabled{opacity:.58;cursor:default}
.record-shell form>.save{position:static;box-shadow:none}
.amount-input input,.compact-amount input{font-variant-numeric:tabular-nums}
input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=hidden]),textarea{scroll-margin-top:64px;scroll-margin-bottom:24px}
.moss-toast{z-index:40;opacity:0;pointer-events:none;transform:translate(-50%,8px);transition:opacity .18s ease,transform .18s ease;box-shadow:0 8px 24px rgba(21,46,29,.2);white-space:nowrap}
.moss-toast.show{opacity:1;transform:translate(-50%,0)}
@media(max-width:360px){.moss-toast{max-width:calc(100vw - 28px);white-space:normal;text-align:center}}


/* UX finish: quiet summaries and final navigation */
.header-text-button{grid-column:3;justify-self:end;border:0;background:transparent;color:#365f40;font:inherit;font-size:13px;font-weight:700;padding:8px 0}
.summary-shell{display:grid;align-content:start;gap:14px}
.summary-shell .record-header{margin-bottom:0}
.summary-shell .history-note{margin-bottom:0}
.summary-card{display:grid;gap:14px;background:#fff;border:1px solid #dfe6dc;border-radius:18px;padding:16px}
.summary-card-head{display:flex;justify-content:space-between;align-items:baseline;gap:12px}
.summary-card-head>span{font-weight:750;color:#263d2d}
.summary-card-head small{color:#6c786f;text-align:right;line-height:1.4}
.summary-total{display:grid;grid-template-columns:1fr auto;align-items:end;gap:3px 12px;border-radius:14px;background:#eef4ed;padding:13px}
.summary-total>span{font-size:12px;color:#607267}
.summary-total>strong{grid-row:1/3;grid-column:2;font-size:24px}
.summary-total>small{font-size:11px;color:#6c786f}
.summary-breakdown{display:grid;gap:9px}
.summary-row{display:flex;justify-content:space-between;gap:12px;font-size:14px;color:#526657}
.summary-row strong{color:#263d2d;font-variant-numeric:tabular-nums}
.summary-row.separated{border-top:1px solid #e3e9e1;padding-top:9px;margin-top:2px}
.summary-note{margin:0;font-size:11px;line-height:1.55}

/* v0.12.1 iPhone実機調整 */
.short-edit-grid,.short-edit-grid .field{min-width:0}
.plain-input[type="date"],.setup-date-input{display:block;width:100%;min-width:0;max-width:100%}
.fixed-confirmed-card{background:#f5f8f3}
.fixed-confirmed-card .fixed-edit-head>span{display:grid;gap:4px;min-width:0}
.fixed-confirmed-card small{color:#607267;font-size:12px;font-weight:400}
.fixed-confirmed-actions{display:flex;align-items:center;justify-content:flex-end;gap:8px;flex-wrap:wrap}
.fixed-confirmed-mark{font-size:12px;color:#4e7a57;font-weight:750}
.setup-confirm{width:100%}
@media(max-width:419px){.short-edit-card{min-width:0;overflow:hidden}.short-edit-grid{width:100%}}

/* v0.12.1 実機UX: 入力内容に合わせた幅と軽いトグル */
.field-fit{width:100%}
.input-name-wide{width:100%}
.amount-input-compact{width:min(100%,240px)}
.day-input-compact{width:min(100%,128px)}
.setup-inline-toggle{display:inline-flex;align-items:center;gap:7px;width:max-content;max-width:100%;padding:2px 0;border:0;background:transparent;color:#526657;font-size:13px}
.setup-inline-toggle input{width:18px;height:18px;margin:0;accent-color:#4e7a57}
.setup-date-input{width:min(100%,210px)!important;inline-size:min(100%,210px);min-inline-size:0;max-inline-size:100%;-webkit-appearance:none;appearance:none}
.short-edit-grid .setup-date-input{justify-self:start}
@media(max-width:360px){.amount-input-compact{width:min(100%,220px)}.setup-date-input{width:min(100%,190px)!important;inline-size:min(100%,190px)}}

/* v0.12.2a 記録スピードUX */
#expense-form{gap:18px}
.record-amount-first{margin-bottom:2px}
.record-amount-first .amount-input{border-color:#b9cabc}
.wallet-choice-grid{grid-template-columns:1fr 1fr}
.memo-fold{border:0;margin:0}
.memo-fold summary{width:max-content;max-width:100%;cursor:pointer;color:#526657;font-size:13px;font-weight:700;padding:7px 0;list-style:none}
.memo-fold summary::-webkit-details-marker{display:none}
.memo-fold summary::before{content:"＋ ";color:#365f40}
.memo-fold[open] summary::before{content:"− ";}
.memo-fold summary small{font-weight:400;color:#7a857c}
.memo-fold textarea{width:100%;resize:none;border:1px solid #d8e1d5;border-radius:14px;background:#fff;padding:11px;font:inherit;color:#172019;margin-top:6px}
.record-after-form{margin-top:28px;margin-bottom:8px;padding-top:18px;border-top:1px solid #dfe6dc}

/* Quick expense entry: one-screen everyday flow on iPhone once the keyboard is closed. */
.quick-record-shell{padding-top:calc(4px + env(safe-area-inset-top));padding-left:12px;padding-right:12px;padding-bottom:calc(76px + env(safe-area-inset-bottom))}
.quick-record-shell .record-header{margin-bottom:4px;grid-template-columns:34px 1fr 34px}
.quick-record-shell .record-header h1{font-size:18px}
.quick-record-shell .record-header .back{font-size:30px}
.quick-record-shell #expense-form{gap:7px}
.quick-record-shell #expense-form legend,.quick-record-shell #expense-form .field>span{font-size:12px;margin-bottom:4px}
.quick-record-shell #expense-form .amount-input{min-height:54px;padding:7px 12px;border-radius:14px}
.quick-record-shell #expense-form .amount-input span{font-size:23px}
.quick-record-shell #expense-form .amount-input input{font-size:29px}
.quick-record-shell #expense-form .choice-grid,.quick-record-shell #expense-form .choice-row{gap:5px}
.quick-record-shell #expense-form .wallet-choice-grid{grid-template-columns:repeat(4,minmax(0,1fr));grid-auto-flow:row}
.quick-record-shell #expense-form .category-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr));grid-auto-flow:row}
.quick-record-shell #expense-form .choice{min-height:44px;padding:6px 2px;border-radius:11px;font-size:clamp(11px,3.1vw,13px);line-height:1.15;white-space:nowrap}
.quick-record-shell #expense-form .hint{margin-top:3px;font-size:10.5px;line-height:1.25}
.quick-record-shell #expense-form .memo-fold summary{padding:2px 0;font-size:12px}
.quick-record-shell #expense-form .memo-fold textarea{margin-top:3px;padding:8px}
.quick-record-shell #expense-form .form-error:empty{display:none}
.quick-record-shell #expense-form>.save{min-height:46px;border-radius:13px;margin-top:1px}



/* v0.12.2e one-hand reach + compact Home */
.quick-record-shell #expense-form{padding-top:28px}
.quick-record-shell #expense-form .category-choice-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
.quick-record-shell #expense-form .record-category-slot{min-height:112px}
.quick-record-shell #expense-form .coop-direct-entry{min-height:93px;display:flex;align-items:center;justify-content:center;border:1px solid #d8e1d5;border-radius:12px;background:#f8faf6;color:#526657;font-size:13px;font-weight:700;text-align:center;padding:10px}

.home-shell{padding-top:calc(10px + env(safe-area-inset-top));padding-bottom:calc(78px + env(safe-area-inset-bottom))}
.home-shell .topbar{margin-bottom:10px}
.home-shell .usable{padding:12px 14px;gap:3px}
.home-shell .usable strong{font-size:26px}
.home-shell .usable small{line-height:1.35;font-size:12px}
.home-shell h2{margin:16px 0 7px}
.home-shell .wallet-grid{gap:6px 10px}
.home-shell .wallet-grid article{gap:3px;padding:5px 4px 7px}
.home-shell .wallet-grid strong{font-size:18px}
.home-shell .convenience{margin-top:0}
.home-shell .gauge{height:10px;margin-bottom:5px}
.home-shell .convenience small{font-size:12px}
.home-shell .home-goal{margin-top:12px}
.home-shell .home-progress{height:8px}
.home-shell .home-flowers{margin-top:5px;font-size:14px}
.home-shell .section-title h2{margin-bottom:7px}
@media(max-height:760px){
  .quick-record-shell #expense-form{padding-top:18px}
  .home-shell .usable{padding:10px 12px}
  .home-shell h2{margin-top:13px}
}

/* v0.12.3a short-term setup + compact setup finish */
.setup-empty-text{margin:0;color:#6c786f;font-size:13px;line-height:1.45}
.setup-short-step{gap:12px}
.setup-short-card{display:grid;gap:10px;border:1px solid #dce7df;border-radius:16px;padding:12px;background:#fafcf9}
.setup-short-card.inactive{opacity:.68}
.setup-short-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.setup-short-overview{display:grid;grid-template-columns:1.1fr 1fr;gap:7px 12px;padding-top:2px}
.setup-short-overview>span{display:grid;gap:2px;min-width:0}
.setup-short-overview>span:first-child{grid-row:1/3}
.setup-short-overview small{font-size:10px;color:#718078}
.setup-short-overview strong{font-size:20px;color:#263d2d}
.setup-short-overview b{font-size:12px;color:#526657;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.setup-short-details{border-top:1px solid #e3e9e1;padding-top:8px}
.setup-short-details summary{cursor:pointer;list-style:none;color:#365f40;font-size:12px;font-weight:750;padding:3px 0}
.setup-short-details summary::-webkit-details-marker{display:none}
.setup-short-details summary::before{content:"＋ ";}
.setup-short-details[open] summary::before{content:"− ";}
.setup-short-details .short-edit-grid{margin-top:10px}
.setup-long-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}
.setup-long-grid .field{min-width:0}
.setup-long-grid .amount-input-compact{width:100%;padding:8px 10px;min-height:50px}
.setup-long-grid .amount-input-compact span{font-size:20px}
.setup-long-grid .amount-input-compact input{font-size:22px;min-width:0}
.setup-long-grid .field>span{font-size:12px;margin-bottom:5px}
.setup-long-card{gap:12px}
.setup-long-card .quiet{font-size:12px;line-height:1.45}
.setup-step-4,.setup-step-5{padding-top:max(38px,calc(18px + env(safe-area-inset-top)))}
.setup-step-4 .setup-header,.setup-step-5 .setup-header{margin-bottom:12px}
.setup-step-5 .setup-start{gap:12px}
.setup-step-5 .setup-summary span{padding:9px}
.setup-step-5 .observation-note{padding:12px}
.setup-step-5 .observation-note p{font-size:12px;line-height:1.45;margin-top:5px}
.short-saving-card{display:grid;gap:8px;align-items:stretch}
.short-saving-card.inactive{opacity:.68}
.short-saving-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.short-saving-head em{font-style:normal;font-size:11px;color:#607267}
.short-saving-guide{display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.short-saving-guide span{font-size:11px;color:#6c786f}
.short-saving-guide strong{font-size:18px}
.short-saving-meta{display:flex;justify-content:space-between;gap:10px;flex-wrap:wrap;font-size:10.5px;color:#6c786f}
.short-saving-detail .saving-meta{gap:8px}
@media(max-width:360px){.setup-short-overview{grid-template-columns:1fr 1fr}.setup-short-overview strong{font-size:18px}.setup-long-grid{gap:8px}.setup-long-grid .amount-input-compact input{font-size:20px}}

/* v0.12.4a short-term fixed monthly contribution */
input:not([type=checkbox]):not([type=radio]):not([type=button]):not([type=submit]):not([type=reset]):not([type=hidden]),textarea{scroll-margin-top:64px;scroll-margin-bottom:24px}


/* v0.12.4a short-term fixed monthly contribution */
.setup-short-head-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.setup-short-confirmed{font-size:13px;font-weight:800;color:var(--moss,#44684a);white-space:nowrap}
.setup-short-confirmed.pending{color:#8a6b2d}
.setup-short-confirm{margin-top:14px;width:100%;min-height:50px}
.setup-short-card.confirmed{border-color:rgba(68,104,74,.34)}

.record-header{grid-template-columns:88px 1fr 88px}
.back-label{width:auto;min-height:44px;font-size:13px;font-weight:750;white-space:nowrap;text-align:left;padding:8px 0}
.back-spacer{grid-column:1;min-height:44px}
.saving-detail-shell{min-height:calc(100vh - env(safe-area-inset-top) - 16px);display:flex;flex-direction:column}
.saving-detail-shell .saving-actions{flex:0 0 auto}
.detail-return{margin-top:auto;margin-bottom:12px;align-self:flex-start;width:auto;min-width:138px}


/* v0.12.5d record touch ergonomics */
.quick-record-shell{padding-bottom:calc(70px + env(safe-area-inset-bottom))}
.quick-record-shell .record-header{grid-template-columns:72px 1fr 72px;margin-bottom:6px}
.quick-record-shell .record-header .back.back-label{font-size:14px;line-height:1.2;min-height:44px;width:auto;padding:8px 0}
.quick-record-shell #expense-form{gap:10px;padding-top:34px}
.quick-record-shell #expense-form legend,.quick-record-shell #expense-form .field>span{font-size:13px;margin-bottom:5px}
.quick-record-shell #expense-form .amount-input{min-height:64px;padding:10px 14px;border:1.5px solid #afc0b2;border-radius:15px}
.quick-record-shell #expense-form .amount-input span{font-size:25px}
.quick-record-shell #expense-form .amount-input input{font-size:32px}
.quick-record-shell #expense-form .choice-grid,.quick-record-shell #expense-form .choice-row{gap:7px}
.quick-record-shell #expense-form .choice{min-height:50px;padding:8px 4px;border:1.5px solid #b8c7ba;border-radius:12px;font-size:clamp(12px,3.4vw,14px)}
.quick-record-shell #expense-form .choice.selected{border:2px solid #4f7257;background:#eaf2e9;color:#23442b}
.quick-record-shell #expense-form .record-category-slot{min-height:121px}
.quick-record-shell #expense-form .coop-direct-entry{min-height:107px;border:1.5px solid #b8c7ba;border-radius:12px}
.quick-record-shell #expense-form .memo-fold summary{padding:4px 0;font-size:13px}
.quick-record-shell #expense-form>.save{min-height:56px;border-radius:14px;margin-top:3px;margin-bottom:0}
nav button{border-width:1.5px;border-color:#c1cdc2}
nav button.active{border-width:2px;border-color:#365f40}
@media(max-height:760px){
  .quick-record-shell #expense-form{padding-top:24px;gap:8px}
  .quick-record-shell #expense-form .amount-input{min-height:60px}
  .quick-record-shell #expense-form .choice{min-height:48px}
  .quick-record-shell #expense-form .record-category-slot{min-height:115px}
}


/* v0.12.5f: shared iPhone viewport containment for every route.
   Never freeze the document for long lists or when the keyboard is shown. */
html {
  width:100%;
  max-width:100%;
  overflow-x:hidden; /* fallback for browsers without clip */
  overflow-x:clip;
  overscroll-behavior-x:none;
  overscroll-behavior-y:none;
}
body {
  width:100%;
  max-width:100%;
  min-width:0;
  overflow-x:hidden;
  overflow-x:clip;
  overscroll-behavior-x:none;
  overscroll-behavior-y:none;
  -webkit-text-size-adjust:100%;
}
#root {
  width:100%;
  max-width:100%;
  min-width:0;
  overflow-x:clip;
}
.app-shell {
  width:100%;
  min-width:0;
  min-height:100svh; /* 100vh includes Safari's browser bars, causing ghost scrolling */
  touch-action:pan-y pinch-zoom;
}
.app-shell > *,
.app-shell fieldset,
.app-shell form,
.app-shell .field,
.app-shell .amount-input,
.app-shell .choice,
.app-shell .month-card,
.app-shell .record-header,
.app-shell .topbar,
.app-shell .setup-card,
.app-shell .oneoff,
.app-shell .adjustment-card { min-width:0; max-width:100%; }
.app-shell .amount-input input,
.app-shell .compact-amount input,
.app-shell .plain-input,
.app-shell input[type=date],
.app-shell .oneoff input { min-width:0; max-width:100%; }
.app-shell .oneoff,
.app-shell .adjustment-card { grid-template-columns:minmax(0,1fr) minmax(0,100px); }
.app-shell .allocation-list span,
.app-shell .month-summary,
.app-shell .receipt-summary,
.app-shell .quiet { overflow-wrap:anywhere; }
.later-empty {
  margin:2px 0;
  padding:4px 0;
  color:#6c786f;
  font-size:14px;
  line-height:1.5;
}
/* When an entire screen fits, lock its document scroll, not the entire UI.
   All pages are tested at runtime; keyboard and expanded controls remain scrollable. */
html.moss-page-static,
html.moss-page-static body { overflow-y:hidden; overscroll-behavior-y:none; }


/* v0.12.5g: the savings overview is a long list. Let it coast with iOS native
   momentum instead of making the entire document act as its scroll surface.
   Only the overview is affected; savings details and other pages stay as-is. */
.savings-shell:not(.saving-detail-shell) {
  height: 100svh;
  min-height: 0;
  overflow-y: auto;
  overflow-x: clip;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  touch-action: pan-y;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}
