/* Compact PC channel tabs, independent histories and native-style badges. */
#chatPanel{background:linear-gradient(120deg,#182017da,#090e0bd9);border-color:#9f874b;box-shadow:inset 0 0 0 1px #332b18,0 2px 8px #0006}
#chatPanel .chat-content{height:clamp(112px,20vh,190px);line-height:1.4;padding:5px 5px 4px;scrollbar-color:#a58d4e #1b231aaa}
#chatPanel[data-chat-size=half] .chat-content{height:clamp(64px,10vh,96px)}
#chatPanel .chat-message{margin:0 0 2px;padding:0;overflow-wrap:anywhere;font:12px/1.4 'Phong Than PC v1.1',serif!important;letter-spacing:.15px;text-shadow:1px 1px #000,-1px 0 #000,0 -1px #000}
#chatPanel .chat-message :is(.chat-sender,.chat-text){color:inherit!important;font:inherit!important;letter-spacing:inherit}
#chatPanel .chat-message:not([data-channel=system]) .chat-sender{color:#fff!important}
#chatPanel .chat-message[data-channel=world]{color:#78e89c}
#chatPanel .chat-message[data-channel=private]{color:#a1edb6}
#chatPanel .chat-message[data-channel=nearby]{color:#f4f3e9}
#chatPanel .chat-message[data-channel=party]{color:#80e5a4}
#chatPanel .chat-message[data-channel=system]{color:#ff6253}
#chatPanel .chat-sender:not(:disabled):hover{text-decoration:underline}
#chatPanel .pc-chat-badge{display:inline-flex;align-items:center;justify-content:center;vertical-align:baseline;margin:0 3px 0 0;min-width:17px;height:13px;padding:0 1px;box-sizing:border-box;font:bold 9px/11px Arial,sans-serif!important;letter-spacing:-.4px;color:#f8fcff;text-shadow:1px 1px #0008;border:1px solid #79bacc;box-shadow:inset 0 0 0 1px #d9faff55;background:linear-gradient(#438a9e,#225268)}
#chatPanel .pc-chat-badge[data-channel=nearby]{background:linear-gradient(#5f946c,#2c5439);border-color:#a5c48e}
#chatPanel .pc-chat-badge[data-channel=system]{background:linear-gradient(#b46e38,#67371e);border-color:#e6b17a}
#chatPanel .pc-chat-badge[data-channel=private]{background:linear-gradient(#a378b5,#5e376d);border-color:#d1b4e0}
#chatPanel .pc-chat-badge[data-channel=party]{background:linear-gradient(#447da3,#244962);border-color:#93bddc}
#chatPanel .pc-chat-tabs{flex:none;display:grid;grid-template-columns:1.25fr .75fr .75fr .75fr 1.25fr;gap:1px;min-height:24px;padding:1px 2px;background:#161c0fee;border-top:1px solid #766235;border-bottom:1px solid #4f452c}
#chatPanel .pc-chat-tabs button{position:relative;min-width:0;min-height:23px;margin:0;padding:2px 1px;border:0;border-radius:0;background:transparent;color:#bcb38b;font:11px/17px 'Phong Than PC v1.1',serif;white-space:nowrap;cursor:pointer;text-shadow:1px 1px #000}
#chatPanel .pc-chat-tabs button:before{content:'';display:inline-block;width:4px;height:4px;margin:0 3px 1px 0;background:#846234;border:1px solid #bd9143}
#chatPanel .pc-chat-tabs button[aria-selected=true]{color:#ffe7a4;background:#51422588;box-shadow:inset 0 -2px #e6bb55}
#chatPanel .pc-chat-tabs button[aria-selected=true]:before{background:#ffc658;box-shadow:0 0 4px #f4bf5a}
#chatPanel .pc-chat-tabs button[data-unread=true]:after{content:'';position:absolute;right:3px;top:3px;width:5px;height:5px;border-radius:50%;background:#ff7861;box-shadow:0 0 4px #e9644a}
#chatPanel #chatForm{border-top:0;background:#11170ee8}
#chatPanel[data-active-channel=system] #chatInput{color:#b39a84}
#chatPanel .chat-emoticon{width:18px;height:18px;vertical-align:middle}
@media(max-width:600px){#chatPanel .chat-message{font-size:11px!important;line-height:1.4}}
#chatPanel .pc-chat-tabs{grid-template-columns:minmax(0,1.55fr) minmax(0,.72fr) minmax(0,.72fr) minmax(0,.72fr) minmax(0,1.65fr);width:100%;box-sizing:border-box}
#chatPanel .pc-chat-tabs button{overflow:hidden;text-overflow:ellipsis;min-width:0;padding-inline:1px;font:10px/18px Tahoma,Arial,sans-serif!important;min-height:22px;letter-spacing:0!important;-webkit-text-size-adjust:none;text-size-adjust:none}
#chatPanel .pc-chat-tabs button:before{display:none}
@media(max-width:600px){#chatPanel .pc-chat-tabs button{font:9.5px/18px Tahoma,Arial,sans-serif!important;min-height:22px;padding:1px}}
@media(max-width:350px){#chatPanel .pc-chat-tabs button{font-size:8.5px!important}}
/* Unified coordinate layout driven by game-viewport.mjs; keep chat clear of .quick and .joystick. */
html body.ingame{position:fixed;inset:0;width:100%;height:100%;min-height:0;overflow:hidden;overscroll-behavior:none}
body.ingame #app{width:100%;height:100%;overflow:hidden}
.game-shell .effect-bar{margin-top:0;top:var(--effect-top,86px)}
.game-shell .mission-panel{top:var(--mission-top,120px);width:var(--left-hud-width,190px)}
.game-shell .chat-group{right:max(var(--chat-right,6px),env(safe-area-inset-right));bottom:calc(var(--bottom-bar-height,56px) + max(6px,env(safe-area-inset-bottom)));width:var(--chat-width,210px);max-width:calc(100% - max(var(--chat-right,6px),env(safe-area-inset-right)) - 8px);min-width:0}
.game-shell .chat-group #chatPanel{width:100%;max-width:none;min-width:0;box-sizing:border-box}
.game-shell .chat-actions{height:30px;gap:5px;margin:0 0 2px}
#chatPanel .chat-content{height:var(--chat-content-height,clamp(112px,20vh,180px))}
#chatPanel[data-chat-size=half] .chat-content{height:calc(var(--chat-content-height,112px) * .55)}
#chatPanel :is(#chatInput,#chatChannel,button[type=submit]){font-family:Tahoma,Arial,sans-serif!important}
#chatPanel #chatForm{width:100%;min-width:0;box-sizing:border-box}
#chatPanel .chat-compose,#chatPanel .chat-input-wrap{min-width:0;flex:1 1 0}
#chatPanel .chat-channel-wrap{flex:0 0 60px;width:60px;min-width:0}
#chatPanel .chat-face-btn{flex:0 0 18px;width:18px;min-width:0;margin:0 1px 0 0}
#chatPanel #chatForm button[type=submit]{flex:0 0 32px;width:32px;min-width:0;font-size:10px;padding:0 1px}
@media(max-width:350px){
 #chatPanel .chat-channel-wrap{flex-basis:54px;width:54px}
 #chatPanel #chatForm button[type=submit]{flex-basis:30px;width:30px}
}
@media(max-width:600px) and (orientation:portrait){
 .game-shell .quick{top:calc(100% + 4px);gap:3px}
 .game-shell .quick :is(.empty-slot,.hud-auto-switch,.activity-shortcut){width:34px;height:34px;min-height:34px}
 .game-shell .quick .hud-auto-switch{font-size:9px;gap:2px}
 .game-shell .quick .hud-auto-switch .auto-state{font-size:10px}
 .game-shell .quick .activity-shortcut span{font-size:6.5px!important;line-height:8px!important}
}
