/* Embedded Winamp panel: dedicated left column, same DOM instance when floating. */
.servius-winamp-panel {min-width:0;min-height:0;overflow:hidden;display:flex;flex-direction:column;position:relative;z-index:4;border:1px solid rgba(142,155,189,.45);border-radius:14px;background:#10101d;box-shadow:0 7px 26px #0005;}
.servius-winamp-title {height:38px;flex:0 0 38px;display:flex;align-items:center;justify-content:space-between;gap:8px;padding:0 7px 0 12px;color:#dcf4da;background:linear-gradient(180deg,#454760,#232434);font:800 12px/1.2 ui-monospace,Consolas,monospace;user-select:none;touch-action:none;}
.servius-winamp-title-name {overflow:hidden;text-overflow:ellipsis;white-space:nowrap;letter-spacing:.04em;}
.servius-winamp-title-name small {color:#b8bcce;font-size:10px;}
.servius-winamp-actions {display:flex;gap:3px;flex-shrink:0;}
.servius-winamp-actions button {border:1px solid #727a96;background:#24263b;color:#e5eaf5;width:27px;height:25px;min-width:0;padding:0;border-radius:5px;font:700 16px/1 monospace;cursor:pointer;}
.servius-winamp-actions button:hover {background:#4e546d;border-color:#b6dba5;}
.servius-winamp-panel iframe {display:block;width:100%;height:100%;flex:1 1 auto;min-height:0;border:0;background:#090e1a;}
.servius-winamp-resize {display:none;position:absolute;right:0;bottom:0;width:23px;height:23px;cursor:nwse-resize;touch-action:none;background:linear-gradient(135deg,transparent 51%,#a3b2c5 52%,#a3b2c5 56%,transparent 57%,transparent 69%,#a3b2c5 70%,#a3b2c5 75%,transparent 76%);opacity:.75;}
body.servius-winamp-docked .workspace {grid-template-columns:76px 300px var(--servius-winamp-width, 300px) minmax(0,1fr) !important;}
body.servius-winamp-docked .workspace > .detail-pane {display:none!important;}
body.servius-winamp-docked .workspace > .servius-winamp-panel {grid-column:3;grid-row:1;}
body.servius-winamp-docked .workspace > .chat-pane {grid-column:4;grid-row:1;}
body.servius-winamp-docked.chat-sidebar-collapsed .workspace {grid-template-columns:0 0 var(--servius-winamp-width,300px) minmax(0,1fr)!important;}
body.servius-winamp-floating .servius-winamp-panel {position:fixed!important;left:var(--servius-winamp-left,100px);top:var(--servius-winamp-top,100px);width:var(--servius-winamp-width,300px);height:var(--servius-winamp-height,650px);max-width:calc(100vw - 12px);max-height:calc(100dvh - 12px);z-index:10010;box-shadow:0 18px 55px #000b;border-radius:10px;}
body.servius-winamp-floating .servius-winamp-title {cursor:move;}
body.servius-winamp-floating .servius-winamp-resize {display:block;}
body.servius-winamp-floating .workspace > .servius-winamp-panel {grid-column:auto;grid-row:auto;}
@media (max-width:1399px) {
 body.servius-winamp-docked .workspace {grid-template-columns:64px 260px var(--servius-winamp-width,300px) minmax(0,1fr)!important;gap:8px;}
 body.servius-winamp-docked.chat-sidebar-collapsed .workspace {grid-template-columns:0 0 var(--servius-winamp-width,300px) minmax(0,1fr)!important;}
}
@media (max-width:1100px) {
 body.servius-winamp-docked .workspace {grid-template-columns:72px minmax(220px,300px) var(--servius-winamp-width,300px) minmax(0,1fr)!important;}
 body.servius-winamp-floating .servius-winamp-panel {max-height:calc(100dvh - 12px);}
}
.servius-winamp-panel[hidden] {display:none!important;}

/* Build 1878: compact layout and shared transport actions. */
.servius-winamp-actions #serviusWinampLive {width:40px;font:700 10px/1 monospace;}
.servius-winamp-actions button[aria-pressed="true"] {background:#45613d;color:#e4ffca;border-color:#89c378;}
.servius-winamp-title-name {min-width:0;}
@media(max-width:430px){.servius-winamp-title-name small{display:none}.servius-winamp-title{padding-left:5px}.servius-winamp-actions{gap:2px}}

/* Winamp mini chrome: 8px top bezel, raised vertical controls on left. */
.servius-winamp-panel{overflow:visible;}
.servius-winamp-title{height:9px;flex:0 0 9px;min-height:9px;padding:0 4px;position:relative;justify-content:flex-start;border-bottom:1px solid #77839c;overflow:visible;}
.servius-winamp-title-name{font-size:0;position:absolute;inset:0;cursor:move;}
.servius-winamp-actions{position:absolute;z-index:6;top:-1px;left:-34px;width:34px;padding:5px 3px;display:flex;flex-direction:column;align-items:center;gap:4px;border:1px solid #717d9a;border-right:0;border-radius:8px 0 0 8px;background:linear-gradient(90deg,#34394b,#1c1f32);box-shadow:-3px 3px 9px #0006;}
.servius-winamp-actions button{width:27px;height:26px;flex:0 0 26px;font-size:16px;}
.servius-winamp-actions #serviusWinampLive{width:27px;font-size:9px;}
body.servius-winamp-floating .servius-winamp-title{cursor:move;}
@media(max-width:1100px){body.servius-winamp-floating .servius-winamp-panel{max-width:calc(100vw - 45px);}}

/* Docked Winamp is a real column: preserve the right member/detail panel.
   All five tracks must be allowed to shrink; otherwise intrinsic chat content
   can push the far-right pane beyond the window edge. */
@media (min-width:901px) {
 body.servius-winamp-docked .shell > .workspace {
   display:grid !important;
   width:100% !important;
   min-width:0 !important;
   max-width:100% !important;
   grid-template-columns:
     minmax(0,76px)
     minmax(0, var(--servius-sidebar-space, 280px))
     minmax(0, var(--servius-winamp-dock-width, 286px))
     minmax(0,1fr)
     minmax(0, var(--servius-details-space, 280px)) !important;
   grid-template-rows:minmax(0,1fr) !important;
   gap:8px !important;
   overflow:hidden !important;
 }
 body.servius-winamp-docked .workspace > .rail {grid-column:1;grid-row:1;min-width:0;}
 body.servius-winamp-docked .workspace > .sidebar {grid-column:2;grid-row:1;min-width:0;}
 body.servius-winamp-docked .workspace > .servius-winamp-panel {grid-column:3;grid-row:1;min-width:0;}
 body.servius-winamp-docked .workspace > .chat-pane {grid-column:4;grid-row:1;min-width:0;max-width:100%;overflow:hidden;}
 body.servius-winamp-docked .workspace > .detail-pane {grid-column:5;grid-row:1;min-width:0;max-width:100%;}
 body.servius-winamp-docked .workspace > .detail-pane.members-only-pane {display:grid !important;}
 body.servius-winamp-docked.chat-sidebar-collapsed .shell > .workspace {grid-template-columns:0 0 minmax(0,var(--servius-winamp-dock-width,286px)) minmax(0,1fr) minmax(0,var(--servius-details-space,280px)) !important;}
 body.servius-winamp-docked.chat-sidebar-collapsed .workspace > .rail,
 body.servius-winamp-docked.chat-sidebar-collapsed .workspace > .sidebar {display:none !important;}
 body.servius-winamp-docked .workspace .chat-pane > * {min-width:0;max-width:100%;}
}
@media (min-width:901px) and (max-width:1300px) {
 body.servius-winamp-docked {--servius-sidebar-space:220px;--servius-details-space:240px;}
 body.servius-winamp-docked .shell > .workspace {grid-template-columns:minmax(0,60px) minmax(0,var(--servius-sidebar-space,220px)) minmax(0,var(--servius-winamp-dock-width,286px)) minmax(0,1fr) minmax(0,var(--servius-details-space,240px)) !important;}
}
@media (min-width:901px) and (max-width:1100px) {
 body.servius-winamp-docked {--servius-sidebar-space:0px;--servius-details-space:220px;}
 body.servius-winamp-docked .workspace > .sidebar {display:none!important;}
}
/* A narrow viewport cannot physically fit two side panels and the chat;
   use a floating Winamp rather than pushing the chat offscreen. */
@media (max-width:900px){body.servius-winamp-docked .servius-winamp-panel{position:fixed!important;left:40px;top:64px;width:min(286px,calc(100vw - 50px));height:min(650px,calc(100dvh - 75px));z-index:10010;}}

/* Build 1880: native Winamp edge, 1px border, no duplicate Servius caption. */
.servius-winamp-panel{border:1px solid #74768c;border-radius:0;box-shadow:none;overflow:visible;}
.servius-winamp-title{height:1px!important;flex-basis:1px!important;min-height:1px!important;padding:0!important;border-bottom:0!important;background:#777b91!important;}
.servius-winamp-title-name{inset:0;opacity:0;pointer-events:none;}
body.servius-winamp-floating .servius-winamp-title-name{pointer-events:auto;}
/* Controls on RIGHT, offset down from the top edge; title is a draggable pixel rail. */
.servius-winamp-actions{left:auto!important;right:-35px!important;top:17px!important;width:35px!important;padding:4px 3px!important;border:1px solid #717d9a!important;border-left:0!important;border-radius:0 8px 8px 0!important;box-shadow:3px 3px 9px #0006!important;transition:opacity .14s ease,visibility .14s ease;}
.servius-winamp-actions button{width:27px;min-width:27px;}
.servius-winamp-rail-toggle{display:block!important;position:absolute;right:-22px;top:12px;z-index:9;width:22px;height:18px;padding:0;border:1px solid #8b93aa;border-left:0;border-radius:0 5px 5px 0;background:linear-gradient(#656d85,#30374c);color:#dcf6df;font:700 16px/15px monospace;cursor:pointer;user-select:none;}
.servius-winamp-panel:not(.servius-winamp-controls-collapsed) .servius-winamp-rail-toggle{top:0;right:-35px;width:35px;height:17px;border-radius:0 8px 0 0;}
.servius-winamp-panel.servius-winamp-controls-collapsed .servius-winamp-actions{opacity:0;visibility:hidden;pointer-events:none;}
.servius-winamp-panel.servius-winamp-controls-collapsed .servius-winamp-rail-toggle{top:14px;right:-16px;width:16px;height:20px;}
/* Keep right-side nub visible when the dock touches the chat column. */
body.servius-winamp-docked .workspace > .servius-winamp-panel{z-index:10;}
body.servius-winamp-floating .servius-winamp-panel{border-radius:0;}

/* Build 1885: independent mobile Winamp drawer. The tab always stays available. */
@media(max-width:900px){
 body.servius-chat-page #serviusWinampToggle{position:relative!important;z-index:10015!important;}
 body.servius-chat-page.servius-winamp-floating .servius-winamp-panel{
   position:fixed!important;left:0!important;top:44px!important;right:0!important;bottom:0!important;
   width:100vw!important;max-width:100vw!important;
   height:calc(var(--chat-viewport-height,100dvh) - 44px)!important;
   max-height:calc(var(--chat-viewport-height,100dvh) - 44px)!important;
   border:0!important;border-radius:0!important;z-index:10011!important;overflow:hidden!important;
 }
 body.servius-chat-page .servius-winamp-title{height:46px!important;min-height:46px!important;flex:0 0 46px!important;background:#292d41!important;}
 body.servius-chat-page .servius-winamp-title-name{pointer-events:none!important;}
 body.servius-chat-page .servius-winamp-actions,
 body.servius-chat-page .servius-winamp-panel.servius-winamp-controls-collapsed .servius-winamp-actions{
   opacity:1!important;visibility:visible!important;pointer-events:auto!important;
   top:2px!important;left:0!important;right:0!important;width:100%!important;height:42px!important;
   display:flex!important;flex-direction:row!important;gap:4px!important;padding:3px 7px!important;
   border:0!important;border-radius:0!important;box-shadow:none!important;overflow-x:auto!important;
 }
 body.servius-chat-page .servius-winamp-actions button{flex:0 0 auto!important;width:auto!important;min-width:32px!important;height:32px!important;padding:0 7px!important;font-size:12px!important;}
 body.servius-chat-page .servius-winamp-rail-toggle{display:none!important;}
 body.servius-chat-page .servius-winamp-resize{display:none!important;}
 body.servius-chat-page .servius-winamp-panel iframe{width:100%!important;min-height:0!important;overflow:auto!important;}
}
@media(min-width:901px){#serviusWinampListenHere,#serviusWinampScaleDown,#serviusWinampScaleUp{display:none!important;}}
/* 1887 single chat header: drawer begins just beneath the chat header. */
@media(max-width:900px){
 body.servius-chat-page.servius-winamp-floating .servius-winamp-panel{
  top:calc(env(safe-area-inset-top) + 42px)!important;
  height:calc(var(--chat-viewport-height,100dvh) - env(safe-area-inset-top) - 42px)!important;
  max-height:calc(var(--chat-viewport-height,100dvh) - env(safe-area-inset-top) - 42px)!important;
 }
}

/* Build 1888: a 1px skin bezel, not an independently growing empty gutter.
   Keep the native iframe scrollbar unchanged. */
@media(min-width:901px){
 body.servius-winamp-floating .servius-winamp-panel,
 body.servius-winamp-docked .servius-winamp-panel {box-sizing:border-box!important;padding:0!important;}
 body.servius-winamp-floating .servius-winamp-panel iframe,
 body.servius-winamp-docked .servius-winamp-panel iframe {box-sizing:border-box!important;margin:0!important;padding:0!important;}
}
