/* Phone geometry follows Figma frame 210:9207 (402 × 874). */
@media(min-width:0px){html,body,body *{scrollbar-width:none}html::-webkit-scrollbar,body::-webkit-scrollbar,body *::-webkit-scrollbar{display:none;width:0;height:0}}
.preview-status{display:none}.type-nav{display:flex;gap:var(--space-2);margin-bottom:var(--space-2)}.type-nav button{white-space:nowrap;border:1px solid var(--line);background:var(--surface);border-radius:var(--radius-lg);padding:var(--space-2) var(--space-4);font-size:var(--text-caption);line-height:20px}.type-nav button.selected{color:var(--inverse);background:var(--ink);border-color:var(--ink)}
.header-date{display:flex;align-items:center;gap:var(--space-2);justify-content:center;font-weight:600;font-size:var(--text-heading);color:var(--ink)}.header-date svg{width:12px;height:12px;color:var(--ink-secondary)}.header-date:disabled{opacity:1}.header-date:disabled svg{display:none}
.attachment-button{width:36px;height:36px;display:grid;place-items:center;color:var(--ink-secondary)}.attachment-button svg{width:22px;height:22px}
.chat-list{display:flex;flex-direction:column;gap:var(--space-3)}.chat-time-divider{text-align:center;color:var(--ink-secondary);font-size:var(--text-caption);line-height:18px;margin:var(--space-3) 0 var(--space-1)}.chat-item{display:flex;flex-direction:column;align-items:flex-end;max-width:100%}.chat-bubble{background:var(--surface);border-radius:var(--radius-lg) var(--radius-xs) var(--radius-lg) var(--radius-lg);padding:var(--space-3) var(--space-4);width:max-content;min-width:min(192px,100%);max-width:min(332px,100%)}.chat-text{font-size:var(--text-input);line-height:26px;letter-spacing:-.3125px;white-space:pre-wrap;overflow-wrap:anywhere;margin:0;color:var(--ink);min-width:0}.chat-footer{display:flex;align-items:center;gap:var(--space-2);margin-top:var(--space-3);padding-top:var(--space-3);border-top:1px solid var(--line);min-height:36px}.chat-category{padding:0;display:flex;align-items:center;gap:var(--space-2);min-width:0;flex:1;color:var(--ink-secondary);font-size:var(--text-caption);font-weight:600;line-height:19.5px;text-align:left;overflow-wrap:anywhere}.chat-category.work{color:#4881c6}.chat-category.learning{color:#81aa3c}.chat-category.life,.chat-category.knowledge{color:#8e66b6}.chat-category.sport{color:#36c8bb}.chat-category.food{color:#ca6b4b}.chat-category.todo{color:var(--ink-secondary)}.category-symbol{width:26px;height:26px;border-radius:var(--radius-xs);display:grid;place-items:center;background:color-mix(in srgb,currentColor 16%,white);flex-shrink:0}.category-symbol svg{width:18px;height:18px;stroke-width:1.8}.chat-actions{position:relative;flex-shrink:0;margin-left:auto}.chat-more{width:28px;height:28px;padding:0;display:grid;place-items:center;color:var(--ink-secondary);border-radius:50%}.chat-more svg{width:17px;height:17px}.chat-more[aria-expanded="true"]{background:var(--surface-sunken)}.chat-menu{position:absolute;right:0;top:calc(100% + 8px);z-index:8;width:154px;display:grid;padding:var(--space-1);border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface);box-shadow:none}.chat-menu.above{top:auto;bottom:calc(100% + 8px)}.chat-menu[hidden]{display:none}.chat-menu button{display:flex;align-items:center;gap:var(--space-2);min-height:40px;padding:var(--space-2) var(--space-2);border-radius:var(--radius-xs);text-align:left;white-space:nowrap;font-size:var(--text-caption);color:var(--ink)}.chat-menu button:hover,.chat-menu button:focus-visible{background:var(--surface-sunken)}.chat-menu svg{width:16px;height:16px}.chat-menu [data-trash]{color:#aa514c}.chat-link{display:flex;align-items:center;gap:var(--space-2);margin-top:var(--space-2);color:#8b5cf6;text-decoration:none;font-size:var(--text-caption);line-height:19.5px;overflow-wrap:anywhere}.chat-link svg{width:14px;height:14px}.empty-history{text-align:center;color:var(--ink-secondary);font-size:var(--text-caption)}
.menu-row{width:100%;display:flex;text-align:left;align-items:center;gap:var(--space-3);padding:var(--space-4) var(--space-1);border-bottom:1px solid var(--line);font-size:var(--text-body)}.calendar-heading{display:flex;align-items:center;justify-content:space-between;margin:var(--space-4) 0}.calendar-heading button{width:40px;height:40px}.calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:var(--space-1);text-align:center}.calendar-grid>span{font-size:var(--text-caption);color:var(--ink-secondary);min-height:24px}.calendar-grid button{height:40px;border-radius:var(--radius-sm);position:relative;font-size:var(--text-caption)}.calendar-grid button.selected{background:var(--ink);color:white}.calendar-grid button i{position:absolute;bottom:3px;left:calc(50% - 2px);width:4px;height:4px;background:#8b5cf6;border-radius:50%}.calendar-today{margin-top:var(--space-3);width:100%}
.attachment-draft{display:flex;gap:var(--space-2);overflow-x:auto;padding:0 0 var(--space-2);max-width:100%}.attachment-chip{display:flex;align-items:center;gap:var(--space-1);background:white;border:1px solid var(--line);border-radius:var(--radius-sm);padding:var(--space-1) var(--space-1) var(--space-1) var(--space-3);max-width:240px;flex-shrink:0;font-size:var(--text-caption)}.attachment-chip>span{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.attachment-chip button{width:36px;height:36px;padding:var(--space-2);flex-shrink:0}.attachment-chip svg{width:16px;height:16px}.record-attachments{display:flex;flex-wrap:wrap;gap:var(--space-2);margin-top:var(--space-2);min-width:0}.record-attachments a{display:flex;flex-direction:column;gap:var(--space-1);max-width:100%;font-size:var(--text-caption);color:var(--ink-secondary);overflow-wrap:anywhere;text-decoration:none}.record-attachments img{width:160px;max-width:100%;max-height:180px;object-fit:cover;border-radius:var(--radius-sm)}.search-field{display:flex;align-items:center;gap:var(--space-1)}.search-field input{min-width:0;flex:1}.search-field button{width:44px;height:44px}.search-panel>label,.search-filters label{display:grid;gap:var(--space-2);color:var(--ink-secondary);font-size:var(--text-caption)}.search-filters{display:grid;grid-template-columns:1fr 1fr;gap:var(--space-3);margin:var(--space-3) 0}.search-filters label:first-child{grid-column:1/-1}.search-filters input,.search-filters select{width:100%;min-width:0;height:42px;padding:0 var(--space-3);border:1px solid var(--line);border-radius:var(--radius-sm);background:var(--surface)}.search-empty{color:var(--ink-secondary);font-size:var(--text-body);padding:var(--space-6) 0}.search-result{display:grid;grid-template-columns:minmax(0,1fr) 44px;align-items:center;border-bottom:1px solid var(--line)}.search-result>button:first-child{min-width:0;padding:var(--space-4) var(--space-1);text-align:left;display:grid;gap:var(--space-1)}.search-result strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:var(--text-body)}.search-result small{font-size:var(--text-caption)}.search-result span{display:flex;align-items:center;gap:var(--space-1);color:#387567;font-size:var(--text-caption)}.search-result span svg{width:14px;height:14px}.search-result>button:last-child{width:44px;height:44px;display:grid;place-items:center;color:var(--ink-secondary)}.menu-row small{display:block;margin-top:var(--space-1);font-size:var(--text-caption)}.calendar-handle:focus-visible{outline-offset:0}
.diary-nav-asset{display:none}
@media(min-width:761px){.quick-nav{display:none}.topbar{color:var(--ink)}}
@media(min-width:0px){
 body.keyboard-open .app{height:var(--visual-height);position:fixed;top:var(--visual-top);width:100%}body.keyboard-open .quick-nav{display:none}body.keyboard-open .preview-status{display:none}body.keyboard-open dialog{max-height:calc(var(--visual-height) - 12px)}
 :root{background:var(--surface-sunken);color:var(--ink);--muted:var(--ink-secondary);--legacy-line:var(--line);--green:#23262a;font-family:"PingFang SC",-apple-system,BlinkMacSystemFont,sans-serif}
 .app{min-height:0}.sidebar{display:none}.workspace{overflow:hidden}.topbar{height:44px;min-height:44px;padding:0;border:0;background:var(--surface-sunken)}.topbar .icon-button{width:44px;height:44px;background:transparent;color:var(--ink)}.topbar .icon-button svg{width:20px;height:20px}.header-date{padding:var(--space-3) 0;line-height:24px}.header-date #mobile-title{font-size:var(--text-heading);font-weight:600}.header-date:disabled{cursor:default}
 .design-preview .preview-status{display:block;height:62px;flex-shrink:0;overflow:hidden;background:var(--surface-sunken)}.preview-status img{display:block;width:100%;height:62px;object-fit:contain}
 .scroll-area{scrollbar-gutter:auto;scrollbar-width:none;min-height:0}.content{padding:var(--space-6) var(--space-4) var(--space-4);max-width:none;margin:0}.day-divider{font-size:var(--text-caption);line-height:18px;gap:var(--space-3);margin:0 0 var(--space-3);white-space:nowrap}.day-divider:before,.day-divider:after{background:var(--surface-sunken)}.page-heading{margin:0 0 var(--space-5)}.page-heading h1{display:none}.page-heading p{font-size:var(--text-caption)}.date-mark{background:var(--surface-sunken);color:var(--ink-secondary);font-size:var(--text-micro)}
 .bottom-area{padding:var(--space-2) var(--space-3) var(--space-3);border-top:.585px solid var(--line);background:var(--surface-sunken);flex-shrink:0}.bottom-inner{max-width:none}.type-nav{display:none}
 .composer{display:flex;align-items:center;gap:var(--space-1);border:0;box-shadow:none;border-radius:var(--radius-lg);padding:var(--space-1) var(--space-2) var(--space-1) var(--space-4);min-height:52px;height:auto;background:var(--surface)}.composer textarea{flex:1;width:0;min-width:0;height:42px;min-height:42px;padding:var(--space-2) 0;resize:none;font-size:var(--text-input);line-height:26px;letter-spacing:-.3125px;font-family:inherit}.composer textarea::placeholder{color:var(--ink-secondary)}.composer-bottom{margin:0;align-self:center;gap:var(--space-1)}.composer-bottom>span,.composer-caption{display:none}.send{height:36px;width:36px;background:var(--ink)}.attachment-button{padding:0}.composer:focus-within{box-shadow:none}
 .quick-nav{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:0;margin:0;height:calc(65px + max(20px,env(safe-area-inset-bottom)));padding:var(--space-1) 0 max(var(--space-5),env(safe-area-inset-bottom));border-top:1px solid var(--line);background:var(--surface);flex-shrink:0;overflow:visible}.quick-nav .nav-button{display:flex;flex-direction:column;align-items:center;justify-content:flex-start;gap:var(--space-1);padding:var(--space-3) 0 0;min-height:0;height:64px;border:0;border-radius:0;background:none;font-size:var(--text-micro);line-height:16.5px;font-weight:400;color:var(--ink-secondary)}.nav-icon{display:grid;place-items:center;width:26px;height:26px}.quick-nav .nav-button.active{background:none;color:var(--ink);font-weight:500}.quick-nav .nav-button.active .nav-icon{background:var(--ink);color:var(--inverse);border-radius:var(--radius-xs)}.quick-nav .nav-button svg{width:20px;height:20px;stroke-width:1.8}.quick-nav .nav-button.active svg{width:18px;height:18px}.diary-nav-asset{display:none}
 .record{padding:var(--space-4);border-radius:var(--radius-lg);margin-bottom:var(--space-3)}.record-body{font-size:var(--text-input);line-height:26px}.record-foot{border-top:1px solid var(--line);padding-top:var(--space-2)}.classify{background:none;color:var(--ink)}.record-head,.record-actions .text-button{font-size:var(--text-micro)}.summary{margin-bottom:var(--space-6);padding:var(--space-4);background:var(--surface);border:0;border-radius:var(--radius-md)}.summary strong{font-size:var(--text-display)}.summary>div+div{padding-left:var(--space-3)}.summary p{font-size:var(--text-micro)}.section-heading h2{font-size:var(--text-heading)}.section-heading span{font-size:var(--text-micro)}.diary-row{grid-template-columns:42px 1fr;gap:var(--space-6)}.diary-card{padding:var(--space-5);border-radius:var(--radius-lg)}.diary-card h3{font-size:var(--text-input)}.diary-card p{font-size:var(--text-body)}.diary-card footer{font-size:var(--text-micro)}.back{margin:0 0 var(--space-3)}.review{background:white;border-radius:var(--radius-lg)}.review textarea{font-size:var(--text-input)}
 dialog{margin:auto 0 0;width:100%;max-width:100%;border-radius:var(--radius-lg) var(--radius-lg) 0 0;max-height:90dvh;padding:var(--space-5) var(--space-5) max(var(--space-6),env(safe-area-inset-bottom));box-shadow:none}dialog::backdrop{background:#0006}.dialog-head h2{font-size:var(--text-heading)}.dialog-head .icon-button{width:36px;height:36px}.field-row{gap:var(--space-3)}.dialog-actions{display:grid;grid-template-columns:1fr 2fr}.toast{top:56px;font-size:var(--text-caption)}.design-preview .toast{top:118px}.plan-reminder{margin:0 0 var(--space-3);background:var(--surface);border:1px solid var(--line);color:var(--ink);border-radius:var(--radius-md)}.plan-reminder>svg:first-child{color:var(--ink-secondary)}#editor[open]{height:min(92dvh,760px)}#editor form{height:100%;max-height:none}.dialog-scroll{padding-right:var(--space-1)}.dialog-actions{padding-bottom:max(0px,env(safe-area-inset-bottom))}
 .chat-detection{font-size:var(--text-micro);line-height:17px}.weekday-picker label{margin-right:var(--space-2)}.detection-result{margin-top:var(--space-3)}
 .calendar-dialog{margin:0;width:100%;border-radius:0 0 var(--radius-lg) var(--radius-lg);padding:0 var(--space-5) var(--space-4);max-height:90dvh;box-shadow:none}.calendar-dialog::backdrop{background:rgba(0,0,0,.7)}.calendar-dialog>.dialog-head{display:none}.design-preview .calendar-dialog{padding-top:60px}.design-preview .calendar-dialog:before{content:"";position:absolute;top:0;left:0;width:100%;height:60px;background:var(--surface) url('assets/preview-calendar-status.png') center top/402px 62px no-repeat}.calendar-dialog .calendar-heading{height:36px;margin:0 0 var(--space-4)}.calendar-heading strong{font-size:var(--text-heading);line-height:24px;font-weight:600;color:var(--ink)}.calendar-dialog .calendar-heading button{width:36px;height:36px;color:var(--ink-secondary)}.calendar-dialog .calendar-grid{gap:0;grid-template-columns:repeat(7,1fr);grid-template-rows:30px;grid-auto-rows:52px}.calendar-dialog .calendar-grid>span{height:26px;padding:var(--space-1) 0;font-size:var(--text-caption);line-height:18px}.calendar-dialog .calendar-grid button{height:52px;display:flex;align-items:flex-start;justify-content:center;padding:var(--space-1) 0 var(--space-3);font-size:var(--text-body);line-height:40px;background:none;color:var(--ink)}.calendar-dialog .calendar-grid button>span{display:block;width:36px;height:28px;line-height:28px;margin-top:var(--space-2);border-radius:var(--radius-xs)}.calendar-dialog .calendar-grid button.selected>span{background:#26292e;color:var(--inverse);font-weight:600}.calendar-dialog .calendar-grid button i{bottom:2px;left:calc(50% - 3px);width:6px;height:6px}.calendar-handle{display:block;width:64px;height:24px;background:transparent;padding:0;margin:var(--space-1) auto -6px;position:relative;touch-action:none}.calendar-handle:after{content:"";display:block;width:40px;height:4px;border-radius:var(--radius-xs);background:var(--surface-sunken);margin:auto}

}
/* P08, P09, P17 have their own measured page headers; P16 is a full-height drawer. */
@media(min-width:0px){
 body[data-page="diary"] .content,body[data-page="review"] .content,body[data-page="settings"] .content{padding:0;margin:0;max-width:none}
 body[data-page="review"] .preview-status,body[data-page="settings"] .preview-status{background:var(--surface)}
 body[data-page="diary"] .quick-nav .nav-icon>svg{display:none}
 body[data-page="diary"] .quick-nav .diary-nav-asset{display:block;object-fit:contain}
 body[data-page="diary"] .quick-nav [data-page="home"] .diary-nav-asset{width:24px;height:24px}
 body[data-page="diary"] .quick-nav [data-page="diary"] .diary-nav-asset{width:16px;height:16px}
 body[data-page="diary"] .quick-nav [data-page="memo"] .diary-nav-asset{width:20px;height:20px}
 body[data-page="diary"] .quick-nav [data-page="knowledge"] .diary-nav-asset{width:24px;height:25px}
 body[data-page="settings"] .settings-content{min-height:calc(100dvh - 44px);width:400px;max-width:100%}
 body.design-preview[data-page="settings"] .settings-content{min-height:calc(100dvh - 106px)}
 .screen-header{position:sticky;top:0;z-index:2}.screen-header h1{font-size:var(--text-heading);letter-spacing:0;line-height:24px}.screen-header .icon-button{height:44px;width:44px}
 .week-calendar{position:sticky;top:0;z-index:2}.diary-screen{background:var(--surface)}.time-card,.health-card{scroll-snap-align:start}.overview-scroller{scroll-snap-type:x proximity}.review-form{padding-top:var(--space-4)}
}
@media(min-width:761px){body[data-page="diary"] .content{padding:var(--space-6) var(--space-8)}.screen-header{border-bottom:1px solid var(--line)}.review-form,.settings-content{max-width:620px;margin:auto}.settings-content{min-height:600px}.week-calendar{border-radius:var(--radius-md);height:76px}.time-card,.health-card{flex:1;min-width:210px}.diary-schedule{padding-top:var(--space-4)}}

@media(min-width:0px){
 body[data-page="memo"] .content,body[data-page="memo-edit"] .content{padding:0;margin:0;max-width:none}
 .memo-edit-screen{min-height:calc(100dvh - 62px)}
 .memo-header,.memo-list{width:100%}
 .memo-filters{width:100%;max-width:none;padding-right:var(--space-4)}
 #batch3-sheet{margin:auto 0 0;width:100%;max-width:100%;border-radius:var(--radius-lg) var(--radius-lg) 0 0}
 #batch3-sheet.memo{height:min(338px,90dvh)}
 #batch3-sheet.food{height:min(682px,90dvh)}
 #batch3-sheet.sport{height:min(652px,90dvh)}
}
@media(min-width:761px){
 body[data-page="memo"] .content{padding-top:var(--space-5)}
}
.batch-plan-row{display:grid;grid-template-columns:112px minmax(0,1fr);gap:var(--space-2);align-items:end;margin:var(--space-2) 0}.batch-plan-row label{min-width:0;margin:0;color:var(--ink-secondary);font-size:var(--text-caption)}.batch-plan-row input{margin-top:var(--space-1);width:100%;min-width:0;padding:var(--space-2);height:40px}.batch-plan-row input[type="date"]{font-size:var(--text-caption)}.batch-plan-row input:not([type="date"]){font-size:var(--text-caption)}#batch-plan-error{min-height:18px;color:#a03f32;font-size:var(--text-caption)}#batch-plan-form .dialog-actions button{white-space:nowrap}#batch-plan-form .dialog-actions .primary{flex:1}

/* Memo uses the knowledge editor structure; only time/category settings are additional. */
 .memo-edit-meta .memo-time-chip{display:flex;align-items:center;gap:var(--space-1);max-width:100%;height:auto;min-height:29px;white-space:normal;text-align:left}
 .memo-time-chip svg{width:14px;height:14px;flex-shrink:0}
 .memo-time-chip[aria-expanded="true"]{background:#eaf2ef;color:#387567}

@media(min-width:0px){
 .memo-full-form{padding-bottom:var(--space-2)}
 .memo-edit-meta{flex-wrap:wrap;overflow:visible}
 .memo-property-panel{margin:var(--space-1) var(--space-4) 0;padding:var(--space-3);border-radius:var(--radius-sm);background:var(--surface)}
 .memo-property-panel .memo-compose-categories{display:flex;flex-wrap:wrap;gap:var(--space-2);height:auto;padding:0;overflow:visible}
 .memo-property-panel .memo-compose-chip{min-height:40px;font-size:var(--text-caption);padding:var(--space-2) var(--space-3)}
 .memo-property-panel label{display:block;font-size:var(--text-caption);color:var(--ink-secondary);margin:0 0 var(--space-2)}
 .memo-date-row{display:flex;gap:var(--space-2);align-items:center}
 .memo-date-row input{flex:1;min-width:0;width:100%;height:44px;border:1px solid var(--line);border-radius:var(--radius-sm);padding:var(--space-2) var(--space-3);background:var(--surface);color:var(--ink);font:14px -apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif}
 .memo-date-row button{min-width:44px;min-height:44px;color:var(--ink-secondary);font-size:var(--text-caption)}
 .memo-property-hint{font-size:var(--text-caption);line-height:20px;color:var(--ink-secondary);margin:var(--space-2) 0 0}
 .memo-property-panel .memo-todo-actions{margin-top:var(--space-3);display:flex;gap:var(--space-2);flex-wrap:wrap}
 .memo-property-panel .memo-todo-actions button{min-height:42px;height:auto;flex:1;white-space:nowrap;font-size:var(--text-caption);font-weight:500;border-radius:var(--radius-sm);display:flex;align-items:center;justify-content:center;gap:var(--space-1)}
 .memo-todo-actions .memo-plan svg{width:14px;height:14px}
 .memo-edit-attachments{margin:var(--space-3) var(--space-4)}
 .memo-full-form .sheet-error:empty{display:none}
}
