:root{--bg:#fff9f2;--paper:#fff;--paper-warm:#fffcf8;--ink:#31271d;--muted:#8e8276;--line:#f0e4d5;--orange:#e67b19;--orange-dark:#b85807;--light:#fff0dc;--red:#c85141;--green:#24825b;--shadow:0 8px 32px rgba(118,73,33,.065);font-family:-apple-system,BlinkMacSystemFont,"Hiragino Kaku Gothic ProN","Yu Gothic",Meiryo,sans-serif;color:var(--ink);background:var(--bg);font-synthesis:none}
*{box-sizing:border-box}html{-webkit-tap-highlight-color:transparent;scroll-behavior:auto}body{margin:0;min-height:100svh}button,input,select,textarea{font:inherit}button{cursor:pointer}button:disabled{opacity:.45;cursor:not-allowed}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:3px solid #ffc478;outline-offset:2px}button{border:0}input,textarea,select{width:100%;background:white;border:1px solid #e7d9c9;border-radius:13px;color:var(--ink);padding:12px 13px;font-size:15px;min-height:46px}textarea{line-height:1.65;resize:none;min-height:80px;overflow:auto}input[type="file"]{padding:10px}input[type="range"]{padding:0;height:25px;accent-color:var(--orange)}input[type="checkbox"]{width:auto;min-height:auto;accent-color:var(--orange)}label{display:block;font-weight:700;font-size:13px;margin-bottom:6px;color:#66574a}h1,h2,h3,p{margin:0}h1{font-size:23px;font-weight:900;letter-spacing:-.05em}h2{font-size:20px;font-weight:900;letter-spacing:-.035em}h3{font-size:16px;font-weight:850}.app-shell{max-width:960px;padding:18px 16px calc(113px + env(safe-area-inset-bottom));margin:0 auto;min-height:100svh}.masthead{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:22px}.logo{display:flex;align-items:center;gap:10px;min-width:0}.logo-icon{width:48px;height:48px;background:linear-gradient(155deg,#ffe0af,#fff3df);border-radius:17px;display:grid;place-items:center;font-size:26px;box-shadow:0 7px 18px #eda95b27;flex-shrink:0}.logo-title{font-size:23px;letter-spacing:-.065em;font-weight:900;color:#4d3020}.logo-sub{font-size:10px;letter-spacing:.04em;color:#ae8a68;font-weight:800;margin-top:2px}.pill{display:inline-flex;align-items:center;gap:5px;background:#fff;border:1px solid var(--line);border-radius:999px;padding:8px 10px;color:#a07048;font-size:11px;font-weight:800;white-space:nowrap}.eyebrow{font-size:11px;color:var(--orange-dark);font-weight:850;letter-spacing:.07em;margin-bottom:8px}.section{margin-bottom:23px}.section-head{display:flex;align-items:baseline;justify-content:space-between;margin-bottom:12px;gap:9px}.section-head .muted{font-size:12px}.card{background:var(--paper);border:1px solid var(--line);border-radius:21px;box-shadow:var(--shadow);padding:18px}.card+.card{margin-top:12px}.panel{background:var(--paper-warm);border:1px solid var(--line);border-radius:16px;padding:14px}.row{display:flex;gap:11px;align-items:center}.row-between{display:flex;gap:10px;align-items:center;justify-content:space-between}.stack{display:flex;flex-direction:column;gap:12px}.muted{color:var(--muted)}.small{font-size:12px}.mini{font-size:11px}.strong{font-weight:800}.orange{color:var(--orange-dark)}.green{color:var(--green)}.danger-text{color:var(--red)}.divider{height:1px;background:var(--line);margin:12px 0}.btn{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:45px;padding:11px 15px;border-radius:13px;font-size:14px;font-weight:850;white-space:normal;text-align:center;transition:transform .12s,background .15s}.btn:active{transform:scale(.985)}.primary{background:var(--orange);color:#fff;box-shadow:0 5px 13px #e67b1927}.secondary{background:var(--light);color:var(--orange-dark)}.outline{background:#fff;color:var(--orange-dark);border:1px solid #eed1b0}.neutral{background:#f7f4f0;color:#615c55}.destructive{color:#b64032;background:#fff6f4;border:1px solid #f4c8c0}.full{width:100%}.back{display:inline-flex;align-items:center;gap:6px;font-size:14px;color:var(--orange-dark);background:none;font-weight:800;padding:8px 6px 8px 0;margin-bottom:18px}.header-title{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-bottom:16px}.empty{border:1.5px dashed #edccaa;border-radius:18px;padding:27px 20px;text-align:center;background:#fffdf9;color:#8e7360}.empty p{line-height:1.65;margin:7px 0 15px;font-size:13px}.hero{background:linear-gradient(135deg,#ffddab,#fff1dc 83%);border:1px solid #ffdfb6;border-radius:24px;padding:20px;position:relative;overflow:hidden;margin-bottom:22px}.hero:after{content:'✦';position:absolute;font-size:80px;right:14px;top:-12px;color:#ffffff78}.hero .caption{font-size:13px;color:#986237;font-weight:800;position:relative;z-index:1}.hero .big{font-size:39px;letter-spacing:-.07em;font-weight:900;color:#8e420f;margin:4px 0 12px;position:relative;z-index:1;word-break:break-word}.hero .big small{font-size:21px;margin-left:4px}.hero-bottom{display:flex;gap:8px;flex-wrap:wrap;position:relative;z-index:1}.hero .hero-chip{background:#fff9;padding:7px 10px;border-radius:12px;color:#955d2e;font-size:12px;font-weight:800}.kids-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(125px,1fr));gap:10px}.kid-card{border:1px solid var(--line);background:#fff;border-radius:20px;box-shadow:var(--shadow);padding:14px 10px;display:flex;flex-direction:column;align-items:center;gap:8px;min-height:157px}.kid-card .kid-name{font-weight:850;max-width:100%;overflow-wrap:anywhere}.kid-card .money{font-weight:900;font-size:20px;color:var(--orange-dark)}.avatar{display:grid;place-items:center;overflow:hidden;border-radius:50%;width:60px;height:60px;background:linear-gradient(145deg,#ffe0b3,#ffeddc);border:3px solid #fff;box-shadow:0 0 0 1px #f5d2a7;font-size:29px;flex-shrink:0}.avatar img{display:block;width:100%;height:100%;object-fit:cover}.avatar.sm{width:42px;height:42px;font-size:22px}.avatar.xs{width:28px;height:28px;font-size:14px;border-width:1px}.actions-grid{display:grid;grid-template-columns:repeat(2,1fr);gap:10px}.action-tile{background:white;border:1px solid var(--line);border-radius:17px;padding:16px 12px;display:flex;align-items:center;gap:10px;font-weight:850;text-align:left;box-shadow:var(--shadow);min-height:67px}.action-tile .symbol{font-size:25px}.action-tile:last-child:nth-child(odd){grid-column:1/-1}.list{display:flex;flex-direction:column;gap:8px}.entry{display:flex;width:100%;text-align:left;align-items:center;gap:11px;padding:12px;background:#fff;border:1px solid var(--line);border-radius:15px;min-width:0}.entry-icon{display:grid;place-items:center;background:#fff0dc;border-radius:12px;width:40px;height:40px;font-size:20px;flex-shrink:0}.entry-main{flex:1;min-width:0}.entry-title{font-weight:800;font-size:14px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.entry-sub{font-size:11px;color:var(--muted);margin-top:3px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.entry-money{font-size:16px;font-weight:900;white-space:nowrap}.entry-money.minus{color:#b65d45}.entry-money.plus{color:var(--orange-dark)}.page-title{font-size:22px;margin-bottom:6px}.info-kid{display:flex;align-items:center;gap:13px}.info-kid .sum{font-size:29px;font-weight:900;color:var(--orange-dark)}.form-group{margin-bottom:15px}.form-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px}.hint{color:#938679;font-size:12px;line-height:1.6;margin-top:6px}.count{font-size:12px;color:var(--orange-dark);text-align:right;margin-top:6px}.count.full-count{font-weight:900;color:#a34b03}.limit-msg{font-size:12px;color:#ab5508;font-weight:850;margin-top:5px}.memo-collapsed{width:100%;text-align:left;display:block;background:#fffcf7;border:1px solid #ebd3b6;border-radius:14px;padding:12px}.memo-collapsed-top{display:flex;gap:9px;align-items:center;justify-content:space-between;color:#995510;font-weight:800;font-size:13px}.memo-preview{white-space:pre;overflow:hidden;text-overflow:ellipsis;color:#6f6055;font-size:13px;display:block;margin-top:7px;max-width:100%}.memo-open{background:#fffcf7;border:1px solid #ebd3b6;border-radius:14px;padding:12px}.memo-label{display:flex;align-items:center;justify-content:space-between;gap:9px;margin-bottom:9px}.memo-label strong{font-size:13px;color:#92500c}.memo-textarea{display:block;line-height:1.6;min-height:84px;max-height:180px;overflow-y:auto;resize:none}.button-row{display:flex;gap:9px}.button-row>*{flex:1;min-width:0}.tabbar{position:fixed;z-index:40;bottom:0;left:0;right:0;border-top:1px solid var(--line);background:#fffcf9f2;backdrop-filter:blur(16px);padding:7px max(12px,env(safe-area-inset-left)) calc(7px + env(safe-area-inset-bottom))}.tabs{max-width:960px;margin:auto;display:grid;grid-template-columns:repeat(4,1fr);gap:5px}.tab{padding:9px 1px 8px;background:transparent;color:#a39382;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;border-radius:13px;min-height:60px;font-weight:800;font-size:11px}.tab.active{background:#fff0dc;color:#ad5c12}.tab-symbol{font-size:22px}.history-filter{display:grid;grid-template-columns:1fr 1fr;gap:10px}.history-filter select{font-size:13px}.date-heading{font-size:13px;font-weight:900;color:#8e6650;margin:18px 0 8px}.more{margin-top:12px}.calendar-head{display:flex;align-items:center;justify-content:space-between;gap:8px}.calendar-month{font-weight:900;font-size:18px}.calendar-nav{background:#fff5e7;border-radius:11px;padding:9px 12px;color:#a35a16;font-weight:800}.calendar-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}.weekday{text-align:center;padding:7px 0;font-size:11px;font-weight:850;color:#9b8f83}.cal-day{border:1px solid #f0e6dc;background:#fff;border-radius:12px;min-height:75px;padding:7px 3px 5px;display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:4px;min-width:0;position:relative}.cal-day:disabled{background:transparent;border:0}.cal-day.today{outline:2px solid #e8a45c}.cal-day .day-num{font-size:12px;font-weight:850}.cal-icons{display:flex;gap:2px;justify-content:center;align-items:center;flex-wrap:wrap}.cal-icons .avatar{width:22px;height:22px;font-size:12px;border-width:1px}.cal-markers{font-size:11px;line-height:1}.settings-group{margin-bottom:21px}.setting-line{display:flex;align-items:center;gap:10px;padding:12px 0;border-bottom:1px solid #f2e8dd}.setting-line:last-child{border-bottom:0}.setting-main{flex:1;min-width:0}.setting-main strong{display:block;font-size:13px}.setting-main small{color:var(--muted);font-size:11px;line-height:1.5}.setting-mini-btn{background:#fff6ed;color:#a65b11;border:1px solid #f1dfc9;border-radius:10px;padding:9px 10px;font-size:12px;font-weight:800;white-space:nowrap}.setting-mini-btn:disabled{opacity:.3}.detail-layout{display:block}.detail-main{min-width:0}.detail-memo{min-width:0}.keyval{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:11px 0;border-bottom:1px solid #f3e9dc;font-size:14px}.keyval:last-child{border:0}.keyval .key{color:#857970}.keyval .value{font-weight:800;text-align:right;overflow-wrap:anywhere}.memo-reading{background:#fffcf7;border:1px solid #eddac6;border-radius:16px;padding:13px}.memo-reading-content{white-space:pre-wrap;overflow-wrap:anywhere;line-height:1.7;font-size:14px;color:#4b4137;transition:max-height .2s ease;overflow:hidden}.memo-reading-content.folded{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;line-clamp:3;overflow:hidden}.memo-toggle{display:flex;align-items:center;justify-content:center;gap:8px;width:100%;background:#fff0dc;border-radius:12px;color:#9e540e;font-weight:850;font-size:13px;padding:13px;margin-top:10px;min-height:44px}.memo-arrow{display:inline-block;transition:transform .2s ease}.memo-arrow.open{transform:rotate(180deg)}.detail-actions{position:fixed;left:50%;transform:translateX(-50%);width:min(920px,calc(100vw - 24px));bottom:calc(80px + env(safe-area-inset-bottom));z-index:35;background:#fffefaf4;backdrop-filter:blur(12px);box-shadow:0 -6px 22px #51310b12;border:1px solid var(--line);padding:10px;border-radius:18px;display:flex;flex-direction:column;gap:8px}.detail-actions .btn{width:100%}.has-detail-actions .app-shell{padding-bottom:calc(270px + env(safe-area-inset-bottom))}.detail-spacer{height:14px}.notice{position:sticky;top:0;z-index:80;background:#fff1e8;color:#9d3e1c;padding:12px 16px;text-align:center;font-size:13px;border-bottom:1px solid #f4bd9e}.toast{position:fixed;z-index:100;left:50%;bottom:calc(96px + env(safe-area-inset-bottom));transform:translateX(-50%);width:min(92vw,420px);padding:13px 17px;background:#55371f;color:#fff;border-radius:14px;box-shadow:0 12px 35px #2c1c1744;font-size:13px;font-weight:800;text-align:center}.toast[hidden],.notice[hidden]{display:none}.extra-info{background:#fff1df;border-radius:15px;padding:13px;color:#986123;font-size:12px;line-height:1.7}.demo-notice{background:#fffbf5;border:1px dashed #efd7be;border-radius:15px;padding:14px;font-size:12px;color:#85694e;line-height:1.7}.crop-preview{width:130px;height:130px;margin:0 auto 12px;border-radius:50%;background:#fff0dc center/cover no-repeat;border:4px solid #ffe0b0}.photo-picker{display:block;font-size:13px}.error{color:var(--red);font-size:12px;margin-top:6px}dialog{width:min(90vw,440px);border:0;border-radius:22px;padding:0;box-shadow:0 20px 60px #321c1844}dialog::backdrop{background:#24170c96}#confirm-body{padding:22px}#confirm-body h3{font-size:19px;margin-bottom:13px}#confirm-body p{font-size:13px;line-height:1.8;margin-bottom:12px;color:#66584d}.help-block{line-height:1.85;font-size:14px;color:#65574a}.help-block p{margin:8px 0 15px}.help-block h3{margin:17px 0 6px}.role-preview{background:#fef3df;border:1px solid #f4d6a9;border-radius:13px;padding:12px;margin:0 0 16px;font-size:12px;color:#99611f}.hidden{display:none!important}button:hover:not(:disabled){filter:brightness(.985)}
@media(min-width:680px){.app-shell{padding:29px 26px 130px}.kids-grid{grid-template-columns:repeat(5,minmax(0,1fr))}.actions-grid{grid-template-columns:repeat(3,1fr)}.action-tile:last-child:nth-child(odd){grid-column:auto}.cal-day{min-height:95px}.cal-icons .avatar{width:26px;height:26px;font-size:14px}}
@media(orientation:landscape) and (min-width:680px){.detail-layout{display:grid;grid-template-columns:minmax(230px,1fr) minmax(260px,1fr);gap:14px;align-items:start}.detail-actions{left:max(26px,calc((100vw - 960px)/2 + 26px));transform:none;bottom:calc(78px + env(safe-area-inset-bottom));width:min(450px,calc((100vw - 72px)/2))}.app-shell{padding-bottom:130px}}
@media(max-width:400px){.app-shell{padding-left:12px;padding-right:12px}.card{padding:14px}.cal-day{min-height:63px;border-radius:10px}.cal-icons .avatar{width:19px;height:19px}.hero .big{font-size:34px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:0s!important;transition-duration:0s!important;scroll-behavior:auto!important}}
.entry-title{display:block}.entry-sub{display:block}

.photo-remove{margin:8px 0 12px;min-height:42px}

/* v0.4: local QR invitation presentation */
.share-qr{display:flex;align-items:center;justify-content:center;padding:12px;background:#fff;border:1px solid #f2dfc6;border-radius:16px;margin:12px auto;max-width:100%;}
.share-qr svg{width:min(100%,285px);height:auto;display:block;}
#confirm-dialog{max-width:min(calc(100vw - 24px),470px);max-height:calc(100dvh - 20px);overflow:auto;}
#confirm-dialog .button-row{flex-wrap:wrap;}
#confirm-dialog .button-row>*{min-width:75px;}

/* v0.5.1: first-time child registration only asks for name */
.child-quick-card{padding:20px;}
.quick-kid-intro{font-size:15px;font-weight:850;margin-bottom:12px;color:#8b511b;}
#quick-kid-form .btn,#kid-form .btn.primary{margin-top:12px;min-height:53px;font-size:16px;}
.kid-form-error:not([hidden]){display:block;margin-top:12px;background:#fff0e8;border:1px solid #e9a58a;border-radius:12px;padding:11px;font-size:13px;font-weight:700;color:#9d3e1c;}

/* ホーム画面追加サポート */
.install-hint{display:flex;align-items:center;justify-content:space-between;gap:13px;background:#fff7ea;border:1px solid #efc99d;border-radius:17px;padding:13px 15px;margin:13px 0 18px;color:#805017;}
.install-hint strong{font-size:13px;line-height:1.5;display:block;}
.install-hint p{font-size:12px;margin-top:4px;line-height:1.6;}
.install-hint .setting-mini-btn{flex-shrink:0;}
.install-state{border-radius:13px;padding:13px;margin:12px 0 15px;font-weight:800;line-height:1.6;}
.install-state.installed{background:#ebf6eb;color:#266036;border:1px solid #b7d8b7;}
.install-state.caution{background:#fff4e2;color:#8c4d13;border:1px solid #e8c594;}
.help-block ol{padding-left:21px;margin:13px 0 17px;}
.help-block li{margin-bottom:7px;}
.help-block code{overflow-wrap:anywhere;font-size:12px;}

/* v1.3: safer on-device backup guidance */
.backup-alert{display:flex;align-items:center;justify-content:space-between;gap:10px;background:#fff5ea;border:1px solid #e2ba84;border-radius:16px;padding:13px 14px;margin:14px 0;color:#74440e}
.backup-alert strong{font-size:13px;line-height:1.55;display:block}
.backup-alert p{font-size:12px;line-height:1.65;margin-top:3px}
.backup-alert .setting-mini-btn{flex-shrink:0}
@media(max-width:370px){.backup-alert{flex-direction:column;align-items:stretch}.backup-alert .setting-mini-btn{align-self:flex-end}}

/* v1.4: app identity icon integrated in the top bar */
.brand-logo{display:inline-flex;align-items:center;justify-content:center;overflow:hidden;background:transparent;border-radius:13px;}
.brand-logo img{display:block;width:100%;height:100%;object-fit:cover;border-radius:inherit;}

/* v1.5: compact monthly summary and safer upgrade flow */
.monthly-summary{background:#fff;border:1px solid #f0e4d5;box-shadow:var(--shadow);border-radius:19px;padding:16px;margin:0 0 22px}
.monthly-heading{font-size:15px;font-weight:900;color:#77512e;display:flex;justify-content:space-between;gap:9px;margin-bottom:11px}
.monthly-heading span{font-size:12px;color:#a18b74}
.monthly-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.monthly-grid>div{padding:12px 8px;background:#fff9f2;border-radius:12px;min-width:0;text-align:center}
.monthly-grid small{display:block;font-size:10px;color:#866d55;font-weight:800;line-height:1.5}
.monthly-grid strong{display:block;font-size:16px;font-weight:900;overflow-wrap:anywhere;margin-top:3px}
.monthly-grid .earned{color:#a85a13}.monthly-grid .spent{color:#a94b37}
.monthly-summary>p{font-size:11px;color:#9a8a7b;margin-top:10px;line-height:1.6}
.maintenance-card{line-height:1.7}.maintenance-top{display:flex;align-items:center;gap:14px;min-width:0}
.maintenance-top img{flex-shrink:0;border-radius:16px;box-shadow:0 3px 12px #8e5b2c21}
.maintenance-top>div{min-width:0}.maintenance-top h3{font-size:18px}
.maintenance-facts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:12px 0}
.maintenance-facts>div{border:1px solid #eedac4;background:#fffaf3;border-radius:13px;padding:12px}
.maintenance-facts small{display:block;font-size:12px;color:#816c57}.maintenance-facts strong{display:block;font-size:21px;color:#94540d}
.maint-steps{padding-left:22px;font-size:13px;color:#5c4d3d;line-height:1.8;margin:13px 0}
.maint-steps li{margin-bottom:8px}
@media(max-width:400px){.monthly-grid strong{font-size:13px}.maintenance-card .button-row{flex-wrap:wrap}.maintenance-card .button-row .btn{min-width:115px}}

/* v1.6: monthly family report, accessible on phones and desktops */
.report-home-link{margin:-11px 0 22px}
.report-panel{margin-bottom:16px}
.report-month-select{display:flex;align-items:center;justify-content:space-between;gap:12px}
.report-month-select h2{font-size:20px;text-align:center}
.report-total{border-radius:17px;background:linear-gradient(130deg,#fff2da,#ffdbad);padding:18px;margin:16px 0 20px;text-align:center;color:#7d4614}
.report-total small{display:block;font-size:12px;font-weight:800}
.report-total strong{display:block;font-size:31px;margin:3px 0;font-weight:900;overflow-wrap:anywhere}
.report-total div{font-size:12px}
.report-subheading{margin:0 0 10px}
.report-child{border:1px solid #f0e3d4;border-radius:15px;padding:14px;margin:9px 0;background:#fffcf8}
.report-kid{display:flex;align-items:center;gap:10px;margin-bottom:9px}
.report-kid strong{font-size:15px;display:block}.report-kid small{font-size:11px;color:#8e7b67;display:block}
.report-numbers{display:flex;flex-wrap:wrap;gap:6px 14px;justify-content:space-between;font-size:12px;color:#86715d}
.report-numbers strong{font-size:14px}
.report-net{display:flex;justify-content:space-between;gap:10px;align-items:center;border-top:1px dashed #edd7be;margin-top:11px;padding-top:10px;font-size:12px;color:#80664e}
.report-net strong{color:#7d4413;font-size:18px;overflow-wrap:anywhere}
.report-plus{color:#9e520f}.report-minus{color:#a3513b}
.report-types{margin:10px 0 3px}.report-type{display:grid;grid-template-columns:minmax(0,1fr) 45px auto;align-items:center;gap:9px;border-bottom:1px solid #f3e9dd;padding:12px 0;font-size:13px}
.report-type span:nth-child(2){font-size:11px;color:#8f7b6c;text-align:right}.report-type strong{text-align:right;font-weight:900}
@media(max-width:400px){.report-numbers{flex-direction:column;gap:4px}.report-total strong{font-size:27px}.report-type{grid-template-columns:minmax(0,1fr) 34px auto}}

/* v1.7: child balances first, no family balance summary */
.kid-balance-label{font-size:11px;color:#87735d;font-weight:750;line-height:1.5;text-align:center}
.home-guidance{font-size:12px;color:#856c52;margin:-9px 0 19px;padding:0 2px}
.quick-chore-grid{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:4px 0 10px}
.quick-chore{display:grid;grid-template-columns:34px minmax(0,1fr);grid-template-rows:auto auto;align-items:center;gap:3px 7px;padding:12px 10px;border-radius:14px;border:1px solid #eed5b9;background:#fffaf3;cursor:pointer;text-align:left;color:#50361e;min-width:0}
.quick-chore:active{transform:scale(.99)}.quick-chore:focus-visible{outline:3px solid #ea9b42;outline-offset:2px}
.quick-chore-icon{grid-row:1/3;font-size:27px;line-height:1.1;text-align:center}
.quick-chore-name{font-size:12px;font-weight:900;overflow-wrap:anywhere;line-height:1.3}
.quick-chore strong{color:#b45c07;font-size:15px;font-weight:900}
.quick-chore-go{grid-column:2;font-size:10px;color:#8b6c46}
@media(max-width:360px){.quick-chore-grid{gap:7px}.quick-chore{padding:10px 8px;grid-template-columns:29px minmax(0,1fr)}}

/* v1.8: live per-child balance forecast before saving a record */
.balance-preview{background:linear-gradient(145deg,#fff6e8,#ffedda);border:1px solid #eed4b4;border-radius:17px;padding:13px 15px;margin:0 0 18px;display:flex;flex-direction:column;gap:5px;color:#80501f}
.balance-preview-label{font-size:12px;font-weight:850;line-height:1.5}
.balance-preview-amounts{display:flex;gap:8px;align-items:center;flex-wrap:wrap;font-size:18px;color:#794614;font-weight:900}
.balance-preview-amounts strong{font-size:20px;overflow-wrap:anywhere}
.balance-preview-amounts .negative-balance{color:#a5442c}
.balance-preview-change{font-size:12px;font-weight:750}
.balance-preview-change.is-minus{color:#a34d37}.balance-preview-change.is-plus{color:#975009}
.balance-preview-pending{font-size:12px;line-height:1.6}
@media(max-width:360px){.balance-preview-amounts strong{font-size:17px}}

/* v1.9: safe edit delta preview and per-child history shortcut */
.kid-all-records{margin:13px 0 0;min-height:48px;font-size:13px;letter-spacing:.01em}
.edit-balance-preview{margin-top:13px;margin-bottom:0}
@media(max-width:370px){.kid-all-records{font-size:12px}}

/* v2.0: safe repeat-entry shortcut and deletion outcome preview */
.detail-repeat{margin:11px 0 16px;min-height:48px;font-size:13px;white-space:normal;line-height:1.5}
.repeat-notice{font-size:13px;line-height:1.7;color:#80521e;background:#fff0dc;border:1px solid #efd1a6;border-radius:13px;padding:12px 13px;margin-bottom:15px}
.delete-balance-preview{background:#fff6e8;border:1px solid #f0d0a5;border-radius:14px;margin:15px 0;padding:13px 12px;color:#724619;font-size:13px;line-height:1.6}
.delete-balance-preview small{font-size:11px;font-weight:700;display:block}
.delete-balance-values{display:flex;align-items:center;justify-content:center;gap:12px;margin:6px 0;font-size:18px;font-weight:900}
.delete-balance-values strong{overflow-wrap:anywhere}
.delete-balance-preview>span{display:block;text-align:center;font-size:12px;font-weight:800}
@media(max-width:350px){.delete-balance-values{font-size:15px;gap:6px}}

/* v2.2 バックアップの照合・移行確認 */
.backup-verify-status{background:#fff7eb;border:1px solid #ecd6b8;color:#855523;border-radius:12px;padding:12px;font-size:13px;line-height:1.65;margin:12px 0 16px;overflow-wrap:anywhere}
.backup-verify-status.verified{background:#f3fbf2;border-color:#add4aa;color:#31642d}
.backup-file-label{display:block;font-weight:800;color:#784c21;font-size:13px;margin:13px 0 6px}
#inspect-file,#transition-file{width:100%;max-width:100%;font-size:13px;padding:10px;border:1px solid #ead2af;background:#fff;border-radius:11px}
.backup-transition-facts{display:flex;gap:10px;flex-wrap:wrap;margin:10px 0 14px}
.backup-transition-facts span{flex:1;background:#fff8eb;border-radius:12px;padding:11px;text-align:center;font-size:13px}
#transition-confirm:disabled{opacity:.45;cursor:not-allowed}

/* v2.3 破損時の救済を、通常の操作から明確に分離 */
.emergency-raw{border:1px solid #c9553d;border-radius:14px;background:#fff4ee;padding:14px;margin:14px 0;color:#7a2f1b}
.emergency-raw p{font-size:13px;line-height:1.6;margin:8px 0 12px}
.emergency-setting{background:#fff6f0;border-radius:10px;padding-inline:8px}

/* v2.4 Restore preview: compare per-child balance and record changes */
.restore-diff{background:#fffaf3;border:1px solid #eed6b7;border-radius:14px;padding:13px;margin:13px 0}
.restore-diff h4{font-size:14px;color:#7c4719;margin:0 0 10px}
.restore-diff-counts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
.restore-diff-counts span{font-size:12px;text-align:center;background:#fff;border-radius:9px;padding:9px 3px;color:#80674a}
.restore-diff-counts strong{display:block;font-size:17px;color:#9c510f}
.restore-kid-rows{display:flex;flex-direction:column;gap:7px;margin:9px 0}
.restore-kid-row{background:#fff;border:1px solid #f3e6d7;border-radius:10px;padding:10px;overflow-wrap:anywhere}
.restore-kid-row>strong{display:block;color:#503b27;font-size:13px}
.restore-kid-balances{display:flex;flex-wrap:wrap;gap:8px;align-items:center;font-size:14px;font-weight:900;margin:5px 0;color:#ac5d0f}
.restore-kid-row small{font-size:11px;color:#8b7763}
.restore-warning{background:#fff1ea;border:1px solid #dfaa8e;padding:12px;border-radius:12px;font-size:13px;color:#8a3b22;margin:12px 0}
.restore-warning p{margin:5px 0 0;line-height:1.6}
.restore-ack{display:flex;align-items:flex-start;gap:10px;margin:14px 0;color:#4d3b28;font-size:13px;font-weight:800;line-height:1.6;cursor:pointer}
.restore-ack input{margin-top:3px;flex:none;width:20px;height:20px;accent-color:#cf6e20}
#restore-confirm:disabled{opacity:.46;cursor:not-allowed}
@media(max-width:370px){.restore-diff{padding:10px}.restore-kid-balances{font-size:12px;gap:5px}}

/* v2.5: 読み取り専用の保存データ整合性チェック */
.audit-counts{display:grid;grid-template-columns:1fr 1fr;gap:9px;margin:14px 0}
.audit-counts span{background:#fff6e8;border-radius:12px;padding:12px;text-align:center;font-size:13px;color:#875626}
.audit-counts strong{font-size:19px;display:block;color:#a4550f}
.audit-kids{border:1px solid #eee0d1;border-radius:13px;overflow:hidden;margin:12px 0}
.audit-kid-row{display:flex;justify-content:space-between;gap:12px;align-items:center;padding:10px 13px;font-size:13px;border-bottom:1px solid #f3e7d8}
.audit-kid-row:last-child{border-bottom:0}
.audit-kid-row span{font-weight:900;color:#95500c}

/* v2.6 - 顔写真の拡大縮小と切り抜きプレビュー */
.photo-editor{display:flex;flex-direction:column;align-items:center;gap:9px;background:#fffaf3;border:1px solid #f0dfc9;border-radius:18px;padding:16px 12px;margin:10px 0 14px}
.photo-editor .crop-preview{width:min(65vw,230px);height:min(65vw,230px);margin:0 auto;border:5px solid #f7d7a8;border-radius:50%;box-shadow:0 4px 20px #7d4a1322;background:#ffefdb;display:flex;align-items:center;justify-content:center;overflow:hidden;touch-action:none;user-select:none;-webkit-user-select:none;cursor:grab;font-size:56px;line-height:1}
.photo-editor .crop-preview:active{cursor:grabbing}.photo-editor .crop-preview:focus-visible{outline:3px solid #b65d08;outline-offset:3px}
.photo-editor #photo-canvas{display:block;width:100%;height:100%;object-fit:cover;pointer-events:none}
.photo-editor #photo-placeholder{pointer-events:none}
.photo-editor #crop-controls{width:100%;max-width:370px}
.photo-zoom-title{display:flex;justify-content:space-between;align-items:center;gap:12px;margin-top:8px;color:#795019;font-size:14px;font-weight:800}
.photo-zoom-title strong{color:#aa5910;font-size:17px;font-variant-numeric:tabular-nums}
.photo-zoom-bar{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:11px;margin:9px 0 15px}
.photo-zoom-bar input[type=range],.photo-pan-sliders input[type=range]{width:100%;min-width:0;accent-color:#e78319;min-height:36px;cursor:pointer}
.photo-zoom-btn{height:44px;min-width:44px;border:1px solid #edc794;border-radius:12px;background:#fff;color:#99500d;font-size:24px;font-weight:800}
.photo-pan-sliders{display:grid;grid-template-columns:72px 1fr;gap:2px 8px;align-items:center}
.photo-pan-sliders label{color:#7e6343;font-size:12px;font-weight:800}
.photo-reset{width:100%;margin:7px 0 3px;min-height:42px}
.photo-guide,.photo-old-note{font-size:12px!important;line-height:1.7!important}
.photo-old-note{color:#9e5b18!important;background:#fff2de;padding:9px;border-radius:9px}
@media(min-width:600px){.photo-editor .crop-preview{width:230px;height:230px}}

/* v2.7 写真の回転・左右反転と安全な変更取消 */
.photo-transform-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;margin:3px 0 6px}
.photo-transform-btn{min-height:44px;padding:9px 7px;font-size:13px;min-width:0}
.photo-flip-btn{grid-column:1/-1}
.photo-flip-btn[aria-pressed="true"]{background:#ffe6c3;border-color:#db8e34}
.photo-transform-status{font-size:12px;color:#9a651f;text-align:center;margin:4px 0 13px;font-weight:750}
.photo-revert{width:100%;margin:2px 0 6px;min-height:43px}
@media(min-width:480px){.photo-transform-actions{grid-template-columns:repeat(3,minmax(0,1fr))}.photo-flip-btn{grid-column:auto}}

/* v2.7: QRだけで参加する案内 */
.qr-welcome{border:1px solid #f2cd9d;background:linear-gradient(160deg,#fff1dc,#fffaf3);padding:16px;border-radius:16px;margin:12px 0 16px}.qr-welcome strong{color:#8e470d;font-size:16px}.qr-welcome p{font-size:13px;line-height:1.7;margin:8px 0 14px;color:#74563e}

/* v2.8: メイン / サブの3役割をわかりやすく表示 */
.family-roles{display:grid;gap:9px;margin:14px 0 16px}
.family-roles>div,.family-sub-note{background:#fff9f1;border:1px solid #f1dabb;border-radius:14px;padding:12px 14px}
.family-roles strong{display:block;color:#80430c;font-size:15px}
.family-roles small{display:block;color:#6c5b4e;font-size:12px;margin-top:3px;line-height:1.55}
.family-sub-note{margin:14px 0}
.family-sub-note strong{color:#87440e}
.family-sub-note p{font-size:13px;margin:7px 0 0;line-height:1.7}
.family-invite-actions{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin:14px 0}
.family-invite-actions>.btn{min-height:60px;padding:9px;font-size:13px;line-height:1.4;white-space:normal}
@media(max-width:340px){.family-invite-actions{grid-template-columns:1fr}}

/* v3.3: ホーム右上の端末権限ラベル。小さな画面でもタイトルをつぶさない */
.home-device-role{display:inline-flex;flex-direction:column;justify-content:center;align-items:center;gap:3px;flex:0 0 auto;margin-left:auto;max-width:46%;padding:7px 10px;border-radius:12px;border:1px solid #ead4ba;background:#fff5e7;color:#86501e;font-size:11px;font-weight:900;line-height:1.35;white-space:nowrap;text-align:center}
.home-device-role.main{background:#fff0d7;border-color:#eac78f;color:#874b0e}
.home-device-role.sub{background:#eaf4ff;border-color:#c5d9ee;color:#285c8a}
.home-device-role.child{background:#e9f6ec;border-color:#c5dfc9;color:#2a6a40}
.home-device-role.pending{background:#f4f2ed;color:#6b655d}
.home-device-role.local{background:#f6f2e9;color:#6e6251}
.home-device-role span:first-child{font-size:17px;line-height:1}
@media(max-width:390px){.home-device-role{font-size:10px;padding:6px 8px;max-width:46%}.logo{gap:7px}.logo-icon{width:42px;height:42px}.logo-title{font-size:20px}.logo-sub{font-size:9px}}
@media(max-width:345px){.logo-title{font-size:18px}.home-device-role{font-size:9px;padding:5px 6px}}

/* v3.4: カレンダー日付の曜日・日本の祝日色。祝日は土曜でも赤優先。 */
.weekday.calendar-sunday,.cal-day.calendar-sunday .day-num,.calendar-legend-red{color:#cf3447}
.weekday.calendar-saturday,.cal-day.calendar-saturday .day-num,.calendar-legend-blue{color:#2368d8}
.cal-day.calendar-sunday .day-num,.cal-day.calendar-saturday .day-num{font-weight:900}

/* v3.5: 子ども一覧の直下に全額支払いボタン */
.home-payout-area{margin-top:14px}
.home-payout-button{border-color:#b7cfe7;font-weight:800;min-height:50px}
.home-payout-area .hint{margin:7px 2px 0;font-size:12px;line-height:1.55}
.payout-choices{display:flex;flex-direction:column;gap:10px;margin:14px 0}
.payout-choice{display:flex;justify-content:space-between;align-items:center;gap:12px;text-align:left}
.payout-choice strong{white-space:nowrap;font-variant-numeric:tabular-nums}
.payout-cancel{margin-top:8px}

/* v3.6: 平日は黒、土曜は青、日曜と祝日は赤（祝日が土曜の場合も赤）。 */
.weekday:not(.calendar-sunday):not(.calendar-saturday),
.cal-day:not(.calendar-sunday):not(.calendar-saturday) .day-num{color:#171717}
.weekday.calendar-saturday,.cal-day.calendar-saturday .day-num{color:#2368d8}
.weekday.calendar-sunday,.cal-day.calendar-sunday .day-num{color:#cf3447}
/* ホーム右上はアイコンを使用せず、役割の文字だけを表示。 */
.home-device-role{flex-direction:row;gap:0;font-size:11px;line-height:1.4;padding:8px 9px;white-space:normal;max-width:52%;text-wrap:balance}
.home-device-role span:first-child{font-size:inherit;line-height:inherit}
@media(max-width:390px){.home-device-role{font-size:10px;max-width:50%;padding:7px 8px}}
