/* Nygui R6: nostalgic buddy status with reliable, viewport-bound chat panels. */
.nygui-self-status{display:grid;gap:10px!important;padding:14px 15px!important;margin:0 0 15px!important;min-width:0;border-radius:16px;background:var(--surface);border:1px solid var(--line)}
.nygui-self-summary{display:flex;align-items:center;gap:12px;flex-wrap:wrap;min-width:0}
.nygui-self-title{display:inline-flex;align-items:center;gap:9px;min-width:80px;font-size:.84rem}
.nygui-self-message{color:var(--muted);font-size:.79rem;margin:0!important;overflow-wrap:anywhere;line-height:1.5}
.nygui-status-choose{flex:1 1 128px;min-width:0}
.nygui-status-choose select{min-height:41px;width:100%;max-width:100%;background:var(--subtle);color:var(--ink);border:1px solid var(--line);border-radius:12px;padding:8px}
.nygui-edit-status{font-size:.79rem;min-height:41px!important;margin:0!important;padding:8px 10px!important;white-space:normal}
.nygui-status-dot{width:12px;height:12px;flex:0 0 12px;display:inline-block;border-radius:50%;background:var(--nygui-dot,#87919d);border:2px solid var(--surface);box-shadow:0 0 0 1px var(--nygui-dot,#87919d)}
.nygui-status-dot[data-presence-mode=away]{background:linear-gradient(90deg,var(--nygui-dot) 50%,transparent 50%)}
.nygui-status-dot[data-presence-mode=dnd]{background:var(--nygui-dot);position:relative}
.nygui-status-dot[data-presence-mode=dnd]:after{content:'';position:absolute;height:2px;width:9px;left:0;top:3px;background:var(--surface);transform:rotate(-35deg)}
.nygui-status-dot[data-presence-mode=offline],.nygui-status-dot[data-presence-mode=invisible]{background:#87919d!important;box-shadow:0 0 0 1px #87919d!important}
.nygui-self-editor[hidden]{display:none!important}
.nygui-self-editor{display:grid;gap:13px;padding-top:12px;border-top:1px solid var(--line)}
.nygui-status-fields{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px 15px}
.nygui-status-fields label{min-width:0;display:grid;gap:7px;font-size:.79rem;font-weight:650}
.nygui-status-fields .field{width:100%;min-width:0;font-weight:400;min-height:42px}
.nygui-status-fields input[type=color]{height:44px;width:100%;padding:4px;background:var(--surface);border:1px solid var(--line);border-radius:10px}
.nygui-palette{display:flex;flex-wrap:wrap;gap:13px}
.nygui-palette button{background:var(--nygui-swatch)!important;width:31px;height:31px;border:3px solid var(--surface)!important;box-shadow:0 0 0 1px var(--nygui-swatch);border-radius:100%;margin:0!important;padding:0!important;min-height:31px!important}
.nygui-save-status{min-height:43px!important;justify-self:start;padding:10px 20px!important;margin:0!important}
.nygui-self-editor .small-print{margin:0!important;line-height:1.55}
.nygui-friend-presence{display:inline-flex;align-items:center;gap:8px;color:var(--muted);font-size:.77rem;line-height:1.4;min-width:0;max-width:100%}
.nygui-friend-presence .nygui-status-dot{width:10px;height:10px;flex-basis:10px}
.nygui-chat-presence{display:block;color:var(--muted);margin:3px 0;font-size:.74rem;flex:1 0 100%;text-align:left}
.nyugi-call-action{display:inline-flex!important;align-items:center!important;justify-content:center!important;gap:9px!important;min-height:43px!important;min-width:44px!important;padding:9px 12px!important;margin:0!important;border-radius:11px!important;white-space:nowrap}
.nyugi-call-action svg,.nygui-call-action svg{display:block;width:23px;height:23px;fill:none!important;stroke:currentColor!important;stroke-width:1.9;flex:0 0 23px}
#nyugiChatPop{position:fixed!important;right:max(12px,env(safe-area-inset-right))!important;top:max(66px,env(safe-area-inset-top))!important;bottom:max(16px,env(safe-area-inset-bottom))!important;left:auto!important;width:min(460px,calc(100vw - 24px))!important;height:auto!important;max-height:calc(100dvh - 82px)!important;min-height:0!important;z-index:205!important;display:flex!important;flex-direction:column!important;overflow:hidden!important;padding:13px!important}
#nyugiChatPop>.nyugi-popup-header{flex:0 0 auto!important;min-height:44px}
#nyugiChatPop>.nygui-self-status{flex:0 0 auto;max-height:40dvh;overflow-y:auto;padding:11px 12px!important;margin:8px 0 7px!important}
#nyugiChatPop>.nyugi-chat-friends{display:flex!important;flex-direction:column!important;align-items:stretch!important;flex:0 1 auto!important;max-height:128px!important;min-height:38px!important;gap:5px!important;overflow-y:auto!important;overflow-x:hidden!important;padding:6px 0 9px!important}
#nyugiChatPop .nyugi-chat-friend{display:flex!important;align-items:center!important;gap:9px!important;text-align:left!important;flex:0 0 auto!important;width:100%!important;min-width:0!important;min-height:36px!important;margin:0!important;padding:8px 12px!important;white-space:normal!important}
#nyugiChatPop .nyugi-chat-friend .nygui-buddy-handle{min-width:0;overflow:hidden;text-overflow:ellipsis}
#nyugiChatPop>.nyugi-chat-conversation{display:flex!important;flex:1 1 0!important;min-height:0!important;overflow:hidden!important}
#nyugiChatPop .nyugi-chat-label{display:flex;flex-wrap:wrap;gap:8px 12px;align-items:center;flex:0 0 auto;min-height:50px;padding-block:5px}
#nyugiChatPop .nyugi-chat-label>div{display:flex;gap:12px;flex-shrink:0}
#nyugiChatPop .nyugi-mini-messages{flex:1 1 0!important;min-height:36px!important;overflow-y:auto!important;overscroll-behavior:contain}
#nyugiChatPop #nyugiPopupMessage{flex:0 0 auto!important;display:grid!important;gap:8px!important;padding-top:8px!important;min-height:0!important;max-height:46dvh!important;overflow-y:auto!important}
#nyugiChatPop #nyugiPopupMessage textarea{min-height:56px!important;max-height:94px!important;resize:vertical!important}
#nyugiChatPop #nyugiPopupMessage .button-row{display:flex!important;justify-content:flex-start!important;gap:9px 11px!important;flex-wrap:wrap!important;align-items:center!important}
#nyugiChatPop #nyugiPopupMessage .button-row>button{min-height:42px!important;padding:8px 11px!important;margin:0!important}
#nyugiChatPop #nyugiPopupMessage .button-row>[type=submit]{margin-left:auto!important}
#chatColumn .section-top{gap:12px 14px;align-items:center;flex-wrap:wrap}
#chatColumn .section-top>.button-row{display:flex!important;align-items:center;gap:12px!important;flex-wrap:wrap}
#chatColumn .nygui-self-status{margin-bottom:16px!important}
#nyugiChatLauncher[data-my-status=dnd]{background:var(--subtle);color:var(--ink)}
/* Incoming call art uses the same legible outlined icons. */
.nyugi-call-orb svg{width:54px;height:54px;fill:none!important;stroke:currentColor;stroke-width:1.8}
@media(max-width:760px){
 #nyugiChatPop{top:max(58px,env(safe-area-inset-top))!important;bottom:calc(80px + env(safe-area-inset-bottom))!important;right:6px!important;width:calc(100vw - 12px)!important;max-height:calc(100dvh - 142px - env(safe-area-inset-bottom))!important;padding:10px!important}
 #nyugiChatPop>.nyugi-chat-friends{max-height:91px!important}
 #nyugiChatPop>.nygui-self-status{max-height:34dvh}
}
@media(max-width:430px){
 .nygui-status-fields{grid-template-columns:minmax(0,1fr)}
 #nyugiChatPop>.nygui-self-status{padding:9px!important}
 #nyugiChatPop .nyugi-chat-label>div{gap:9px}
 #nyugiChatPop .nyugi-chat-label .nygui-call-action{min-height:42px!important}
}
@media(max-height:540px){
 #nyugiChatPop{top:6px!important;bottom:6px!important;max-height:calc(100dvh - 12px)!important}
 #nyugiChatPop>.nyugi-chat-friends{max-height:60px!important}
}

/* In the compact Messenger the editor opens as a contained, scrollable sheet.
   Its header and message composer remain in their own fixed positions. */
#nyugiChatPop>.nygui-self-status{overflow:visible!important;max-height:none!important;position:static}
#nyugiChatPop .nygui-self-editor:not([hidden]){
 display:block!important;position:absolute!important;z-index:8;top:63px;left:12px;right:12px;
 max-height:calc(100% - 75px);overflow-y:auto;overscroll-behavior:contain;
 padding:18px;background:var(--surface);border:1px solid var(--line);border-radius:17px;
 box-shadow:0 16px 40px #0007;
}
#nyugiChatPop .nygui-self-editor .nygui-status-fields{margin-bottom:14px}
#nyugiChatPop .nygui-self-editor .nygui-palette{margin:12px 0}
#nyugiChatPop .nygui-self-editor .nygui-close-status{margin-left:13px;min-height:43px}
#nyugiChatPop .nygui-self-editor .small-print{margin-top:16px!important}
