/* Mobile layout: one bounded conversation, independently scrollable panels. */
@media(max-width:767px){
 html,body{width:100%;height:100%;overflow:hidden;overscroll-behavior:none}
 main{display:flex;flex-direction:column;width:100%;height:var(--chat-height,100dvh);max-width:none;margin:0;padding:0;gap:0;overflow:hidden}
 .brand{display:grid;grid-template-columns:minmax(0,1fr) auto;grid-template-rows:auto auto;flex:0 0 auto;min-height:0;max-height:none;overflow:visible;padding:10px 12px 9px;padding-top:max(10px,env(safe-area-inset-top));gap:9px 10px;border:0;border-bottom:1px solid var(--line);border-radius:0;background:var(--panel);z-index:5}
 .brand .logo-mark{width:30px;height:30px;flex:0 0 30px;font-size:17px}
 .brand .logo{font-size:22px;line-height:1.2}
 .brand .logo small,.brand .subtitle,.brand .rooms,.brand .network,.brand footer,.brand .profile-card{display:none}
 .brand .projects-menu{grid-column:2;grid-row:1;margin:0;position:relative;align-self:center}
 .brand .projects-menu summary{font-size:12px;min-height:34px;padding:7px 9px;line-height:1.4;white-space:nowrap}
 .brand .projects-menu .projects{position:absolute;top:40px;right:0;left:auto;width:min(280px,calc(100vw - 24px));max-height:60dvh;overflow-y:auto;padding:10px;background:var(--panel);border:1px solid var(--line);box-shadow:0 10px 30px #0004}
 .brand .projects-menu .projects a{font-size:14px;padding:10px 8px}.brand .projects-menu .projects a small{font-size:12px;display:block}
 .brand .utility{grid-column:1 / -1;grid-row:2;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));width:100%;max-width:none;margin:0;gap:6px;align-items:stretch}
 .brand .utility button,.brand .utility #language-select{min-width:0;width:100%;min-height:38px;height:38px;font-size:12px;padding:7px 4px;line-height:1.3;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;background:var(--surface);color:var(--text)}
 .chat{display:flex;flex-direction:column;flex:1 1 0%;min-height:0;min-width:0;width:100%;overflow:hidden;border:0;border-radius:0}
 .chat>header{display:grid;grid-template-columns:minmax(0,1fr) auto auto;align-items:center;gap:4px 8px;flex:0 0 auto;min-height:0;padding:11px 12px 9px}
 .chat>header .channel-icon,.chat>header .channel-badge{display:none}
 .channel-info{grid-column:1;grid-row:1;min-width:0}.channel-heading{display:block;min-width:0}
 #channelTitle{font-size:19px;line-height:1.3;margin:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 #topic{font-size:12px;line-height:1.5;max-width:none;margin:4px 0 0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
 #status{grid-column:1 / -1;grid-row:2;font-size:12px;line-height:1.4;max-width:none;margin:0;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
 #people-toggle{grid-column:2;grid-row:1;display:block}#leave{grid-column:3;grid-row:1}
 #people-toggle,#leave{font-size:12px;min-height:36px;padding:7px 9px;margin:0;white-space:nowrap}
 .channel-tools{display:flex;flex-wrap:nowrap;flex:0 0 auto;gap:7px;width:100%;min-width:0;padding:9px 12px 0;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;overscroll-behavior-x:contain}
 .channel-tools::-webkit-scrollbar,.views::-webkit-scrollbar{display:none}
 .channel-tools button{flex:0 0 auto;font-size:12px;min-height:36px;line-height:1.4;padding:8px 10px;white-space:nowrap}
 .views{display:flex;flex-wrap:nowrap;flex:0 0 auto;align-items:center;gap:7px;width:100%;min-width:0;padding:9px 12px;overflow-x:auto;overflow-y:hidden;scrollbar-width:none;overscroll-behavior-x:contain}
 .views>button,.views>.view-tab{flex:0 0 auto}.views button{font-size:13px;line-height:1.4;min-height:36px;padding:7px 10px;white-space:nowrap}.views .view-tab{gap:2px}.views .tab-close{min-width:30px;padding:7px;font-size:18px}
 #messages{flex:1 1 0%;min-height:0;min-width:0;overflow-x:hidden;overflow-y:auto;padding:10px 5px;overscroll-behavior-y:contain;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
 .message:not(.system){grid-template-columns:28px minmax(0,1fr) auto;gap:1px 8px;padding:4px 7px;margin:0 0 2px;min-width:0}
 .message:not(.system) .message-avatar{width:28px;height:28px;font-size:11px}.message:not(.system) .message-nick{font-size:13px;line-height:1.4;min-width:0;max-width:100%;overflow-wrap:anywhere}
 .message:not(.system) p{font-size:15px;line-height:1.5;min-width:0;margin:0;overflow-wrap:anywhere;word-break:normal}.message:not(.system) time{font-size:11px;line-height:1.6;padding:0;margin:0;white-space:nowrap}
 .message.system{font-size:12px;line-height:1.5;padding:4px 7px;margin:2px 0;overflow-wrap:anywhere}.message.system time{font-size:11px}
 #error{flex:0 0 auto;max-height:54px;font-size:13px;line-height:1.5;padding:0 12px;overflow-y:auto}
 #composer{display:flex;flex:0 0 auto;align-items:center;min-width:0;gap:6px;margin:4px 10px 0;padding:5px;border:1px solid var(--line);box-shadow:none}
 #composer input{flex:1 1 0%;min-width:0;width:0;min-height:44px;padding:10px 8px;font-size:16px!important;line-height:1.4;border:0;outline-offset:-2px}
 #composer button{flex:0 0 auto;min-width:90px;min-height:44px;padding:10px 9px;font-size:13px;line-height:1.4}#composer button span{display:none}
 .hint{display:flex;flex:0 0 auto;justify-content:space-between;gap:6px;padding:7px 12px;padding-bottom:max(8px,env(safe-area-inset-bottom));font-size:11px;line-height:1.4;flex-wrap:nowrap}.hint span{white-space:nowrap}.hint span:last-child{overflow:hidden;text-overflow:ellipsis;display:block}
 .welcome{width:100%;max-width:390px;min-width:0;padding:12px;margin:auto}.welcome h2{font-size:27px;line-height:1.25;margin:16px 0 22px}.welcome form{width:100%;margin-top:0}.welcome input{font-size:16px!important;min-height:46px}.welcome label{font-size:14px}.welcome .primary{font-size:15px;min-height:46px}.join-room,.join-room strong{font-size:13px}.welcome-note{font-size:12px;line-height:1.6;margin-top:12px}
 .people{display:none;position:fixed;z-index:40;top:max(8px,env(safe-area-inset-top));right:8px;bottom:max(8px,env(safe-area-inset-bottom));width:min(300px,calc(100vw - 16px));height:auto;max-height:none;padding:18px 12px;background:var(--panel);box-shadow:-16px 0 60px #0007;overflow:hidden}
 .people-open .people{display:flex}.people-heading h3{font-size:18px}.people-heading .section-label{font-size:11px}.people-caption{font-size:12px;padding-bottom:10px;margin:10px 0}.people-footer{font-size:11px;padding-top:10px;margin-top:10px}
 #people-close{display:block;width:40px;min-height:40px;font-size:25px;padding:0;margin:0}.user-row{min-height:40px;padding:4px 6px;gap:9px}.user-row .user-name{font-size:14px}.user-row .user-avatar{width:30px;height:30px}
 dialog,#account-dialog{width:calc(100vw - 20px);max-width:500px;max-height:calc(var(--chat-height,100dvh) - 24px);margin:auto;padding:18px;overflow-x:hidden;overflow-y:auto;overscroll-behavior:contain}
 .dialog-head{gap:10px;margin-bottom:14px}.dialog-head h2{font-size:21px;line-height:1.35;overflow-wrap:anywhere}.dialog-head>button{flex:0 0 38px;min-height:38px;height:38px;width:38px;padding:0;font-size:25px}.dialog-note{font-size:13px;line-height:1.6}
 dialog input,dialog select{font-size:16px!important;min-height:44px;width:100%;min-width:0}dialog label{font-size:14px;line-height:1.5;margin:0 0 8px}dialog input[type=file]{font-size:13px!important;max-width:100%}
 .service-buttons,.action-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:7px}.service-buttons button,.action-grid button,.command-buttons button{font-size:13px;line-height:1.4;padding:10px 7px;min-height:44px;white-space:normal;overflow-wrap:anywhere}
 .account-banner{font-size:13px;padding:11px 12px;line-height:1.6}.account-workspace{display:flex;flex-direction:column;gap:14px;min-width:0;margin-top:14px}.account-controls,.account-console-panel{width:100%;min-width:0}.account-controls h3{font-size:17px}.account-console-panel{padding:12px}.console-heading h3{font-size:14px}.console-heading button{font-size:12px;min-height:36px;padding:7px 9px}#account-console{height:190px;max-height:35dvh;font-size:13px;line-height:1.6;margin-top:12px}#account-console p>span:first-child{font-size:11px}
 .advanced-commands{padding:12px}.advanced-commands summary{font-size:14px}.command-help{font-size:13px;padding:10px;overflow-wrap:anywhere}.command-buttons{gap:7px;flex-wrap:wrap}.command-buttons button{flex:1 1 110px}
 .channel-list-tools{gap:7px;min-width:0}.channel-list-tools input{flex:1;min-width:0}.channel-list-tools button{font-size:13px;min-height:44px;padding:8px 10px}.channel-list-row{gap:8px;min-width:0}.channel-list-row>div{min-width:0}.channel-list-row strong{font-size:14px}.channel-list-row p{font-size:13px}.channel-list-row span{font-size:12px}.channel-list-row button{font-size:13px;padding:8px 10px;min-height:40px}
}
@media(max-width:360px){.brand .utility{gap:4px}.brand .utility button,.brand .utility #language-select{font-size:11px}.brand .projects-menu summary{font-size:11px;padding:7px}.brand .logo{font-size:20px}.chat>header{gap:4px 6px}#people-toggle,#leave{padding:7px;font-size:11px}.hint span:last-child{display:none}.service-buttons,.action-grid{grid-template-columns:1fr}}
@media(max-width:767px) and (max-height:480px){.brand{padding:6px 10px;gap:5px}.brand .identity,.brand .projects-menu{display:none}.brand .utility{grid-row:1}.brand .utility button,.brand .utility #language-select{height:34px;min-height:34px}.chat>header{padding:7px 12px}#topic,#status,.hint{display:none}.channel-tools{padding-top:6px}.views{padding-top:6px;padding-bottom:6px}.channel-tools button,.views button{min-height:32px}#composer{margin-bottom:6px}.welcome h2{margin:8px 0 14px}}

/* Reset positioning inherited from the earlier mobile header. */
@media(max-width:767px){
 .brand{position:relative;height:auto;max-height:none;overflow:visible}
 .brand .utility{position:static;inset:auto;transform:none;grid-column:1 / -1;grid-row:2;max-width:none;width:100%}
 .brand .projects-menu{position:relative;inset:auto;top:auto;left:auto;right:auto;bottom:auto;transform:none;width:auto;max-width:100%;margin:0;grid-column:2;grid-row:1}
 .brand .projects-menu summary{max-width:100%;overflow:hidden;text-overflow:ellipsis}
 .chat>header{position:relative;z-index:1}
}

/* Single-column utility menu. */
.brand .utility{grid-template-columns:repeat(1,minmax(0,1fr));}

/* Compact mobile navigation; desktop retains its sidebar controls. */
#mobile-menu-toggle{display:none}
#mobile-menu{display:contents}
#channel-tools[hidden],#views[hidden],#channel-info[hidden],#channel-symbol[hidden],#people-toggle[hidden]{display:none!important}
@media(max-width:767px){
 .brand{grid-template-rows:auto}
 .brand #mobile-menu-toggle{display:block;grid-column:2;grid-row:1;width:40px;height:38px;padding:0;font-size:23px;line-height:1;background:var(--surface);color:var(--text);border:1px solid var(--line)}
 .brand #mobile-menu{display:none;position:absolute;top:100%;left:0;right:0;width:100%;max-width:none;box-sizing:border-box;max-height:calc(var(--chat-height,100dvh) - 70px);overflow-y:auto;padding:10px;background:var(--panel);border:1px solid var(--line);border-radius:7px;box-shadow:0 8px 24px #0003;z-index:20}
 .brand #mobile-menu.is-open{display:flex;flex-direction:column;gap:8px}
 .brand #mobile-menu .utility{display:grid;position:static;grid-column:auto;grid-row:auto;flex:none;min-width:0;grid-template-columns:repeat(1,minmax(0,1fr));margin:0;width:100%;gap:6px}
 .brand #mobile-menu .utility button{height:42px;font-size:14px;text-align:left;padding:9px 12px}
 .brand #mobile-menu .projects-menu{display:block;position:static;grid-column:auto;grid-row:auto;flex:none;min-width:0;margin:0;width:100%}
 .brand #mobile-menu .projects-menu summary{box-sizing:border-box;width:100%;font-size:14px;min-height:42px;padding:10px 12px}
 .brand #mobile-menu .projects-menu .projects{position:static;width:100%;max-height:none;box-shadow:none;margin-top:6px}
}

/* Anchor the app to the visible viewport when the keyboard pans the page. */
@media(max-width:767px){
 main{position:fixed;top:var(--chat-top,0px);left:0;right:0;bottom:auto;min-height:0;box-sizing:border-box}
 html.keyboard-open .channel-tools,html.keyboard-open #topic,html.keyboard-open #status,html.keyboard-open .hint{display:none!important}
 html.keyboard-open .brand{display:grid!important;flex-shrink:0;padding-top:7px;padding-bottom:4px;row-gap:4px}
 html.keyboard-open #desktop-tabs{display:none!important}
 html.keyboard-open .brand #mobile-menu{max-height:calc(var(--chat-height,100dvh) - 54px)}
 html.keyboard-open .chat>header{padding:5px 10px;gap:4px}
 html.keyboard-open #channelTitle{font-size:16px}
 html.keyboard-open .views{padding:4px 10px;gap:5px}
 html.keyboard-open .views button{min-height:30px;padding:4px 8px}
 html.keyboard-open #composer{margin:3px 8px max(4px,env(safe-area-inset-bottom));padding:3px}
 html.keyboard-open #composer input,html.keyboard-open #composer button{min-height:40px;padding:8px}
 html.keyboard-open .welcome{padding:8px;margin:0 auto}
 html.keyboard-open .welcome h2,html.keyboard-open .welcome-note,html.keyboard-open .join-room{display:none}
 html.keyboard-open .welcome form{margin:0}
}

@media(max-width:767px){
 .brand #mobile-menu #language-open{justify-content:flex-start;text-align:left}
}

/* Reserve separate space for the participant count and close button. */
.people-heading{gap:12px}
.people-heading>div{flex:1 1 0%;min-width:0}
.people-heading h3{justify-content:flex-start;gap:8px;flex-wrap:wrap}
.people-heading #count{flex:0 0 auto}
.people-heading #people-close{position:static;flex:0 0 40px;width:40px;min-width:40px;margin-left:0;align-self:center}

#mobile-chat-menu:empty{display:none}
@media(max-width:767px){
 #mobile-chat-menu{display:flex;flex-direction:column;gap:6px;min-width:0}
 .brand #mobile-chat-menu .channel-tools,.brand #mobile-chat-menu .views{display:flex;flex-direction:column;align-items:stretch;gap:6px;width:100%;padding:0;overflow:visible}
 .brand #mobile-chat-menu button{width:100%;min-width:0;min-height:40px;margin:0;padding:9px 12px;font-size:14px;text-align:left;white-space:normal}
 .brand #mobile-chat-menu .view-tab{display:flex;gap:6px;width:100%}
 .brand #mobile-chat-menu .view-tab>button:first-child{flex:1;min-width:0}
 .brand #mobile-chat-menu .view-tab>.tab-close{flex:0 0 40px;width:40px;text-align:center;padding:4px}
 #mobile-chat-menu [hidden]{display:none!important}
}

.mobile-menu-heading{display:none}
@media(max-width:767px){
 .hint{display:none}
 #composer{margin-bottom:max(8px,env(safe-area-inset-bottom))}
 .brand #mobile-menu .mobile-menu-heading{display:block;margin:4px 0 2px;padding:5px 12px;font-size:12px;font-weight:600;color:var(--muted);text-align:left}
}

#mobile-menu-heading[hidden]{display:none!important}

@media(max-width:767px){
 .brand #mobile-menu .radio-player{width:100%;margin:0;padding:12px}
 .radio-player select{font-size:16px;min-height:40px}
}

/* Icon toolbar on desktop only; mobile keeps its labeled menu. */
@media(min-width:768px){
 .brand .utility{grid-template-columns:repeat(4,minmax(0,1fr));gap:8px}
 .brand .utility button{font-size:0!important;display:grid;place-items:center;min-height:38px;padding:5px 8px}
 .brand .utility #language-open>span{display:none}
 .brand .utility button::before{display:block;font-size:22px;line-height:1}
 #theme-toggle::before{content:'☀'}
 html[data-theme=light] #theme-toggle::before{content:'☾'}
 #language-open::before{content:'🌐'}
 #commands-open::before{content:'⌘'}
 #account-open::before{content:'';width:22px;height:22px;background:currentColor;mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='12' cy='8' r='4'/%3E%3Cpath d='M4 21v-2a8 8 0 0 1 16 0v2'/%3E%3C/g%3E%3C/svg%3E") center/contain no-repeat}
}

@media(max-width:767px){
 .radio-player .radio-volume{display:none}
}

/* Keep the station picker inside the visible viewport, including iOS keyboard. */
@media(max-width:767px){
 #radio-dialog{position:fixed;top:calc(var(--chat-top,0px) + 10px);bottom:auto;left:0;right:0;margin:0 auto;width:calc(100% - 20px);height:min(680px,calc(var(--chat-height,100dvh) - 20px));max-height:calc(var(--chat-height,100dvh) - 20px);padding:14px;overflow:hidden;box-sizing:border-box}
 #radio-dialog[open]{display:flex;flex-direction:column}
 #radio-dialog .dialog-head{flex:0 0 auto;margin-bottom:10px}
 #radio-dialog .dialog-head h2{font-size:20px}
 #radio-dialog #radio-search{flex:0 0 auto;margin:0 0 10px;min-height:42px;font-size:16px}
 #radio-dialog .radio-stations{flex:1 1 0%;min-height:0;max-height:none;width:100%;overflow-y:auto;-webkit-overflow-scrolling:touch;grid-template-columns:1fr;align-content:start}
 #radio-dialog .radio-station-option{min-height:46px;padding:7px 9px}
 #radio-dialog #radio-empty{flex:0 0 auto;margin:8px 0}
}

@media(max-width:767px){.message:not(.system) time{max-width:none;white-space:nowrap;text-align:right;font-size:10px;line-height:1.4}}

@media(max-width:767px){
 .brand #mobile-menu>#site-footer{display:block;flex:0 0 auto;margin:0;padding:4px 10px max(7px,env(safe-area-inset-bottom));text-align:center;font-size:10px;line-height:1.45;color:var(--muted);border:0;overflow-wrap:anywhere}
 .brand #mobile-menu>#site-footer a{color:var(--accent);text-decoration:none}
 .brand #mobile-menu>#site-footer .daily-visitors{margin-top:2px;font-size:11px;line-height:1.4}
 #composer{margin-bottom:3px}
}

/* Emoji picker: compact controls on desktop and mobile. */
#composer #emoji-toggle{display:flex;align-items:center;justify-content:center;align-self:center;flex:0 0 44px;min-width:44px;width:44px;height:44px;min-height:44px;padding:0;line-height:1}
#composer #emoji-toggle svg{display:block;flex:none;width:24px;height:24px;margin:0}
#composer #emoji-picker{position:absolute;right:0;bottom:calc(100% + 10px);z-index:40;width:min(352px,100%);height:410px;max-height: min(460px,60dvh);display:flex;flex-direction:column;gap:0;padding:12px 10px 8px;background:var(--panel);color:var(--text);border:1px solid var(--line);border-radius:9px;box-shadow:0 8px 30px #0005;overflow:hidden}
#composer #emoji-picker[hidden]{display:none}
#composer #emoji-picker button{display:flex;align-items:center;justify-content:center;flex:none;min-width:0;min-height:0;margin:0;padding:0;border:0;box-shadow:none;background:transparent;color:inherit;line-height:1}
#composer #emoji-picker button:focus-visible{outline:2px solid var(--accent);outline-offset:-2px}
#emoji-picker .emoji-top{display:flex;align-items:center;gap:10px;flex:none;margin:2px 0 18px}
#composer #emoji-picker .emoji-search{display:block;flex:1 1 90px;min-width:0;width:100px;height:40px;min-height:40px;padding:8px 10px;font-size:13px!important;line-height:20px;background:var(--input);color:var(--text);border:0;border-radius:7px;outline-offset:-2px}
#emoji-picker .emoji-search::placeholder{color:var(--muted)}
#emoji-picker .emoji-tones{display:flex;gap:5px;align-items:center;flex:none}
#composer #emoji-picker .emoji-tones button{width:20px;height:26px;border-radius:5px;position:relative}
#emoji-picker .emoji-tones button::after{content:'';display:block;width:13px;height:13px;border-radius:3px;background:var(--tone)}
#composer #emoji-picker .emoji-tones button[aria-pressed="true"]{background:var(--surface-hover);box-shadow:inset 0 0 0 2px var(--accent)}
#emoji-picker .emoji-tabs{display:flex;justify-content:space-between;gap:2px;flex:none;padding-bottom:12px;border-bottom:1px solid var(--line)}
#composer #emoji-picker .emoji-tabs button{width:30px;height:32px;color:var(--muted);border-radius:4px}
#emoji-picker .emoji-tabs svg{display:block;width:23px;height:23px}
#composer #emoji-picker .emoji-tabs button[aria-selected="true"]{color:var(--accent)}
#composer #emoji-picker .emoji-tabs button:hover{color:var(--text);background:var(--surface-hover)}
#emoji-picker .emoji-body{flex:1;min-height:0;overflow:auto;overscroll-behavior:contain;scrollbar-width:thin;scrollbar-color:var(--muted) transparent;padding:0 4px 0 0}
#emoji-picker h3{font-size:14px;line-height:20px;font-weight:600;margin:14px 0 10px;color:inherit}
#emoji-picker .emoji-grid{display:grid;grid-template-columns:repeat(7,minmax(0,1fr));gap:2px}
#composer #emoji-picker .emoji-item{width:100%;height:40px;font-family:"Apple Color Emoji","Segoe UI Emoji","Noto Color Emoji",sans-serif;font-size:29px;line-height:1;border-radius:5px}
#composer #emoji-picker .emoji-item:hover{background:var(--surface-hover)}
#emoji-picker .emoji-empty{font-size:13px;color:var(--muted);padding:8px 0}
@media(max-width:400px){#emoji-picker .emoji-grid{grid-template-columns:repeat(6,minmax(0,1fr))}#emoji-picker .emoji-top{gap:6px}#emoji-picker .emoji-tones{gap:2px}}
/* Message replies and reactions. */
.message:not(.system){position:relative}
.message .message-actions{position:absolute;right:6px;top:0;display:flex;gap:3px;padding:3px;background:var(--surface);border:1px solid var(--line);border-radius:6px;box-shadow:0 3px 12px #0002;opacity:0;pointer-events:none;z-index:3}
.message:hover .message-actions,.message:focus-within .message-actions,.message.actions-visible .message-actions{opacity:1;pointer-events:auto}
.message .message-actions button{display:flex;align-items:center;justify-content:center;width:32px;height:30px;padding:0;font-size:23px;background:transparent;color:var(--text);border:0}
.message .message-actions button:hover{background:var(--surface-hover)}
/* Mention, reaction, reply and pin share the same SVG size and button style. */
.message .reaction-choices{position:absolute;right:6px;bottom:calc(100% + 4px);z-index:5;display:flex;flex-wrap:wrap;gap:3px;width:max-content;max-width:calc(100% - 12px);background:var(--surface);padding:5px;border:1px solid var(--line);border-radius:7px;margin:0;box-shadow:0 4px 18px #0003}
.message .reaction-choices.open-below{bottom:auto;top:calc(100% + 4px)}
.message .reaction-choices[hidden]{display:none}
.message .reaction-choices button{font-size:22px;width:35px;height:36px;padding:0;border:0;background:transparent;line-height:1}
.message .message-reactions{grid-column:2/-1;display:flex;flex-wrap:wrap;gap:5px;margin:3px 0}
.message .message-reactions button{font-size:13px;line-height:1.3;padding:3px 8px;min-height:28px;border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:12px!important}
.message .message-reactions button[aria-pressed="true"]{border-color:var(--accent);background:#5898ee22}
.message:not(.system) p .message-quote{display:block;width:100%;text-align:left;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border:0;border-left:3px solid var(--accent);background:#5898ee10;color:var(--muted);font-size:12px;line-height:1.4;padding:5px 8px;margin:0 0 5px}
.message.reply-highlight{background:#5898ee28!important}
#reply-preview{display:flex;align-items:center;flex:0 0 auto;gap:8px;margin:0 26px 5px;padding:7px 10px;border-left:3px solid var(--accent);border-radius:5px;background:var(--surface);min-width:0}
#reply-preview[hidden]{display:none}
#reply-preview-text{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:13px;color:var(--muted)}
#reply-cancel{flex:none;border:0;background:transparent;color:var(--muted);font-size:22px;padding:0;width:30px;height:30px}
@media(max-width:767px){#reply-preview{margin:0 10px 3px}.message .message-actions button{height:36px;width:36px}}

.message .chat-link{color:var(--accent);text-decoration:underline;text-underline-offset:3px;overflow-wrap:anywhere;word-break:break-word}.message .chat-link:hover{opacity:.8}
#youtube-dialog{width:min(960px,calc(100vw - 24px));max-width:960px;max-height:calc(100dvh - 24px);padding:16px;background:var(--panel);color:var(--text)}
#youtube-dialog .dialog-head{margin-bottom:12px}#youtube-dialog .dialog-head h2{font-size:20px;margin:0}
#youtube-player{width:100%;aspect-ratio:16/9;max-height:calc(100dvh - 145px);min-height:160px;background:#000;border-radius:8px;overflow:hidden}
#youtube-player iframe{display:block;width:100%;height:100%;border:0}
#youtube-external{display:inline-block;margin-top:12px;color:var(--accent);font-size:13px}

/* Presence dot stays visible below every avatar, including uploaded photos. */
.user-avatar{overflow:visible!important}.user-avatar img{border-radius:inherit}
.user-avatar .activity-dot{position:absolute;right:-2px;bottom:-2px;z-index:2;display:block!important;width:10px;height:10px;min-width:10px;padding:0;border:2px solid var(--panel);border-radius:50%!important;background:#e55353;box-sizing:content-box;box-shadow:0 0 0 1px #00000012}
.user-avatar .activity-dot[data-state="active"]{background:#36c875}
.user-avatar .activity-dot[data-state="idle"],.user-avatar .activity-dot[data-state="offline"]{background:#e55353}

.user-avatar .activity-dot[data-state="unknown"]{background:#8993a2}

/* Show only active users’ green presence dots. */
.user-avatar .activity-dot:not([data-state="active"]){display:none!important}



/* Desktop sidebar controls and conversation navigation. */
.desktop-sidebar-layout #desktop-user-tools{display:flex;flex-wrap:wrap;align-items:center;gap:6px;margin:0 0 16px;position:relative;flex-shrink:0}
.desktop-sidebar-layout #desktop-user-tools #personal-controls,.desktop-sidebar-layout #desktop-user-tools .utility{display:contents}
.desktop-sidebar-layout #desktop-user-tools button,.desktop-sidebar-layout #desktop-user-tools #personal-controls button,.desktop-sidebar-layout #desktop-user-tools .projects-menu summary{display:flex;align-items:center;justify-content:center;flex:0 0 36px;width:36px;min-width:36px;height:36px;min-height:36px;padding:6px;margin:0;box-sizing:border-box;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:6px;font-size:0;cursor:pointer}
.desktop-sidebar-layout #desktop-user-tools button[data-desktop-icon]::before{content:attr(data-desktop-icon);font-size:22px;line-height:1}
.desktop-sidebar-layout #desktop-user-tools #language-open span{display:none}
.desktop-sidebar-layout #desktop-user-tools #personal-controls svg{width:23px;height:23px}
.desktop-sidebar-layout #desktop-user-tools .projects-menu{margin:0;position:static}
.desktop-sidebar-layout #desktop-user-tools .projects-menu summary::before{content:'▦';font-size:24px;line-height:1}
.desktop-sidebar-layout #desktop-user-tools .projects-menu summary::after{display:none}
.desktop-sidebar-layout #desktop-user-tools .projects-menu .projects{position:absolute;top:100%;left:0;right:0;width:auto;z-index:50;max-height:60vh;overflow:auto;background:var(--panel);border:1px solid var(--line);box-shadow:0 8px 24px #0005}
.desktop-sidebar-layout #desktop-conversations{margin:24px 0 12px;min-width:0}
.desktop-sidebar-layout #desktop-conversations h2{font-size:16px;margin:0 0 12px;color:var(--text)}
.desktop-sidebar-layout #desktop-conversations .channel-tools{padding:0;display:flex;flex-wrap:wrap;gap:6px;margin-bottom:10px}
.desktop-sidebar-layout #desktop-conversations .views{padding:0;display:flex;flex-direction:column;gap:6px;max-height:35vh;overflow:auto;min-width:0}
.desktop-sidebar-layout #desktop-conversations .view-tab{display:flex;width:100%;gap:4px}
.desktop-sidebar-layout #desktop-conversations .view-tab>button:first-child{flex:1;min-width:0;text-align:left;overflow-wrap:anywhere}
.desktop-sidebar-layout #desktop-conversations .view-tab>.tab-close{flex:0 0 30px}
#desktop-user-tools[hidden],#desktop-conversations[hidden],#desktop-conversations [hidden]{display:none!important}

/* A uniform row of desktop SVG controls. */
.desktop-sidebar-layout main{grid-template-columns:335px minmax(0,1fr) 352px}
.desktop-sidebar-layout #desktop-user-tools{flex-wrap:nowrap;gap:6px;margin:0 0 24px;padding-bottom:18px;border-bottom:1px solid var(--line)}
.desktop-sidebar-layout #desktop-user-tools button,.desktop-sidebar-layout #desktop-user-tools #personal-controls button,.desktop-sidebar-layout #desktop-user-tools .projects-menu summary{flex:0 0 40px;width:40px;min-width:40px;height:40px;min-height:40px;border-radius:10px!important;background:linear-gradient(145deg,var(--surface),var(--panel));box-shadow:0 2px 5px #0002;transition:background .16s,border-color .16s,transform .16s}
.desktop-sidebar-layout #desktop-user-tools button:not(:disabled):hover,.desktop-sidebar-layout #desktop-user-tools .projects-menu summary:hover{border-color:var(--accent);background:var(--surface-hover,var(--surface));transform:translateY(-1px)}
.desktop-sidebar-layout #desktop-user-tools button:focus-visible,.desktop-sidebar-layout #desktop-user-tools summary:focus-visible{outline:2px solid var(--accent);outline-offset:3px}
.desktop-sidebar-layout #desktop-user-tools button[data-desktop-icon]::before,.desktop-sidebar-layout #desktop-user-tools .projects-menu summary::before{content:'';width:23px;height:23px;display:block;background-color:currentColor;mask-size:contain;mask-repeat:no-repeat;mask-position:center}
.desktop-sidebar-layout .people-heading{margin-bottom:20px;padding-bottom:12px;border-bottom:1px solid var(--line)}
.desktop-sidebar-layout .people-heading h3{margin:0;line-height:1.5}
.desktop-sidebar-layout .brand>.profile-card{margin:20px 0 0;flex-shrink:0}
@media (max-width: 1250px) {
 .desktop-sidebar-layout main {
  grid-template-columns: 250px minmax(0, 1fr) 280px;
 }
}
@media(max-width:767px){.desktop-sidebar-layout main{grid-template-columns:254px minmax(0,1fr)}.desktop-sidebar-layout .people{width:366px;max-width:calc(100vw - 24px)}}
@media(max-width:850px){.desktop-sidebar-layout main{grid-template-columns:228px minmax(0,1fr)}}
.desktop-sidebar-layout #desktop-user-tools #language-open::before{mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%229%22%2F%3E%3Cpath%20d%3D%22M3%2012h18M12%203a17%2017%200%200%201%200%2018%2017%2017%200%200%201%200-18Z%22%2F%3E%3C%2Fsvg%3E")}
.desktop-sidebar-layout #desktop-user-tools #account-open::before{mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%228%22%20r%3D%224%22%2F%3E%3Cpath%20d%3D%22M4%2021v-2a8%208%200%200%201%2016%200v2%22%2F%3E%3C%2Fsvg%3E")}
.desktop-sidebar-layout #desktop-user-tools #commands-open::before{mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%224%22%20width%3D%2218%22%20height%3D%2216%22%20rx%3D%223%22%2F%3E%3Cpath%20d%3D%22m7%209%203%203-3%203M13%2015h4%22%2F%3E%3C%2Fsvg%3E")}
.desktop-sidebar-layout #desktop-user-tools #theme-toggle::before{mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Ccircle%20cx%3D%2212%22%20cy%3D%2212%22%20r%3D%224%22%2F%3E%3Cpath%20d%3D%22M12%202v2m0%2016v2M2%2012h2m16%200h2M5%205l1.5%201.5m11%2011L19%2019M5%2019l1.5-1.5m11-11L19%205%22%2F%3E%3C%2Fsvg%3E")}
.desktop-sidebar-layout #desktop-user-tools .projects-menu summary::before{mask-image:url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20stroke%3D%22black%22%20stroke-width%3D%221.8%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%3E%3Crect%20x%3D%223%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%223%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22%2F%3E%3Crect%20x%3D%223%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22%2F%3E%3Crect%20x%3D%2214%22%20y%3D%2214%22%20width%3D%227%22%20height%3D%227%22%20rx%3D%221.5%22%2F%3E%3C%2Fsvg%3E")}

.views button {
  border-radius: 4px !important;
}

/* Consistent dialog close buttons independent of the font baseline. */
dialog .dialog-head{display:grid;grid-template-columns:minmax(0,1fr) 40px;align-items:start;gap:12px}
dialog .dialog-head h2{margin:0;min-height:40px;display:flex;align-items:center;min-width:0;overflow-wrap:anywhere}
dialog .dialog-head>button{position:relative;display:block;justify-self:end;align-self:start;flex:none;width:40px;min-width:40px;height:40px;min-height:40px;margin:0;padding:0;line-height:1;font-size:0!important;border-radius:8px!important}
dialog .dialog-head>button::before,dialog .dialog-head>button::after{content:'';position:absolute;top:50%;left:50%;width:17px;height:2px;background:currentColor;border-radius:2px;transform:translate(-50%,-50%) rotate(45deg)}
dialog .dialog-head>button::after{transform:translate(-50%,-50%) rotate(-45deg)}


/* Separate chat messages and align avatars with the first line. */
.message:not(.system){border:1px solid var(--line);margin-bottom:7px;padding-top:9px;padding-bottom:9px}
.message:not(.system) .message-avatar{align-self:start;justify-self:start}
.profile-card>.user-avatar{align-self:start}
.message.system{margin-bottom:5px}

.chat>header{padding:12px 26px;min-height:76px}
.chat .channel-heading{gap:8px;line-height:1.2}
.chat .channel-heading h1{margin:0;line-height:1.2}
.chat #topic{margin:3px 0 0;line-height:1.4}
#channel-modes:not([hidden]){display:inline-flex;align-items:center;font-family:ui-monospace,SFMono-Regular,Consolas,monospace;letter-spacing:0;padding:3px 7px;font-size:12px}
#channel-modes[hidden]{display:none!important}
@media(max-width:767px){.chat>header{padding:10px 14px;min-height:66px}}

.desktop-sidebar-layout #desktop-conversations h2{
 font-family:"Segoe UI",system-ui,-apple-system,Arial,sans-serif;
 font-size:15px;font-weight:600;font-style:normal;line-height:1.4;
 letter-spacing:0;text-transform:none;text-shadow:none;
 -webkit-text-stroke:0;-webkit-text-fill-color:currentColor;
 background:none;color:var(--text);margin:0 0 12px;
}

/* Avatar dimensions and appearance requested for all chat surfaces. */
.user-avatar,
.user-row .user-avatar,
.message:not(.system) .message-avatar,
.nick-suggestion .user-avatar{
 width:40px;height:40px;font-size:14px;
 border-radius:13px!important;
 background:var(--surface);color:var(--accent);
 border:solid 1px var(--line);
}
.message:not(.system){grid-template-columns:40px minmax(0,1fr) auto}

/* Channel shortcuts use the same compact SVG controls as the right toolbar. */
#channel-tools{gap:6px}
#channel-tools>button{display:flex;align-items:center;justify-content:center;flex:0 0 40px;width:40px;min-width:40px;height:40px;min-height:40px;padding:6px;margin:0;font-size:0;line-height:1;border:1px solid var(--line);border-radius:10px!important;background:linear-gradient(145deg,var(--surface),var(--panel));color:var(--text);box-shadow:0 2px 5px #0002;transition:background .16s,border-color .16s,transform .16s}
#channel-tools>button svg{display:block;flex:none;width:23px;height:23px}
#channel-tools>button:hover{border-color:var(--accent);background:var(--surface-hover,var(--surface));transform:translateY(-1px)}
#channel-tools>button.active{color:var(--accent);border-color:var(--accent);background:var(--surface)}
#mobile-chat-menu #channel-tools{flex-direction:row;flex-wrap:wrap;gap:6px}
#mobile-chat-menu #channel-tools>button{width:40px;min-width:40px;padding:6px}

#nick-password-form .remember-password{display:flex;align-items:center;gap:9px;margin:14px 0 5px;font-size:14px;cursor:pointer}
#nick-password-form #nick-password-remember{width:17px;height:17px;min-height:17px;margin:0;padding:0;flex:none;accent-color:var(--accent)}
.remember-password-note{display:block;font-size:12px;line-height:1.5;color:var(--muted)}


.radio-controls .radio-live{flex:1;min-width:0}
.radio-controls .radio-live .radio-volume{display:flex;margin-top:5px;width:100%;gap:6px}
.radio-controls .radio-live #radio-mute{display:flex;align-items:center;justify-content:center;flex:0 0 24px;min-height:24px;width:24px;padding:0}
.radio-controls .radio-live #radio-volume{min-height:20px;height:20px;padding:0}

#composer #send .send-icon{display:none}
@media(max-width:767px){
 #composer #send{display:flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;min-width:44px;height:44px;min-height:44px;padding:0}
 #composer #send .send-label{display:none}
 #composer #send .send-icon{display:block;flex:none;width:23px;height:23px}
}

.channel-tool-label,.mobile-menu-icon{display:none}
@media(max-width:767px){
 #composer #send{display:block;flex:0 0 auto;width:auto;min-width:94px;height:auto;min-height:44px;padding:10px}
 #composer #send .send-label{display:inline}
 #composer #send .send-icon{display:none}
 #mobile-chat-menu #channel-tools{flex-direction:column;align-items:stretch}
 #mobile-chat-menu #channel-tools>button{width:100%;min-width:0;flex:0 0 auto;justify-content:flex-start;gap:10px;font-size:14px;line-height:1.4;padding:9px 12px;min-height:42px;height:auto}
 #mobile-chat-menu #channel-tools .channel-tool-label{display:inline}
 .brand #mobile-menu .mobile-menu-icon{display:inline-block;flex:none;width:22px;height:22px;vertical-align:middle}
 .brand #mobile-menu #account-open,.brand #mobile-chat-menu #leave{display:flex;align-items:center;justify-content:flex-start;gap:10px}
 .brand #mobile-menu .projects-menu summary{display:flex;align-items:center;justify-content:flex-start;gap:10px}
 .brand #mobile-menu .projects-menu summary .projects-menu-label{float:none}
}

/* Mobile send button is an icon; menu shortcuts keep their text labels. */
@media(max-width:767px){
 #composer #send{display:flex;align-items:center;justify-content:center;flex:0 0 44px;width:44px;min-width:44px;height:44px;min-height:44px;padding:0}
 #composer #send .send-label{display:none}
 #composer #send .send-icon{display:block;flex:none;width:23px;height:23px}
}

.radio-launcher{display:flex;align-items:center;justify-content:center;gap:13px;width:100%;min-height:82px;margin:24px 0 0;padding:18px;font-size:20px;font-weight:600;color:var(--accent);background:linear-gradient(135deg,var(--surface),var(--panel));border:1px solid var(--line);border-radius:12px!important;box-shadow:0 4px 15px #0002;cursor:pointer}
.radio-launcher svg{flex:none;display:block}
.radio-launcher:hover,.radio-launcher.is-playing{border-color:var(--accent);background:var(--surface)}
#radio-player-panel{width:min(440px,calc(100vw - 28px));box-sizing:border-box}
#radio-player-panel .radio-player{margin:0;padding:0;border:0;background:transparent;border-radius:0;box-shadow:none;display:block;width:100%}
#radio-player-panel .radio-volume{display:flex}
#radio-player-panel #radio-volume{min-height:20px}
@media(max-width:767px){
 .brand #mobile-chat-menu #radio-player-open{display:flex;align-items:center;justify-content:center;gap:12px;min-height:62px;width:100%;margin:0;padding:12px;font-size:18px}
}

#radio-player-panel .radio-bars-wide{display:flex;width:100%;height:42px;align-items:flex-end;justify-content:space-between;gap:2px;margin:18px 0 10px;padding:0 2px;overflow:hidden}
#radio-player-panel .radio-bars-wide i{flex:1;min-width:0;max-width:none;height:4px;background:var(--accent);border-radius:3px;opacity:.65;animation:none}
#radio-player-panel .is-playing .radio-bars-wide i{opacity:1;animation:radio-wide-wave .7s ease-in-out infinite alternate;animation-delay:var(--bar-delay)}
@keyframes radio-wide-wave{from{height:4px}to{height:var(--bar-level,32px)}}
@media(prefers-reduced-motion:reduce){#radio-player-panel .is-playing .radio-bars-wide i{animation:none;height:var(--bar-level,20px)}}

.radio-launcher{min-height:41px;padding:9px;gap:9px;font-size:16px}
.radio-launcher svg{width:23px;height:23px}
@media(max-width:767px){
 .brand #mobile-chat-menu #radio-player-open{min-height:31px;padding:6px;font-size:15px;gap:8px}
}

#desktop-conversations .radio-launcher{margin:0 0 12px}
.chat>.client-downloads{display:flex;align-items:center;gap:12px;flex:0 0 auto;flex-wrap:wrap;margin:0;padding:4px 26px 12px;background:transparent;border:0;border-radius:0;box-shadow:none}
.chat>.client-downloads h3{font-size:11px;font-weight:500;line-height:1.4;margin:0;color:var(--muted)}
.chat>.client-downloads .client-download-grid{grid-template-columns:repeat(4,42px);gap:5px}
.chat>.client-downloads .client-platform{min-height:40px;padding:5px 2px;gap:3px;font-size:8px;border-radius:6px}
.chat>.client-downloads .client-platform svg{width:17px;height:17px;flex:none}
@media(max-width:767px){
 .chat>.client-downloads{padding:5px 12px 8px;gap:8px}
 .brand #mobile-chat-menu #radio-player-open{margin-bottom:6px}
}

/* Real audio frequencies replace the decorative animation. */
#radio-player-panel .radio-bars-wide i,#radio-player-panel .is-playing .radio-bars-wide i{animation:none!important;height:4px;transition:height .07s linear;will-change:height}

/* Sidebar radio/downloads and browser-style desktop conversation tabs. */
#radio-player-panel{display:block;width:100%;margin:18px 0 0;padding:12px;box-sizing:border-box;background:var(--panel);border:1px solid var(--line);border-radius:10px}
#radio-player-panel .radio-bars-wide{height:38px;margin:12px 0 8px}
#radio-player-panel.is-playing .radio-bars-wide i{opacity:1;animation:none!important}
.brand .client-downloads{margin:12px 0 0;padding:10px;background:var(--panel);border:1px solid var(--line);border-radius:10px}
.brand .client-downloads h3{margin:0 0 8px;font-size:11px;font-weight:500}
.brand .client-download-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:5px}
.brand .client-download-grid .client-platform{min-height:40px;padding:5px 2px;gap:3px;font-size:8px;border-radius:6px}
.brand .client-download-grid .client-platform svg{width:17px;height:17px;flex:none}
#desktop-tabs[hidden]{display:none!important}
.desktop-sidebar-layout #desktop-tabs{display:block;flex:0 0 auto;min-width:0;background:var(--panel);border-radius:var(--radius) var(--radius) 0 0}
.desktop-sidebar-layout #desktop-tabs .views{display:flex;flex-direction:row;flex-wrap:nowrap;gap:4px;padding:8px 12px 0;margin:0;border:0;overflow-x:auto;min-width:0}
.desktop-sidebar-layout #desktop-tabs .view-tab{display:inline-flex;align-items:stretch;flex:0 0 auto;gap:0;max-width:240px}
.desktop-sidebar-layout #desktop-tabs .views button{min-height:34px;padding:6px 12px;white-space:nowrap;border-radius:4px!important;background:var(--surface);border:1px solid var(--line)}
.desktop-sidebar-layout #desktop-tabs .views button.active{background:var(--chat);border-color:var(--accent);color:var(--accent)}
.desktop-sidebar-layout #desktop-tabs .view-tab>button:first-child{overflow:hidden;text-overflow:ellipsis;max-width:200px}
.desktop-sidebar-layout #desktop-tabs .view-tab>.tab-close{width:28px;padding:3px;flex:none;margin-left:2px}
.message .message-actions{top:50%;right:8px;transform:translateY(-50%)}
@media(max-width:767px){
 .brand #mobile-chat-menu #radio-player-panel{width:100%;margin:6px 0 0;padding:12px;background:var(--surface);opacity:1}
}

/* More spacious desktop tabs and one mobile conversation selector. */
.desktop-sidebar-layout #desktop-tabs .views{padding:14px 16px 10px;gap:7px;align-items:stretch;background:linear-gradient(180deg,var(--surface),var(--panel))}
.desktop-sidebar-layout #desktop-tabs .views button{min-height:44px;padding:10px 16px;font-size:14px;border-color:var(--line);transition:background .15s,border-color .15s,box-shadow .15s}
.desktop-sidebar-layout #desktop-tabs .views button:hover{background:var(--surface-hover,var(--surface));border-color:var(--accent)}
.desktop-sidebar-layout #desktop-tabs .views button.active{color:var(--accent);background:var(--chat);box-shadow:inset 0 -3px 0 var(--accent),0 2px 7px #0002}
.desktop-sidebar-layout #desktop-tabs .view-tab>.tab-close{width:30px;padding:4px;min-height:44px}
.desktop-sidebar-layout #desktop-tabs{display:flex;align-items:center;gap:10px;flex:0 0 auto;min-width:0;padding:14px 16px 10px;background:linear-gradient(180deg,var(--surface),var(--panel))}
.desktop-sidebar-layout #desktop-tabs #channel-tools{display:flex;align-items:center;flex:0 0 auto;gap:6px;padding:0;margin:0}
.desktop-sidebar-layout #desktop-tabs .views{flex:1;min-width:0;padding:0;background:transparent}
.desktop-sidebar-layout #desktop-tabs #channel-tools[hidden]{display:none!important}

.desktop-sidebar-layout #desktop-user-tools{flex-wrap:wrap}
.desktop-sidebar-layout #desktop-connection-row{display:flex;align-items:center;justify-content:space-between;gap:12px;flex:0 0 100%;width:100%;margin-top:8px}
.desktop-sidebar-layout #desktop-user-tools #desktop-connection-row #status{flex:1;min-width:0;max-width:none;margin:0;font-size:12px;line-height:1.4;white-space:normal;text-align:left}
.desktop-sidebar-layout #desktop-user-tools #desktop-connection-row #leave{display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:auto;min-width:66px;height:34px;min-height:34px;margin:0;padding:7px 12px;font-size:12px;line-height:1.4;border-radius:6px!important}
#desktop-connection-row #leave[hidden]{display:none!important}

/* Fixed-size track actions; mobile menu button rules must not stretch them. */
#radio-player-panel .radio-track-row{display:grid;grid-template-columns:minmax(0,1fr) repeat(3,32px);align-items:center;gap:6px}
#radio-player-panel .radio-track-row>button{display:grid;place-items:center;box-sizing:border-box;width:32px;min-width:32px;height:32px;min-height:32px;margin:0;padding:6px;line-height:1;border:1px solid var(--line);border-radius:6px;background:var(--panel);color:var(--accent)}
#radio-player-panel .radio-track-row>button svg{display:block;width:18px;height:18px;flex:none}
#radio-player-panel .radio-track-row>button:hover:not(:disabled){border-color:var(--accent);background:var(--surface-hover)}
#radio-player-panel .radio-track-row>button:disabled{opacity:.35;cursor:default}
#radio-player-panel #radio-youtube{color:#ff4545}
@media(max-width:767px){
 .brand #mobile-chat-menu #radio-player-panel .radio-track-row{grid-template-columns:minmax(0,1fr) repeat(3,36px);gap:6px}
 .brand #mobile-chat-menu #radio-player-panel .radio-track-row>button{width:36px;min-width:36px;height:36px;min-height:36px;padding:8px;text-align:center;white-space:nowrap}
 #desktop-tabs{display:flex;align-items:center;gap:6px;flex:0 0 auto;min-width:0;padding:7px 8px;background:linear-gradient(180deg,var(--surface),var(--panel));border-bottom:1px solid var(--line)}
 #desktop-tabs #channel-tools{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:center;flex:0 0 auto;width:auto;gap:4px;margin:0;padding:0}
 #desktop-tabs #channel-tools>button{flex:0 0 28px;width:28px;min-width:28px;height:30px;min-height:30px;padding:4px;border-radius:6px!important}
 #desktop-tabs #channel-tools>button svg{width:18px;height:18px}
 #desktop-tabs .channel-tool-label{display:none}
 #desktop-tabs .views{display:flex;flex-direction:row;flex-wrap:nowrap;align-items:stretch;flex:1;min-width:0;max-height:none;gap:4px;margin:0;padding:0;overflow-x:auto;overflow-y:hidden;scrollbar-width:thin;background:transparent}
 #desktop-tabs .view-tab{display:inline-flex;align-items:stretch;flex:0 0 auto;gap:2px;max-width:150px}
 #desktop-tabs .views button{box-sizing:border-box;flex:0 0 auto;min-height:30px;height:30px;margin:0;padding:5px 8px;font-size:11px;line-height:18px;white-space:nowrap;background:var(--surface);border:1px solid var(--line)}
 #desktop-tabs .views button.active{background:var(--chat);border-color:var(--accent);color:var(--accent);box-shadow:inset 0 -2px 0 var(--accent)}
 #desktop-tabs .view-tab>button:first-child{min-width:0;max-width:120px;overflow:hidden;text-overflow:ellipsis}
 #desktop-tabs .view-tab>.tab-close{flex:0 0 22px;width:22px;min-width:22px;padding:4px;text-align:center}
}

/* People shortcut immediately before the mobile menu. */
#people-toggle .people-toggle-icon{display:none}
@media(max-width:767px){
 .brand{grid-template-columns:minmax(0,1fr) 40px 40px;column-gap:6px}
 .brand #people-toggle{grid-column:2;grid-row:1;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:40px;min-width:40px;height:38px;min-height:38px;margin:0;padding:0;border:1px solid var(--line);background:var(--surface);color:var(--text);border-radius:8px!important;touch-action:manipulation}
 .brand #people-toggle .people-toggle-icon{display:block;width:22px;height:22px;flex:none}
 .brand #people-toggle .people-toggle-label{display:none}
 .brand #people-toggle[aria-expanded="true"]{color:var(--accent);border-color:var(--accent)}
 .brand #mobile-menu-toggle{grid-column:3;grid-row:1}
}

/* Smaller phone composer buttons with their original appearance. */
@media(max-width:767px){
 #composer{gap:4px;padding:4px;margin-left:8px;margin-right:8px}
 #composer #text{min-height:38px;padding:8px 6px;font-size:16px!important}
 #composer #emoji-toggle,#composer #send{display:flex;align-items:center;justify-content:center;align-self:center;box-sizing:border-box;flex:0 0 36px;width:36px;min-width:36px;height:36px;min-height:36px;margin:0;padding:0;line-height:1;touch-action:manipulation}
 #composer #emoji-toggle svg,#composer #send .send-icon{display:block;flex:none;width:20px;height:20px;margin:0}
 #composer #send .send-label{display:none}
}

/* Topic visibility is shared by desktop and phone layouts. */
#chat-topic-header[hidden]{display:none!important}
#chat-topic-header{position:relative;padding-right:100px}
#chat-topic-header #topic-close,#chat-topic-header #topic-edit{position:absolute;top:10px;right:10px;display:flex;align-items:center;justify-content:center;box-sizing:border-box;width:32px;min-width:32px;height:32px;min-height:32px;margin:0;padding:0;background:var(--surface);color:var(--muted);border:1px solid var(--line);border-radius:6px!important;touch-action:manipulation}
#chat-topic-header #topic-close svg,#chat-topic-header #topic-edit svg{display:block;width:18px;height:18px}
#chat-topic-header #topic-close:hover,#chat-topic-header #topic-edit:hover{color:var(--accent);border-color:var(--accent)}
#chat-topic-header #topic-edit{right:50px}
#chat-topic-header #topic-edit[hidden]{display:none!important}
#topic-edit-dialog #topic-edit-input{display:block;box-sizing:border-box;width:100%;min-height:115px;resize:vertical;margin:8px 0 12px;padding:12px;line-height:1.5;font:inherit;background:var(--surface);color:var(--text);border:1px solid var(--line);border-radius:4px}
#topic-edit-dialog #topic-edit-input:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
#topic-edit-dialog #topic-edit-error{color:var(--danger,#e66);min-height:1.4em;margin:8px 0}
@media(max-width:767px){
 #chat-topic-header{padding-right:94px}
 #chat-topic-header #topic-close{top:7px;right:8px}
 #chat-topic-header #topic-edit{top:7px;right:46px}
}

@media(max-width:767px){
 .brand #mobile-menu>#site-footer{display:block;flex:0 0 auto;order:100;margin:6px 0 0;padding:12px 4px max(6px,env(safe-area-inset-bottom));border-top:1px solid var(--line);text-align:center;font-size:11px;line-height:1.6;color:var(--muted)}
 .brand #mobile-menu>#site-footer .daily-visitors{margin-top:5px;font-size:11px;line-height:1.5}
}

/* The people drawer becomes a profile drawer in a private conversation. */
#private-profile-panel[hidden],#users[hidden],#count[hidden]{display:none!important}
.private-profile-panel{flex:1;min-height:0;overflow:auto;padding:4px 2px 12px;scrollbar-width:thin;outline-offset:-2px}
.private-profile-identity{display:flex;align-items:center;gap:12px;margin:0 0 18px}
.private-profile-identity h3{margin:0;min-width:0;font-size:18px;overflow-wrap:anywhere}
.private-profile-panel .profile-details>div{grid-template-columns:minmax(0,1fr);gap:4px}
.private-profile-panel .profile-details dd{font-size:14px}
.private-profile-panel .profile-social-heading{margin:20px 0 12px;font-size:15px}
#people-toggle .people-toggle-info{display:none}
@media(max-width:767px){
 .brand #people-toggle[data-mode="users"] .people-toggle-info{display:none}
 .brand #people-toggle[data-mode="profile"] .people-toggle-users{display:none}
 .brand #people-toggle[data-mode="profile"] .people-toggle-info{display:block}
 .people.showing-private-profile .people-heading h3{font-size:16px}
}

/* Compact profile in the private conversation panel. */
.private-profile-panel{padding-top:2px;padding-bottom:6px}
.private-profile-identity{gap:10px;margin-bottom:10px}
.private-profile-panel .profile-details>div{gap:2px;padding-bottom:5px}
.private-profile-panel .profile-social-heading{margin:12px 0 8px;line-height:1.3}

.private-profile-panel{padding-top:0;padding-bottom:4px}
.private-profile-identity{gap:8px;margin-bottom:7px}
.private-profile-identity h3{font-size:16px}
.private-profile-panel .profile-details>div{gap:1px;padding-bottom:3px}
.private-profile-panel .profile-details dd{font-size:12px;line-height:1.4}
.private-profile-panel .profile-social-heading{margin:9px 0 6px;font-size:13px;line-height:1.3}
.private-profile-panel .dialog-note{font-size:11px;line-height:1.4}

/* Keep the mood beside the private-profile photo, clear of the heading. */
#private-profile-avatar:has(.avatar-mood){margin-right:28px}
#private-profile-avatar .user-avatar>.avatar-mood{left:auto;right:-28px;top:50%;width:24px;height:24px;transform:translateY(-50%);transform-origin:center;z-index:1}
@media(max-width:767px){
 .people.showing-private-profile{width:min(440px,calc(100vw - 16px));max-width:calc(100vw - 16px)}
 .people.showing-private-profile .people-heading>div{min-width:0}
 .people.showing-private-profile .people-heading h3{margin-top:0;line-height:1.35}
}

/* Mood above the photo; presence below the nickname. */
.private-profile-identity:has(.avatar-mood){padding-top:20px}
#private-profile-avatar:has(.avatar-mood){margin-right:0}
#private-profile-avatar .user-avatar>.avatar-mood{left:50%;right:auto;top:-19px;width:28px;height:28px;transform:translateX(-50%) scale(.78);transform-origin:center}
.private-profile-text{min-width:0}
#private-profile-status{margin-top:3px}
#private-profile-status[hidden]{display:none!important}
#private-profile-status .presence-badge{display:block;margin:0;font-size:11px;line-height:1.4;overflow-wrap:anywhere}

/* Phone radio keeps playback controls without the volume row. */
@media(max-width:767px){
 #radio-player-panel .radio-volume{display:none!important}
}

/* Shared dialog width on desktop and phone, including specialized dialogs. */
html body dialog{width:min(800px,calc(100vw - 32px))!important;box-sizing:border-box}
html body dialog[id]{width: min(900px,calc(100vw - 32px))!important;box-sizing:border-box}

/* Keep mobile toolbar tap/focus states inside the button bounds. */
@media(max-width:767px){
 #desktop-tabs #channel-tools{overflow:visible}
 #desktop-tabs #channel-tools>button,
 #desktop-tabs #channel-tools>button:hover,
 #desktop-tabs #channel-tools>button:active,
 #desktop-tabs #channel-tools>button:focus{transform:none}
 #desktop-tabs #channel-tools>button:focus-visible,
 #desktop-tabs .views button:focus-visible{outline:2px solid var(--accent);outline-offset:-3px}
}

.message .message-actions button svg{display:block;width:18px;height:18px;flex:none;color:inherit}

/* Radio cover, equal-height playback row and contained interaction states. */
#radio-player-panel .radio-song-card{display:grid;place-items:center;flex:0 0 44px;width:44px;height:44px;margin:0;background:var(--surface);border:1px solid var(--line);border-radius:6px;overflow:hidden}
#radio-player-panel .radio-song-card img{display:block;width:100%;height:100%;margin:0;object-fit:cover}
#radio-player-panel .radio-playback-row{display:flex;align-items:center;gap:10px;margin:8px 0 8px;height:30px;min-width:0}
#radio-player-panel .radio-playback-row #radio-play{flex:0 0 38px;width:38px;min-width:38px;height:38px;min-height:38px;margin:0;padding:0;transform:none;box-shadow:none}
#radio-player-panel .radio-playback-row .radio-bars-wide{flex:1;min-width:0;width:auto;height:30px;margin:0;padding:0}
#radio-player-panel button:focus{outline:none}#radio-player-panel button:focus-visible,#radio-dialog .radio-station-option:focus-visible{outline:2px solid var(--accent);outline-offset:-3px}
#radio-player-panel button:active,#radio-player-panel button:hover,#radio-dialog .radio-station-option:active{transform:none}
/* Checkboxes must not inherit the dimensions and decoration of text fields. */
html body .enhanced-dialog .enhanced-check input[type=checkbox]{appearance:auto;box-sizing:border-box;width:18px;min-width:18px;height:18px;min-height:18px;max-height:18px;margin:0;padding:0;border:0;background:none;box-shadow:none;outline-offset:2px}
#history-search-dialog #history-load-server{display:inline-flex;margin:16px 0 0}
html body dialog#friends-dialog{width:min(850px,calc(100vw - 32px))!important;height:min(720px,calc(100dvh - 32px));max-height:calc(100dvh - 32px);box-sizing:border-box;overflow:auto}
#friends-dialog .enhanced-inline{flex-wrap:nowrap;gap:10px;align-items:end}
#friends-dialog .enhanced-inline input,#friends-dialog .enhanced-inline>button{box-sizing:border-box;height:44px;min-height:44px;margin:0;padding:8px 12px;line-height:1.4}
#friends-dialog .enhanced-inline>label{flex:1;min-width:0}
#friends-dialog .enhanced-list{max-height:none;overflow:visible;margin-top:18px}
#friends-dialog .friend-suggestions{max-height:280px}
.problem-description{display:block;box-sizing:border-box;width:100%;min-height:100px;resize:vertical;padding:10px 12px;background:var(--input);color:var(--text);border:1px solid var(--line);border-radius:6px;font:15px/1.5 var(--ui-font)}
@media(max-width:767px){.problem-description{font-size:16px}html body dialog#friends-dialog{height:calc(100dvh - 32px)}}

/* Compact own profile below the network controls in the right column. */
.desktop-sidebar-layout #desktop-user-tools{margin-bottom:6px;padding-bottom:6px;border-bottom:0}
.desktop-sidebar-layout #participants>.profile-card{display:flex;align-items:center;flex:0 0 auto;gap:8px;min-height:48px;margin:0 0 10px;padding:6px 0 10px;background:transparent;border-radius:0!important;border-bottom:1px solid var(--line)}
.desktop-sidebar-layout #participants>.profile-card>.user-avatar{align-self:center;flex:0 0 32px;width:32px;height:32px;font-size:12px}
.desktop-sidebar-layout #participants>.profile-card>div:nth-child(2){flex:1;min-width:0}
.desktop-sidebar-layout #participants>.profile-card strong{font-size:13px;line-height:1.3}
.desktop-sidebar-layout #participants>.profile-card small{font-size:11px;line-height:1.35;margin-top:2px}

/* Stable radio controls and aligned own-profile content. */
#radio-player-panel .radio-playback-row #radio-play{flex-basis:30px;width:30px;min-width:30px;height:30px;min-height:30px;border-radius:4px!important;transition:background .16s,filter .16s}
#radio-player-panel #radio-play-icon,#radio-player-panel #radio-play-icon svg{width:20px;height:20px}
.desktop-sidebar-layout #participants>.profile-card{display:grid;grid-template-columns:36px minmax(0,1fr) 30px;align-items:center;gap:10px;min-height:54px;padding:8px 0 10px;border:0;border-bottom:1px solid var(--line);box-shadow:none}
.desktop-sidebar-layout #participants>.profile-card #profile-avatar,.desktop-sidebar-layout #participants>.profile-card #profile-avatar>.user-avatar{display:grid;place-items:center;width:36px;height:36px;min-width:36px;min-height:36px;margin:0;padding:0;box-sizing:border-box;border-radius:6px!important}
.desktop-sidebar-layout #participants>.profile-card #profile-avatar{background:transparent;border:0}
.desktop-sidebar-layout #participants>.profile-card #profile-avatar>.user-avatar>img{display:block;width:100%;height:100%;object-fit:cover;border-radius:6px}
.desktop-sidebar-layout #participants>.profile-card>div:nth-child(2){display:grid;align-content:center;gap:3px;min-width:0}
.desktop-sidebar-layout #participants>.profile-card strong{display:block;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;line-height:1.35}
.desktop-sidebar-layout #participants>.profile-card small{display:block;margin:0;line-height:1.4;overflow-wrap:anywhere}

/* Connection state beside the nickname and compact account actions. */
.desktop-sidebar-layout #participants>.profile-card{grid-template-columns:36px minmax(0,1fr) auto}
.desktop-sidebar-layout #participants>.profile-card .profile-card-text{display:grid;gap:3px;min-width:0}
.desktop-sidebar-layout #participants>.profile-card .profile-heading{display:flex;align-items:baseline;flex-wrap:wrap;gap:3px 7px;min-width:0}
.desktop-sidebar-layout #participants>.profile-card .profile-heading strong{flex:0 1 auto;max-width:100%}
.desktop-sidebar-layout #participants>.profile-card #status{flex:0 1 auto;max-width:100%;min-width:0;margin:0;padding:0;white-space:normal;overflow-wrap:anywhere;text-align:left;font-size:10px;line-height:1.35}
.desktop-sidebar-layout #participants>.profile-card .profile-card-actions{display:flex;align-items:center;gap:5px;min-width:0}
.desktop-sidebar-layout #participants>.profile-card #leave{display:grid;place-items:center;flex:0 0 30px;width:30px;min-width:30px;height:30px;min-height:30px;margin:0;padding:5px;background:var(--surface);color:#dc7483;border:1px solid var(--line);border-radius:4px!important;font-size:0;line-height:1}
.desktop-sidebar-layout #participants>.profile-card #leave>span{display:none}
.desktop-sidebar-layout #participants>.profile-card #leave svg{display:block;width:18px;height:18px;flex:none}
.desktop-sidebar-layout #participants>.profile-card #leave[hidden]{display:none!important}
.desktop-sidebar-layout #participants>.profile-card #leave:hover{background:var(--surface-hover);border-color:#c35868}

/* Form spacing and close icons independent of font glyph baselines. */
#login .login-password-choice{display:flex;align-items:center;gap:10px;min-height:24px;margin:12px 0 14px;padding:0}
#login .login-password-choice>span{flex:1;min-width:0;line-height:1.45}
#login #login-with-password{align-self:center;flex:0 0 20px;height:20px;min-height:20px;max-height:20px;padding:0;margin:0}
dialog .dialog-head>button,#people-close,#topic-close,#reply-cancel{position:relative;display:grid;place-items:center;box-sizing:border-box;padding:0;font-size:0!important;line-height:0}
dialog .dialog-head>button>svg,#people-close>svg,#topic-close>svg,#reply-cancel>svg{display:none}
dialog .dialog-head>button::before,dialog .dialog-head>button::after,#people-close::before,#people-close::after,#topic-close::before,#topic-close::after,#reply-cancel::before,#reply-cancel::after{content:'';display:block;position:absolute;top:50%;left:50%;width:16px;height:2px;margin:0;padding:0;border-radius:1px;background:currentColor;transform:translate(-50%,-50%) rotate(45deg);pointer-events:none}
dialog .dialog-head>button::after,#people-close::after,#topic-close::after,#reply-cancel::after{transform:translate(-50%,-50%) rotate(-45deg)}
@media(max-width:767px){.people .people-heading{display:flex;align-items:center;margin:0 0 12px;padding:0;gap:10px}.people .people-heading h3{margin:0;line-height:1.4}.people .people-heading #people-close{align-self:center;flex:0 0 36px;width:36px;min-width:36px;height:36px;min-height:36px;margin:0}.people .people-search-wrap{margin:0 0 15px}}
@media(min-width:768px){#people-close{display:none}}
.people-heading #people-close{position:relative}
#chat-topic-header #topic-close>svg{display:none}


/* Separate mobile lists of open channels and private conversations. */
.mobile-conversation-toggle{display:none!important}
html body dialog#mobile-conversations-dialog{width:min(420px,calc(100vw - 24px))!important;max-height:min(75dvh,calc(var(--chat-height,100dvh) - 24px));box-sizing:border-box;overflow:auto}
.mobile-conversation-list{display:grid;gap:8px;min-width:0}
.mobile-conversation-row{display:flex;align-items:stretch;min-width:0;gap:4px;border:1px solid var(--line);border-radius:8px;background:var(--surface)}
.mobile-conversation-open{display:flex;align-items:center;justify-content:space-between;gap:10px;flex:1;min-width:0;min-height:44px;padding:10px 12px;text-align:left;border:0;background:transparent;color:var(--text);font-size:14px}
.mobile-conversation-name{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.mobile-conversation-unread,.mobile-conversation-count{
 display:grid;place-items:center;flex:none;min-width:18px;height:18px;
 padding:0 4px;box-sizing:border-box;
 background:#b94353;color:#fff;border-radius:4px;
 font-size:10px;line-height:1;font-weight:700;
 font-variant-numeric:tabular-nums;
}
.mobile-conversation-dismiss{display:grid;place-items:center;flex:0 0 36px;width:36px;min-height:44px;padding:0;border:0;background:transparent;color:var(--muted)}
.mobile-conversation-row.is-current{border-color:var(--accent)}
.mobile-conversation-row.needs-attention{border-color:#c05b68;animation:mobile-conversation-attention 1.8s ease-in-out infinite}
@keyframes mobile-conversation-attention{0%,100%{box-shadow:inset 0 0 0 999px #b9435308}50%{box-shadow:inset 0 0 0 999px #b9435328}}
@media(prefers-reduced-motion:reduce){.mobile-conversation-row.needs-attention{animation:none;background:#b9435318}}
@media(max-width:767px){
 .brand.has-mobile-conversations{grid-template-columns:minmax(0,1fr) repeat(4,36px);column-gap:6px}
 .brand .mobile-conversation-toggle,.brand #people-toggle,.brand #mobile-menu-toggle{display:grid!important;place-items:center;position:relative;width:36px;min-width:36px;height:38px;min-height:38px;margin:0;padding:0;border:1px solid var(--line);border-radius:8px!important;background:var(--surface);color:var(--text);touch-action:manipulation;transform:none}
 .brand #mobile-channels-toggle{grid-column:2;grid-row:1}.brand #mobile-privates-toggle{grid-column:3;grid-row:1}.brand.has-mobile-conversations #people-toggle{grid-column:4;grid-row:1}.brand.has-mobile-conversations #mobile-menu-toggle{grid-column:5;grid-row:1}
 .brand .mobile-conversation-toggle[hidden],.brand #people-toggle[hidden]{display:none!important}
 .brand .mobile-conversation-count{position:absolute;right:-4px;top:-5px;pointer-events:none;min-width:16px;height:16px;font-size:9px}
 .mobile-conversation-count[hidden]{display:none!important}
 .brand .mobile-conversation-toggle[aria-expanded=true]{border-color:var(--accent);color:var(--accent)}
 #desktop-tabs #views{display:none!important}
 #desktop-tabs #channel-tools{justify-content:center;width:100%}
}
@media(max-width:340px){.brand .logo{font-size:19px}.brand .logo-mark{width:26px;height:26px;flex-basis:26px}.brand .identity{gap:5px}}


/* Desktop shortcuts use exactly the same channel/private buttons and dialog
   as the mobile navigation. Keep them at the right of the desktop tab bar. */
#desktop-conversation-shortcuts{display:none}
.mobile-conversation-count[hidden]{display:none!important}
@media(min-width:768px){
 .desktop-sidebar-layout #desktop-tabs #desktop-conversation-shortcuts{
  display:flex;flex:0 0 auto;align-items:center;justify-content:flex-end;
  gap:8px;margin-left:auto;order:5;min-width:0
 }
 .desktop-sidebar-layout #desktop-tabs #desktop-conversation-shortcuts .mobile-conversation-toggle{
  display:grid!important;place-items:center;position:relative;
  box-sizing:border-box;flex:0 0 44px;width:44px;min-width:44px;
  height:44px;min-height:44px;margin:0;padding:0;
  border:1px solid var(--line);border-radius:8px!important;
  background:var(--surface);color:var(--text);cursor:pointer;
  touch-action:manipulation;transition:background .15s,border-color .15s,color .15s
 }
 .desktop-sidebar-layout #desktop-tabs #desktop-conversation-shortcuts .mobile-conversation-toggle:hover{
  background:var(--surface-hover,var(--surface));border-color:var(--accent)
 }
 .desktop-sidebar-layout #desktop-tabs #desktop-conversation-shortcuts .mobile-conversation-toggle:focus-visible{
  outline:2px solid var(--accent);outline-offset:2px
 }
 .desktop-sidebar-layout #desktop-tabs #desktop-conversation-shortcuts .mobile-conversation-toggle[aria-expanded="true"]{
  border-color:var(--accent);color:var(--accent);background:var(--chat)
 }
 .desktop-sidebar-layout #desktop-tabs #desktop-conversation-shortcuts .mobile-conversation-toggle[hidden]{display:none!important}
 .desktop-sidebar-layout #desktop-tabs #desktop-conversation-shortcuts .mobile-conversation-toggle>svg{width:23px;height:23px;display:block}
 .desktop-sidebar-layout #desktop-tabs #desktop-conversation-shortcuts .mobile-conversation-count{
  position:absolute;right:-5px;top:-6px;pointer-events:none;
  min-width:18px;height:18px;font-size:10px
 }
}


/* 1.9.2: Remove duplicate old conversation tabs from the desktop header.
   The desktop Channels and Privates shortcuts at the right replace them. */
@media(min-width:768px){
 .desktop-sidebar-layout #desktop-tabs #views{display:none!important}
 .desktop-sidebar-layout #desktop-tabs #desktop-conversations{display:none!important}
}


/* Mobile: all nine chat shortcuts share a single responsive row.
   Existing control sizes are upper bounds, never enlarged. */
@media(max-width:767px){
 #chat-feature-bar{
  display:flex;align-items:center;justify-content:center;flex-wrap:nowrap;
  gap:clamp(2px,.85vw,6px);padding:5px clamp(5px,1.8vw,10px);
  min-width:0;box-sizing:border-box;overflow:visible
 }
 #chat-feature-bar[hidden]{display:none!important}
 #chat-feature-bar #channel-tools{
  display:contents; /* preserve actual toolbar buttons and their handlers */
 }
 #chat-feature-bar #channel-tools[hidden]{display:none!important}
 #chat-feature-bar > button,
 #chat-feature-bar #channel-tools > button{
  display:flex;align-items:center;justify-content:center;
  box-sizing:border-box;flex:1 1 0;min-width:0;
  margin:0;line-height:1;font-size:0;white-space:nowrap;
  padding:clamp(2px,.6vw,6px);transform:none
 }
 #chat-feature-bar > button{
  width:36px;max-width:36px;height:clamp(24px,9vw,36px);
  min-height:0;max-height:36px
 }
 #chat-feature-bar #channel-tools > button{
  width:40px;max-width:40px;height:clamp(24px,10vw,40px);
  min-height:0;max-height:40px
 }
 /* Uniform SVG artwork size for all eight mobile toolbar buttons.
    Both dimensions shrink together on narrow screens, never above 18px. */
 #chat-feature-bar > button > svg,
 #chat-feature-bar #channel-tools > button > svg{
  display:block;
  flex:0 0 clamp(12px,4.8vw,18px);
  width:clamp(12px,4.8vw,18px);
  height:clamp(12px,4.8vw,18px);
  min-width:0;min-height:0;
  max-width:18px;max-height:18px;
  aspect-ratio:1
 }
 #chat-feature-bar #channel-tools .channel-tool-label{display:none!important}
 html.keyboard-open #chat-feature-bar #channel-tools{display:contents!important}
}

/* 1.9.6: desktop navigation strip belongs to the desktop layout only. */
@media(max-width:767px){
 #desktop-tabs,
 #desktop-tabs:not([hidden]),
 .desktop-sidebar-layout #desktop-tabs{display:none!important}
}

/* 1.9.7: Mobile-only. The existing eight-button feature bar now lives in
   the hamburger menu. Keep the compact, equally-sized icon row and never
   increase the original button/icon maximums. No desktop styles change. */
@media(max-width:767px){
 .brand #mobile-chat-menu #chat-feature-bar{
  display:flex;flex-flow:row nowrap;align-items:center;justify-content:center;
  gap:clamp(2px,.85vw,6px);box-sizing:border-box;
  width:100%;max-width:100%;min-width:0;
  margin:0;padding:6px 0 9px;
  border-bottom:1px solid var(--line);overflow:visible;
 }
 .brand #mobile-chat-menu #chat-feature-bar[hidden]{display:none!important}
 .brand #mobile-chat-menu #chat-feature-bar #channel-tools{display:contents}
 .brand #mobile-chat-menu #chat-feature-bar #channel-tools[hidden]{display:none!important}
 .brand #mobile-chat-menu #chat-feature-bar > button,
 .brand #mobile-chat-menu #chat-feature-bar #channel-tools > button{
  display:flex;align-items:center;justify-content:center;
  box-sizing:border-box;flex:1 1 0;min-width:0;
  width:auto;max-width:40px;height:clamp(24px,10vw,40px);
  min-height:0;max-height:40px;margin:0;
  padding:clamp(2px,.6vw,6px);font-size:0;line-height:1;
  text-align:center;white-space:nowrap;transform:none;
 }
 .brand #mobile-chat-menu #chat-feature-bar > button{
  max-width:36px;height:clamp(24px,9vw,36px);max-height:36px;
 }
 .brand #mobile-chat-menu #chat-feature-bar #channel-tools > button > svg,
 .brand #mobile-chat-menu #chat-feature-bar > button > svg{
  display:block;flex:0 0 clamp(12px,4.8vw,18px);
  width:clamp(12px,4.8vw,18px);height:clamp(12px,4.8vw,18px);
  max-width:18px;max-height:18px;min-width:0;min-height:0;
 }
 .brand #mobile-chat-menu #chat-feature-bar #channel-tools .channel-tool-label{display:none!important}
}

/* 1.9.8: Only the mobile hamburger menu. All channel-tools SVGs (and the
   adjacent feature icons) use the same square artwork box, based on the
   *available toolbar width*, never bigger than the previous 18px maximum. */
@media (max-width:767px){
 .brand #mobile-chat-menu #chat-feature-bar{
  container-type:inline-size;
  --mobile-toolbar-icon-size:clamp(12px,4.8vw,18px); /* legacy fallback */
 }
 .brand #mobile-chat-menu #chat-feature-bar #channel-tools > button > svg,
 .brand #mobile-chat-menu #chat-feature-bar > button > svg{
  display:block;
  box-sizing:border-box;
  flex:0 0 var(--mobile-toolbar-icon-size);
  width:var(--mobile-toolbar-icon-size);
  height:var(--mobile-toolbar-icon-size);
  min-width:0;min-height:0;
  max-width:18px;max-height:18px;
  aspect-ratio:1 / 1;
  object-fit:contain;
  transform:none;
 }
}
@supports (width:1cqi){
 @media (max-width:767px){
  .brand #mobile-chat-menu #chat-feature-bar{
   --mobile-toolbar-icon-size:clamp(12px,4.8cqi,18px);
  }
 }
}

/* 1.9.9: Mobile menu - feature buttons match channel-tools exactly.
   Eight controls share the same button shape, icon size and responsive space.
   The desktop toolbar is intentionally untouched. */
@media (max-width:767px){
 .brand #mobile-chat-menu #chat-feature-bar{
  --chat-shortcut-gap:clamp(2px,.85vw,6px);
  --chat-shortcut-icon-size:clamp(10px,4.8vw,18px);
  display:flex;flex-flow:row nowrap;align-items:center;justify-content:center;
  gap:var(--chat-shortcut-gap);
  width:100%;max-width:100%;min-width:0;
  container-type:inline-size;
 }
 .brand #mobile-chat-menu #chat-feature-bar > button,
 .brand #mobile-chat-menu #chat-feature-bar #channel-tools > button{
  display:grid;place-items:center;
  box-sizing:border-box;
  flex:1 1 0%;width:auto;max-width:40px;min-width:0;
  aspect-ratio:1 / 1;height:auto;max-height:40px;min-height:0;
  margin:0;padding:clamp(2px,.6vw,6px);
  border:1px solid var(--line);border-radius:10px!important;
  background:linear-gradient(145deg,var(--surface),var(--panel));
  color:var(--text);box-shadow:0 2px 5px #0002;
  font-size:0;line-height:1;transform:none;
  transition:background .16s,border-color .16s;
 }
 .brand #mobile-chat-menu #chat-feature-bar > button > svg,
 .brand #mobile-chat-menu #chat-feature-bar #channel-tools > button > svg{
  display:block;box-sizing:border-box;
  flex:none;width:var(--chat-shortcut-icon-size);
  height:var(--chat-shortcut-icon-size);
  min-width:0;min-height:0;max-width:18px;max-height:18px;
  aspect-ratio:1 / 1;object-fit:contain;
 }
 .brand #mobile-chat-menu #chat-feature-bar > button > span,
 .brand #mobile-chat-menu #chat-feature-bar #channel-tools > button > span{display:none!important}
 .brand #mobile-chat-menu #chat-feature-bar > button:hover,
 .brand #mobile-chat-menu #chat-feature-bar #channel-tools > button:hover{
  border-color:var(--accent);background:var(--surface-hover,var(--surface));transform:none
 }
 .brand #mobile-chat-menu #chat-feature-bar > button:focus-visible,
 .brand #mobile-chat-menu #chat-feature-bar #channel-tools > button:focus-visible{
  outline:2px solid var(--accent);outline-offset:2px
 }
 .brand #mobile-chat-menu #chat-feature-bar #channel-tools > button.active{
  color:var(--accent);border-color:var(--accent);background:var(--surface)
 }
}
@supports (width:1cqi){
 @media (max-width:767px){
  .brand #mobile-chat-menu #chat-feature-bar{
   --chat-shortcut-icon-size:clamp(10px,4.8cqi,18px)
  }
 }
}


/* 2.0.1: mobile-only spectrum fallback when Web Audio supplies no samples.
   Desktop keeps its real audio analyser; pause and mute keep bars still. */
@media(max-width:767px){
 #radio-player-panel.is-playing.radio-spectrum-fallback .radio-bars-wide i{
  animation:radio-mobile-spectrum-fallback .8s ease-in-out infinite alternate!important;
  animation-delay:var(--bar-delay,0s)!important;
  transition:none;
 }
 @keyframes radio-mobile-spectrum-fallback{
  from{height:4px}
  to{height:clamp(12px,var(--bar-level,22px),28px)}
 }
}
@media(max-width:767px) and (prefers-reduced-motion:reduce){
 #radio-player-panel.is-playing.radio-spectrum-fallback .radio-bars-wide i{
  animation:none!important;
  height:12px;
 }
}

/* RusChat: connected desktop layout. Does NOT apply on phones or offline. */
#rc-desktop-conversation-nav, #desktop-radio-dock, .rc-fold-toggle { display:none; }
@media(min-width:768px){
 body.rc-desktop-connected .brand #rc-desktop-conversation-nav{
  display:block;box-sizing:border-box;width:100%;margin:18px 0 0;padding:12px;
  border:1px solid var(--line);border-radius:10px;background:var(--panel);
 }
 /* The same radio element docks into the main toolbar only while connected. */
 body.rc-desktop-connected #desktop-tabs{gap:10px;padding:8px 13px;min-height:58px;box-sizing:border-box}
 body.rc-desktop-connected #desktop-tabs #desktop-radio-dock{
  display:flex;align-items:center;flex:1 1 auto;min-width:0;overflow:visible;
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-player-panel{
  display:grid;align-items:center;grid-template-columns:140px minmax(160px,1.25fr) minmax(85px,100px) minmax(0,1.6fr);
  gap:8px;position:relative;box-sizing:border-box;width:100%;min-width:0;max-width:none;
  min-height:45px;height:45px;margin:0;padding:4px 9px;
  border:1px solid var(--line);border-radius:9px;background:var(--panel);
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-station-open{
  min-width:0;max-width:100%;min-height:34px;height:34px;padding:4px 7px;gap:3px;
  border-radius:6px;font-size:12px;background:var(--surface);
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-current small{display:none}
 body.rc-desktop-connected #desktop-radio-dock .radio-current strong{font-size:12px;line-height:1.3}
 body.rc-desktop-connected #desktop-radio-dock .radio-current>svg{width:15px;height:15px}
 body.rc-desktop-connected #desktop-radio-dock .radio-controls{
  display:flex;align-items:center;gap:5px;min-width:0;margin:0;
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-song-card{
  display:grid;place-items:center;flex:0 0 34px;width:34px;height:34px;min-width:34px;
  border-radius:5px;overflow:hidden;
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-song-card img{display:block;width:100%;height:100%;object-fit:cover}
 body.rc-desktop-connected #desktop-radio-dock .radio-live{flex:1;min-width:0}
 body.rc-desktop-connected #desktop-radio-dock #radio-state{display:none}
 body.rc-desktop-connected #desktop-radio-dock .radio-volume{
  display:flex!important;align-items:center;gap:3px;width:100%;min-width:0;margin:0;
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-mute{
  flex:0 0 19px;min-width:19px;width:19px;min-height:24px;height:24px;padding:0;
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-volume{
  display:block;flex:1 1 auto;min-width:18px;width:100%;height:16px;min-height:16px;padding:0;
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-volume-value{display:none}
 body.rc-desktop-connected #desktop-radio-dock .radio-playback-row{
  display:flex;align-items:center;gap:5px;min-width:0;max-width:100%;height:34px;margin:0;
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-play{
  flex:0 0 30px;display:grid;place-items:center;width:30px;min-width:30px;height:30px;min-height:30px;padding:0;border-radius:6px!important;
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-play-icon,
 body.rc-desktop-connected #desktop-radio-dock #radio-play-icon svg{width:17px;height:17px}
 body.rc-desktop-connected #desktop-radio-dock .radio-bars-wide{
  display:flex;flex:1 1 auto;min-width:0;width:auto;height:30px;margin:0;padding:0;gap:1px;align-items:center;
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-now{
  display:flex;align-items:center;gap:3px;min-width:0;margin:0;height:34px;
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-now>small:first-child{display:none}
 body.rc-desktop-connected #desktop-radio-dock .radio-track-row{
  display:grid;flex:1;min-width:0;grid-template-columns:minmax(0,1fr) repeat(3,22px);gap:3px;align-items:center;
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-track{
  display:block;min-width:0;max-width:100%;font-size:12px;line-height:1.4;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-track-row>button{
  display:grid;place-items:center;box-sizing:border-box;width:22px;min-width:22px;height:26px;min-height:26px;
  margin:0;padding:3px;border-radius:5px;
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-track-row>button svg{width:15px;height:15px}
 body.rc-desktop-connected #desktop-radio-dock #radio-history-open{
  display:grid;place-items:center;flex:0 0 22px;box-sizing:border-box;
  width:22px;min-width:22px;height:26px;min-height:26px;
  margin:0;padding:0;font-size:0;border:1px solid var(--line);border-radius:5px;
  background:var(--surface);color:var(--accent);
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-history-open svg{display:block;width:17px;height:17px;flex:none}
 body.rc-desktop-connected #desktop-radio-dock #radio-copy-status{display:none!important}
 body.rc-desktop-connected #desktop-radio-dock #radio-error{
  position:absolute;left:5px;top:calc(100% + 5px);max-width:360px;z-index:4;
  margin:0;padding:6px 9px;border:1px solid var(--line);border-radius:6px;background:var(--panel);
 }
 /* Closed by default when IRC is connected; offline retains the original sections. */
 body.rc-desktop-connected .brand .client-downloads,
 body.rc-desktop-connected .brand #site-information{padding:11px 12px;margin-top:12px}
 body.rc-desktop-connected .brand .client-downloads>h3,
 body.rc-desktop-connected .brand #site-information>h3{display:none}
 body.rc-desktop-connected .brand .rc-fold-toggle{
  display:flex;align-items:center;justify-content:space-between;gap:8px;
  box-sizing:border-box;width:100%;min-height:28px;margin:0;padding:0;
  color:var(--text);font-size:12px;font-weight:600;text-align:left;
  border:0;background:transparent;cursor:pointer;
 }
 body.rc-desktop-connected .brand .rc-fold-toggle svg{flex:none;color:var(--accent);transition:transform .18s}
 body.rc-desktop-connected .brand .rc-fold-open>.rc-fold-toggle svg{transform:rotate(180deg)}
 body.rc-desktop-connected .brand .client-downloads:not(.rc-fold-open)>:not(.rc-fold-toggle),
 body.rc-desktop-connected .brand #site-information:not(.rc-fold-open)>:not(.rc-fold-toggle){display:none!important}
 body.rc-desktop-connected .brand .rc-fold-toggle:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
}
@media(min-width:768px){
 body.rc-desktop-connected #desktop-tabs #channel-tools{order:0}
 body.rc-desktop-connected #desktop-tabs #desktop-radio-dock{order:1}
}

/* Connected desktop: unread channel totals are steady badges, never animated.
   The mobile highlight animation remains completely unchanged. */
@media(min-width:768px){
 body.rc-desktop-connected #mobile-conversations-dialog .mobile-conversation-row.needs-attention{
  animation:none!important;
  box-shadow:none!important;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .mobile-conversation-count{
  animation:none!important;
  transition:none!important;
 }
}

/* 2.0.4: show compact 34px open channel and private rows on connected PC.
   The mobile dialog and offline layout are intentionally not changed. */
@media(min-width:768px){
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-heading{
  margin:0 0 12px;padding:0 1px;font-size:14px;line-height:1.45;
  font-weight:700;color:var(--text);
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-list{
  display:flex;flex-direction:column;gap:6px;max-height:min(60vh,450px);
  min-width:0;overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-row{
  display:flex;align-items:stretch;gap:3px;min-width:0;flex:0 0 34px;height:34px;min-height:34px;max-height:34px;
  border:1px solid var(--line);border-radius:4px;background:var(--surface);overflow:hidden;
  transition:border-color .15s,background .15s;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-row.is-current{
  border-color:var(--accent);background:var(--chat);
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-row:hover{border-color:var(--accent)}
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-open{
  display:flex;align-items:center;gap:4px;flex:1;min-width:0;height:100%;min-height:100%;max-height:100%;margin:0;
  box-sizing:border-box;padding:5px 8px;border:0;border-radius:0;
  background:transparent;color:var(--text);text-align:left;font-size:12px;cursor:pointer;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-avatar{
  position:relative;display:grid;place-items:center;overflow:hidden;
  flex:0 0 24px;width:24px;height:24px;box-sizing:border-box;
  border-radius:4px;background:var(--surface-hover,var(--input));
  color:var(--accent);font-size:10px;font-weight:700;line-height:1;
  text-align:center;letter-spacing:0;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-avatar>img{
  position:absolute;inset:0;width:100%;height:100%;object-fit:cover;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-open>svg{
  flex:0 0 19px;width:19px;height:19px;color:var(--accent);
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-name{
  flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-unread{
  display:grid;place-items:center;flex:none;min-width:20px;height:20px;
  box-sizing:border-box;padding:0 4px;border-radius:4px;
  background:#a84053;color:#ffffff;font-size:11px;line-height:0px;font-weight:600;
  font-variant-numeric:tabular-nums;animation:none!important;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-close{
  display:grid;place-items:center;flex:0 0 29px;box-sizing:border-box;width:29px;
  height:100%;min-height:100%;max-height:100%;margin:0;padding:5px;border:0;border-radius:0;
  color:var(--muted);background:transparent;cursor:pointer;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-close:hover{
  color:var(--text);background:var(--surface-hover,var(--panel));
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-row button:focus-visible{
  outline:2px solid var(--accent);outline-offset:-2px;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-empty{
  margin:0;padding:10px 3px;font-size:12px;color:var(--muted);line-height:1.5;
 }
 /* Wider, usable volume slider, centered stereo-style equalizer and crisp icons. */
 body.rc-desktop-connected #desktop-radio-dock #radio-player-panel{
  grid-template-columns:140px minmax(165px,1.3fr) minmax(82px,100px) minmax(130px,1.5fr);
  gap:7px;
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-controls{gap:4px}
 body.rc-desktop-connected #desktop-radio-dock .radio-song-card{flex:0 0 34px;width:34px;min-width:34px;height:34px}
 body.rc-desktop-connected #desktop-radio-dock .radio-volume{gap:6px}
 body.rc-desktop-connected #desktop-radio-dock #radio-volume{
  flex:1 1 auto;width:100%;min-width:90px;cursor:pointer;
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-bars-wide{
  align-items:center;height:30px;overflow:hidden;
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-bars-wide i{
  align-self:center;max-height:30px;border-radius:3px;
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-history-open{
  display:grid;place-items:center;align-self:center;font-size:0;
  flex:0 0 25px;box-sizing:border-box;width:25px;min-width:25px;
  height:26px;min-height:26px;margin:0 0 0 2px;padding:3px;
  background:var(--surface);border:1px solid var(--line);border-radius:5px;color:var(--accent);
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-history-open svg{
  display:block;flex:none;width:17px;height:17px;
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-track-row>button{
  padding:3px;border:1px solid var(--line);background:var(--surface);color:var(--accent);
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-track-row>button svg{
  display:block;flex:none;width:16px;height:16px;
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-track-row>button:hover:not(:disabled),
 body.rc-desktop-connected #desktop-radio-dock #radio-history-open:hover{border-color:var(--accent)}
 body.rc-desktop-connected #desktop-radio-dock #radio-track{
  display:block;min-width:0;max-width:100%;font-size:12px;line-height:1.4;
  overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-track .radio-track-text{
  max-width:100%;
 }
 body.rc-desktop-connected #desktop-radio-dock.is-playing.radio-spectrum-fallback .radio-bars-wide i,
 body.rc-desktop-connected #desktop-radio-dock #radio-player-panel.is-playing.radio-spectrum-fallback .radio-bars-wide i{
  animation:rc-desktop-centered-spectrum .85s ease-in-out infinite alternate!important;
  animation-delay:var(--bar-delay,0s)!important;
 }
 @keyframes rc-desktop-centered-spectrum{
  from{height:4px}
  to{height:clamp(8px,var(--bar-level,20px),30px)}
 }
}
@media(min-width:768px) and (prefers-reduced-motion:reduce){
 body.rc-desktop-connected #desktop-radio-dock #radio-player-panel.is-playing.radio-spectrum-fallback .radio-bars-wide i{
  animation:none!important;height:4px;
 }
}

@media(min-width:768px){
 body.rc-desktop-connected #desktop-tabs #desktop-conversation-shortcuts,
 body.rc-desktop-connected .desktop-sidebar-layout #desktop-tabs #desktop-conversation-shortcuts{
  display:none!important;
 }
}

/* Compact fallback for smaller desktop viewports: keep all radio controls reachable. */
@media(min-width:768px) and (max-width:1399px){
 body.rc-desktop-connected #desktop-tabs{flex-wrap:wrap;row-gap:6px}
 body.rc-desktop-connected #desktop-tabs #desktop-radio-dock{
  order:2;flex:1 0 100%;width:100%;min-width:0;
 }
}
@media(min-width:768px) and (max-width:1249px){
 body.rc-desktop-connected #desktop-radio-dock #radio-player-panel{
  grid-template-columns:minmax(70px,86px) minmax(122px,1.3fr) minmax(72px,88px) minmax(90px,1.5fr);
  gap:5px;padding:4px 6px;
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-volume{min-width:52px}
 body.rc-desktop-connected #desktop-radio-dock .radio-song-card{flex-basis:34px;width:34px;min-width:34px;height:34px}
 body.rc-desktop-connected #desktop-radio-dock .radio-track-row{grid-template-columns:minmax(0,1fr) repeat(3,20px);gap:2px}
 body.rc-desktop-connected #desktop-radio-dock .radio-track-row>button{width:20px;min-width:20px;padding:2px}
 body.rc-desktop-connected #desktop-radio-dock #radio-history-open{width:22px;min-width:22px;flex-basis:22px}
}
@media(min-width:768px){
 body.rc-desktop-connected #desktop-radio-dock #radio-track .radio-track-text{
  display:block;min-width:0;max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-track.track-scrolling .radio-track-text{
  animation:none!important;
 }
}


/* RusChat 2.0.3: all four radio track buttons have matching square hit areas.
   History is part of the same track actions row, not a separate flex sibling. */
#radio-player-panel .radio-track-row{
 display:grid;grid-template-columns:minmax(0,1fr) repeat(4,32px);align-items:center;gap:6px;
}
#radio-player-panel .radio-track-row>button,
#radio-player-panel #radio-history-open{
 display:grid;place-items:center;align-self:center;justify-self:center;
 box-sizing:border-box;flex:none;
 width:32px;min-width:32px;max-width:32px;
 height:32px;min-height:32px;max-height:32px;
 margin:0;padding:0;line-height:1;
 border:1px solid var(--line);border-radius:6px;
 background:var(--panel);color:var(--accent);
 cursor:pointer;
}
#radio-player-panel .radio-track-row>button:disabled{opacity:.35;cursor:default}
#radio-player-panel .radio-track-row>button>svg,
#radio-player-panel #radio-history-open>svg{
 display:block;flex:none;width:17px;height:17px;stroke-linecap:round;stroke-linejoin:round;
}
#radio-player-panel .radio-track-row>button:hover:not(:disabled){
 border-color:var(--accent);background:var(--surface-hover);
}
#radio-player-panel #radio-youtube{color:#ff4545}
#radio-player-panel #radio-history-open .radio-history-label{display:none}
@media(max-width:767px){
 .brand #mobile-chat-menu #radio-player-panel .radio-track-row{
  grid-template-columns:minmax(0,1fr) repeat(4,36px);
 }
 .brand #mobile-chat-menu #radio-player-panel .radio-track-row>button,
 .brand #mobile-chat-menu #radio-player-panel #radio-history-open{
  width:36px;min-width:36px;max-width:36px;
  height:36px;min-height:36px;max-height:36px;padding:0;
 }
}
@media(min-width:768px){
 body.rc-desktop-connected #desktop-radio-dock #radio-player-panel{
  grid-template-columns:140px minmax(188px,1.55fr) minmax(78px,96px) minmax(180px,1.6fr);
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-volume{
  display:flex!important;gap:5px;width:100%;min-width:0;
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-volume{
  display:block;flex:1 1 96px;width:100%;min-width:0;max-width:100%;
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-track-row{
  display:grid;flex:1 1 auto;min-width:0;
  grid-template-columns:minmax(0,1fr) repeat(4,26px);
  gap:4px;align-items:center;
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-track-row>button,
 body.rc-desktop-connected #desktop-radio-dock #radio-player-panel #radio-history-open{
  display:grid;place-items:center;align-self:center;justify-self:center;
  box-sizing:border-box;flex:none;
  width:26px;min-width:26px;max-width:26px;
  height:26px;min-height:26px;max-height:26px;
  margin:0;padding:0;line-height:1;
  border:1px solid var(--line);border-radius:5px;background:var(--surface);
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-track-row>button>svg,
 body.rc-desktop-connected #desktop-radio-dock #radio-player-panel #radio-history-open>svg{
  display:block;width:16px;height:16px;flex:none;
 }
}
@media(min-width:768px) and (max-width:1399px){
 body.rc-desktop-connected #desktop-radio-dock #radio-player-panel{
  grid-template-columns:140px minmax(188px,1.55fr) minmax(78px,96px) minmax(180px,1.6fr);
 }
}
@media(min-width:768px) and (max-width:1249px){
 body.rc-desktop-connected #desktop-radio-dock #radio-player-panel{
  grid-template-columns:140px minmax(188px,1.55fr) minmax(78px,96px) minmax(180px,1.6fr);
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-volume{min-width:0}
 body.rc-desktop-connected #desktop-radio-dock .radio-track-row{
  grid-template-columns:minmax(0,1fr) repeat(4,26px);gap:4px;
 }
}


/* RusChat 2.0.5: adapt the connected desktop radio to its own available width,
   not just to the size of the monitor. No mobile or disconnected changes. */
@media (min-width: 768px) {
 body.rc-desktop-connected #desktop-tabs #desktop-radio-dock {
  container-type: inline-size;
  container-name: rc-radio-dock;
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-controls,
 body.rc-desktop-connected #desktop-radio-dock .radio-live,
 body.rc-desktop-connected #desktop-radio-dock .radio-volume,
 body.rc-desktop-connected #desktop-radio-dock .radio-track-row {
  min-width: 0;
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-volume {
  display: block;
  flex: 1 1 96px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
 }
}
/* For a narrow middle column, place the title and all four song buttons
   together in a dedicated second row with room for the full controls. */
@container rc-radio-dock (max-width: 760px) {
 body.rc-desktop-connected #desktop-radio-dock #radio-player-panel {
  display: grid;
  grid-template-columns: 170px minmax(140px, 1fr) minmax(75px, .85fr);
  grid-template-rows: 34px 30px;
  column-gap: 7px;
  row-gap: 5px;
  height: auto;
  min-height: 82px;
  padding: 6px 8px;
  align-items: center;
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-station-open,
 body.rc-desktop-connected #desktop-radio-dock .radio-controls,
 body.rc-desktop-connected #desktop-radio-dock .radio-playback-row {
  min-width: 0;
  width: 100%;
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-now {
  grid-column: 1 / -1;
  grid-row: 2;
  display: flex;
  min-width: 0;
  width: 100%;
  height: 30px;
  margin: 0;
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-track-row {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  grid-template-columns: minmax(0,1fr) repeat(4,26px);
  gap: 4px;
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-track {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
 }
}
/* Extra-narrow desktop columns can use a third row without hiding controls. */
@container rc-radio-dock (max-width: 440px) {
 body.rc-desktop-connected #desktop-radio-dock #radio-player-panel {
  grid-template-columns: 170px minmax(0,1fr);
  grid-template-rows: 34px 30px 30px;
  min-height: 116px;
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-playback-row {
  grid-column: 1 / -1;
  grid-row: 2;
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-now {
  grid-row: 3;
 }
}


/* RusChat 2.0.14: desktop station selector 170px wide.
   Channel activity is a steady tint; nickname mentions alone pulse/count. */
@media (min-width: 768px) {
 body.rc-desktop-connected #desktop-radio-dock #radio-station-open {
  box-sizing: border-box;
  width: 170px;
  min-width: 170px;
  max-width: 170px;
  flex: 0 0 140px;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-row.has-activity:not(.has-mention) {
  background: color-mix(in srgb, #31b4a4 17%, var(--surface));
  border-color: color-mix(in srgb, #31b4a4 62%, var(--line));
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-row.has-activity:not(.has-mention) .rc-conversation-open>svg {
  color: #35c6b0;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-row.has-mention {
  border-color: #ec768c;
  animation: rc-mention-pulse 1.6s ease-in-out infinite;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-row.has-mention .rc-conversation-open>svg {
  color: #ff889c;
 }
 @keyframes rc-mention-pulse {
  0%,100% {background: color-mix(in srgb, #ec5875 15%, var(--surface));box-shadow:0 0 0 0 #ec587500;}
  50% {background: color-mix(in srgb, #ec5875 38%, var(--surface));box-shadow:0 0 0 2px #ec587533;}
 }
}
@media (min-width: 768px) and (prefers-reduced-motion: reduce) {
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-row.has-mention {
  animation: none;
  background: color-mix(in srgb, #ec5875 25%, var(--surface));
 }
}


/* RusChat 2.0.7: ONLY connected desktop. The live status button is first in
   the channel/private sidebar; other two tools join the chat feature bar. */
@media (min-width: 768px) {
 body.rc-desktop-connected #desktop-tabs #channel-tools {
  display: none !important;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-status-slot {
  width: 100%;
  margin: 0 0 6px;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav #server-open {
  display: flex;
  align-items: center;
  gap: 9px;
  box-sizing: border-box;
  width: 100%;
  height: 34px;
  min-height: 34px;
  max-height: 34px;
  margin: 0;
  padding: 5px 8px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid #e65a703d;
  border-radius: 8px;
  background: #a840531c;
  color: #f6aab7;
  cursor: pointer;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav #server-open > svg {
  flex: 0 0 19px;
  width: 19px;
  height: 19px;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav #server-open:hover {
  background: #a8405330;
  border-color: #ff80925c;
  color: #ffc2ca;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav #server-open.active {
  background: #b6425b40;
  border-color: #e9697e73;
  color: #ffd2db;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav #server-open:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
 }
 body.rc-desktop-connected #chat-feature-bar > #channels-open,
 body.rc-desktop-connected #chat-feature-bar > #topic-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 5px 9px;
  font-size: 11px;
  background: var(--surface);
  color: var(--text);
 }
 body.rc-desktop-connected #chat-feature-bar > #channels-open svg,
 body.rc-desktop-connected #chat-feature-bar > #topic-toggle svg {
  width: 18px;
  height: 18px;
  flex: none;
 }
 body.rc-desktop-connected #chat-feature-bar > #topic-toggle.active {
  color: var(--accent);
  border-color: var(--accent);
 }
 /* Longer slider when space permits; it shrinks on narrow desktop columns. */
 body.rc-desktop-connected #desktop-radio-dock #radio-volume {
  display: block;
  flex: 1 1 160px;
  width: 100%;
  min-width: 0;
  max-width: 160px;
 }
}
@media (min-width: 768px) {
 html[data-theme=light] body.rc-desktop-connected #rc-desktop-conversation-nav #server-open {
  color: #a42d45;
  background: #b52b4310;
  border-color: #d7768859;
 }
 html[data-theme=light] body.rc-desktop-connected #rc-desktop-conversation-nav #server-open:hover {
  background: #b52b4324;
 }
 html[data-theme=light] body.rc-desktop-connected #rc-desktop-conversation-nav #server-open.active {
  color: #a72e45;
  background: #b52b432b;
  border-color: #b52b4366;
 }
}


/* RusChat 2.0.9: connected-desktop layout refinements only. */
@media (min-width: 768px) {
 /* Full text on the red status button; mobile keeps its original compact UI. */
 body.rc-desktop-connected #rc-desktop-conversation-nav #server-open .channel-tool-label {
  display: inline;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
 }
 /* Match the feature-bar controls (labels, icon sizes and hit areas). */
 body.rc-desktop-connected #chat-feature-bar > #channels-open,
 body.rc-desktop-connected #chat-feature-bar > #topic-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  gap: 6px;
  box-sizing: border-box;
  min-height: 32px;
  height: auto;
  width: auto;
  padding: 5px 9px;
  font: inherit;
  font-size: 11px;
  line-height: normal;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
 }
 body.rc-desktop-connected #chat-feature-bar > #channels-open .channel-tool-label,
 body.rc-desktop-connected #chat-feature-bar > #topic-toggle .channel-tool-label {
  display: inline;
  font-size: inherit;
  line-height: inherit;
  white-space: nowrap;
 }
 body.rc-desktop-connected #chat-feature-bar > #channels-open > svg,
 body.rc-desktop-connected #chat-feature-bar > #topic-toggle > svg {
  display: block;
  flex: 0 0 18px;
  width: 18px;
  height: 18px;
 }
 body.rc-desktop-connected #chat-feature-bar > #channels-open:hover,
 body.rc-desktop-connected #chat-feature-bar > #topic-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--accent);
 }
 /* Keep the whole station/playback/track group close together and centred. */
 body.rc-desktop-connected #desktop-radio-dock #radio-player-panel {
  box-sizing: border-box;
  width: 100%;
  margin-inline: auto;
  justify-content: center;
  grid-template-columns: 170px minmax(190px, 230px) 120px minmax(225px, 390px);
  column-gap: 7px;
 }
 body.rc-desktop-connected #desktop-radio-dock .radio-controls,
 body.rc-desktop-connected #desktop-radio-dock .radio-playback-row,
 body.rc-desktop-connected #desktop-radio-dock .radio-now {
  min-width: 0;
 }
 body.rc-desktop-connected #participants #users .user-row .user-name {
  font-family: 'Segoe UI', Inter, system-ui, -apple-system, Arial, sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
 }
 body.rc-desktop-connected #participants #users .user-row .nick-status {
  display: inline-grid;
  place-items: center;
  box-sizing: border-box;
  width: 1.15em;
  min-width: 1.15em;
  margin: 0 5px 0 0;
  vertical-align: baseline;
  font-family: 'Segoe UI Symbol', 'Segoe UI', system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  font-variant-ligatures: none;
 }
 body.rc-desktop-connected #participants #users .user-row .presence-badge {
  font-family: 'Segoe UI', Inter, system-ui, -apple-system, Arial, sans-serif;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.45;
 }
}
/* Existing responsive radio rows must take precedence over the centred wide layout. */
@container rc-radio-dock (max-width: 760px) {
 body.rc-desktop-connected #desktop-radio-dock #radio-player-panel {
  grid-template-columns: 170px minmax(140px, 1fr) minmax(75px, .85fr);
  max-width: 100%;
 }
}
@container rc-radio-dock (max-width: 440px) {
 body.rc-desktop-connected #desktop-radio-dock #radio-player-panel {
  grid-template-columns: 170px minmax(0, 1fr);
 }
}


/* RusChat 2.0.11: exact desktop radio grid, overflow-only track marquee,
   and heading typography matching the application's other panel headings.
   Never changes <=1100px/mobile or the disconnected player. */
@media (min-width: 768px) {
 body.rc-desktop-connected #desktop-radio-dock #radio-player-panel {
  box-sizing: border-box;
  width: 100%;
  margin-inline: auto;
  justify-content: center;
  grid-template-columns: 170px minmax(190px, 230px) 120px minmax(225px, 390px);
  column-gap: 7px;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-heading {
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  font-style: normal;
  line-height: 1.4;
  letter-spacing: normal;
  text-transform: none;
 }
 /* The track label is intrinsic-width so JS can measure when it overflows.
    Only an overflowing title receives the .track-scrolling class. */
 body.rc-desktop-connected #desktop-radio-dock #radio-track {
  display: block;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: clip;
  white-space: nowrap;
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-track .radio-track-text {
  display: inline-block;
  width: max-content;
  max-width: none;
  min-width: 0;
  white-space: nowrap;
  overflow: visible;
  text-overflow: clip;
  vertical-align: middle;
  transform: translateX(0);
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-track.track-scrolling .radio-track-text {
  animation: rc-desktop-track-marquee var(--track-duration, 12s) ease-in-out infinite alternate !important;
  will-change: transform;
 }
}
@keyframes rc-desktop-track-marquee {
  0%, 12% { transform: translateX(0); }
  88%, 100% { transform: translateX(var(--track-overflow, 0px)); }
}
/* Keep title movement disabled for accessibility preferences. */
@media (min-width: 768px) and (prefers-reduced-motion: reduce) {
 body.rc-desktop-connected #desktop-radio-dock #radio-track.track-scrolling .radio-track-text {
  animation: none !important;
  transform: none !important;
 }
}
/* The dock's container queries must still win for narrow desktop columns.
   Below 760px, title/actions go into their own next row. */
@container rc-radio-dock (max-width: 760px) {
 body.rc-desktop-connected #desktop-radio-dock #radio-player-panel {
  grid-template-columns: 170px minmax(140px, 1fr) minmax(75px, .85fr);
  max-width: 100%;
 }
}
@container rc-radio-dock (max-width: 440px) {
 body.rc-desktop-connected #desktop-radio-dock #radio-player-panel {
  grid-template-columns: 170px minmax(0, 1fr);
 }
}


/* RusChat 1.2.15: one consistent corner radius for buttons and visible UI
   surfaces. Preserve circular user-presence indicators and other small
   semantic status dots so they remain distinguishable. */
:root { --radius: 4px; }
:is(button, [role="button"], input:not([type="range"]):not([type="radio"]):not([type="checkbox"]),
    select, textarea, summary, dialog,
    .brand, .chat, .people, .logo-mark, .room-active, .profile-card, .user-row,
    .welcome, .site-information, .client-downloads, .client-platform,
    .projects-menu .projects, .project-icon, .message:not(.system),
    .message-actions, .reaction-choices, #composer, #reply-preview,
    #desktop-tabs, #chat-topic-header, #desktop-radio-dock, #radio-player-panel,
    .radio-song-card, .radio-station-option, .radio-station-icon,
    .views button, .view-tab, .channel-icon, .user-avatar, .message-avatar,
    .people-search-wrap, .private-profile-panel, .enhanced-card, .enhanced-person,
    .updates-list, .updates-item, .update-version, .friend-suggestions,
    .friend-suggestions button, .problem-report, .radio-track-history,
    .rc-conversation-row, .rc-conversation-open, .rc-conversation-close,
    #rc-desktop-conversation-nav, .rc-conversation-status-slot,
    .account-banner, .account-console-panel, .link-hover-preview,
    .client-download-grid, .client-development, .presence-options,
    .mood-options, .radio-stations, .site-information-contact) {
 border-radius: 4px !important;
}
/* Icons centered in both personal-controls buttons inside the desktop tools,
   independent of SVG intrinsic sizing and hidden text labels. */
.desktop-sidebar-layout #desktop-user-tools #personal-controls button {
 display: grid;
 place-items: center;
 align-content: center;
 justify-content: center;
 box-sizing: border-box;
 text-align: center;
 padding: 6px;
}
.desktop-sidebar-layout #desktop-user-tools #personal-controls button > svg {
 display: block;
 place-self: center;
 flex: none;
 width: 23px;
 height: 23px;
 margin: 0;
}

/* High-specificity legacy icon rules use !important. Override them explicitly
   so every visible control really finishes with the same 4px corners. */
#radio-player-panel .radio-playback-row #radio-play,
body.rc-desktop-connected #desktop-radio-dock #radio-play,
.desktop-sidebar-layout #desktop-tabs #desktop-conversation-shortcuts .mobile-conversation-toggle,
#chat-topic-header #topic-close,
#chat-topic-header #topic-edit,

#composer #emoji-toggle,
#composer #send,
.desktop-sidebar-layout #desktop-user-tools button,
.desktop-sidebar-layout #desktop-user-tools #personal-controls button,
.desktop-sidebar-layout #desktop-user-tools .projects-menu summary {
 border-radius: 4px !important;
}


/* Chat pictures · RusChat 2.0.23 */
#composer #chat-image-upload-open{display:flex;align-items:center;justify-content:center;align-self:center;box-sizing:border-box;flex:0 0 44px;min-width:44px;width:44px;height:44px;min-height:44px;padding:0;line-height:1}
#composer #chat-image-upload-open svg{width:23px;height:23px;flex:none;margin:0}
#composer #chat-image-file{display:none!important}
.chat-image-upload-status{margin:5px 24px 0;padding:5px 8px;font-size:12px;color:var(--muted);border-radius:4px;overflow-wrap:anywhere}
.chat-image-upload-status[hidden]{display:none!important}
#messages .chat-image-thumb{display:inline-flex;vertical-align:middle;align-items:center;justify-content:center;width:120px;height:80px;max-width:100%;overflow:hidden;background:var(--surface);border:1px solid var(--line);border-radius:4px;text-decoration:none;cursor:zoom-in}
#messages .chat-image-thumb img{display:block;width:120px;height:80px;max-width:100%;object-fit:cover;border-radius:3px}
#messages .chat-image-thumb img[hidden]{display:none!important}
#messages .chat-image-thumb span{font-size:12px;overflow-wrap:anywhere;padding:5px}
#messages .chat-image-thumb span[hidden]{display:none!important}
#messages .chat-image-thumb:hover{border-color:var(--accent)}
/* 1.2.2: image viewer fills the entire screen; controls float over the photo. */
html body dialog#chat-image-viewer{
 position:fixed;inset:0;margin:0;padding:0;
 width:100vw!important;max-width:100vw!important;height:100vh;height:100dvh;max-height:100dvh;
 box-sizing:border-box;border:0;border-radius:0;box-shadow:none;
 background:#05070b;color:#fff;overflow:hidden;
}
html body dialog#chat-image-viewer[open],html body dialog#chat-image-viewer:fullscreen{
 display:flex;align-items:stretch;justify-content:stretch;
}
html body dialog#chat-image-viewer:fullscreen{width:100%!important;max-width:100%!important;height:100%;max-height:100%}
#chat-image-viewer::backdrop{background:#05070b}
#chat-image-viewer .chat-image-viewer-head{
 position:absolute;inset:0 0 auto;z-index:2;box-sizing:border-box;
 display:flex;align-items:center;justify-content:space-between;gap:12px;
 padding:max(12px,env(safe-area-inset-top)) max(12px,env(safe-area-inset-right)) 24px max(12px,env(safe-area-inset-left));
 font-size:13px;background:linear-gradient(to bottom,#000c,#0009 60%,transparent);
 pointer-events:none;
}
#chat-image-viewer .chat-image-viewer-head>div{display:flex;align-items:center;gap:10px;pointer-events:auto}
#chat-image-viewer-original{
 display:inline-flex;align-items:center;justify-content:center;min-height:38px;box-sizing:border-box;
 padding:7px 11px;color:#e5efff;text-decoration:none;font-size:12px;
 background:#1b2538cc;border:1px solid #ffffff40;border-radius:4px;
}
#chat-image-viewer-original:hover{background:#32445acc}
#chat-image-viewer-close{
 display:grid;place-items:center;flex:none;width:44px;min-width:44px;height:44px;min-height:44px;
 padding:0;font-size:28px;line-height:1;color:#fff;cursor:pointer;
 background:#1b2538cc;border:1px solid #ffffff40;border-radius:4px;
}
#chat-image-viewer-close:hover{background:#32445acc}
#chat-image-viewer-img{
 display:block;flex:1 1 auto;width:100%;height:100%;max-width:100%;max-height:100%;
 min-width:0;min-height:0;margin:0;object-fit:contain;cursor:zoom-out;
 user-select:none;-webkit-user-select:none;
}
@media(max-width:600px){
 #chat-image-viewer .chat-image-viewer-head{gap:8px;justify-content:flex-end}
 #chat-image-viewer .chat-image-viewer-head>strong{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
 #chat-image-viewer .chat-image-viewer-head>div{gap:6px}
 #chat-image-viewer-original{padding:7px 8px;font-size:11px}
}
@media(max-width:767px){#composer #chat-image-upload-open{flex:0 0 36px;width:36px;min-width:36px;height:36px;min-height:36px;padding:0}#composer #chat-image-upload-open svg{width:20px;height:20px}.chat-image-upload-status{margin:4px 10px 0;font-size:11px}}

/* 2.0.24: individually dismissible IRC/server system notices. */
.message.system.rc-dismissable-server-error{position:relative;padding-right:34px!important;min-width:0}
.message.system .rc-system-dismiss{
 position:absolute;top:50%;right:3px;transform:translateY(-50%);
 display:grid;place-items:center;width:26px;min-width:26px;height:26px;min-height:26px;
 padding:0;margin:0;border:1px solid transparent;border-radius:4px!important;
 background:transparent;color:var(--muted);font-size:20px;line-height:1;cursor:pointer;
}
.message.system .rc-system-dismiss:hover{border-color:var(--line);background:var(--surface);color:var(--text)}
/* 2.0.24: collapsible sidebars apply only on connected desktop screens. */
@media(min-width:768px){
 body.rc-desktop-connected{--rc-left-column:335px;--rc-right-column:352px}
 body.rc-desktop-connected.rc-left-collapsed{--rc-left-column:66px}
 body.rc-desktop-connected.rc-right-collapsed{--rc-right-column:66px}
 body.rc-desktop-connected main{grid-template-columns:var(--rc-left-column) minmax(0,1fr) var(--rc-right-column)}
 body.rc-desktop-connected .brand,body.rc-desktop-connected .people{position:relative;min-width:0}
 body.rc-desktop-connected .rc-sidebar-toggle{
  position:absolute;z-index:5;top:9px;right:9px;display:grid;place-items:center;
  width:30px;min-width:30px;height:30px;min-height:30px;padding:4px;
  background:var(--surface);color:var(--accent);border:1px solid var(--line);
  border-radius:4px!important;cursor:pointer;
 }
 body.rc-desktop-connected .rc-sidebar-toggle:hover{background:var(--surface-hover,var(--surface));border-color:var(--accent)}
 body.rc-desktop-connected .rc-sidebar-toggle svg{width:18px;height:18px;display:block}
 body.rc-desktop-connected .brand>.identity{padding-right:0px}
 body.rc-desktop-connected #participants>.rc-sidebar-toggle{right:auto;left:9px}
 body.rc-desktop-connected #participants>#desktop-user-tools{padding-top:33px}
 body.rc-desktop-connected .rc-collapsed-rail{display:none}
 body.rc-desktop-connected.rc-left-collapsed .brand,
 body.rc-desktop-connected.rc-right-collapsed .people{padding:48px 7px 12px!important;overflow:hidden}
 body.rc-desktop-connected.rc-left-collapsed .brand>.rc-sidebar-toggle,
 body.rc-desktop-connected.rc-right-collapsed .people>.rc-sidebar-toggle{top:9px;left:50%;right:auto;transform:translateX(-50%)}
 body.rc-desktop-connected.rc-left-collapsed .brand>:not(.rc-sidebar-toggle):not(.rc-collapsed-rail),
 body.rc-desktop-connected.rc-right-collapsed .people>:not(.rc-sidebar-toggle):not(.rc-collapsed-rail){display:none!important}
 body.rc-desktop-connected.rc-left-collapsed .brand>.rc-collapsed-rail,
 body.rc-desktop-connected.rc-right-collapsed .people>.rc-collapsed-rail{
  display:flex;flex-direction:column;align-items:center;gap:7px;
  width:100%;min-width:0;max-height:calc(100dvh - 95px);overflow-y:auto;overflow-x:hidden;
  scrollbar-width:none;overscroll-behavior:contain;
 }
 body.rc-desktop-connected .rc-collapsed-rail::-webkit-scrollbar{display:none}
 body.rc-desktop-connected .rc-rail-item{
  position:relative;display:grid;place-items:center;flex:0 0 43px;
  width:43px;min-width:43px;height:43px;min-height:43px;
  box-sizing:border-box;padding:3px;margin:0;border:1px solid var(--line);
  border-radius:4px!important;background:var(--surface);color:var(--text);cursor:pointer;
 }
 body.rc-desktop-connected .rc-rail-item:hover,
 body.rc-desktop-connected .rc-rail-item.is-current{border-color:var(--accent);background:var(--surface-hover,var(--surface))}
 body.rc-desktop-connected .rc-rail-item.has-activity:not(.has-mention){border-color:#30bda2;background:#1fa88a24}
 body.rc-desktop-connected .rc-rail-item.has-mention{border-color:#d85984;background:#e05b7b2e;animation:rc-mention-pulse 1.15s ease-in-out infinite}
 body.rc-desktop-connected .rc-rail-avatar{
  display:grid;place-items:center;position:relative;overflow:hidden;width:35px;height:35px;
  border-radius:4px;background:var(--input);color:var(--accent);font-size:12px;font-weight:700;
  line-height:1;text-transform:uppercase;letter-spacing:0;
 }
 body.rc-desktop-connected .rc-rail-avatar img{position:absolute;inset:0;width:100%;height:100%;object-fit:cover}
 body.rc-desktop-connected .rc-rail-count{
  position:absolute;top:-3px;right:-4px;min-width:16px;height:16px;box-sizing:border-box;
  display:grid;place-items:center;border-radius:8px!important;padding:0 3px;
  background:#bf385a;color:white;font-size:9px;font-weight:700;line-height:1;
 }
 body.rc-desktop-connected .rc-rail-server .rc-rail-avatar{color:#ff98a8;background:#a93f5528}
}
@media(min-width:768px) and (max-width:1250px){
 body.rc-desktop-connected{--rc-left-column:250px;--rc-right-column:280px}
 body.rc-desktop-connected.rc-left-collapsed{--rc-left-column:66px}
 body.rc-desktop-connected.rc-right-collapsed{--rc-right-column:66px}
}


/* 2.0.25: The input-area IRC error alert is separate from system chat rows. */
#error.rc-error-active{
 display:flex;align-items:center;gap:8px;box-sizing:border-box;
 max-height:100px;min-height:36px;padding:5px 12px;
 overflow-y:auto;overflow-x:hidden;
}
#error .rc-error-text{flex:1 1 auto;min-width:0;overflow-wrap:anywhere}
#error .rc-error-dismiss{
 display:grid;place-items:center;flex:0 0 28px;
 width:28px;min-width:28px;height:28px;min-height:28px;
 margin:0;padding:0;border:1px solid var(--line);border-radius:4px!important;
 background:var(--surface);color:var(--muted);font-size:19px;line-height:1;cursor:pointer;
}
#error .rc-error-dismiss:hover{background:var(--surface-hover,var(--panel));color:var(--text);border-color:var(--accent)}
@media(min-width:768px){
 /* Override the expanded-panel #participants left:9px rule when collapsed. */
 body.rc-desktop-connected.rc-right-collapsed #participants>.rc-sidebar-toggle{
  left:50%;right:auto;transform:translateX(-50%);
 }
}

/* RusChat 2.0.27: connection-only desktop avatar panels. No remnants on the login page. */
body:not(.rc-desktop-connected) .rc-collapsed-rail,
body:not(.rc-desktop-connected) .rc-sidebar-toggle { display:none!important; }
@media (min-width:768px) {
 body.desktop-sidebar-layout:not(.rc-desktop-connected) main { grid-template-columns:335px minmax(0,1fr)!important; }
 body.desktop-sidebar-layout:not(.rc-desktop-connected) #participants { display:none!important; }
}
/* Jump to new messages, over the bottom edge of the scrollable message log. */
#rc-new-messages-anchor { flex:0 0 0; position:relative; height:0; min-height:0; z-index:9; }
#rc-new-messages-jump {
 position:absolute;right:18px;bottom:12px;display:inline-flex;align-items:center;
 justify-content:center;gap:7px;max-width:min(85vw,300px);
 box-sizing:border-box;padding:9px 13px;border:1px solid var(--accent);
 border-radius:4px;background:var(--panel,#192b42);color:var(--text);
 font-size:12px;font-weight:700;white-space:nowrap;cursor:pointer;
 box-shadow:0 4px 16px #0005;
}
#rc-new-messages-jump:hover { filter:brightness(1.12); }
#rc-new-messages-jump svg {width:16px;height:16px;flex:none}
#rc-new-messages-jump[hidden] {display:none!important}
#rc-new-messages-count:empty {display:none}
@media (max-width:767px) {
 #rc-new-messages-jump {bottom:8px;right:10px;padding:8px 10px;font-size:11px;}
}

/* RusChat 2.1.30: matching styled initials in expanded and collapsed PC sidebars.
   User-uploaded photos always remain visible; only absent photos use initials. */
@media (min-width:768px) {
 body.rc-desktop-connected .rc-avatar-tone-0{--rc-avatar-bg:#294974;--rc-avatar-bg2:#1b304e;--rc-avatar-fg:#c5dcff;--rc-avatar-stroke:#587eae}
 body.rc-desktop-connected .rc-avatar-tone-1{--rc-avatar-bg:#195859;--rc-avatar-bg2:#14393e;--rc-avatar-fg:#b5f4e9;--rc-avatar-stroke:#3f938d}
 body.rc-desktop-connected .rc-avatar-tone-2{--rc-avatar-bg:#51406e;--rc-avatar-bg2:#332a4f;--rc-avatar-fg:#e6d3ff;--rc-avatar-stroke:#7f67a6}
 body.rc-desktop-connected .rc-avatar-tone-3{--rc-avatar-bg:#71502c;--rc-avatar-bg2:#493922;--rc-avatar-fg:#ffe4b4;--rc-avatar-stroke:#a87b44}
 body.rc-desktop-connected .rc-avatar-tone-4{--rc-avatar-bg:#714358;--rc-avatar-bg2:#493044;--rc-avatar-fg:#ffd0df;--rc-avatar-stroke:#aa6b8c}
 body.rc-desktop-connected .rc-avatar-tone-5{--rc-avatar-bg:#355b45;--rc-avatar-bg2:#243d36;--rc-avatar-fg:#d1f4d0;--rc-avatar-stroke:#669477}
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-avatar.rc-avatar-tile,
 body.rc-desktop-connected .rc-collapsed-rail .rc-rail-avatar.rc-avatar-tile{
  position:relative;display:grid;place-items:center;overflow:hidden;box-sizing:border-box;
  background:linear-gradient(145deg,var(--rc-avatar-bg),var(--rc-avatar-bg2));
  color:var(--rc-avatar-fg);border:1px solid var(--rc-avatar-stroke);
  border-radius:4px!important;box-shadow:inset 0 1px 0 #ffffff1a;
  font-family:'Segoe UI',system-ui,sans-serif;font-weight:800;
  font-variant-ligatures:none;line-height:1;text-align:center;letter-spacing:.15px;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-avatar.rc-avatar-tile{
  flex:0 0 26px;width:26px;height:26px;font-size:10px;
 }
 body.rc-desktop-connected .rc-collapsed-rail .rc-rail-avatar.rc-avatar-tile{
  flex:0 0 35px;width:35px;height:35px;font-size:12px;
 }
 body.rc-desktop-connected .rc-avatar-tile .rc-avatar-initials{display:block;position:relative;z-index:1;white-space:nowrap}
 body.rc-desktop-connected .rc-avatar-tile img{position:absolute;inset:0;z-index:3;width:100%;height:100%;object-fit:cover}
 body.rc-desktop-connected .rc-avatar-tile .rc-avatar-channel-mark{
  position:absolute;z-index:2;top:1px;right:1px;width:9px;height:9px;
  fill:none;stroke:currentColor;stroke-width:2.2;stroke-linecap:round;
  opacity:.8;pointer-events:none;
 }
 body.rc-desktop-connected .rc-collapsed-rail .rc-avatar-tile .rc-avatar-channel-mark{width:11px;height:11px;top:2px;right:2px}
 body.rc-desktop-connected .rc-rail-server .rc-avatar-tile{--rc-avatar-bg:#713243;--rc-avatar-bg2:#472535;--rc-avatar-fg:#ffd1de;--rc-avatar-stroke:#9f566a}
 body.rc-desktop-connected .rc-conversation-open:hover .rc-avatar-tile,
 body.rc-desktop-connected .rc-rail-item:hover .rc-avatar-tile{filter:brightness(1.12)}
}

/* Connected desktop conversations: draggable handles stay to the left
   of the conversation; close buttons remain separate on the far right. */
@media (min-width:768px){
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-row{
  gap:0;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-grip{
  display:grid;place-items:center;flex:0 0 24px;min-width:24px;width:24px;
  box-sizing:border-box;height:100%;min-height:0;max-height:100%;
  margin:0;padding:0;border:0;border-right:1px solid var(--line);
  border-radius:0;background:transparent;color:var(--muted);
  cursor:grab;touch-action:none;user-select:none;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-grip svg{
  display:block;flex:none;width:13px;height:17px;pointer-events:none;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-open{
  min-width:0;padding-left:6px;padding-right:6px;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-close{
  flex:0 0 30px;min-width:30px;width:30px;border-left:1px solid var(--line);
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-close svg{
  display:block;flex:none;width:14px;height:14px;pointer-events:none;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-grip:hover,
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-grip:focus-visible{
  color:var(--accent);background:var(--surface-hover,var(--panel));
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-grip:active{cursor:grabbing}
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-row.rc-drop-before{
  box-shadow:inset 0 3px 0 var(--accent);
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-row.rc-drop-after{
  box-shadow:inset 0 -3px 0 var(--accent);
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-grip.rc-is-dragging,
 body.rc-desktop-connected .rc-collapsed-rail .rc-rail-item.rc-is-dragging{opacity:.35}
 body.rc-desktop-connected .rc-collapsed-rail .rc-rail-item[draggable=true]{cursor:grab}
 body.rc-desktop-connected .rc-collapsed-rail .rc-rail-item.rc-drop-before{box-shadow:0 -3px 0 var(--accent)}
 body.rc-desktop-connected .rc-collapsed-rail .rc-rail-item.rc-drop-after{box-shadow:0 3px 0 var(--accent)}
}


/* RusChat 1.2.14: phones <=767px; tablets and computers >=768px.
   A narrow desktop window keeps desktop navigation (not the phone hamburger).
   Its participant list is a desktop drawer, leaving usable width for the chat. */
@media (min-width:768px) and (max-width:1100px) {
 html,body{min-width:0;overflow:hidden}
 body main,
 body.desktop-sidebar-layout main{
  display:grid;grid-template-columns:clamp(192px,26vw,248px) minmax(0,1fr);
  grid-template-rows:minmax(0,1fr);
  width:100%;max-width:none;height:100dvh;margin:0;padding:8px;gap:8px;
  overflow:hidden;
 }
 body main>.brand{min-width:0;max-width:none;padding:14px 10px;border-radius:10px;overflow-x:hidden;overflow-y:auto}
 body main>.chat{min-width:0;width:100%;border-radius:10px;overflow:hidden}
 body .desktop-sidebar-layout #desktop-user-tools,
 body.desktop-sidebar-layout #desktop-user-tools{flex-wrap:wrap;gap:5px;padding-bottom:9px;margin-bottom:10px}
 body.desktop-sidebar-layout #desktop-user-tools button,
 body.desktop-sidebar-layout #desktop-user-tools #personal-controls button,
 body.desktop-sidebar-layout #desktop-user-tools .projects-menu summary{
  flex:0 0 36px;width:36px;min-width:36px;height:36px;min-height:36px;
 }
 body.rc-desktop-connected .brand #rc-desktop-conversation-nav{margin-top:9px;padding:7px}
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-heading{font-size:13px}
 body main>.people{
  display:none;position:fixed;z-index:70;
  top:8px;right:8px;bottom:8px;left:auto;
  width:min(320px,calc(100vw - 24px));height:auto;max-height:none;
  padding:16px 12px;border:1px solid var(--line);border-radius:10px;
  background:var(--panel);box-shadow:-14px 0 40px #0007;
 }
 body.people-open main>.people{display:flex}
 body #people-toggle:not([hidden]),body #people-close:not([hidden]){display:flex;align-items:center;justify-content:center}
 body #people-close{display:flex;flex:0 0 36px;width:36px;height:36px;padding:0}
 body #desktop-tabs{min-width:0;max-width:100%;overflow:visible}
 body.rc-desktop-connected #desktop-tabs{flex-wrap:wrap;row-gap:6px;padding:7px 8px}
 body.rc-desktop-connected #desktop-tabs #desktop-radio-dock{flex:1 0 100%;width:100%;min-width:0;order:2}
 body.rc-desktop-connected #desktop-radio-dock #radio-player-panel{
  box-sizing:border-box;display:grid;width:100%;min-width:0;max-width:100%;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr);
  grid-template-rows:auto auto;
  justify-content:stretch;align-items:center;
  gap:5px;height:auto;min-height:82px;padding:5px 7px;
 }
 body.rc-desktop-connected #desktop-radio-dock #radio-station-open{width:100%;min-width:0}
 body.rc-desktop-connected #desktop-radio-dock .radio-controls{min-width:0}
 body.rc-desktop-connected #desktop-radio-dock .radio-playback-row{min-width:0}
 body.rc-desktop-connected #desktop-radio-dock .radio-now{min-width:0}
 body.rc-desktop-connected #desktop-radio-dock .radio-track-row{min-width:0}
 body.rc-desktop-connected #desktop-radio-dock #radio-track{min-width:0}
 body #messages{min-width:0;padding:12px 10px}
 body #composer{min-width:0;margin:0 10px}
 body .hint{padding:7px 12px 10px}
}


/* RusChat 1.2.16: fixed desktop columns and compact seven-button toolbar. */
@media (min-width: 768px) {
 body.rc-desktop-connected {
  --rc-left-column: 285px;
  --rc-right-column: 270px;
 }
 body.rc-desktop-connected.rc-left-collapsed { --rc-left-column: 66px; }
 body.rc-desktop-connected.rc-right-collapsed { --rc-right-column: 66px; }
 /* Seven controls (including the two personal-controls) must fit inside
    the 270px participants column, which has 17px horizontal padding. */
 body.desktop-sidebar-layout #desktop-user-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px;
  min-width: 0;
  justify-content: center;
 }
 body.desktop-sidebar-layout #desktop-user-tools > #personal-controls,
 body.desktop-sidebar-layout #desktop-user-tools > .utility { display: contents; }
 body.desktop-sidebar-layout #desktop-user-tools button:not(#leave),
 body.desktop-sidebar-layout #desktop-user-tools #personal-controls button,
 body.desktop-sidebar-layout #desktop-user-tools .projects-menu summary {
  flex: 0 0 30px;
  width: 30px;
  min-width: 30px;
  height: 30px;
  min-height: 30px;
  box-sizing: border-box;
  padding: 4px;
  margin: 0;
 }
 body.desktop-sidebar-layout #desktop-user-tools button[data-desktop-icon]::before,
 body.desktop-sidebar-layout #desktop-user-tools .projects-menu summary::before {
  width: 18px;
  height: 18px;
  flex: none;
 }
 body.desktop-sidebar-layout #desktop-user-tools #personal-controls button > svg,
 body.desktop-sidebar-layout #desktop-user-tools #personal-controls svg {
  display: block;
  width: 18px;
  height: 18px;
  flex: none;
  margin: 0;
 }
 /* The account/projects SVG icons must not enforce their 22px intrinsic size. */
 body.desktop-sidebar-layout #desktop-user-tools button > svg,
 body.desktop-sidebar-layout #desktop-user-tools .projects-menu summary > svg {
  width: 18px;
  height: 18px;
  flex: none;
 }
}
@media (min-width: 768px) and (max-width: 1100px) {
 /* Narrow desktop uses a two-column layout; the participants column
    slides over the chat rather than squeezing it into a third column. */
 body.rc-desktop-connected.desktop-sidebar-layout main {
  grid-template-columns: var(--rc-left-column) minmax(0, 1fr);
 }
 body.rc-desktop-connected main > .people {
  width: min(270px, calc(100vw - 24px));
 }
}

/* RusChat 1.2.18: roomier sidebars on full-HD desktop displays. */
@media (min-width: 1600px) {
 body.rc-desktop-connected {
  --rc-left-column: 340px;
  --rc-right-column: 320px;
 }
}


/* RusChat 1.2.19: compact, permanently visible right-side user avatars on
   tablet/narrow desktop. Expand into an overlay without shrinking the chat. */
@media (min-width: 768px) and (max-width: 1100px) {
 body.rc-desktop-connected.desktop-sidebar-layout main,
 body.rc-desktop-connected main {
  grid-template-columns: var(--rc-left-column) minmax(0, 1fr) 66px;
 }
 body.rc-desktop-connected main > #participants,
 body.rc-desktop-connected.rc-right-collapsed main > #participants {
  display: flex;
  position: relative;
  z-index: 5;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  width: auto;
  min-width: 0;
  height: 100%;
  max-height: none;
  box-shadow: none;
 }
 body.rc-desktop-connected.rc-right-collapsed main > #participants {
  padding: 48px 7px 12px !important;
 }
 body.rc-desktop-connected:not(.rc-right-collapsed) main > #participants {
  position: fixed;
  z-index: 70;
  top: 8px;
  right: 8px;
  bottom: 8px;
  left: auto;
  width: min(310px, calc(100vw - 24px));
  height: auto;
  padding: 16px 12px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: -14px 0 40px #0007;
 }
 /* Keep the top-edge controls accessible when the expanded panel is open. */
 body.rc-desktop-connected #participants > .rc-sidebar-toggle {display:grid;}
 body.rc-desktop-connected.rc-right-collapsed #participants > .rc-collapsed-rail {display:flex;}
}


/* RusChat 1.2.20: On 768–1100px, both sidebars remain visible as 66px
   icon/avatar rails. Expanding either rail overlays the conversation without
   altering the middle column. Wider desktops keep their saved settings. */
@media (min-width: 768px) and (max-width: 1100px) {
 body.rc-desktop-connected { --rc-left-column: 66px; --rc-right-column: 66px; }
 body.rc-desktop-connected.desktop-sidebar-layout main,
 body.rc-desktop-connected main {
  grid-template-columns: 66px minmax(0, 1fr) 66px;
 }
 /* Explicitly lock grid placement while either sidebar is fixed-position. */
 body.rc-desktop-connected main > .brand {grid-column:1;grid-row:1;}
 body.rc-desktop-connected main > .chat {grid-column:2;grid-row:1;}
 body.rc-desktop-connected main > #participants {grid-column:3;grid-row:1;}
 body.rc-desktop-connected main > .brand {
  display:flex;
  position:relative;
  top:auto;
  left:auto;
  right:auto;
  bottom:auto;
  z-index:5;
  width:auto;
  min-width:0;
  height:100%;
  max-height:none;
  box-shadow:none;
 }
 body.rc-desktop-connected.rc-left-collapsed main > .brand {
  padding:48px 7px 12px !important;
  overflow:hidden;
 }
 body.rc-desktop-connected:not(.rc-left-collapsed) main > .brand {
  position:fixed;
  z-index:71;
  top:8px;
  left:8px;
  right:auto;
  bottom:8px;
  width:min(310px, calc(100vw - 24px));
  height:auto;
  box-sizing:border-box;
  padding:14px 12px;
  border:1px solid var(--line);
  background:var(--panel);
  box-shadow:14px 0 40px #0007;
  overflow-x:hidden;
  overflow-y:auto;
 }
 body.rc-desktop-connected main > .brand > .rc-sidebar-toggle { display:grid; }
 body.rc-desktop-connected.rc-left-collapsed main > .brand > .rc-collapsed-rail { display:flex; }
}

/* RusChat 1.3.3: unified theme-safe radio controls; no brown native backgrounds
   or decorative pseudo-element squares when a radio control is clicked. */
#radio-player-open, .radio-launcher {
 -webkit-appearance:none;appearance:none;
 background:var(--surface,#1c2a40)!important;
 color:var(--text,#e8eef9)!important;
 border:1px solid var(--line,#96b6e51c)!important;
 box-shadow:none!important;
}
#radio-player-open:hover,.radio-launcher:hover,
#radio-player-open.is-playing,.radio-launcher.is-playing {
 background:var(--surface-hover,#253754)!important;
 border-color:var(--accent,#9bb6ff)!important;
}
#radio-player-open::before,#radio-player-open::after,
.radio-launcher::before,.radio-launcher::after,
#radio-player-panel #radio-play::before,
#radio-player-panel #radio-play::after {content:none!important;display:none!important}
#radio-player-panel .radio-playback-row #radio-play {
 -webkit-appearance:none;appearance:none;
 background:var(--accent,#9bb6ff)!important;
 color:var(--page,#0b111d)!important;
 border:0!important;box-shadow:none!important;
}
#radio-player-panel .radio-playback-row #radio-play:hover:not(:disabled){filter:brightness(1.08)}

/* RusChat 1.3.19: points in the mobile menu, verified NickServ users only. */
@media(max-width:767px){
 #mobile-chat-menu > #rc-points-personal{display:block;box-sizing:border-box;width:100%;margin:10px 0;padding:12px;border-radius:10px;border:1px solid var(--line);background:var(--surface)}
 #mobile-chat-menu > #rc-points-personal[hidden]{display:none!important}
 #mobile-chat-menu > #rc-points-personal .rc-points-header{display:flex;align-items:center;justify-content:space-between;gap:8px;font-size:14px}
 #mobile-chat-menu > #rc-points-personal small{font-size:12px;line-height:1.55}
 #mobile-chat-menu > #rc-points-personal #rc-leaderboard-open{width:100%;min-height:38px;margin-top:9px}
}
@media(min-width:768px){}

/* RusChat 1.3.21: compact conversation reorder / close actions.
   Keep separate keyboard focus and click targets without wasting label space. */
@media (min-width:768px){
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-row{gap:0}
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-open{padding-inline:7px;gap:6px;min-width:0}
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-grip{
  display:grid;place-items:center;flex:0 0 30px;width:30px;min-width:30px;
  height:100%;max-height:100%;padding:0;margin:0;
  background:transparent;border:0;border-left:1px solid var(--line);border-right:0;
  border-radius:0;color:var(--muted);cursor:grab;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-grip svg{
  width:12px;height:14px;opacity:.75;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-close{
  display:grid;place-items:center;flex:0 0 30px;min-width:30px;width:30px;
  height:100%;min-height:0;max-height:100%;padding:0;margin:0;
  border:0;border-left:1px solid var(--line);border-radius:0;
 }
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-close svg{width:11px;height:11px}
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-grip:focus-visible,
 body.rc-desktop-connected #rc-desktop-conversation-nav .rc-conversation-close:focus-visible{
  outline:2px solid var(--accent);outline-offset:-2px;
 }
}

/* RusChat 1.3.24: bring back the right-hand people sidebar on the desktop
   home/login page. Preserve the two-column tablet layout and mobile drawer. */
@media (min-width: 1101px) {
 body.desktop-sidebar-layout:not(.rc-desktop-connected) main {
  grid-template-columns: 335px minmax(0,1fr) 352px !important;
 }
 body.desktop-sidebar-layout:not(.rc-desktop-connected) main > #participants {
  display: flex !important;
 }
}

/* 1.4.6: no emoji picker shortcut in the mobile message composer.
   Desktop retains its original button and behaviour. */
@media (max-width:767px){
 #composer #emoji-toggle{display:none!important}
}

/* 1.4.6: mobile Commands row uses the same 22px line icon as Account/Projects. */
@media(max-width:767px){
 .rc-mobile-menu-host #mobile-menu .utility #commands-open{
  display:flex;align-items:center;justify-content:flex-start;gap:10px;
  color:var(--text);font-size:14px;text-align:left;
 }
 .rc-mobile-menu-host #mobile-menu .utility #commands-open::before{content:none!important;display:none!important}
 .rc-mobile-menu-host #mobile-menu .utility #commands-open svg{
  box-sizing:content-box;display:block;flex:0 0 22px;width:22px;height:22px;
  fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;color:inherit;
 }
 .rc-mobile-menu-host #mobile-menu .utility #commands-open span{font-size:14px;line-height:1.3}
}
/* Keep the old desktop utility icons, without rendering the new SVG twice. */
@media(min-width:768px){#commands-open .rc-menu-command-icon,#commands-open .rc-menu-command-label{display:none!important}}

/* RusChat 1.4.11: allow normal mobile panning, but not page pinch/double-tap zoom.
   Restrict this to the phone layout; desktop zoom is unchanged. */
@media (max-width: 767px) {
  html, body { touch-action: pan-x pan-y; }
}

/* RusChat 1.7.23: visually separate IRC system events from the background, both themes. */
/* RusChat 1.7.24: calmer system events on the dark theme only. */
#messages .message.system{
 box-sizing:border-box;
 display:block;
 margin:4px 0;
 padding:7px 12px;
 border:1px solid #29364a;
 border-left:3px solid #3c5272;
 border-radius:7px;
 background:#121b29;
 color:#a2b1c8;
 line-height:1.5;
 overflow-wrap:anywhere;
}
#messages .message.system time{color:#8699b4}
#messages .message.system:hover{background:#172233;border-color:#33465d}
html[data-theme="light"] #messages .message.system{
 background:#eff4fa;
 border-color:#d6e0ed;
 border-left-color:#879fc2;
 color:#52627b;
}
html[data-theme="light"] #messages .message.system time{color:#687c98}
html[data-theme="light"] #messages .message.system:hover{background:#e6eef9;border-color:#c6d7eb}
@media(max-width:700px){#messages .message.system{margin:3px 0;padding:6px 9px}}

/* Telegram-exported animated stickers: a second tab inside the existing emoji picker. */
#emoji-picker .emoji-main-tabs{display:grid;grid-template-columns:1fr 1fr;gap:5px;margin-bottom:10px;flex:0 0 auto;border-bottom:1px solid var(--line);padding-bottom:8px}
#composer #emoji-picker .emoji-mode-tab{height:34px;min-height:34px;border-radius:4px;background:var(--surface);color:var(--muted);font-size:13px;font-weight:600;line-height:1.2}
#composer #emoji-picker .emoji-mode-tab[aria-selected="true"]{background:var(--surface-hover);color:var(--accent);box-shadow:inset 0 -2px 0 var(--accent)}
#emoji-picker .emoji-section,#emoji-picker .sticker-section{display:flex;flex:1 1 auto;min-height:0;flex-direction:column}
#emoji-picker .emoji-section[hidden],#emoji-picker .sticker-section[hidden]{display:none!important}
#emoji-picker .sticker-section{gap:8px}
#composer #emoji-picker .sticker-search{display:block;box-sizing:border-box;width:100%;height:36px;min-height:36px;background:var(--input);color:var(--text);border:1px solid var(--line);border-radius:4px;padding:6px 10px;font-size:13px}
#emoji-picker .sticker-pack-tabs{display:flex;gap:5px;overflow-x:auto;flex:0 0 auto;padding:2px 1px 5px;scrollbar-width:thin}
#composer #emoji-picker .sticker-pack{flex:none;white-space:nowrap;padding:6px 10px;min-height:30px;background:var(--surface);border:1px solid var(--line);border-radius:4px;color:var(--muted);font-size:12px}
#composer #emoji-picker .sticker-pack[aria-pressed="true"]{border-color:var(--accent);color:var(--accent);background:var(--surface-hover)}
#emoji-picker .sticker-body{flex:1 1 auto;min-height:0;overflow-y:auto;overscroll-behavior:contain}
#emoji-picker .sticker-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:7px}
#composer #emoji-picker .sticker-item{position:relative;display:flex;width:100%;height:auto;aspect-ratio:1/1;padding:4px;border-radius:5px;background:var(--surface);border:1px solid transparent;cursor:pointer;overflow:hidden}
#composer #emoji-picker .sticker-item:hover,#composer #emoji-picker .sticker-item:focus-visible{background:var(--surface-hover);border-color:var(--accent)}
#emoji-picker .sticker-preview{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
#emoji-picker .sticker-preview-fallback{font-size:38px}
#emoji-picker .sticker-preview-fallback[hidden]{display:none}
#emoji-picker .sticker-note{flex:0 0 auto;font-size:10px;line-height:1.3;color:var(--muted);padding:2px 0}
#emoji-picker .sticker-empty{font-size:13px;color:var(--muted)}
.message .rc-chat-sticker{display:inline-flex;align-items:center;justify-content:center;max-width:min(180px,100%);min-width:120px;min-height:120px;border:0;text-decoration:none;background:transparent}
.message .rc-chat-sticker-img{display:block;max-width:100%;width:164px;height:164px;object-fit:contain}
.message .rc-chat-sticker-fallback{color:var(--muted);font-size:15px}
.message .rc-chat-sticker-fallback[hidden]{display:none}
@media(max-width:400px){#emoji-picker .sticker-grid{gap:4px}.message .rc-chat-sticker-img{width:136px;height:136px}}
@media(prefers-reduced-motion:reduce){#emoji-picker .sticker-preview,.message .rc-chat-sticker-img{animation:none!important}}

#emoji-picker .sticker-preview[hidden],.message .rc-chat-sticker-img[hidden]{display:none!important}

/* RusChat 1.9.13: compact Telegram stickers (keep chat readable). */
#emoji-picker .sticker-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
#composer #emoji-picker .sticker-item{padding:2px;aspect-ratio:1/1;min-height:0;border-radius:4px}
#emoji-picker .sticker-preview{max-width:100%;max-height:100%;object-fit:contain}
#emoji-picker .sticker-pack-tabs{gap:4px}
#composer #emoji-picker .sticker-pack{padding:6px 9px;min-height:27px;font-size:11px}
#emoji-picker .sticker-note{font-size:10px}
.message .rc-chat-sticker{width:auto;min-width:0;min-height:0;max-width:min(104px,100%);display:inline-flex;vertical-align:middle}
.message .rc-chat-sticker-img{display:block;width:96px;height:96px;max-width:100%;max-height:96px;object-fit:contain}
@media(max-width:450px){
 #emoji-picker .sticker-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:3px}
 .message .rc-chat-sticker{max-width:min(90px,100%)}
 .message .rc-chat-sticker-img{width:84px;height:84px;max-height:84px}
}

/* RusChat 1.9.14 — compact cover-only sticker collection navigator. */
#composer #emoji-picker .sticker-back{display:block;align-self:flex-start;width:28px;height:24px;min-height:24px;padding:0;border:1px solid var(--line);background:var(--surface);border-radius:4px;color:var(--text);font-size:18px;line-height:20px}
#emoji-picker .sticker-back[hidden],#emoji-picker .sticker-pack-tabs[hidden],#emoji-picker .sticker-body[hidden]{display:none!important}
#emoji-picker .sticker-pack-tabs{display:grid!important;grid-template-columns:repeat(8,minmax(0,1fr));gap:3px;max-height:min(34vh,245px);overflow-y:auto;overflow-x:hidden;scrollbar-width:thin;align-content:start;padding:2px;min-height:0}
#composer #emoji-picker .sticker-pack{display:flex;align-items:center;justify-content:center;aspect-ratio:1/1;width:100%;min-width:0;height:auto;min-height:0;padding:2px;border:1px solid transparent;border-radius:4px;background:var(--surface);overflow:hidden;font-size:0;line-height:1;cursor:pointer}
#composer #emoji-picker .sticker-pack:hover,#composer #emoji-picker .sticker-pack:focus-visible{border-color:var(--accent);background:var(--surface-hover)}
#emoji-picker .sticker-cover-media{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
#emoji-picker .sticker-cover-loading{display:flex;align-items:center;justify-content:center;font-size:20px;opacity:.6;width:100%;height:100%}
#emoji-picker .sticker-pack.is-unavailable{color:var(--muted);font-size:16px}
#emoji-picker .sticker-grid{display:grid;grid-template-columns:repeat(6,minmax(0,1fr));gap:4px}
#composer #emoji-picker .sticker-item{padding:2px;aspect-ratio:1/1;min-height:0}
#emoji-picker .sticker-preview{display:block;width:100%;height:100%;object-fit:contain;pointer-events:none}
#emoji-picker .sticker-note{font-size:10px;line-height:1.4}
.message .rc-chat-sticker{display:inline-flex;width:74px;min-width:0;min-height:0;max-width:74px;align-items:center;justify-content:center;vertical-align:middle}
.message .rc-chat-sticker-img{display:block;width:68px;height:68px;max-height:68px;max-width:68px;object-fit:contain}
@media(max-width:650px){
 #emoji-picker .sticker-pack-tabs{grid-template-columns:repeat(7,minmax(0,1fr));max-height:min(32vh,190px);gap:2px}
 #emoji-picker .sticker-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:3px}
 .message .rc-chat-sticker{width:62px;max-width:62px}
 .message .rc-chat-sticker-img{width:56px;height:56px;max-width:56px;max-height:56px}
}
#composer #emoji-picker .sticker-back[hidden]{display:none!important}

/* 1.9.14: mobile sticker collections must be accessible from the smiley button. */
@media(max-width:767px){#composer #emoji-toggle{display:flex!important;align-items:center;justify-content:center;flex:0 0 36px;width:36px;min-width:36px;height:36px;min-height:36px}}


/* RusChat 1.9.15: complete Telegram collections, usable covers, compact search. */
#composer #emoji-picker input.sticker-search{
 box-sizing:border-box!important; flex:0 0 28px!important;
 height:28px!important;min-height:28px!important;max-height:28px!important;
 padding:3px 8px!important;border-radius:4px!important;font-size:12px!important;
 line-height:20px!important;margin:0!important;box-shadow:none!important;
}
#emoji-picker .sticker-section{gap:5px;min-height:0}
#emoji-picker .sticker-pack-tabs{
 grid-template-columns:repeat(6,minmax(0,1fr))!important;
 gap:5px!important;max-height:min(42vh,305px)!important;
 padding:3px!important;align-content:start;
}
#composer #emoji-picker .sticker-pack{
 border:1px solid var(--line)!important;border-radius:5px!important;
 padding:4px!important;min-height:49px!important;aspect-ratio:1/1;
 background:var(--surface)!important;overflow:hidden!important;
}
#emoji-picker .sticker-cover-media{
 width:100%!important;height:100%!important;max-height:100%!important;
 object-fit:contain!important;object-position:center!important;
 background:transparent!important;display:block;
}
#emoji-picker .sticker-grid{grid-template-columns:repeat(5,minmax(0,1fr));gap:4px}
#composer #emoji-picker .sticker-item{padding:5px;border-radius:5px;background:var(--surface)}
#emoji-picker .sticker-preview{object-fit:contain!important;object-position:center!important}
#emoji-picker .sticker-note{font-size:10px;color:var(--muted)}
.message .rc-chat-sticker,.message .rc-chat-sticker-img{min-width:0;min-height:0}
@media(max-width:650px){
 #emoji-picker .sticker-pack-tabs{grid-template-columns:repeat(5,minmax(0,1fr))!important;max-height:min(39vh,250px)!important;gap:4px!important}
 #composer #emoji-picker .sticker-pack{min-height:45px!important;padding:3px!important}
 #emoji-picker .sticker-grid{grid-template-columns:repeat(4,minmax(0,1fr));gap:4px}
}

/* RusChat 1.9.16: full live sticker collections, animated TGS with WebP fallback. */
#emoji-picker .sticker-pack-tabs{scrollbar-gutter:stable;overscroll-behavior:contain}
#composer #emoji-picker .sticker-pack{contain:layout paint;transition:border-color .12s ease,background .12s ease}
#emoji-picker .sticker-cover-media[hidden]{display:none!important}
#emoji-picker .sticker-tgs{position:relative;display:inline-flex;justify-content:center;align-items:center;overflow:hidden;flex:0 0 auto;isolation:isolate}
#emoji-picker .sticker-tgs-poster{display:block;width:100%;height:100%;max-width:100%;max-height:100%;object-fit:contain;pointer-events:none}
#emoji-picker .sticker-tgs-player{position:absolute;inset:0;width:100%;height:100%;overflow:hidden;pointer-events:none}
#emoji-picker .sticker-tgs-player svg{display:block;width:100%!important;height:100%!important}
#emoji-picker .sticker-tgs-poster[hidden]{display:none!important}
.message .rc-chat-sticker-img.sticker-tgs{display:inline-flex;position:relative}
.message .sticker-tgs-poster{width:100%;height:100%;object-fit:contain}
.message .sticker-tgs-player{position:absolute;inset:0;display:block;width:100%;height:100%;pointer-events:none;overflow:hidden}
.message .sticker-tgs-player svg{width:100%!important;height:100%!important}
.message .sticker-tgs-poster[hidden]{display:none!important}
