@media(min-width:768px) and (max-width:1439px){body.calendar-active #messages{margin-left:284px;width:calc(100% - 296px);max-width:854px}}
#calendarBtn{display:none;white-space:nowrap}
#calendarPanel{position:fixed;z-index:5;left:12px;top:90px;width:260px;box-sizing:border-box;overflow:auto;background:#f4f4efeF;color:#202624;border:1px solid #838a91;border-radius:14px;padding:12px;box-shadow:0 6px 22px #0004}
#calendarPanel[hidden]{display:none}
#calendarPanel button,#calendarPanel input,#calendarPanel textarea{font:inherit;box-sizing:border-box;border:1px solid #9aa0a6;border-radius:7px;padding:7px;min-height:36px}
#calendarPanel button{cursor:pointer;background:#fff;color:#202624}
#calendarPanel button:disabled{opacity:.55;cursor:wait}
#calendarPanel a{color:#1456a0}
#calendarPanel nav{display:grid;grid-template-columns:44px minmax(0,1fr) 44px;align-items:center;gap:6px;margin-bottom:8px}
#calendarPanel .calendar-grid{display:grid;grid-template-columns:repeat(7,1fr);gap:3px}
#calendarPanel .calendar-grid button{padding:4px;min-width:0}
#calendarPanel .calendar-grid [aria-current=date]{background:#175c53;color:#fff;border:2px solid #0b3e37;font-weight:800;box-shadow:0 0 0 2px #175c5355}
#calendarPanel .calendar-grid [data-selected=true]{outline:2px solid #146bc4;outline-offset:1px}
#calendarPanel [data-busy=true]{font-weight:800;text-decoration:underline;text-decoration-thickness:3px}
#calendarPanel .calendar-event{display:block;width:100%;text-align:left;margin:5px 0;overflow-wrap:anywhere}
#calendarPanel label{display:block;margin:8px 0}#calendarPanel input,#calendarPanel textarea{width:100%}
#calendarPanel p{overflow-wrap:anywhere;line-height:1.35}
#calendarPanel details{margin:12px 0}#calendarPanel summary{cursor:pointer}
@media(max-width:767px){
 #calendarBtn{display:flex;align-items:center;justify-content:center}
 #calendarPanel{left:8px;right:8px;width:auto;top:85px;max-height:calc(100svh - 100px)}
}


#calendarPanel #calendarStatus{font-size:12px;margin:0 0 6px}
#calendarBtn{font-size:clamp(11px,3.2vw,14px);padding-inline:4px}
#calendarEditor{position:fixed;inset:0;margin:0;width:100%;max-width:none;max-height:none;box-sizing:border-box;border:0;border-radius:0;padding:0;background:#f4f4ef;color:#202624;overflow:hidden}
#calendarEditor[open]{display:flex;flex-direction:column}
#calendarEditor::backdrop{background:#f4f4ef}
body.calendar-editing #app{visibility:hidden}
#calendarEditor header{display:flex;align-items:center;gap:8px;padding:12px 16px;border-bottom:1px solid #b9bcb5;flex-shrink:0}
#calendarEditor h2{font-size:18px;flex:1;margin:0;outline:none}
#calendarEditor .calendar-editor-body{overflow-y:auto;overscroll-behavior:contain;min-height:0;padding:12px 16px max(16px,env(safe-area-inset-bottom));scroll-padding-block:16px}
#calendarEditor button,#calendarEditor input,#calendarEditor textarea{font:inherit;box-sizing:border-box;border:1px solid #9aa0a6;border-radius:7px;padding:10px;min-height:44px}
#calendarEditor button{background:#fff;color:#202624;cursor:pointer}
#calendarEditor button:disabled{opacity:.55}
#calendarEditor label{display:block;margin:12px 0}
#calendarEditor input:not([type=checkbox]),#calendarEditor textarea{display:block;width:100%;font-size:16px}
#calendarEditor textarea{resize:vertical;overflow-wrap:anywhere}
#calendarEditor p,#calendarPanel .calendar-change p{overflow-wrap:anywhere;white-space:pre-wrap}
#calendarEditor #calendarProposal>button{display:block;width:100%;margin:10px 0}
#calendarEditor .calendar-change{padding:10px 0;border-bottom:1px solid #ccc}
#calendarEditor .calendar-change p{margin:5px 0}

.calendar-linked-text{white-space:pre-wrap}
#calendarPanel a.calendar-text-link,#calendarEditor a.calendar-text-link{display:block;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;margin:6px 0;color:#1456a0;text-decoration:underline;text-underline-offset:3px}

#calendarPanel.calendar-detail-view{background:#f4f4ef}
.calendar-detail{color:#202624}
.calendar-detail>h2{font-size:24px;line-height:1.25;margin:20px 0;overflow-wrap:anywhere}
.calendar-detail-row{padding:14px 0;border-bottom:1px solid #d4d6d0}
.calendar-detail-row h3{font-size:13px;color:#59645e;margin:0 0 7px;font-weight:600}
.calendar-detail-row p{margin:0;white-space:pre-wrap;font-size:17px;line-height:1.5}
.calendar-categories{display:flex;flex-wrap:wrap;gap:7px}
.calendar-category{--category-color:#59645e;display:inline-flex;align-items:center;gap:7px;border:1px solid #ccd0c9;border-radius:7px;padding:5px 9px;background:#fff;overflow-wrap:anywhere}
.calendar-category::before{content:'';width:10px;height:10px;border-radius:50%;background:var(--category-color);flex-shrink:0}
.calendar-detail-actions{display:flex;flex-wrap:wrap;align-items:center;gap:12px;margin:20px 0}
#calendarPanel .calendar-delete,#calendarEditor .calendar-delete{color:#a42020;margin-left:auto}
#calendarPanel select,#calendarEditor select{font:inherit;max-width:100%;width:100%;box-sizing:border-box;padding:9px;background:#fff;color:#202624;border:1px solid #9aa0a6;border-radius:7px}
#calendarPanel small,#calendarEditor small{display:block;font-size:12px;margin-top:5px}

@media(min-width:768px){
 #calendarPanel.calendar-detail-view .calendar-detail>h2{font-size:1em;line-height:1.35;margin:10px 0}
 #calendarPanel.calendar-detail-view .calendar-detail-row{padding:8px 0}
 #calendarPanel.calendar-detail-view .calendar-detail-row h3{margin-bottom:4px}
 #calendarPanel.calendar-detail-view .calendar-detail-row p{font-size:inherit;line-height:1.4}
 #calendarPanel.calendar-detail-view .calendar-category{padding:3px 7px}
 #calendarPanel.calendar-detail-view .calendar-detail-actions{display:grid;grid-template-columns:max-content minmax(0,1fr);gap:8px 10px;margin:12px 0 4px}
 #calendarPanel.calendar-detail-view .calendar-detail-actions>button:not(.calendar-delete){grid-column:1;grid-row:1}
 #calendarPanel.calendar-detail-view .calendar-detail-actions>a{grid-column:2;grid-row:1}
 #calendarPanel.calendar-detail-view .calendar-delete{grid-column:1;grid-row:2;margin-left:0;justify-self:start}
}
#calendarPanel .calendar-month-picker{grid-column:1/-1;grid-row:1;min-width:0;width:100%;display:grid;grid-template-columns:minmax(0,1fr) 6em;gap:6px}
#calendarPanel .calendar-month-picker select{min-width:0;width:100%;font:inherit;box-sizing:border-box;border:1px solid #9aa0a6;border-radius:7px;padding:7px;min-height:40px;background:#fff;color:#202624}
#calendarPanel nav>.calendar-month-arrow{width:44px;min-width:44px;min-height:44px;padding:4px;font-size:28px;line-height:1;grid-row:2}
#calendarPanel nav>.calendar-month-arrow:first-child{grid-column:1}
#calendarPanel nav>.calendar-month-arrow:nth-child(3){grid-column:3}
#calendarPanel nav>.calendar-today{grid-column:2;grid-row:2;justify-self:center;width:auto;min-width:58px;min-height:44px;padding:8px 10px}
#calendarPanel .calendar-view-head{display:flex;align-items:center;gap:8px;margin-bottom:12px}
#calendarPanel .calendar-view-head h2{font-size:15px;flex:1;margin:0}
#calendarPanel .calendar-view-head button{flex:none;min-height:40px}
#calendarPanel input[type=checkbox],#calendarEditor input[type=checkbox]{width:18px;height:18px;min-height:18px;max-width:18px;padding:0;margin:0;flex:none;vertical-align:middle}
#calendarPanel .calendar-check,#calendarEditor .calendar-check{display:flex;align-items:center;gap:10px;flex-wrap:wrap;min-height:36px}
#calendarPanel .calendar-operation-controls,#calendarEditor .calendar-operation-controls{position:sticky;top:0;z-index:3;background:#f4f4ef;padding:8px 0;border-bottom:1px solid #b9bcb5;display:flex;flex-wrap:wrap;gap:6px}
#calendarPanel .calendar-operation-controls>button,#calendarEditor .calendar-operation-controls>button{flex:1;min-height:40px;font-weight:700}
#calendarPanel .calendar-operation-controls>.calendar-save,#calendarEditor .calendar-operation-controls>.calendar-save{background:#175c53;color:#fff;border:2px solid #0b3e37;min-height:48px;font-weight:800;box-shadow:0 2px 4px #0003}
#calendarPanel .calendar-save:focus-visible,#calendarEditor .calendar-save:focus-visible{outline:3px solid #146bc4;outline-offset:2px}
#calendarPanel .calendar-form-status,#calendarEditor .calendar-form-status{width:100%;font-size:14px;margin:0;color:#9b2020}
#calendarPanel .calendar-form-status:empty,#calendarEditor .calendar-form-status:empty{display:none}
#calendarPanel [aria-invalid=true],#calendarEditor [aria-invalid=true]{border:2px solid #b42323;outline:1px solid #b42323;background:#fff4f2}
#calendarPanel .calendar-field-error,#calendarEditor .calendar-field-error{color:#9b2020;font-weight:600}
#calendarPanel [data-time][hidden],#calendarEditor [data-time][hidden]{display:none}
