/* ROOT armor panels and viewport geometry — 2026-10-06 */
html[data-theme] { --red:#35ccff;--danger:#35ccff;--color-danger:#35ccff;--dm-edge-out:rgba(53,204,255,.66);--dm-edge-in:rgba(110,199,235,.4); }
html[data-theme] body{margin:0!important}
html[data-theme] :is(#chatScreen,#directChatScreen,#systemChatScreen).chatScreen {
 position:fixed!important;inset:auto!important;top:var(--root-view-top,0px)!important;left:var(--root-view-left,0px)!important;
 width:var(--root-view-width,100%)!important;max-width:none!important;
 height:var(--root-view-height,100dvh)!important;min-height:0!important;max-height:none!important;
 display:flex!important;flex-direction:column!important;padding:0!important;margin:0!important;
 overflow:hidden!important;box-sizing:border-box!important;
}
html[data-theme] :is(#chatScreen,#directChatScreen,#systemChatScreen).hidden{display:none!important}
html[data-theme] :is(#chatScreen,#directChatScreen,#systemChatScreen)>.chatHead {
 position:relative!important;inset:auto!important;box-sizing:border-box!important;
 flex:0 0 auto!important;height:calc(56px + var(--root-safe-top,env(safe-area-inset-top,0px)))!important;
 min-height:calc(56px + var(--root-safe-top,env(safe-area-inset-top,0px)))!important;
 padding:var(--root-safe-top,env(safe-area-inset-top,0px)) max(8px,env(safe-area-inset-right)) 0 max(8px,env(safe-area-inset-left))!important;
 margin:0!important;gap:8px!important;
}
html[data-theme] :is(#chatScreen,#directChatScreen,#systemChatScreen)>.messages {
 position:relative!important;inset:auto!important;flex:1 1 0!important;
 width:100%!important;max-width:940px!important;min-height:0!important;
 margin:0 auto!important;padding:12px max(8px,env(safe-area-inset-right)) 12px max(8px,env(safe-area-inset-left))!important;
 box-sizing:border-box!important;gap:12px!important;overflow-y:auto!important;overflow-x:hidden!important;
 scrollbar-gutter:auto!important;scroll-padding:12px!important;
}
html[data-theme] :is(#chatScreen,#directChatScreen,#systemChatScreen)>.secureNote {
 position:relative!important;inset:auto!important;flex:0 0 auto!important;margin:0!important;
 padding:5px 8px!important;line-height:1.3!important;font-size:10px!important;
}
html[data-theme] :is(#chatScreen,#directChatScreen)>.composer#rootComposer,
html[data-theme] :is(#chatScreen,#directChatScreen)>.composer#directComposer {
 position:relative!important;inset:auto!important;flex:0 0 auto!important;
 width:100%!important;min-height:0!important;max-height:none!important;
 margin:0!important;padding:8px max(8px,env(safe-area-inset-right)) calc(8px + var(--root-safe-bottom,env(safe-area-inset-bottom,0px))) max(8px,env(safe-area-inset-left))!important;
 box-sizing:border-box!important;gap:6px!important;
}
html[data-theme] #chatScreen #rootComposer {
 display:grid!important;grid-template-columns:44px minmax(0,1fr) 48px!important;
 grid-template-rows:auto!important;align-items:center!important;
}
html[data-theme] #chatScreen #rootComposer :is(#rootAttach,#messageInput,#micBtn,#sendBtn){grid-row:1!important;margin:0!important}
html[data-theme] #chatScreen #rootComposer #rootImagePreview:not(.hidden){grid-row:1!important;grid-column:1/-1!important}
html[data-theme] #chatScreen #rootComposer:has(#rootImagePreview:not(.hidden)) :is(#rootAttach,#messageInput,#micBtn,#sendBtn){grid-row:2!important}
html[data-theme] #chatScreen #rootComposer #messageInput,
html[data-theme] #directChatScreen #directComposer #directInput{width:100%!important;min-width:0!important;min-height:44px!important;max-height:110px!important;padding:10px 12px!important;font-size:16px!important;box-sizing:border-box!important}
html[data-theme] #chatScreen #rootComposer #rootAttach,
html[data-theme] #chatScreen #rootComposer :is(#micBtn,#sendBtn){width:44px!important;height:44px!important;min-width:44px!important;min-height:44px!important}
html[data-theme] #directChatScreen #directComposer{display:grid!important;grid-template-columns:40px 40px minmax(0,1fr) 40px!important;grid-template-rows:auto auto!important;align-items:center!important}
html[data-theme] #directChatScreen #directComposer :is(#directEmoji,#directEmojiToggle,#directSmile){grid-column:1!important;grid-row:1!important}
html[data-theme] #directChatScreen #directComposer #directAttach{grid-column:2!important;grid-row:1!important}
html[data-theme] #directChatScreen #directComposer #directInput{grid-column:3!important;grid-row:1!important}
html[data-theme] #directChatScreen #directComposer :is(#directSend,#directVoice,#directCompressSend){grid-column:4!important;grid-row:1!important}
html[data-theme] #directChatScreen #directComposer>.round{width:40px!important;height:40px!important;min-width:40px!important;min-height:40px!important}
html[data-theme] #directChatScreen #directComposer>.composerScrollControls{grid-row:2!important;grid-column:1/-1!important;justify-self:end!important;display:flex!important;flex-direction:row!important;width:auto!important;margin:0!important}
html[data-theme] #directChatScreen #directComposer :is(.directEditNotice,.directReplyNotice,.directAttachmentPreview):not(.hidden){grid-column:1/-1!important;grid-row:auto!important;margin:0!important}
html[data-theme] #directChatScreen #directComposer:has(:is(.directEditNotice,.directReplyNotice,.directAttachmentPreview):not(.hidden)) :is(#directInput,#directAttach,#directSend,#directVoice,#directEmojiToggle){grid-row:auto!important}
html[data-theme] .keyboardOpen {--root-safe-bottom:0px}
html[data-theme].keyboardOpen :is(#chatScreen,#directChatScreen)>.composer {padding-bottom:8px!important}
html[data-theme] .chatHead :is(.chatHeaderAction,.chatDeleteButton) {background:rgba(8,31,47,.8)!important;color:#8ae4ff!important;border:1px solid rgba(53,204,255,.32)!important}
html[data-theme] :is(.chatDeleteButton,.conversationDelete) .deleteCrossOuter {stroke:#35ccff!important}
html[data-theme] :is(.chatDeleteButton,.conversationDelete) .deleteCrossInner {stroke:#b2edff!important}
html[data-theme] :is(#chatScreen,#directChatScreen) .bubble :is(.directTime,.messageTime){font-size:11px!important;line-height:1.3!important;color:#98bdcf!important;margin-top:6px!important}
html[data-theme] .content .rowCard[data-cid],html[data-theme] .content .rowCard[data-did]{
 background:linear-gradient(145deg,rgba(9,34,53,.96),rgba(1,10,18,.96))!important;
 border:1px solid rgba(53,204,255,.28)!important;box-shadow:inset 0 1px 0 rgba(167,229,255,.06),0 8px 25px rgba(0,0,0,.32)!important;
}
html[data-theme] #appShell>.nav button.on,html[data-theme] #appShell>.nav button.active{color:#80dcff!important;background:rgba(0,153,229,.1)!important;box-shadow:inset 0 2px 0 #35ccff!important}
html[data-theme] #appShell>.nav button.on::before{background:#35ccff!important;box-shadow:0 0 12px rgba(53,204,255,.28)!important}
html[data-theme] #appShell>.nav button[data-nav="root"] .nicon{color:#35ccff!important;background:rgba(53,204,255,.1)!important}
html[data-theme] :is(.danger,.dangerBtn,.ghost.danger,.authError,.adminKill,.adminDelete,.masterPharaohMark,.adminOnlyBrand small){color:#81deff!important;border-color:rgba(53,204,255,.45)!important;text-shadow:none!important}
html[data-theme] :is(.danger,.dangerBtn,.ghost.danger,.adminKill,.adminDelete){background:rgba(8,38,55,.62)!important}
html[data-theme] .recording,html[data-theme] #chatScreen #rootComposer #micBtn.recording{background:#079cff!important;border-color:#a2e8ff!important;color:#f5fcff!important;box-shadow:0 0 20px rgba(53,204,255,.35)!important}
@media(max-width:600px){
 html[data-theme] #appShell.shell{padding:0!important;margin:0!important;width:100%!important}
 html[data-theme] #appShell>.topbar{height:calc(52px + var(--root-safe-top,env(safe-area-inset-top,0px)))!important;min-height:0!important;padding-top:var(--root-safe-top,env(safe-area-inset-top,0px))!important;box-sizing:border-box!important}
 html[data-theme] #mainContent.content{width:100%!important;max-width:none!important;padding-left:8px!important;padding-right:8px!important;margin:0!important}
 html[data-theme] #appShell>.nav{padding-left:4px!important;padding-right:4px!important;box-sizing:border-box!important}
 html[data-theme] :is(#chatScreen,#directChatScreen,#systemChatScreen) .chatHeadTitle{font-size:14px!important}
}

html[data-theme] #directChatScreen #directComposer>.composerScrollControls{position:absolute!important;left:8px!important;right:auto!important;top:-76px!important;bottom:auto!important;display:flex!important;flex-direction:column!important;width:32px!important;gap:4px!important}
html[data-theme] #directChatScreen #directComposer>.composerScrollControls button{width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important}
html[data-theme] #directChatScreen #directComposer:has(#directCompressSend:not(.hidden)){grid-template-columns:40px 40px minmax(0,1fr) 40px 40px!important}
html[data-theme] #directChatScreen #directComposer #directCompressSend{grid-column:4!important;grid-row:1!important}
html[data-theme] #directChatScreen #directComposer:has(#directCompressSend:not(.hidden)) :is(#directVoice,#directSend){grid-column:5!important}

html[data-theme] #directChatScreen #directComposer>.composerScrollControls{grid-area:auto!important;height:68px!important;justify-content:flex-start!important;align-items:stretch!important;transform:none!important}

/* Admin: one vertical scroll container; tabs allow both gesture axes. */
html[data-theme] body.adminClient #appShell.shell{position:fixed!important;inset:0!important;height:var(--root-view-height,100dvh)!important;min-height:0!important;overflow:hidden!important;padding:0!important}
html[data-theme] body.adminClient #appShell>.topbar{height:calc(50px + var(--root-safe-top,env(safe-area-inset-top,0px)))!important;min-height:0!important;padding-top:var(--root-safe-top,env(safe-area-inset-top,0px))!important}
html[data-theme] body.adminClient #appShell>#mainContent.content{position:absolute!important;top:calc(50px + var(--root-safe-top,env(safe-area-inset-top,0px)))!important;bottom:0!important;left:0!important;right:0!important;width:auto!important;height:auto!important;min-height:0!important;max-height:none!important;overflow-x:hidden!important;overflow-y:auto!important;touch-action:pan-x pan-y pinch-zoom!important;-webkit-overflow-scrolling:touch!important;overscroll-behavior-y:contain!important;padding:12px 8px calc(16px + var(--root-safe-bottom,env(safe-area-inset-bottom,0px)))!important}
html[data-theme] body.adminClient #appShell>#mainContent.content .adminTabs,
html[data-theme] body.adminClient #appShell>#mainContent.content .adminTabs>.adminTab{touch-action:pan-x pan-y pinch-zoom!important}
html[data-theme] body.adminClient #appShell>#mainContent.content>*{touch-action:pan-x pan-y pinch-zoom!important}

html[data-theme] #sideDrawer .drawerFooter{display:flex!important;flex-wrap:wrap!important;gap:12px!important;margin-top:auto!important}
html[data-theme] #sideDrawer .drawerVersions{display:flex!important;flex:1 1 100%!important;flex-direction:column!important;gap:7px!important;font-size:11px!important;color:#8faebf!important}
html[data-theme] #sideDrawer .drawerVersions>div{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;width:100%!important}
html[data-theme] #sideDrawer .drawerVersions b{color:#9ee4ff!important;font-weight:600!important;font-variant-numeric:tabular-nums}

/* Honeycomb wallpaper behind the original rounded message bubbles. */
html[data-theme] :is(#chatScreen,#directChatScreen,#systemChatScreen).chatScreen{background-color:#050709!important;background-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22120%22%20height%3D%22208%22%20viewBox%3D%220%200%20120%20208%22%3E%3Cdefs%3E%3ClinearGradient%20id%3D%22p%22%20x2%3D%220.6%22%20y2%3D%221%22%3E%3Cstop%20stop-color%3D%22%2320252b%22%2F%3E%3Cstop%20offset%3D%221%22%20stop-color%3D%22%23080a0d%22%2F%3E%3C%2FlinearGradient%3E%3Cfilter%20id%3D%22g%22%20x%3D%22-60%25%22%20y%3D%22-60%25%22%20width%3D%22220%25%22%20height%3D%22220%25%22%3E%3CfeGaussianBlur%20stdDeviation%3D%223%22%2F%3E%3C%2Ffilter%3E%3Cpath%20id%3D%22h%22%20d%3D%22M60%203%20117%2036V102L60%20135%203%20102V36Z%22%2F%3E%3C%2Fdefs%3E%3Crect%20width%3D%22120%22%20height%3D%22208%22%20fill%3D%22%23020407%22%2F%3E%3Cg%20fill%3D%22none%22%20stroke%3D%22%23829cba%22%20stroke-opacity%3D%22.55%22%20stroke-width%3D%222%22%20filter%3D%22url%28%23g%29%22%3E%3Cuse%20href%3D%22%23h%22%2F%3E%3Cuse%20href%3D%22%23h%22%20x%3D%2260%22%20y%3D%22104%22%2F%3E%3Cuse%20href%3D%22%23h%22%20x%3D%22-60%22%20y%3D%22104%22%2F%3E%3Cuse%20href%3D%22%23h%22%20x%3D%2260%22%20y%3D%22-104%22%2F%3E%3Cuse%20href%3D%22%23h%22%20x%3D%22-60%22%20y%3D%22-104%22%2F%3E%3C%2Fg%3E%3Cg%20fill%3D%22url%28%23p%29%22%20stroke%3D%22%23647b94%22%20stroke-opacity%3D%22.45%22%20stroke-width%3D%22.8%22%3E%3Cuse%20href%3D%22%23h%22%2F%3E%3Cuse%20href%3D%22%23h%22%20x%3D%2260%22%20y%3D%22104%22%2F%3E%3Cuse%20href%3D%22%23h%22%20x%3D%22-60%22%20y%3D%22104%22%2F%3E%3Cuse%20href%3D%22%23h%22%20x%3D%2260%22%20y%3D%22-104%22%2F%3E%3Cuse%20href%3D%22%23h%22%20x%3D%22-60%22%20y%3D%22-104%22%2F%3E%3C%2Fg%3E%3C%2Fsvg%3E")!important;background-size:120px 208px!important;background-repeat:repeat!important}
html[data-theme] :is(#chatScreen,#directChatScreen,#systemChatScreen).chatScreen::before,html[data-theme] :is(#chatScreen,#directChatScreen,#systemChatScreen).chatScreen::after{display:none!important}
html[data-theme] :is(#chatScreen,#directChatScreen,#systemChatScreen)>.messages{background:transparent!important}

/* Chat viewport and stable history: 20261020-chat-viewport1. */
html[data-theme] :is(#chatScreen,#directChatScreen,#systemChatScreen)>.messages {
 overflow-anchor:none!important;overscroll-behavior-y:contain;scroll-behavior:auto!important;
 touch-action:pan-y pinch-zoom;
}
html[data-theme] #chatScreen #rootComposer #messageInput,
html[data-theme] #directChatScreen #directComposer #directInput {
 max-height:min(30dvh,220px)!important;resize:none!important;
}
