/* Management editors: one scrolling body, persistent navigation and actions. */
/* The document stays scrollable outside a management modal. Inside it, only
   the body/log scroll layer owns scrolling, including at its boundaries. */
html:has(#dialog.management-editor[open]),body:has(#dialog.management-editor[open]){overflow:hidden;overscroll-behavior:none}
#dialog.management-editor{overscroll-behavior:none}
#dialog.management-editor[open]{display:flex;flex-direction:column;width:min(720px,calc(100vw - 40px));height:min(860px,calc(var(--management-height,100dvh) - 48px));max-height:calc(var(--management-height,100dvh) - 48px);padding:0;overflow:hidden;background:#0c0e0c;border:1px solid #a7936240;border-radius:26px;isolation:isolate}
#dialog.management-editor::before{content:"";position:absolute;inset:0;z-index:-1;pointer-events:none;background:url('/scene-reflections.svg') center top/cover no-repeat;opacity:.2}
.management-editor .dialog-head{flex:none;display:block;margin:0;padding:18px 24px 16px;border-bottom:1px solid #ffffff0b;background:#0b0d0be8}
.management-editor .dialog-head h2{font-size:25px;line-height:1.2;padding:0;margin:14px 0 7px;overflow-wrap:anywhere}
.management-editor .dialog-head>.meta{margin:0;font-size:13px}
.management-topline{display:flex;justify-content:space-between;align-items:center;gap:12px}
.management-topline>button:first-child{min-height:44px;padding:8px 14px;border:1px solid #ffffff17;border-radius:24px;font-size:14px}
.management-editor #dialog-status{flex:none;position:static;margin:10px 18px 0;padding:10px 13px;max-height:20%;overflow:auto;font-size:14px}
.management-body{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;padding:20px 24px 24px;scroll-padding:18px;-webkit-overflow-scrolling:touch}
.management-body form{display:grid;gap:18px;margin:0;min-width:0}
.management-body label{font-size:14px;color:#c5c9bf;min-width:0}
.management-body input,.management-body textarea,.management-body select{font-size:16px;min-height:48px;background:#080a09bd;border-color:#ffffff21;border-radius:14px}
.management-body textarea{min-height:140px;line-height:1.55;resize:vertical}
.management-body button{min-height:44px;font-size:14px}
.management-body small,.management-body .meta{font-size:13px;line-height:1.5}
.management-body .meta{color:#a7afa0}
.management-footer{flex:none;display:grid;gap:8px;padding:13px 20px max(16px,env(safe-area-inset-bottom));background:#11130ff7;border-top:1px solid #ffffff16}
.management-footer p{margin:0;font-size:12px;color:#b6bdad;line-height:1.4}
.management-editor[data-keyboard="true"] .management-footer{display:none}
.management-footer .gold{width:100%;min-height:50px;font-size:16px;border-radius:18px;background:var(--gold);color:#191712;box-shadow:none}
.management-tabs{display:flex;gap:4px;padding:4px;border:1px solid #ffffff18;border-radius:18px;background:#05070580;overflow-x:auto}
.management-tabs button{flex:1;white-space:nowrap;min-width:0;padding:9px 12px;border:0;background:transparent;color:#bfc5b8}
.management-tabs button.active,.management-week button.active{background:#ddbd7b24;color:#eed18f;box-shadow:inset 0 0 0 1px #dcc18377}
.management-find{display:grid;gap:12px;min-width:0;position:sticky;top:0;z-index:2;background:#0c0e0cf5;padding:4px 0 10px}
.management-list-tools{display:flex;align-items:center;gap:12px;justify-content:space-between}
.management-list-tools select{flex:1;min-width:0;max-width:65%;font-size:14px}
.management-list-tools button{flex:none;border-color:#d6b97680;color:#e8ca8a;background:#14160f}
.management-list{display:grid;gap:8px}
.management-row{display:flex;align-items:center;gap:14px;width:100%;padding:15px;text-align:left;min-height:68px;border:1px solid #ffffff17;border-radius:17px;background:#10130ed9;box-shadow:none;color:var(--text)}
.management-row-copy{display:grid;gap:4px;min-width:0;flex:1}
.management-row strong{font-weight:500;font-size:15px;line-height:1.4;overflow-wrap:anywhere}
.management-row small{color:#a6b09b;overflow:hidden;text-overflow:ellipsis;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical}
.management-row-value{font-size:15px;max-width:30%;overflow-wrap:anywhere}
.management-number{font-size:14px;color:#c5baa0;font-variant-numeric:tabular-nums}
.management-fields-stack{display:grid;gap:20px}
.management-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.management-group{display:grid;gap:16px;padding:18px;border:1px solid #ffffff13;border-radius:18px;background:#11140ec9}
.management-group h3{font-size:16px;margin:0;color:#e0dbc9}
.management-group p{margin:0}
.management-toggle{display:flex;align-items:center;gap:12px;min-height:46px}
.management-toggle input[type=checkbox]{flex:none;width:22px;height:22px;min-height:22px}
.management-days{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:5px}
.management-days label{position:relative;display:grid;place-items:center;min-height:44px;cursor:pointer}
.management-days input{position:absolute;opacity:0;width:100%;height:100%;margin:0;min-height:44px;cursor:pointer}
.management-days span{display:grid;place-items:center;width:100%;min-height:44px;border:1px solid #ffffff20;border-radius:12px;font-size:13px}
.management-days input:checked+span{background:#d8be7c25;border-color:#d8be7c;color:#f0d89b}
.management-days input:focus-visible+span{outline:2px solid var(--gold);outline-offset:3px}
.management-week{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:4px}
.management-week button{display:grid;gap:3px;padding:8px 2px;min-width:0;border-radius:12px;font-size:14px}
.management-week small{font-size:11px;color:inherit;opacity:.65}
.management-row-actions,.management-step{display:flex;gap:8px;flex-wrap:wrap;margin-top:18px}
.management-row-actions button{flex:1;padding:10px 12px;white-space:nowrap}
.management-step{border-top:1px solid #ffffff13;padding-top:18px}
.management-step button{flex:1;font-size:14px;padding:10px 8px}
.management-photos{border:1px solid #ffffff1c;border-radius:18px;background:#10130ed9;overflow:hidden}
.management-photos summary{padding:18px;min-height:54px;cursor:pointer;font-size:15px}
.management-photos>div,.management-photos>section{padding:0 18px 18px}
.management-photos .check-photo-editor{margin:0;border:0;background:none}
.management-photos .check-photo-editor>p:first-child{display:none}
.management-editor .scheme-slot{min-width:0}
.management-editor input[type=file]{max-width:100%;font-size:13px;padding:10px}
.management-editor .photo-editor{margin:0}
.management-editor .danger{color:#ecaa98}
.management-log-card{border:1px solid #ffffff15;border-radius:18px;overflow:hidden;background:#10130ed9}
.management-log-card>.management-row{border:0;background:none}
.management-log-detail{padding:0 16px 18px;overflow-wrap:anywhere;white-space:pre-wrap;font-size:15px}
.management-log-detail p{margin-bottom:16px}
.text-edit-bar{position:sticky;top:8px;z-index:24;box-shadow:0 8px 24px #0005}
@media(hover:hover) and (pointer:fine){.management-row:hover{background:#20241a;border-color:#b7a57460}.management-photos summary:hover{background:#ffffff06}}
@media(max-width:760px){
 #dialog.management-editor[open]{position:fixed;inset:auto 0 auto;top:var(--management-top,0px);margin:0;width:100%;max-width:100%;height:var(--management-height,100dvh);max-height:var(--management-height,100dvh);border-radius:0;border:0}
 .management-editor .dialog-head{padding:calc(12px + env(safe-area-inset-top)) 18px 14px}
 .management-editor .dialog-head h2{font-size:25px;margin-top:12px}
 .management-body{padding:18px 18px 24px}
 .management-footer{padding-left:18px;padding-right:18px}
}
@media(max-width:360px){.management-body{padding-left:12px;padding-right:12px}.management-editor .dialog-head{padding-left:12px;padding-right:12px}.management-tabs button{padding-left:9px;padding-right:9px;font-size:13px}.management-row{gap:9px;padding:13px}.management-fields{gap:9px}.management-group{padding:13px}.management-row-actions button{font-size:12px;padding:10px 8px}.management-days{gap:3px}}
@media(max-height:540px){.management-find{position:static}.management-editor .dialog-head{padding-top:8px;padding-bottom:8px}.management-editor .dialog-head h2{font-size:19px;margin:6px 0 0}.management-editor .dialog-head>.meta{display:none}.management-footer{padding-top:8px;padding-bottom:8px}.management-footer p{display:none}.management-footer .gold{min-height:44px}}

.management-date-heading{margin:12px 4px 4px;font-size:14px;font-weight:500;color:#b8c0ad}

/* Separate filters from the scroll layer: rows never pass behind them. */
.management-read-list .management-body{display:flex;flex-direction:column;overflow:hidden;min-width:0}
.management-read-list .management-find{position:static;flex:none;background:#0c0e0c}
.management-log-scroll{flex:1;min-height:0;min-width:0;overflow-y:auto;overflow-x:hidden;overscroll-behavior:contain;scroll-padding:12px}
.management-read-list .management-find>*,.management-log-scroll>*{min-width:0;max-width:100%}
.management-read-list input,.management-read-list select{width:100%;min-width:0;max-width:100%;box-sizing:border-box}
.management-read-list input[type="date"]{display:block;-webkit-appearance:none;appearance:none}
.management-read-list .management-list{grid-template-columns:minmax(0,1fr)}
.management-read-list .management-log-card{min-width:0}

/* Editable checklist items retain native disclosure and keyboard behavior. */
#dialog.management-editor .management-inline-item{padding:0;border-radius:24px 24px 12px 24px;overflow:hidden}
#dialog.management-editor .management-inline-item>summary{display:flex;align-items:center;gap:12px;min-height:66px;padding:14px 16px;list-style:none;cursor:pointer}
#dialog.management-editor .management-inline-item>summary::-webkit-details-marker{display:none}
#dialog.management-editor .management-inline-item>summary::marker{content:''}
#dialog.management-editor .management-inline-item>summary:after{display:none}
.management-inline-item .management-item-number{display:grid;place-items:center;width:30px;height:30px;flex:0 0 30px;border-radius:50%;font-size:13px;font-weight:600;color:#dcbb7e;background:#dcbb7e14}
.management-inline-item .management-item-title{min-width:0;flex:1;font-size:15px;font-weight:600;line-height:1.4;overflow-wrap:anywhere}
.management-inline-item .management-item-toggle{width:28px;height:28px;padding:5px;flex:0 0 28px;border:1px solid #ffffff24;border-radius:50%;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;color:#bdbdb6}
.management-inline-item[open] .management-item-toggle{transform:rotate(45deg);color:#dcbb7e;border-color:#dcbb7e55}
#dialog.management-editor .management-inline-content{padding:0 16px 18px}
#dialog.management-editor .management-inline-item>summary:focus-visible{outline:2px solid #dcbb7e;outline-offset:-4px;border-radius:22px}
@media(prefers-reduced-motion:no-preference){.management-inline-item .management-item-toggle{transition:transform .18s ease-out,color .18s ease-out}}
