/* User settings follow the same Bootstrap 2 controls as the workspace. */
#settings-dialog{width:min(720px,calc(100vw - 24px));left:50%;margin-left:0;transform:translateX(-50%);top:7%;max-height:86dvh}
.settings-layout{display:grid;grid-template-columns:154px minmax(0,1fr);min-height:340px}
#settings-nav{padding:12px 0;border-right:1px solid #ddd}
#settings-nav .nav-list>li>a{padding:7px 15px}
.settings-page{overflow:auto;max-height:calc(83dvh - 60px);padding:12px 20px 18px;box-sizing:border-box}
.settings-page h4{margin:4px 0 15px}.settings-page select{width:100%;max-width:340px}
.settings-page label:not(.checkbox){font-weight:bold;margin-top:8px}
.settings-page input[type=range]{width:100%;max-width:340px;display:block;margin:3px 0 12px}
.settings-page output{margin-left:6px;font-weight:normal;font-variant-numeric:tabular-nums}
.settings-page .checkbox{margin:8px 0}.settings-page .muted{font-size:12px}
.settings-identity,.mic-check,.self-controls{display:flex;align-items:center;gap:9px}
.settings-identity{margin-bottom:16px}.settings-identity .avatar{width:42px;height:42px}
.self-controls{justify-content:space-between}.self-controls .self{min-width:0;overflow-wrap:anywhere}.self-controls>.btn{flex:none}
.mic-check{margin:12px 0 16px}.mic-check meter{width:120px;max-width:45%}.settings-buttons{display:flex;gap:5px;flex-wrap:wrap}
.settings-channels{margin:14px 0;list-style:none}.settings-channels li{border-top:1px solid #ddd;padding:5px 0}
.settings-channels .btn{margin-left:5px}
.channel-person{display:flex;align-items:center;gap:4px;padding:2px 0 2px 12px;font-size:12px;overflow-wrap:anywhere}
.tree-avatar{display:inline-flex;flex:none;pointer-events:none}
.tree-avatar .avatar{height:22px;width:22px;min-width:22px;border-radius:50%;font-size:10px;font-weight:bold}
.channel-person .voice-state{color:#666;font-size:10px}
.channel-person.speaking .tree-avatar{outline:2px solid #298a50;border-radius:50%}
.call-tile .voice-state{position:absolute;top:8px;right:8px;display:flex;align-items:center;gap:5px;padding:2px 6px;border:1px solid #ccc;background:white;color:#666;border-radius:3px;font-size:12px}
.call-tile .voice-state::before{content:'';width:7px;height:7px;border-radius:50%;background:#999}
.call-tile.speaking{border-color:#23814b;box-shadow:inset 0 0 0 2px #23814b}
.call-tile.speaking .avatar{outline:3px solid #23814b;outline-offset:3px}
.call-tile.speaking .voice-state{color:#176737;border-color:#23814b}.call-tile.speaking .voice-state::before{background:#23814b}
.call-tile.mic-muted .voice-state::before{width:9px;height:2px;border-radius:0}
#hold-talk{touch-action:none;user-select:none}#hold-talk[aria-pressed=true]{box-shadow:inset 0 1px 4px #999}
.call-tools{flex-wrap:wrap}
.msg p{font-size:var(--chat-size,14px);line-height:1.45}
html[data-density=compact] .msg{padding:1px 0;gap:6px}html[data-density=compact] .msg .avatar{width:23px;height:23px;min-width:23px;font-size:10px}
html[data-timestamps=false] .msg time{display:none}

html[data-theme=dark]{color-scheme:dark;--base:#222428;--panel:#292c30;--control:#35383d;--line:#494c53;--fg:#eeeef0;--sub:#b4b7bf;background:var(--base)}
[data-theme=dark] body,[data-theme=dark] #workspace,[data-theme=dark] #sidebar,[data-theme=dark] #members,[data-theme=dark] #call-stage{background:var(--base);color:var(--fg)}
[data-theme=dark] .navbar-inner,[data-theme=dark] .modal,[data-theme=dark] .account-panel,[data-theme=dark] .pane-heading,[data-theme=dark] .channel-head,[data-theme=dark] #call-bar,[data-theme=dark] .modal-footer,[data-theme=dark] #notice,[data-theme=dark] .tile-label,[data-theme=dark] #settings-nav,[data-theme=dark] .call-tile .voice-state{background:var(--panel);color:var(--fg);border-color:var(--line);box-shadow:none;text-shadow:none}
[data-theme=dark] .call-tile,[data-theme=dark] .screen-tile video,[data-theme=dark] .avatar,[data-theme=dark] .profile-cover{background:#303338;color:var(--fg);border-color:var(--line)}
[data-theme=dark] :is(#sidebar,#members,#compose,.stage-heading,.sidebar-bottom,.channel-intro,.channel-topic,.modal-header,.nav-tabs,.settings-channels li){border-color:var(--line)}
[data-theme=dark] .navbar .divider-vertical{border-color:var(--line)}
[data-theme=dark] :is(.navbar .brand,.navbar .nav>li>a,.nav-list>li>a,.nav-header,.nav-tabs>li>a,.close){color:var(--fg);text-shadow:none}
[data-theme=dark] .close{opacity:.8}
[data-theme=dark] :is(.navbar .nav>.active>a,.nav-list>.active>a,.nav-tabs>.active>a,.nav>li>a:hover,.nav>li>a:focus){background:var(--control);color:var(--fg);border-color:var(--line);box-shadow:none;text-shadow:none}
[data-theme=dark] .btn,[data-theme=dark] .btn:hover,[data-theme=dark] .btn:focus{color:var(--fg);border-color:#60636b;background:linear-gradient(#42464d,#33363b);text-shadow:none;box-shadow:none}
[data-theme=dark] a{color:#8bc7f8}
[data-theme=dark] :is(input:not([type=range]):not([type=checkbox]),select,textarea,.uneditable-input){color:var(--fg);background:var(--base);border-color:#656972}
[data-theme=dark] :is(.muted,small,.msg time,.channel-person .voice-state,.person small,.self small,.help-block){color:var(--sub)}
[data-theme=dark] :is(.error,.text-error){color:#ffaca7}
[data-theme=dark] [class^=icon-],[data-theme=dark] [class*=" icon-"]{filter:invert(1)}
[data-theme=dark] .speaking .voice-state{color:#81e6a8;border-color:#63bd89}
[data-theme=dark] .call-tile.speaking{border-color:#63bd89;box-shadow:inset 0 0 0 2px #63bd89}
@media(max-width:600px){.settings-layout{grid-template-columns:minmax(0,1fr);min-height:0}#settings-nav{border-right:0;border-bottom:1px solid #aaa;padding:0}#settings-nav .nav-list{display:flex;flex-wrap:wrap;margin:0;padding:4px}#settings-nav .nav-list>li>a{margin:0;padding:4px 7px}.settings-page{padding:10px;max-height:55dvh}#settings-dialog{top:4%}}
.voice-tree .channel-person{gap:4px;min-height:21px}.channel-person[draggable=true]{cursor:grab}.tree-name{min-width:0;overflow-wrap:anywhere}
.tree-icon{display:inline-flex;align-items:center;flex:none;color:inherit;line-height:1}.tree-icon svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.tree-icon.server-restriction{color:#b63138}[data-theme=dark] .tree-icon.server-restriction{color:#ff858b}
.voice-options{margin-left:auto;line-height:14px}.nav-list a.voice-drop-target{outline:2px dashed currentColor;outline-offset:-2px}
#new-category{margin-left:auto;white-space:nowrap}
.category-head{display:flex;align-items:center;gap:4px;padding:3px 10px}
.category-head .category-toggle{display:flex;align-items:center;gap:6px;flex:1;min-width:0;text-align:left;border:0;background:transparent;color:inherit;font:inherit;text-transform:inherit;overflow-wrap:anywhere;padding:3px 0}
.category-caret{flex:none;width:5px;height:5px;border-right:1.5px solid currentColor;border-bottom:1.5px solid currentColor;transform:rotate(45deg);margin:0 2px 3px}
.category-toggle[aria-expanded=false] .category-caret{transform:rotate(-45deg);margin-bottom:0}
.category-head .btn-mini{flex:none;min-width:20px;float:none}
.channel-category .nav-list{margin-bottom:4px}
.channel-category{margin-bottom:5px}
.empty-uncategorized{display:none}
#channels[data-moving=channel] .empty-uncategorized{display:block}
#channels [data-sort-kind]{cursor:grab}
#channels [data-sort-kind]:active{cursor:grabbing}
.sidebar-grip{display:inline-block;float:right;flex:none;width:16px;height:16px;margin-left:auto;touch-action:none;opacity:0}
.sidebar-grip::after{content:'';display:block;width:8px;height:12px;margin:2px auto;background:radial-gradient(circle,currentColor 1px,transparent 1.3px) 0 0 / 4px 4px}
[data-sort-kind]:is(:hover,:focus) .sidebar-grip{opacity:.6}
@media(pointer:coarse){.sidebar-grip{opacity:.65;width:28px;height:22px}.sidebar-grip::after{margin-top:5px}}
#channels [data-drop=before]{box-shadow:inset 0 2px currentColor}
#channels [data-drop=after]{box-shadow:inset 0 -2px currentColor}
#channels [data-drop=inside]{outline:1px dashed currentColor;outline-offset:-2px}
.tree-person{display:inline-flex;align-items:center;gap:4px;min-width:0;text-align:left;font:inherit}
.tree-person:hover .tree-name{text-decoration:underline}
:root{--ping-red:#ba2438}
[data-theme=dark]{--ping-red:#ff7183}
#server-nav.unread-ping .icon-comment,#channels .unread-ping .icon-comment,#direct-list .unread-ping .icon-envelope{
  background:var(--ping-red);filter:none;
  mask:url(/img/glyphicons-halflings.png) -240px -120px no-repeat;
}
#direct-list .unread-ping .icon-envelope{mask-position:-72px 0}
.category-ping[aria-expanded=false] .category-caret{color:var(--ping-red)}
#typing-indicator,#reply-draft{padding:3px 15px;font-size:12px;line-height:20px}
#reply-draft{display:flex;align-items:center;gap:8px;border-top:1px solid var(--line,#ddd)}
#reply-draft span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#reply-draft .close{margin-left:auto}
.msg{position:relative}
.msg.grouped{padding-top:0;padding-bottom:1px}
.group-body{margin-left:38px}
html[data-density=compact] .group-body{margin-left:29px}
.msg-actions{display:flex;gap:2px;position:absolute;right:0;top:-7px;z-index:1;opacity:0;pointer-events:none}
.msg:hover .msg-actions,.msg:focus-within .msg-actions{opacity:1;pointer-events:auto}
@media(hover:none){.msg-actions{position:static;margin-left:auto;align-self:start;opacity:1;pointer-events:auto}}
.reply-quote{font-size:12px;line-height:18px;color:var(--sub,#666);border-left:2px solid var(--line,#bbb);padding-left:7px;overflow-wrap:anywhere}
#dialog:has(.profile-title){width:min(310px,calc(100vw - 24px));margin-left:0;left:var(--profile-x,max(12px,calc(50% - 155px)));top:var(--profile-y,10%);}
#dialog:has(.profile-title) .modal-body{max-height:65dvh}
#dialog:has(.profile-title)::backdrop{background:transparent}
#dialog:has(.profile-title) .modal-header{position:absolute;right:8px;top:8px;z-index:1;padding:0;border:0}
#dialog:has(.profile-title) #dialog-title{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%)}
#dialog:has(.profile-title) #close{margin:0;width:24px;height:24px;border-radius:50%;background:#333;color:#fff;text-shadow:none;opacity:.85}
#dialog:has(.profile-title) .profile-cover{margin:-15px -15px 0;border:0}
#dialog:has(.profile-title) .profile-main .avatar{border-radius:50%;height:52px;width:52px}
#profile-quick{display:flex;flex-wrap:wrap;align-items:center;gap:5px;margin:12px 0 0}
#profile-quick input{flex:1;min-width:0;margin:0}
#profile-quick .error{width:100%;margin:0}
#profile-quick .error:empty{display:none}
.profile-open{margin-top:7px;text-decoration:underline;font-size:12px}
.screen-tile.call-tile{display:flex;flex-direction:column;align-items:stretch}
.screen-tile.call-tile video{position:static;flex:1 1 0;min-height:0;height:0;width:100%;object-fit:contain}
.screen-toolbar{display:flex;flex-wrap:wrap;align-items:center;gap:5px;padding:4px 7px;background:var(--panel,#fff);border-top:1px solid var(--line,#ddd);color:var(--fg,#333)}
.screen-caption{flex:1 1 65px;min-width:0;line-height:16px}
.screen-caption strong,.screen-caption small{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.screen-caption strong{font-size:12px}.screen-caption small{color:var(--sub,#666);font-size:11px}
.screen-toolbar .btn{min-width:24px;min-height:24px}.screen-toolbar .screen-volume{width:clamp(38px,5vw,78px);margin:0;accent-color:currentColor}
.screen-tile:fullscreen,.screen-tile.screen-expanded{width:100%;height:100%;border:0;border-radius:0;background:var(--panel,#fff);box-sizing:border-box}
.screen-tile.screen-expanded{position:fixed;inset:0;z-index:1050}
.dialog-form .remove-art input[type=checkbox]{width:auto}
#voice-management .checkbox{margin:8px 0}#voice-management select{max-width:75%}
.tree-live{flex:none;padding:0 4px;border-radius:3px;background:#b5263b;color:#fff;font-size:9px;font-weight:700;line-height:15px;letter-spacing:.04em}
.stage-tiles{display:contents}
.screen-tile video,.screen-caption{cursor:pointer}
#tile-grid.theater{--rail-height:clamp(86px,15dvh,132px);--gutter:6px;position:relative;grid-template-columns:minmax(0,1fr);grid-template-rows:minmax(0,1fr) var(--rail-height);padding:var(--gutter);gap:var(--gutter);overflow:hidden}
.theater .stage-tiles{grid-row:2;display:flex;gap:var(--gutter);min-height:0;overflow-x:auto;overflow-y:hidden;overscroll-behavior-x:contain}
.theater .call-tile:not(.theater-pinned){flex:0 0 clamp(116px,17vw,182px)}
.theater .screen-tile.theater-pinned:not(:fullscreen):not(.screen-expanded){position:absolute;inset:var(--gutter) var(--gutter) calc(var(--rail-height) + 2 * var(--gutter))}
.theater .call-tile .avatar{width:clamp(30px,5dvh,48px);height:clamp(30px,5dvh,48px);font-size:18px}
.theater .tile-label{left:4px;bottom:3px;padding:0 4px}
.theater .call-tile .voice-state{top:3px;right:4px;padding:0 3px;font-size:10px;line-height:14px}
.theater .screen-tile:not(.theater-pinned):not(:fullscreen):not(.screen-expanded) .screen-toolbar{padding:2px 4px;flex-wrap:nowrap}
.theater .screen-tile:not(.theater-pinned):not(:fullscreen):not(.screen-expanded) .screen-toolbar :is(.screen-mute,.screen-volume,.screen-full,.screen-caption small){display:none}
@media(max-height:460px){#tile-grid.theater{--rail-height:64px}.theater .call-tile .avatar{width:26px;height:26px;font-size:14px}}
