/* Mobile FORMLAYER bottom sheet (≤760px), driven by layer-sheet.mjs via #admin[data-sheet].
   States: half (page stays visible above), full (Inhalte/Verlauf), bar (compact approval while a draft is staged).
   Desktop keeps the right-hand panel untouched. */
.sheet-grip{display:none}

@media(max-width:760px){
 #admin[data-sheet]{top:auto;left:0;right:0;bottom:var(--sheet-kb,0px);width:auto;height:var(--sheet-h,56svh);max-height:calc(var(--sheet-vh,100svh) - 8px - env(safe-area-inset-top,0px));border-radius:20px 20px 0 0;box-shadow:0 -14px 50px #0008,0 -1px 0 #ffffff1f;padding-bottom:env(safe-area-inset-bottom,0px);overscroll-behavior:contain;z-index:30;transition:height .34s cubic-bezier(.22,.8,.24,1),transform .34s cubic-bezier(.22,.8,.24,1);will-change:height}
 #admin[data-sheet].kb-open{padding-bottom:0}
 #admin[data-sheet].no-anim,#admin[data-sheet].is-dragging{transition:none}
 #admin[data-sheet].is-auto{height:auto!important;transition:none}
 #admin[data-sheet].is-entering{transform:translateY(100%)}
 #admin[data-sheet].is-dragging{user-select:none;-webkit-user-select:none}
 #admin[data-sheet] :is(.chat-feed,.content-panel,.history-panel){overscroll-behavior:contain}

 /* Drag handle: full-width target, visible pill */
 #admin[data-sheet] .sheet-grip{display:flex;align-items:center;justify-content:center;flex-shrink:0;width:100%;height:26px;margin:0;padding:0;border:0;background:transparent;cursor:grab;touch-action:none;border-radius:20px 20px 0 0}
 #admin[data-sheet] .sheet-grip span{display:block;width:40px;height:5px;border-radius:5px;background:#b3b9a6;transition:background .2s,width .2s}
 #admin[data-sheet] .sheet-grip:hover span,#admin[data-sheet].is-dragging .sheet-grip span{background:#6c755f;width:48px}
 #admin[data-sheet] .sheet-grip:focus-visible{outline:2px solid #29311e;outline-offset:-3px}
 #admin[data-sheet].is-dragging .sheet-grip{cursor:grabbing}
 #admin[data-sheet] .admin-header{padding:0 14px 8px 20px;touch-action:none}
 #admin[data-sheet] #closeAdmin{width:44px;height:44px}

 /* Half: keep the chrome lean so chat + composer fit */
 #admin[data-sheet=half] :is(.admin-status,.admin-footer){display:none}
 #admin[data-sheet=half] .admin-tabs button{padding:13px 0}
 #admin[data-sheet=half] .chat-feed{padding-top:16px}
 #admin[data-sheet=half] .chat-intro>span{display:none}
 #admin[data-sheet=half] .chat-intro h2{font-size:24px!important;margin-bottom:14px}
 #admin[data-sheet=half] .chat-intro p{display:none}
 #admin[data-sheet=half] .chat-form{margin-bottom:10px}
 #admin[data-sheet].kb-open .chat-form{max-height:none}
 #admin[data-sheet=half].kb-open .admin-tabs{display:none}

 /* Bar: only the staged change and the decision */
 #admin[data-sheet=bar]>:not(.sheet-grip):not(:has(#pending)){display:none}
 #admin[data-sheet=bar] :has(>#pending)>:not(#pending){display:none}
 #admin[data-sheet=bar] #chatPanel{flex:none}
 #admin[data-sheet=bar] #pending{display:flex;flex-direction:column;gap:4px;padding:0 16px 12px;background:transparent;border:0}
 #admin[data-sheet=bar] #pending>div:first-child{font-size:11px;line-height:1.3;letter-spacing:.9px;text-transform:uppercase;color:#56633f;white-space:nowrap}
 #admin[data-sheet=bar] #pending>div:first-child strong{font-weight:600}
 #admin[data-sheet=bar] #pendingText{margin:0 0 8px;font-size:15px;font-weight:600;line-height:1.3;color:#24271e;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #admin[data-sheet=bar] #inspectDraft{display:none}
 #admin[data-sheet=bar] .pending-actions{gap:10px}
 #admin[data-sheet=bar] .pending-actions button{min-height:46px;font-size:15px}
 #admin[data-sheet=bar] #publish:focus-visible,#admin[data-sheet=bar] #discard:focus-visible{outline:2px solid #29311e;outline-offset:2px}

 /* Room to scroll everything above the sheet */
 body.admin-open{padding-bottom:var(--sheet-space,0px)}

 /* Slim trigger pill */
 .floating-admin{left:50%;right:auto;bottom:calc(12px + env(safe-area-inset-bottom,0px));transform:translateX(-50%);height:46px;max-width:calc(100% - 32px);padding:0 18px 0 14px;gap:10px;border-radius:999px;font-size:14px;font-weight:500;white-space:nowrap;box-shadow:0 8px 30px #0008;transition:transform .3s cubic-bezier(.22,.8,.24,1),opacity .3s}
 .floating-admin>span:nth-child(2){overflow:hidden;text-overflow:ellipsis}
 .floating-admin small{display:none}
 .floating-admin .spark{font-size:21px;line-height:1}
 .floating-admin>span:last-child{font-size:17px;margin-left:0}
 .floating-admin.is-away{transform:translate(-50%,calc(100% + 24px));opacity:0;pointer-events:none}
 html.kb-open .floating-admin,body:has(#previewBar:not([hidden])) .floating-admin{display:none}
 .preview-bar{bottom:calc(12px + env(safe-area-inset-bottom,0px))}
}

@media(max-width:760px) and (prefers-reduced-motion:reduce){
 #admin[data-sheet],#admin[data-sheet] .sheet-grip span,.floating-admin{transition:none}
 #admin[data-sheet].is-entering{transform:none}
}
