/* WELOOMA v15: Pub2Date-inspired EDGE DRAWER interaction, independently designed.
   No external assets, libraries, images, model, backend or database changes. */
:root { --wf-edge-tab: 39px; --wf-side-panel: min(300px, calc(100vw - 95px));
        --wf-history-width: min(590px, calc(100vw - 75px)); }

/* Rail geometry is permanently outside the 3D viewport except for the narrow tabs.
   Use the existing native <details>/<summary> disclosure and its built-in keyboard support. */
.wf-world .wf-rail { width:var(--wf-side-panel)!important; max-width:none!important;
 top:12px!important; bottom:calc(var(--wf-bottom) + 8px)!important;
 gap:10px!important; overflow:visible!important; }
.wf-world .wf-left {left:0!important; right:auto!important;align-items:stretch!important;}
.wf-world .wf-right {right:0!important;left:auto!important;align-items:stretch!important;}
.wf-world .wf-drawer {position:relative!important;width:var(--wf-side-panel)!important;max-width:none!important;
 height:128px!important; min-height:128px!important; flex:0 0 128px!important;
 overflow:visible!important; isolation:isolate; transition:transform .26s cubic-bezier(.18,.8,.19,1);}
.wf-left .wf-drawer {transform:translateX(-100%);}
.wf-left .wf-drawer[open] {transform:translateX(0);z-index:12;}
.wf-right .wf-drawer {transform:translateX(100%);}
.wf-right .wf-drawer[open] {transform:translateX(0);z-index:12;}
.wf-world .wf-drawer>summary {position:absolute!important;top:0!important;z-index:3;
 width:var(--wf-edge-tab)!important;height:128px!important;min-height:128px!important;
 padding:8px 6px!important;display:flex!important; flex-direction:row!important;
 align-items:center!important;justify-content:center!important;gap:6px!important;
 writing-mode:vertical-rl;transform:rotate(180deg);
 border:1px solid #81a694!important;border-radius:0 10px 10px 0!important;
 background:#143c32f2!important;color:#fff!important;font-size:12px!important;
 font-weight:760!important;letter-spacing:.025em;}
.wf-left .wf-drawer>summary {right:calc(-1 * var(--wf-edge-tab));}
.wf-right .wf-drawer>summary {left:calc(-1 * var(--wf-edge-tab));
 border-radius:10px 0 0 10px!important;}
.wf-world .wf-drawer>summary>span:first-child {font-size:16px!important;width:auto!important;display:inline!important;line-height:1!important;color:#f5d99e!important;}
.wf-world .wf-drawer>summary .wf-drawer-title {display:inline!important;}
.wf-world .wf-drawer[open]>summary {background:#316653!important;}
.wf-world .wf-drawer[open]>.wf-drawer-content {display:block!important;}
.wf-world .wf-drawer>.wf-drawer-content {position:absolute!important;top:0!important;left:0!important;
 width:100%!important;max-width:none!important;max-height:min(70dvh,620px)!important;
 padding:14px!important;margin:0!important;border-radius:0 11px 11px 0!important;
 background:#f8fbf7fa!important;border:1px solid #6d9b84!important;
 box-shadow:0 8px 28px #081e1c7a!important;overflow-y:auto!important;overscroll-behavior:contain;}
.wf-right .wf-drawer>.wf-drawer-content {border-radius:11px 0 0 11px!important;}
.wf-world .wf-drawer:focus-within {z-index:25;}

/* Sliding public / private history, anchored to opposite lower screen edges.
   Existing public composer remains permanently on bottom bar. */
.wf-history-tab {position:absolute!important;z-index:34!important;
 bottom:calc(var(--wf-bottom) + 9px)!important;width:var(--wf-edge-tab)!important;
 height:min(222px,calc(100dvh - var(--wf-top) - var(--wf-bottom) - 35px))!important;
 min-height:65px!important;padding:8px 7px!important;border:1px solid #81a694!important;
 font:bold 12px/1.1 system-ui,sans-serif!important;letter-spacing:.035em;
 writing-mode:vertical-rl;display:grid;place-items:center;cursor:pointer;
 color:#f4f7ec!important;background:#153e33f2!important;box-shadow:0 3px 12px #001a1966;
 transition:left .25s ease,right .25s ease,background .2s;}
#wfChatOpen {left:0!important;border-radius:0 10px 10px 0;}
#wfAiOpen {right:0!important;border-radius:10px 0 0 10px;}
#wfChatOpen[aria-expanded="true"] {left:var(--wf-history-width)!important;background:#356e57!important;}
#wfAiOpen[aria-expanded="true"] {right:var(--wf-history-width)!important;background:#356e57!important;}
.wf-history-tab:focus-visible {outline:3px solid #ffd87a;outline-offset:2px;}
.wf-world .wf-overlay-layer {position:absolute!important;left:0!important;right:0!important;
 bottom:calc(var(--wf-bottom) + 9px)!important;display:block!important;z-index:29!important;
 pointer-events:none!important;height:0!important;}
.wf-world .wf-popup {position:absolute!important;bottom:0!important;
 width:var(--wf-history-width)!important;max-width:none!important;
 height:min(245px,calc(100dvh - var(--wf-top) - var(--wf-bottom) - 35px))!important;
 min-height:0!important;display:flex!important;flex-direction:column!important;
 padding:10px 13px!important;border-radius:0 12px 12px 0!important;overflow:hidden!important;
 pointer-events:auto!important;}
.wf-world .wf-chat-popup {left:0!important;right:auto!important;
 animation:wf-slide-from-left .27s ease-out both;}
.wf-world .wf-ai-popup {left:auto!important;right:0!important;
 border-radius:12px 0 0 12px!important;animation:wf-slide-from-right .27s ease-out both;}
@keyframes wf-slide-from-left {from{transform:translateX(-105%);opacity:.7}to{transform:translateX(0);opacity:1}}
@keyframes wf-slide-from-right{from{transform:translateX(105%);opacity:.7}to{transform:translateX(0);opacity:1}}
.wf-world .wf-popup-heading {flex:0 0 auto!important;}
.wf-world #wfChatBody {display:flex!important;flex:1 1 0!important;min-height:0!important;
 flex-direction:column!important;overflow:hidden!important;}
.wf-world #wfChatMessages {display:block!important;flex:1 1 0!important;
 height:auto!important;min-height:0!important;max-height:none!important;
 overflow-y:auto!important;overflow-x:hidden!important;overflow-anchor:none;scrollbar-gutter:stable;
 overscroll-behavior:contain!important;}
.wf-world #wfChatIdentity,.wf-world .wf-popup-hint {flex:0 0 auto!important;}
.wf-world #wfAiMessages {flex:1 1 0!important;height:auto!important;min-height:0!important;
 max-height:none!important;overflow-y:auto!important;overflow-x:hidden!important;}
.wf-world #wfAiIdentity {flex:0 0 auto!important;}
.wf-world #wfAiForm {flex:0 0 38px!important;margin:5px 0 0!important;}
.wf-world #wfAiNotice {flex:0 0 auto!important;min-height:0!important;}
#wfChatScopeNotice[hidden] {display:none!important;}
@media(max-width:780px){:root{--wf-edge-tab:33px;--wf-side-panel:min(275px,calc(100vw - 52px));
 --wf-history-width:calc(100vw - 44px)}
 .wf-world .wf-drawer{height:98px!important;min-height:98px!important;flex-basis:98px!important;}
 .wf-world .wf-drawer>summary {height:98px!important;min-height:98px!important;}
 .wf-history-tab {height:min(180px,calc(100dvh - var(--wf-top) - var(--wf-bottom) - 20px))!important;}
 .wf-world .wf-popup {height:min(220px,calc(100dvh - var(--wf-top) - var(--wf-bottom) - 24px))!important;}
}
@media(max-height:520px){.wf-world .wf-drawer{height:74px!important;min-height:74px!important;flex-basis:74px!important;}
 .wf-world .wf-drawer>summary{height:74px!important;min-height:74px!important;font-size:10px!important;}
 .wf-world .wf-drawer>.wf-drawer-content {max-height:calc(100dvh - var(--wf-top) - var(--wf-bottom) - 20px)!important;}
}
@media(prefers-reduced-motion:reduce){.wf-world .wf-drawer,.wf-history-tab{transition:none!important;}
 .wf-world .wf-popup{animation:none!important;}}
/* The hidden attribute must override the higher-specificity sliding layout. */
.wf-world .wf-popup[hidden], .wf-world #wfChatScopeNotice[hidden] {display:none!important;}

/* WELOOMA v16: independent public and private history panes, no world layout changes. */
.wf-world{min-width:0!important;max-width:100vw!important;contain:layout!important}
.wf-world .viewer{width:100%!important;min-width:0!important;}
.wf-world #stage{width:100%!important;min-width:0!important;}
.wf-overlay-layer{contain:layout!important;}
.wf-world .wf-chat-popup,.wf-world .wf-ai-popup{will-change:transform;}
.wf-world .wf-popup[hidden]{display:none!important;}
/* When both conversations are open, neither closes or resizes the 3D scene. */
@media(min-width:1000px){
 .wf-world .wf-chat-popup:not([hidden]),.wf-world .wf-ai-popup:not([hidden]){
  width:min(40vw,570px)!important;max-width:calc(50vw - 26px)!important;
 }
 #wfChatOpen[aria-expanded="true"]{left:min(40vw,570px)!important;}
 #wfAiOpen[aria-expanded="true"]{right:min(40vw,570px)!important;}
}
/* Visitor controls should never expose developer-only seat tuning. */
#wfInternalSeatTuning[hidden]{display:none!important}
/* Obvious busy feedback within the disabled AI composer. */
#wfAiForm.wf-ai-working #wfAiInput:disabled{opacity:1!important;background:#e9f2e9!important;
 color:#2a5443!important;font-style:italic;font-weight:650;cursor:progress}
#wfAiForm.wf-ai-working #wfAiSend:disabled{opacity:1!important;background:#608b72!important;
 color:#fff!important;cursor:progress}

/* V39: het volledige woord Instellingen blijft op zijn verticale tab staan. */
@media(min-width:781px){
 .wf-world #wfSettingsDrawer{height:146px!important;min-height:146px!important;flex-basis:146px!important;}
 .wf-world #wfSettingsDrawer>summary{width:48px!important;left:-48px!important;
  height:146px!important;min-height:146px!important;
  font-size:11.5px!important;letter-spacing:0!important;padding:6px 7px!important;}
}
@media(max-width:780px){
 .wf-world #wfSettingsDrawer{height:128px!important;min-height:128px!important;flex-basis:128px!important;}
 .wf-world #wfSettingsDrawer>summary{width:38px!important;left:-38px!important;
  height:128px!important;min-height:128px!important;
  font-size:10.5px!important;letter-spacing:0!important;padding:5px 4px!important;}
}
