:root{--paper:#faf8f3;--ink:#262522;--muted:#575149;--accent:#385468;--line:#d9d8d1;--fine:#eae7df;--block:#dce6eb;--block2:#eee3d3;--block3:#e4e9d9;--block4:#e8e0eb;--block-text:#263f51;--text-color:#262522;--shadow:0 14px 44px #283e5012;font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Noto Sans CJK SC","Microsoft YaHei",sans-serif;color:var(--text-color);background:var(--paper);font-size:16px;font-synthesis:none}
:root[data-theme=wood]{--block:#e8d9c5;--block2:#f0e4d3;--block3:#dfd6c9;--block4:#eddbd5;--block-text:#513923;--text-color:#2c241f}
:root[data-theme=green]{--block:#dce7dd;--block2:#e8e9d7;--block3:#dde6e6;--block4:#e7dfd4;--block-text:#2d4e40;--text-color:#252923}
*{box-sizing:border-box}body{margin:0;min-width:300px}button,input,textarea,select{font:inherit;color:inherit}button{cursor:pointer;border:0;background:none;-webkit-tap-highlight-color:transparent;position:relative;touch-action:manipulation}button:disabled{opacity:.3;cursor:default}button:active:not(:disabled){transform:scale(.965)}button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible{outline:2px solid var(--accent);outline-offset:3px}button svg{width:21px;height:21px;flex-shrink:0;color:var(--accent)}button{transition:transform .14s,background-color .16s}input,textarea,select{width:100%;border:1px solid #d6d5cd;background:#fffdf8;padding:11px 10px;border-radius:8px;min-width:0;max-width:100%;font-size:16px}textarea{resize:vertical;line-height:1.7}input[type=checkbox]{width:18px;height:18px;accent-color:var(--accent);flex-shrink:0}input[type=range]{padding:8px 0;accent-color:var(--accent)}select{appearance:none;background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='m4 6 4 4 4-4' fill='none' stroke='%23385468' stroke-width='1.5'/%3E%3C/svg%3E");background-repeat:no-repeat;background-size:16px;background-position:right 8px center;padding-right:27px}label{display:block;font-size:13px;line-height:1.5;color:var(--muted)}label input,label textarea,label select{margin-top:5px}h1,h2,h3,p{margin:0}h1{font-size:21px;letter-spacing:.02em;font-weight:600}h2{font-size:18px;font-weight:600}h3{font-size:14px;margin:22px 0 12px;font-weight:500}p{line-height:1.75}small{font-size:12px;color:var(--muted)}#app{max-width:940px;margin:auto;padding:0 34px 30px;min-height:100svh}#app.page-edit{max-width:1060px}#app.page-home{max-width:900px}.icon{display:inline-flex;align-items:center;justify-content:center;width:44px;height:44px;min-width:44px;border-radius:12px;color:var(--accent)}.icon:hover{background:#38546809}.home-head{display:flex;align-items:center;gap:15px;padding:36px 0 28px}.home-head>div{flex:1}.home-head h1{font-weight:500;font-size:22px}.eyebrow{color:var(--muted);font-size:12px;letter-spacing:.08em;line-height:1.8}.avatar{width:48px;height:48px;min-width:48px;border-radius:50%;overflow:hidden;background:#a9bdc7}.avatar img,.avatar-preview img{width:100%;height:100%;object-fit:cover}.avatar-preview{width:96px;height:96px;border-radius:50%;overflow:hidden;background:#a9bdc7;margin:12px auto}.section-caption{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:13px;min-height:30px;color:var(--muted);font-size:13px}.text-button{color:var(--accent);display:inline-flex;align-items:center;justify-content:center;gap:6px;min-height:40px;padding:4px 8px;font-size:13px}.text-button svg{width:14px;height:14px}.reminder-section{margin-bottom:29px;position:relative;z-index:3}.reminders{display:flex;gap:10px;min-height:89px}.reminder-slot{flex:1;min-width:0;position:relative;max-width:25%}.reminder{display:flex;text-align:left;flex-direction:column;justify-content:center;padding:14px 13px;gap:9px;border-radius:11px;width:100%;height:86px;position:relative;z-index:2;overflow:hidden}.reminder span{font-size:11px;line-height:1.4;font-variant-numeric:tabular-nums;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.reminder strong{font-size:15px;font-weight:500;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;max-width:100%}.past{background:#eae7e2;color:#4c4a45}.current{background:#f5e2d3;color:#754423}.future{background:#e2edf4;color:#31566d}.stacked:before,.stacked:after{content:'';position:absolute;height:80%;left:4px;right:4px;bottom:-4px;border-radius:11px;background:#edcfb9;z-index:1}.stacked:after{left:8px;right:8px;bottom:-8px;z-index:0;background:#e5c6af}.expanded-cards{position:absolute;left:0;right:0;top:92px;display:flex;flex-direction:column;gap:6px;z-index:10;filter:drop-shadow(0 12px 10px #3b30281a);animation:unfold .22s ease-out}.empty-reminder{width:100%;border:1px dashed #d8d7cd;border-radius:12px;padding:17px 19px;display:flex;flex-direction:column;justify-content:center;gap:7px;font-size:14px}.calendar-card{border:1px solid #deddd5;border-radius:16px;background:#fdfbf7;overflow:hidden;box-shadow:0 5px 24px #38546804}.calendar-toolbar{display:flex;align-items:center;justify-content:space-between;padding:22px 20px 6px}.calendar-toolbar h2{font-size:21px;margin-top:4px;font-weight:500}.segmented{display:inline-flex;background:#efede5;border-radius:9px;padding:3px;gap:2px}.segmented button{padding:8px 13px;border-radius:7px;font-size:13px;min-height:34px;white-space:nowrap}.segmented button.active{background:#fffcf7;box-shadow:0 1px 4px #292e3212;color:var(--accent);font-weight:600}.calendar-navigation{display:flex;align-items:center;justify-content:flex-end;padding:0 10px 4px;gap:4px}.calendar-navigation .icon{height:36px}.calendar-shell{display:grid;grid-template-columns:51px minmax(0,1fr);position:relative;overflow:hidden;touch-action:pan-y}.time-heading{font-size:11px;display:flex;align-items:center;justify-content:center;color:var(--muted);border-bottom:1px solid var(--line)}.days-clip{overflow:hidden;min-width:0;position:relative}.calendar-shell.near>.days-clip:after,.calendar-shell.near .body-clip:after{content:'';position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,#fdfbf7 0,transparent 15px,transparent calc(100% - 15px),#fdfbf7 100%);z-index:5}.day-headings,.day-columns{display:flex;--pan:0px;width:100%;transform:translateX(var(--pan));transition:transform .18s ease-out}.day-headings.near,.day-columns.near{transform:translateX(calc(-100% / 3.4 * 1.3 + var(--pan)));}.day-headings button{height:62px;border-left:1px solid var(--fine);border-bottom:1px solid var(--line);display:flex;align-items:center;justify-content:center;flex-direction:column;gap:7px;flex-shrink:0}.near>button,.near>.day-column{flex:0 0 calc(100% / 3.4)}.week>button,.week>.day-column{flex:0 0 calc(100% / 7)}.day-headings button span{font-size:12px;color:var(--muted)}.day-headings button strong{font-size:19px;font-weight:500;display:inline-flex;width:29px;height:29px;align-items:center;justify-content:center}.day-headings .is-today strong{background:var(--accent);color:#fff;border-radius:50%}.calendar-scroll{grid-column:1/-1;display:grid;grid-template-columns:51px minmax(0,1fr);height:504px;overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:#d0d2cb transparent}.time-scale{height:2016px;position:relative;color:var(--muted);font-size:11px;font-variant-numeric:tabular-nums;background:#fdfbf7;z-index:2}.time-scale span{position:absolute;left:0;right:6px;text-align:right;line-height:15px;transform:translateY(-50%)}.time-scale span:first-child{transform:translateY(0)}.day-columns{height:2016px}.day-column{height:2016px;position:relative;border-left:1px solid var(--line);min-width:0}.grid-line{position:absolute;left:0;right:0;height:1px;background:var(--line);pointer-events:none}.grid-line.half{background:var(--fine)}.meal-line{position:absolute;left:0;right:0;border-top:1px dashed #aa9675;pointer-events:none;z-index:1}.event{position:absolute;border-radius:6px;background:var(--block);color:var(--block-text);z-index:3;overflow:hidden;text-align:left;padding:6px;display:flex;flex-direction:column;gap:4px;border:1px solid #3854680b;line-height:1.3;touch-action:pan-y;transition:background-color .2s,opacity .2s}.event strong{font-size:13px;font-weight:500;word-break:break-all;overflow:hidden}.event-time{font-variant-numeric:tabular-nums;font-size:10px;white-space:nowrap;overflow:hidden}.event.color-1{background:var(--block2)}.event.color-2{background:var(--block3)}.event.color-3{background:var(--block4)}.cropped .event-time,.week .event-time{display:none}.week .event{padding:4px 3px}.week .event strong{font-size:12px}.now-line{position:absolute;left:0;right:0;height:2px;background:var(--accent);z-index:4;pointer-events:none}.now-line span{position:absolute;left:-3px;top:-2px;width:6px;height:6px;border-radius:50%;background:var(--accent)}.home-foot{text-align:center;font-size:12px;color:#80796e;padding:24px 0 0;letter-spacing:.09em}.month-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px;padding:10px 14px 22px}.month-grid .weekday{text-align:center;font-size:12px;padding:10px}.month-grid button{height:48px;font-size:16px;border-radius:10px}.month-grid .today{background:var(--accent);color:#fff}.month-grid .outside{color:#a49f94}.page-head{display:flex;align-items:center;gap:5px;padding:22px 0 14px;min-height:92px}.head-title{flex:1;min-width:0}.head-title p{font-size:12px;color:var(--muted);margin-top:5px}.date-nav{display:flex;align-items:center;justify-content:center;border-bottom:1px solid var(--line);padding:3px 0 14px;gap:12px}.date-picker{display:flex;align-items:center;gap:8px;position:relative;height:44px;color:var(--ink);font-size:15px}.date-picker svg{width:18px;height:18px;color:var(--accent)}.date-picker input{opacity:0;position:absolute;inset:0;width:100%;height:100%;margin:0;cursor:pointer}.edit-layout{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:21px;padding-top:16px}.edit-timeline{min-width:0;position:relative}.timeline-title{display:flex;justify-content:space-between;font-size:12px;color:var(--muted);height:32px;padding-left:52px}.timeline-title span:last-child{font-size:11px;color:#8b8172}.edit-scroll{height:min(68svh,630px);overflow-y:auto;display:grid;grid-template-columns:48px minmax(0,1fr);scrollbar-width:thin;overscroll-behavior:contain;scrollbar-color:#d0d2cb transparent;background:#fdfbf7;border-radius:0 0 12px 12px}.single-column{position:relative;height:2016px;border-left:1px solid var(--line);min-width:0}.single-column .event{touch-action:none;padding:9px}.single-column .event strong{font-size:14px}.single-column .event-time{font-size:12px}.event.selected{outline:1.5px solid var(--accent);outline-offset:0;z-index:4}.event.draft{border:1px dashed var(--accent)}.resize-handle{position:absolute;bottom:0;left:0;right:0;height:12px;cursor:ns-resize;touch-action:none}.resize-handle:after{content:'';position:absolute;left:calc(50% - 10px);bottom:3px;width:20px;height:2px;border-radius:2px;background:#38546860}.edit-sidebar{min-width:0;position:relative;border-left:1px solid var(--fine);padding-left:18px}.toolbox{padding-top:32px}.blank-card{height:145px;border:1px dashed #aeb8bc;border-radius:11px;background:#e5ebec66;display:flex;align-items:center;justify-content:center;flex-direction:column;gap:12px;color:var(--accent);touch-action:none;user-select:none;cursor:grab}.blank-card svg{width:24px;height:24px;stroke-width:1}.blank-card small{color:#526674}.blank-card.split{height:95px}.tray-card{display:flex;text-align:left;flex-direction:column;gap:9px;width:100%;margin-top:10px;height:95px;padding:14px;background:var(--block);border-radius:10px;touch-action:none}.tray-card strong{font-size:14px;font-weight:500}.tray-card span{font-size:11px;line-height:1.5}.tools{display:flex;justify-content:space-around;gap:2px;margin-top:18px}.tools .icon{border-radius:50%;background:#f1efe8}.sidebar-note{font-size:12px;color:#7d786b;line-height:1.8;padding:18px 5px}.detail-form{max-height:calc(100svh - 190px);overflow-y:auto;padding-right:2px;padding-bottom:20px;scrollbar-width:thin}.form-title{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px}.form-title h2{font-size:15px}.detail-form label{margin-top:12px}.detail-form input,.detail-form select{padding:9px 8px;font-size:14px}.detail-form textarea{font-size:14px;padding:9px 8px}.detail-form .icon{width:36px;min-width:36px;height:36px}.field-hint{font-size:11px;color:#777064;line-height:1.6;margin-top:7px}.tag-suggestions{display:flex;gap:5px;flex-wrap:wrap;margin-top:7px}.tag-suggestions button,.filter-tags button{padding:5px 8px;font-size:12px;border-radius:6px;background:#ebece5;color:var(--accent)}details{border-top:1px solid var(--fine);margin-top:18px;padding-top:14px}summary{cursor:pointer;font-size:13px;color:var(--accent);line-height:1.6}.primary,.secondary{min-height:43px;border-radius:9px;padding:10px 16px;font-size:14px;display:inline-flex;align-items:center;justify-content:center;gap:8px}.primary{background:var(--accent);color:#fff}.secondary{background:#edece5;color:var(--accent);border:1px solid #dddcd3}.full{width:100%;margin-top:17px}.form-actions{display:flex;gap:8px;margin-top:22px}.form-actions .primary{flex:1}.week-choices{display:grid;grid-template-columns:repeat(7,1fr);gap:3px;margin-top:12px}.week-choices label{margin:0;position:relative;cursor:pointer}.week-choices input{position:absolute;opacity:0;width:100%;height:100%;margin:0}.week-choices span{display:flex;align-items:center;justify-content:center;min-height:33px;background:#efede6;border-radius:6px;font-size:12px}.week-choices input:checked+span{background:var(--accent);color:white}.week-choices input:focus-visible+span{outline:2px solid var(--accent);outline-offset:2px}.warning{font-size:12px;color:#a03929;margin-top:12px;line-height:1.7}.check-row{display:flex;align-items:center;gap:8px;font-size:13px;min-height:36px;line-height:1.6}.check-row input{margin:0}.check-row span{margin-left:auto;font-size:12px}.return-button{position:fixed;bottom:max(20px,env(safe-area-inset-bottom));left:max(18px,calc((100vw - 992px)/2));z-index:12;display:flex;align-items:center;gap:7px;background:#fffdf8ed;border:1px solid #d9d8ce;box-shadow:0 4px 16px #3854680e;border-radius:11px;padding:11px 13px;font-size:13px;color:var(--accent)}.return-button svg{width:17px;height:17px}.settings-content{display:grid;grid-template-columns:1fr 1fr;gap:20px;margin-top:12px}.settings-content section{padding:23px;border:1px solid var(--line);border-radius:14px}.settings-content section h2{font-size:16px;margin-bottom:18px}.settings-content section p{font-size:13px;color:var(--muted)}.settings-content label{margin-top:15px}.settings-content form>.primary{margin-top:20px}.meal-settings{display:flex;flex-direction:column;gap:6px}.meal-choice{display:flex;align-items:center;gap:9px;margin:0!important}.meal-choice input[type=time]{max-width:145px}.theme-options{display:flex;flex-direction:column;gap:8px}.theme-choice{display:flex;align-items:center;gap:12px;text-align:left;padding:10px;border:1px solid #deddd5;border-radius:9px;font-size:13px;height:46px}.theme-choice.chosen{border-color:var(--accent)}.theme-choice i{width:24px;height:24px;border-radius:6px;background:#dce6eb}.theme-choice.wood i{background:#e8d9c5}.theme-choice.green i{background:#dce7dd}.theme-choice span{flex:1}.theme-choice svg{width:16px}.setting-link{width:100%;display:flex;align-items:center;justify-content:space-between;font-size:15px}.record-content,.diary-content{max-width:650px;margin:20px auto}.record-top{display:flex;justify-content:space-between;align-items:center;margin-bottom:24px;padding:12px 0}.total{font-size:38px;font-weight:400;letter-spacing:-.03em;color:var(--accent);font-variant-numeric:tabular-nums}.expense-row{display:grid;grid-template-columns:minmax(0,1fr) 120px;align-items:center;gap:22px;padding:17px 0;border-bottom:1px solid var(--fine)}.expense-name{font-size:16px}.expense-name input{border:0;background:transparent;font-size:12px;padding:4px 0;outline-offset:0}.expense-row>input{text-align:right;font-variant-numeric:tabular-nums;font-size:20px;background:#fdfbf7}.add-record{display:flex;align-items:center;justify-content:center;gap:10px;width:100%;border:1px dashed #c6cbc8;color:var(--accent);padding:14px;border-radius:10px;margin-top:22px;font-size:14px}.summary-row summary{display:flex;justify-content:space-between;font-size:15px}.summary-row p{font-size:13px;padding:8px 0}.summary-row p span{color:var(--muted);margin-left:12px}.preset-row{display:flex;align-items:center;padding:15px 0;border-bottom:1px solid var(--fine);gap:4px}.grip{color:#92998e;padding:8px;cursor:grab}.preset-main{flex:1;display:flex;flex-direction:column;gap:6px;text-align:left;min-width:0;padding:5px}.preset-main strong{font-size:15px;font-weight:500}.preset-main span{font-size:11px;color:var(--muted)}.preset-row .icon{min-width:36px;width:36px}.empty-state{padding:70px 12px;text-align:center;color:#7c776b;font-size:14px;line-height:2}.diary-toolbar{display:flex;justify-content:space-between;margin-bottom:26px}.diary-pages{display:flex;align-items:center;gap:6px;margin-bottom:20px}.diary-pages>button{width:35px;height:35px;border-radius:50%;color:var(--muted);font-size:13px}.diary-pages>button.active{color:#fff;background:var(--accent)}.diary-pages>span{margin-left:auto;font-size:12px;color:var(--muted)}#diary-text{border:0;background:transparent;padding:5px 0;min-height:50svh;resize:none;font-size:17px;line-height:2.1;outline-offset:6px}#diary-text::placeholder{font-size:12px;color:#8b8274}.diary-bottom{display:flex;align-items:center;gap:10px;color:var(--accent);font-size:12px;flex-wrap:wrap}.diary-bottom small{margin-left:auto;font-size:11px}.filter-tags{display:flex;gap:7px;flex-wrap:wrap;margin-bottom:20px}.filter-tags .active{background:var(--accent);color:#fff}.diary-excerpt{display:block;width:100%;text-align:left;padding:20px 0;border-bottom:1px solid var(--line)}.diary-excerpt>span{color:var(--accent);font-size:12px}.diary-excerpt p{white-space:pre-line;font-size:14px;margin:8px 0;line-height:1.8}.tag-section{padding:18px 0;border-bottom:1px solid var(--line)}.tag-section .section-caption h2{font-size:17px}.tag-event{display:flex;flex-direction:column;gap:8px;padding:12px 0;text-align:left;width:100%}.tag-event strong{font-size:14px;font-weight:500}.tag-event span{font-size:12px;color:var(--muted)}dialog{border:1px solid #e0ded3;border-radius:18px;padding:0;background:var(--paper);color:var(--text-color);max-width:min(94vw,480px);width:480px;max-height:85svh;box-shadow:var(--shadow)}dialog::backdrop{background:#24384635;backdrop-filter:blur(3px)}.modal-body{padding:26px;overflow:auto}.modal-body>h2{margin-bottom:14px}.modal-body>p{font-size:14px;color:var(--muted);margin:12px 0}.modal-body>label,.modal-body .two-fields{margin-top:14px}.dialog-actions{display:flex;justify-content:flex-end;gap:10px;margin-top:25px}.two-fields{display:grid;grid-template-columns:1fr 1fr;gap:12px}.date-preview{display:flex;flex-direction:column;gap:8px;max-height:180px;overflow-y:auto;font-size:12px;margin-top:12px}.item-preview{min-height:190px}.item-preview .ellipsis{white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.pending-popover h2{font-size:16px}.pending-items{max-height:240px;overflow-y:auto;display:flex;flex-direction:column;gap:8px}.pending-card{padding:14px;background:var(--block);border-radius:10px;display:flex;flex-direction:column;gap:8px;text-align:left;min-height:70px;touch-action:none}.pending-card strong{font-size:14px;font-weight:500;max-width:6em;text-overflow:ellipsis;overflow:hidden;white-space:nowrap}.pending-card span{font-size:11px;color:var(--muted)}#toast{position:fixed;bottom:30px;left:50%;transform:translate(-50%,15px);background:#293c49ef;color:#fff;max-width:calc(100vw - 32px);padding:12px 19px;border-radius:10px;font-size:13px;opacity:0;pointer-events:none;transition:.2s;z-index:100;line-height:1.7;min-width:160px;text-align:center}#toast.visible{opacity:1;transform:translate(-50%,0)}#drag-ghost{position:fixed;z-index:200;pointer-events:none;border:1.5px solid var(--accent);border-radius:8px;background:transparent!important;padding:8px;color:var(--accent);display:flex;flex-direction:column;gap:5px;overflow:hidden;font-size:13px;box-shadow:0 3px 14px #38546815}#drag-ghost[hidden]{display:none}#drag-ghost small,#drag-ghost span{font-size:11px}#drag-ghost svg{width:20px;height:20px}.drag-origin{opacity:.25!important}.dragging{user-select:none;cursor:grabbing}.drop-active{outline:2px dashed var(--accent);outline-offset:-2px;background:#38546809}.holding{isolation:isolate;overflow:hidden}.holding:after{content:'';position:absolute;inset:0;background:#243e5725;transform:translateY(100%);animation:fill .55s linear forwards;pointer-events:none;border-radius:inherit;z-index:0}.landed{animation:land .25s ease-out}.saved-pulse{animation:pulse .6s ease-out}.particle{position:fixed;z-index:99;width:3px;height:3px;border-radius:50%;background:#59748a;pointer-events:none;animation:spark .6s ease-out forwards}.loading,.error-state{padding:80px 25px;font-size:14px;color:var(--muted)}.error-state h1{margin-bottom:20px}.page-edit .time-scale{background:var(--paper)}
@keyframes fill{to{transform:translateY(0)}}@keyframes land{from{clip-path:circle(10% at center)}to{clip-path:circle(150% at center)}}@keyframes pulse{50%{box-shadow:0 0 0 4px #38546824}}@keyframes spark{from{opacity:.9;transform:translate(0,0)}to{opacity:0;transform:translate(var(--dx),var(--dy))}}@keyframes unfold{from{opacity:0;transform:translateY(-12px)}to{opacity:1;transform:translateY(0)}}
@media(min-width:1000px){.home-head{padding-top:46px}.calendar-scroll{height:504px}.calendar-card{margin-top:5px}.home-head h1{font-size:25px}.reminder{height:92px}.reminder-section{margin-bottom:35px}}
@media(max-width:600px){#app{padding:0 17px 26px}.home-head{padding:28px 0 24px;gap:12px}.home-head h1{font-size:18px}.avatar{width:43px;height:43px;min-width:43px}.eyebrow{font-size:11px}.reminders{gap:6px;min-height:80px}.reminder{height:80px;padding:12px 8px;gap:7px;border-radius:9px}.reminder strong{font-size:13px}.reminder span{font-size:10px}.reminder-section{margin-bottom:25px}.section-caption{font-size:12px;margin-bottom:10px}.empty-reminder{font-size:13px;padding:13px}.empty-reminder small{font-size:11px}.calendar-toolbar{padding:17px 13px 2px}.calendar-toolbar h2{font-size:19px}.segmented button{padding:7px 10px;font-size:12px}.calendar-shell{grid-template-columns:43px minmax(0,1fr)}.calendar-scroll{grid-template-columns:43px minmax(0,1fr);height:504px;max-height:none}.time-scale{font-size:10px}.time-scale span{right:4px}.calendar-card{border-radius:13px}.day-headings button{height:58px}.day-headings button span{font-size:11px}.day-headings button strong{font-size:16px}.event{padding:5px 4px}.event strong{font-size:12px}.event-time{font-size:9px}.week .event strong{font-size:11px}.week .event{border-radius:4px;padding:4px 2px}.calendar-navigation{padding-right:7px}.calendar-navigation .icon{width:35px;min-width:35px;height:33px}.page-head{padding-top:17px;padding-bottom:10px;gap:0;min-height:80px}.page-head h1{font-size:19px}.head-title p{font-size:10px}.page-head>.icon{width:38px;min-width:38px}.date-nav{gap:9px;padding-bottom:9px}.date-picker{font-size:14px}.edit-layout{grid-template-columns:minmax(0,1fr) 150px;gap:10px;padding-top:15px}.edit-sidebar{padding-left:10px}.edit-scroll{grid-template-columns:39px minmax(0,1fr);height:calc(100svh - 205px)}.timeline-title{padding-left:40px;font-size:11px;gap:3px}.timeline-title span:last-child{font-size:9px}.single-column .event{padding:6px 4px}.single-column .event strong{font-size:12px}.single-column .event-time{font-size:10px}.toolbox{padding-top:32px}.blank-card{height:135px}.tools{gap:0;margin-top:16px}.tools .icon{width:38px;min-width:38px;height:40px}.tools svg{width:19px;height:19px}.sidebar-note{font-size:11px;padding:16px 2px}.detail-form{max-height:calc(100svh - 180px)}.form-title h2{font-size:13px}.form-title{margin-bottom:3px}.detail-form label{font-size:11px;margin-top:10px}.detail-form input,.detail-form select,.detail-form textarea{font-size:16px;padding:7px 6px;border-radius:6px}.detail-form .field-hint{font-size:10px}.detail-form summary{font-size:12px}.detail-form .primary,.detail-form .secondary{font-size:12px;padding:9px}.detail-form .week-choices{gap:2px;grid-template-columns:repeat(4,1fr)}.week-choices span{font-size:11px}.detail-form .warning{font-size:11px}.detail-form .check-row{font-size:11px}.settings-content{display:block}.settings-content section{padding:21px;margin-bottom:16px}.record-content,.diary-content{margin-top:16px}.total{font-size:33px}.modal-body{padding:23px}.modal-body>p{font-size:13px}.two-fields{gap:9px}.record-top{margin-bottom:14px}.expanded-cards{top:86px}.expense-row{gap:15px;grid-template-columns:minmax(0,1fr) 100px}.preset-row .icon{width:33px;min-width:33px}.return-button{left:14px;bottom:14px}.diary-pages{gap:4px}}
@media(max-width:360px){#app{padding:0 12px 20px}.edit-layout{grid-template-columns:minmax(0,1fr) 138px;gap:7px}.edit-sidebar{padding-left:7px}.tools .icon{width:36px;min-width:36px}.home-head h1{font-size:16px}.reminder strong{font-size:12px}.reminder span{font-size:9px}.segmented button{padding:7px 8px}.head-title p{max-width:150px}.form-title .icon{width:30px;min-width:30px}}
@media(prefers-reduced-motion:reduce){*,*:before,*:after{animation-duration:.01ms!important;transition-duration:.01ms!important;scroll-behavior:auto!important}.holding:after{animation-duration:.55s!important}.landed{clip-path:none}.saved-pulse{outline:2px solid var(--accent)}}

.now-line:before{content:attr(data-time);position:absolute;top:-14px;left:4px;font-size:9px;line-height:12px;color:var(--accent);font-variant-numeric:tabular-nums;background:#fdfbf7c9;padding:0 2px;border-radius:2px}

.anchored-dialog{position:fixed;margin:0;z-index:60;max-height:380px;box-shadow:0 10px 34px #293d4c24;border-radius:13px}.anchored-dialog .modal-body{padding:17px}.anchored-dialog .item-preview{height:174px;min-height:174px}.anchored-dialog .item-preview h2{font-size:16px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}.anchored-dialog .item-preview p{font-size:12px;margin:8px 0}.anchored-dialog .item-preview .primary{min-height:34px;font-size:12px;padding:7px 12px}.anchored-dialog .pending-items{max-height:232px}.anchored-dialog .add-record{margin-top:12px;padding:10px;font-size:12px}.anchored-dialog .pending-card{flex-shrink:0}

.grip{touch-action:none;user-select:none;min-width:44px;min-height:44px;display:flex;align-items:center;justify-content:center}.tools .icon,.page-head>.icon{min-width:44px;width:44px;height:44px}.detail-form .form-title .icon{min-width:44px;width:44px;height:44px}

.presets-layout{max-width:940px;margin:0 auto;display:grid;grid-template-columns:minmax(0,1fr)}.presets-layout>.record-content{width:100%}.preset-detail{display:none}.presets-layout.has-detail,.category-layout{display:grid;grid-template-columns:minmax(0,1fr) 270px;gap:22px}.presets-layout.has-detail .preset-detail{display:block}.preset-detail,.category-detail{border-left:1px solid var(--fine);padding:16px 0 0 18px;min-width:0}.preset-detail .modal-body,.category-detail .modal-body{padding:0 0 22px;max-height:calc(100svh - 130px);overflow-y:auto}.preset-detail h2,.category-detail h2{font-size:16px}.category-layout>.record-content{width:100%;min-height:240px}.category-detail .blank-card{width:100%;margin-top:12px}.category-detail .blank-card>svg{width:24px;height:24px}.category-layout .two-fields,.presets-layout .two-fields{grid-template-columns:1fr}.category-layout .week-choices,.presets-layout .week-choices{grid-template-columns:repeat(4,1fr)}.category-layout .dialog-actions,.presets-layout .dialog-actions{flex-wrap:wrap}.category-layout .dialog-actions button,.presets-layout .dialog-actions button{flex:1;min-width:60px;padding:9px;font-size:12px}
@media(max-width:600px){.presets-layout.has-detail,.category-layout{grid-template-columns:minmax(0,1fr) 150px;gap:10px}.preset-detail,.category-detail{padding-left:10px}.preset-detail label,.category-detail label{font-size:11px}.preset-detail h2,.category-detail h2{font-size:13px}.preset-row .grip{min-width:24px;padding:0}.has-detail .preset-row .icon,.category-layout .preset-row .icon{width:28px;min-width:28px}.has-detail .preset-main strong,.category-layout .preset-main strong{font-size:12px}.has-detail .preset-main span,.category-layout .preset-main span{font-size:10px}.has-detail .preset-row,.category-layout .preset-row{flex-wrap:wrap}.has-detail .preset-row .preset-main,.category-layout .preset-row .preset-main{flex-basis:calc(100% - 30px)}.category-layout .record-content{margin-top:0}}

.home-head,.page-head,.date-nav,.day-headings,.month-grid,.calendar-toolbar,.calendar-navigation{color:var(--ink)}

.day-headings button{min-width:0;padding:0}

.expense-amount{display:flex;align-items:center;gap:6px;min-width:0;margin:0}
.expense-amount span{flex-shrink:0;color:var(--muted);font-size:11px}
.expense-amount input{margin:0;text-align:right;font-variant-numeric:tabular-nums;background:#fdfbf7}
input[aria-invalid="true"]{border-color:#a03929}

/* The viewport owns the page. Each long work surface scrolls independently. */
html,body{height:100%;overflow:hidden;overscroll-behavior:none}
#app{position:relative;top:var(--app-top,0px);height:var(--app-height,100dvh);min-height:0;display:flex;flex-direction:column;overflow:hidden;padding:env(safe-area-inset-top) max(12px,env(safe-area-inset-right)) max(8px,env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left))}
#app > main{min-height:0}
.home-head,.page-head,.date-nav,.reminder-section{flex:none}
.home-head,.page-head{padding:4px 0;min-height:52px}
.home-head h1{font-size:1rem;overflow:hidden;text-overflow:ellipsis}
.home-head>div{min-width:0}
.date-nav{padding:0;min-height:44px}
.reminder-section{margin:4px 0 10px}
.reminder-section[hidden]{display:none}
.reminders{min-height:0}
.reminder-section>.text-button{min-height:32px}
.reminder{height:68px;padding:8px;gap:4px}
.expanded-cards{top:74px;max-height:50dvh;overflow:auto}
.calendar-card{flex:1;display:flex;flex-direction:column;margin:0}
.calendar-toolbar{padding:5px 10px;gap:6px;flex:none}
.calendar-toolbar h2{font-size:1rem;margin:0}
.calendar-navigation{padding:0;justify-content:center;flex:none}
.calendar-navigation .icon{height:44px;min-width:44px}
.calendar-shell{flex:1;min-height:0;grid-template-rows:auto minmax(0,1fr);max-height:555px}
.day-headings button{height:48px;gap:2px}
.calendar-scroll{height:100%;max-height:504px;min-height:0;overscroll-behavior:contain}
.month-grid{overflow:auto;min-height:0}
.edit-layout{flex:1;min-height:0;padding-top:6px;grid-template-columns:minmax(0,1fr) minmax(0,42%);gap:9px}
.edit-timeline,.edit-sidebar{min-height:0;display:flex;flex-direction:column}
.edit-scroll{height:auto;flex:1;min-height:0}
.timeline-title{height:auto;min-height:20px;padding:0 0 2px 4px}
.toolbox{padding-top:20px;overflow-y:auto;overscroll-behavior:contain}
.detail-form{display:flex;flex-direction:column;min-height:0;height:100%;max-height:none;overflow:hidden;padding:0}
.form-title,.form-actions{flex:none;background:var(--paper);margin:0}
.form-actions{padding:5px 2px;border-top:1px solid var(--line)}
.form-title h2{font-size:.875rem}
.form-fields,.profile-fields{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:0 4px 8px 0;scroll-padding:8px}
.form-fields input,.form-fields textarea,.form-fields select,.profile-fields input{font-size:max(16px,1rem)}
.return-button{bottom:max(12px,env(safe-area-inset-bottom));max-width:45%;min-height:44px}
.settings-content,.page-tags .record-content,.guide-content{flex:1;overflow:auto;overscroll-behavior:contain;margin:0 auto;width:100%}
.settings-content section{padding:12px;margin-bottom:8px}
.settings-links{grid-column:1/-1}
.setting-link{min-height:44px}
.profile-form{display:flex;flex-direction:column;min-height:0;flex:1;width:100%;max-width:630px;margin:0 auto}
.profile-actions{padding:6px 0;flex:none}
.profile-fields label{margin:10px 0}
.presets-layout,.category-layout{flex:1;width:100%;min-height:0;grid-template-rows:minmax(0,1fr)}
.presets-layout>.record-content,.category-layout>.record-content{overflow:auto;min-height:0;margin:0}
.preset-detail,.category-detail{min-height:0;overflow:auto;padding-top:3px}
.preset-detail .modal-body,.category-detail .modal-body{max-height:none;overflow:visible}
.page-expenses .record-content,.diary-content{width:100%;flex:1;display:flex;flex-direction:column;min-height:0;margin:0 auto}
.record-top,.diary-toolbar,.diary-pages,.diary-bottom{flex:none;margin:0;padding:4px 0}
.record-top .total{font-size:1.35rem}
.expense-body,.diary-archive{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain}
.page-expenses .add-record{min-height:44px;padding:8px;margin:5px 0 0;flex:none}
#diary-text{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain}
.diary-pages>button{min-width:44px;min-height:44px}
.guide-content{max-width:660px;padding:0 4px 6px}
.guide-content section{padding:12px 0;border-bottom:1px solid var(--line)}
.guide-content h2{font-size:1.125rem;font-weight:700}
.guide-content ol{margin:8px 0 0;padding-left:1.5em;font-size:1rem;line-height:1.6}
.guide-content li+li{margin-top:6px}
.operation-hint{position:fixed;z-index:160;display:flex;align-items:center;gap:4px;max-width:min(19rem,calc(100vw - 24px));background:var(--accent);color:white;border-radius:10px;padding:0 2px 0 10px;box-shadow:0 3px 10px #0003;font-size:.875rem;line-height:1.35;overflow-wrap:anywhere;pointer-events:none}
.operation-hint[hidden]{display:none}
.operation-hint button{pointer-events:auto;min-width:44px;min-height:44px;display:grid;place-items:center}
.operation-hint button svg{color:white;width:16px;height:16px}
dialog{max-height:calc(var(--app-height,100dvh) - 20px);overflow:auto}
@media (max-height:510px) and (orientation:landscape){
  .home-head,.page-head{min-height:44px;padding:0}
  .home-head .avatar{width:36px;height:36px;min-width:36px}
  .reminder{height:52px}
  .reminder-section{margin:2px 0 5px}
  .expanded-cards{top:56px}
  .calendar-toolbar{padding:0 8px}
  .calendar-navigation .icon,.calendar-navigation .text-button{height:44px}
  .day-headings button{height:40px}
}
