/* Template-driven tasks: content at the top, notes use the available space. */
.task-type-grid{display:grid;gap:9px}
.template-intro{font-size:13px;color:var(--muted);margin:0 0 14px}
.task-type-card{display:flex;align-items:center;text-align:left;gap:12px;padding:14px;border-radius:14px;min-height:76px;width:100%;background:var(--paper)}
.task-type-card>span:nth-child(2){flex:1;min-width:0}
.task-type-card strong{display:block;font-size:15px}
.task-type-card small{display:block;color:var(--muted);font-size:12px;line-height:1.4;margin-top:4px;font-weight:400}
.task-type-card>svg{width:16px;flex-shrink:0;color:var(--muted)}
.type-icon{display:grid;place-items:center;width:38px;height:38px;border-radius:11px;background:#e9edf7;color:#526695;flex-shrink:0}
.type-icon svg{width:21px;height:21px}
.type-medicine .type-icon{background:#f5e5ee;color:#995c7e}.type-prepare .type-icon{background:#f4edda;color:#897136}.type-routine .type-icon{background:#e2eee5;color:#467956}.type-ondate .type-icon{background:#eee6f6;color:#806397}
#editor.template-editor{padding:0 22px;max-width:680px;width:100%;height:min(850px,94dvh);max-height:94dvh;overflow:hidden}
.template-editor::before{display:none}
.template-editor #task-form{height:100%;display:flex;flex-direction:column;min-height:0}
.template-editor .modal-head{position:static;flex-shrink:0;margin:0;padding:18px 0 12px;min-height:72px}
.task-kind{font-size:11px;color:var(--muted);display:block;margin-bottom:4px}
.template-editor .modal-head h2{font-size:19px}
.task-editor-body{display:flex;flex-direction:column;flex:1;min-height:0;overflow-y:auto;padding:16px 0 8px;scroll-padding:16px}
.template-editor label{font-size:12px;margin-bottom:6px}
.template-editor .title-input{font-size:24px;line-height:1.35;min-height:52px;border:0;box-shadow:none;padding:0;margin-bottom:14px;flex-shrink:0}
.template-editor .schedule-fields{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:10px 12px}
.template-editor .schedule-fields .field{margin:0;min-width:0}
.template-editor .schedule-fields .wide{grid-column:1/-1}
.template-schedule{margin-bottom:14px}
.task-schedule-summary{display:flex;gap:10px;align-items:center;background:var(--bg);padding:13px;border-radius:12px;flex-shrink:0}
.summary-icon svg{width:22px;height:22px;color:var(--accent)}
.task-schedule-summary strong{font-size:13px;line-height:1.5;font-weight:500;display:block}
.task-schedule-summary small{display:block;font-size:11px;color:var(--muted);line-height:1.4;margin-top:3px}
.task-schedule-summary small:empty{display:none}
.template-editor .task-notify{flex-shrink:0;margin:8px 0}
.template-editor .task-notify[hidden],.template-editor .task-schedule-summary[hidden]{display:none}
.task-notes-field{display:flex;flex-direction:column;flex:1;min-height:130px;margin:6px 0 12px}
.task-notes-field textarea{flex:1;min-height:95px;resize:none;background:transparent;border:0;padding:8px 0;box-shadow:none;font-size:16px;line-height:1.6}
.task-more{border-top:1px solid var(--line);flex-shrink:0}
.task-more>summary{min-height:48px;color:var(--muted)}
.task-more-body{padding:0 0 14px}
.task-more-body h3{font-size:12px;margin:16px 0 10px;color:var(--muted)}
.task-secondary-actions{display:flex;gap:8px;margin-top:18px;flex-wrap:wrap}
.task-secondary-actions button{font-size:12px;min-height:44px}
.template-editor #task-form>.form-actions{position:static;margin:0 -22px;padding:12px 22px;flex-shrink:0;border-top:1px solid var(--line);display:flex;background:var(--paper)}
.template-editor .form-actions button{min-height:48px}.template-editor .form-actions .primary{flex:1}
@media(max-width:760px),(max-width:1000px) and (max-height:500px){
 #editor.template-editor{inset:env(safe-area-inset-top) 0 var(--keyboard-space,0);height:calc(100dvh - env(safe-area-inset-top) - var(--keyboard-space,0));max-height:none;max-width:none;border-radius:0;padding:0 18px}
 .template-editor .modal-head{padding-top:12px;min-height:72px}
 .template-editor #task-form>.form-actions{margin:0 -18px;padding:10px 18px calc(10px + env(safe-area-inset-bottom))}
 #modal.template-picker{padding-bottom:calc(20px + env(safe-area-inset-bottom))}
 .task-type-card{padding:12px;min-height:74px}
 .template-editor .task-notify>button{max-width:124px}
}
