/* Agent47. A quiet, shared workspace for browser and Windows. */
:root {
  --signal:#eaa16c; --signal-ink:#291d15;
  --ink:#141519; --panel:#1b1d22; --raised:#24272e;
  --surface2:#24272e; --surface3:#2a2e36; --surface4:#313640;
  --line:#2d313a; --line2:#3b414d; --text:#edf0f5;
  --muted:#9ba2af; --muted2:#818995;
  --green:#93b5a3; --good:#93b5a3; --bad:#dfa4aa; --warn:#c9b28b; --cyan:#aab7ca; --orange:#eaa16c;
  --orange2:#f4b986; --ember:#eaa16c; --radius:14px;
  color-scheme:dark;
}
body { background:var(--ink); color:var(--text); font:14px/1.5 "Segoe UI",system-ui,sans-serif; }
button,input,select,textarea { font:inherit; }
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,textarea:focus-visible { outline:2px solid var(--signal); outline-offset:3px; }
.profile-trigger:focus-visible { outline:2px solid var(--signal); outline-offset:3px; }
.modal-card input:focus,.modal-card select:focus { border-color:var(--signal); }
::selection { background:var(--signal); color:var(--signal-ink); }
::-webkit-scrollbar { width:7px; height:7px; }
::-webkit-scrollbar-thumb { background:#3b414d; border:2px solid transparent; border-radius:8px; background-clip:padding-box; }

/* Navigation and channels form one continuous column. */
html #app { height:100dvh; grid-template-columns:var(--channel-dock-width,280px) minmax(0,1fr); grid-template-rows:114px minmax(0,1fr); background:var(--ink); }
html #app > .rail { grid-column:1; grid-row:1; }
html #app > .sidebar { grid-column:1; grid-row:2; }
html #app > main { grid-column:2; grid-row:1/3; }
.rail { position:relative; display:grid; grid-template-columns:1fr 1fr 1fr; grid-template-rows:54px 42px; align-items:center; gap:4px; padding:8px 16px 10px; border:0; background:var(--ink); }
.rail-logo { width:auto; height:54px; grid-column:1/-1; display:flex; align-items:center; justify-content:flex-start; gap:11px; margin:0; border:0; border-radius:0; background:none; box-shadow:none; }
.rail-logo .brand-rail-image { width:48px!important; height:48px!important; flex-shrink:0; object-fit:contain; filter:none!important; transform:none; }
.brand-drawer-image { display:none; }
.brand-auth-image { display:block; width:72px; height:72px; margin:0 0 20px; object-fit:contain; filter:none; }
.brand-settings-image { display:block; width:40px; height:40px; flex-shrink:0; object-fit:contain; filter:none; }
.rail-wordmark { display:flex; flex-direction:column; color:var(--text); font-size:17px; font-weight:700; letter-spacing:-.035em; line-height:1.05; }
.rail-wordmark small { color:var(--muted2); font-size:11px; font-weight:500; letter-spacing:.025em; margin-top:4px; }
.rail-btn { width:auto; min-height:42px; padding:0 7px; display:inline-flex; flex-direction:row; align-items:center; justify-content:center; gap:6px; border:0; border-radius:11px; color:var(--muted); background:transparent; }
.rail-btn .icon { width:17px; height:17px; }
.rail-btn small { font-size:12px; font-weight:600; letter-spacing:0; }
.rail-btn:hover { background:#22252c; color:var(--text); }
.rail-btn.active { background:color-mix(in srgb,var(--signal) 10%,var(--raised)); color:var(--signal); box-shadow:none; }
.rail > .grow { display:none; }
.rail a[data-desktop-download] { position:absolute; top:23px; right:15px; min-height:38px; width:32px; padding:0; }
.rail a[data-desktop-download] small { display:none; }
.rail-btn .rail-badge { right:0; top:0; background:var(--signal); color:var(--signal-ink); box-shadow:0 0 0 2px var(--ink); }
.sidebar { background:var(--ink); border:0; padding:0 12px 12px; }
.community-card { height:62px; flex:0 0 62px; border:0; background:none; overflow:visible; }
.community-card::after,.community-art::before,.community-art::after { content:none!important; }
.community-art { display:none; }
.community-copy { left:8px; top:12px; bottom:auto; }
.community-copy .eyebrow { display:none; }
.community-copy strong { color:var(--text); font-size:17px; font-weight:650; letter-spacing:-.025em; }
.community-copy span { display:block; color:var(--muted2); font-size:12px; margin-top:6px; }
.community-status { display:none; }
.drawer-close { display:none; position:absolute; top:14px; right:4px; width:40px; height:40px; border:0; border-radius:12px; background:var(--raised); color:var(--text); cursor:pointer; place-items:center; }
.channel-finder { height:42px; margin:0 3px 8px; display:flex; align-items:center; gap:9px; padding:0 12px; border:1px solid transparent; border-radius:12px; background:#202329; color:var(--muted2); }
.channel-finder:focus-within { border-color:var(--signal); }
.channel-finder .icon { width:17px; height:17px; flex-shrink:0; }
.channel-finder input { min-width:0; width:100%; border:0; background:transparent; color:var(--text); font-size:13px; }
.channel-finder input::placeholder { color:var(--muted2); }
.channel-filter-empty { padding:15px 8px; color:var(--muted); font-size:13px; }
.sidebar-scroll { flex:1; padding:4px 0 16px; scrollbar-color:#3b414d transparent; }
html .a47-channel-component { min-height:0; overflow:visible; padding:0; border:0; border-radius:0; background:transparent; }
.section-title { padding:13px 9px 9px; color:var(--muted); font-size:12px; font-weight:600; letter-spacing:0; text-transform:none; }
.voice-heading { margin-top:18px; }
.voice-heading #regionLabel { display:none; }
.voice-heading > span:first-child { font-size:12px; color:var(--muted); }
.section-title button { color:var(--muted); width:28px; height:28px; border-radius:8px; }
.section-title button:hover { background:var(--raised); color:var(--text); }
.channel-list { padding:0 2px; }
.channel-entry { margin:3px 0; gap:0; border-radius:12px; }
.channel-btn { height:44px; gap:9px; border-radius:12px; padding:0 12px; color:#b6bcc8; font-size:calc(14px * var(--ui-font-scale,1)); font-weight:500; }
.channel-btn .hash { width:20px; color:#818995; }
.channel-btn:hover { background:#22252c; color:var(--text); }
.channel-entry.active,.channel-btn.active { border-radius:12px; background:color-mix(in srgb,var(--signal) 10%,var(--raised)); }
.channel-entry.active > .channel-btn,.channel-btn.active { color:var(--text); background:transparent; box-shadow:none; }
.channel-entry.active .hash,.channel-btn.active .hash { color:var(--signal); }
.channel-btn .count { background:transparent; color:var(--muted2); font-size:11px; padding:0 2px; }
.channel-menu-btn,.channel-leave-btn { width:28px; height:32px; margin-right:4px; border-radius:8px; color:var(--muted2); }
.channel-menu-btn:hover { background:#343943; color:var(--text); }
.channel-leave-btn { color:#d79a9e; }
.voice-room { margin-bottom:6px; border-radius:13px; background:#1e2026; }
.voice-room .channel-entry { margin:0; }
.voice-room .channel-btn { height:49px; }
.voice-room.joined,.voice-room.joined .channel-entry { background:#2c3238; }
.voice-room.joined > .channel-btn { background:transparent; box-shadow:none; }
.voice-join-label { margin-left:auto; padding:4px 9px; border-radius:8px; background:color-mix(in srgb,var(--signal) 10%,var(--raised)); color:var(--signal); font-size:11px; font-weight:600; }
.voice-room.joined .voice-join-label { background:#3a4645; color:#c2d7cc; }
.voice-users { padding:0 10px 7px 20px; }
.voice-user { color:var(--muted); min-height:33px; }
.voice-user.speaking { background:#293432; color:var(--text); }
.voice-avatar,.avatar,.call-avatar { border:0; background:#323640; color:#e0e4ec; }
.node-card { min-height:58px; margin:0 3px 8px; padding:11px; gap:8px; grid-template-columns:24px minmax(0,1fr) auto auto; border:0; border-radius:13px; background:#1e2026; }
.node-flag { color:var(--muted); }
.node-flag .icon { width:19px; height:19px; }
.node-copy b { font-size:12px; font-weight:600; }
.node-copy small { color:var(--muted2); font-size:11px; }
.node-card > strong { color:var(--muted); font-size:11px; font-weight:500; }
.node-card > strong small { display:none; }
.node-leave { border:0; border-radius:9px; background:#37272e; color:#deb0b5; }
.status-dot,.online-dot { background:var(--green); box-shadow:none; }
.me { height:68px; flex:0 0 68px; margin:0 3px; padding:10px; gap:9px; border:0; border-radius:14px; background:#24272e; }
.me .avatar { width:36px; height:36px; }
.identity strong { font-size:13px; font-weight:600; }
.identity small { color:var(--muted2); font-size:11px; }
.me button { width:34px; height:38px; border-radius:9px; color:var(--muted); }
.me button:hover { background:#343943; color:var(--text); }
.me button.active { color:#e2b3b6!important; background:#432d34!important; }

/* The conversation is a single, softly framed surface. */
main { grid-template-columns:minmax(0,1fr); grid-template-rows:76px minmax(0,1fr) auto; margin:12px 12px 12px 0; overflow:hidden; border:1px solid #25282f; border-radius:20px; background:var(--panel); }
.topbar { min-width:0; height:76px; min-height:76px; padding:0 26px; gap:12px; border:0; background:var(--panel); }
.channel-head { min-width:0; margin-right:auto; }
.channel-head strong { color:var(--text); font-size:21px; font-weight:650; letter-spacing:-.035em; }
.channel-head span { display:block; color:var(--muted2); font-size:12px; margin-top:2px; }
.top-search { display:none!important; }
.header-actions { gap:6px; }
.action,.mobile-top-btn { height:40px; min-height:40px; padding:0 11px; border:0; border-radius:11px; background:transparent; color:var(--muted); font-size:12px; }
.action:hover,.mobile-top-btn:hover { background:var(--raised); color:var(--text); }
.compact-search-btn.icon-action { width:40px; min-width:40px; height:40px; padding:0; display:inline-flex; align-items:center; justify-content:center; gap:7px; }
.compact-search-btn span { display:none; }
.mobile-top-btn { width:40px; min-width:40px; padding:0; display:inline-flex!important; align-items:center; justify-content:center; }
.mobile-top-btn span { display:none; }
.mobile-top-btn .icon { width:19px; height:19px; }
#mobileChannelsBtn { display:none!important; }
.node-pill,.header-actions [data-desktop-download] { display:none!important; }
#heroJoinVoiceBtn { min-height:40px; display:inline-flex; align-items:center; gap:8px; padding:0 14px; border:0; border-radius:11px; background:var(--signal); color:var(--signal-ink); font-size:12px; font-weight:650; white-space:nowrap; cursor:pointer; }
#heroJoinVoiceBtn:hover { filter:brightness(1.08); }
#heroJoinVoiceBtn .icon { width:17px; height:17px; }
#showChatBtn,#showCallBtn { background:#2c3039; color:var(--text); }
#voiceBadge { display:none!important; }
.global-search-panel { top:70px; right:20px; border-color:var(--line2); border-radius:16px; background:var(--panel); box-shadow:0 16px 40px #0005; }
.global-search-head { border-bottom-color:var(--line); }
.global-search-head b { color:var(--text); font-size:15px; }
.global-search-head span { color:var(--muted2); font-size:12px; }
.global-search-head button { background:var(--raised); color:var(--text); }
.compact-search-row { display:flex!important; align-items:center; gap:9px; height:44px; margin:12px; padding:0 12px; border:1px solid var(--line2); border-radius:12px; background:var(--ink); color:var(--muted); }
.compact-search-row input { width:100%; border:0; background:transparent; color:var(--text); font-size:14px; }
.search-result-row { color:var(--text); border-radius:10px; }
.search-result-row:hover { background:var(--raised); border-color:var(--line2); }
.main-body,.chat-view { background:var(--panel); }
.community-hero { min-height:110px; margin:0 24px 10px; padding:16px 20px; align-items:center; justify-content:space-between; border:0; border-radius:16px; background:var(--raised)!important; }
.community-hero::before,.community-hero::after,.hero-shade { content:none!important; display:none!important; }
.hero-copy { padding:0; }
.hero-copy > span { display:none; }
.hero-copy h1 { margin:0; color:var(--text); font:650 24px/1.1 "Segoe UI",sans-serif; letter-spacing:-.04em; }
.hero-copy p { margin:7px 0 0; color:var(--muted); font-size:13px; }
.hero-quick-actions { margin:0; }
.hero-quick-actions button { min-height:40px; padding:0 13px; border:0; border-radius:10px; background:#363b45; color:var(--text); font-size:12px; }
.messages { grid-row:2; padding:4px 25px 20px; scrollbar-color:#3b414d transparent; }
.msg { max-width:1100px; grid-template-columns:42px minmax(0,1fr); gap:13px; padding:14px 9px; border-radius:13px; }
.msg:hover { background:#22252c; }
.msg .avatar { width:40px; height:40px; font-size:13px; }
.msg-head { gap:9px; }
.msg-head b { color:var(--text); font-size:calc(14px * var(--ui-font-scale,1)); font-weight:650; }
.msg-head time { color:var(--muted2); font-size:11px; }
.msg p { color:#cdd2dc; font-size:calc(15px * var(--ui-font-scale,1)); line-height:1.6; margin-top:4px; }
.unread-divider { color:var(--muted); font-size:11px; font-weight:500; letter-spacing:0; }
.unread-divider::before,.unread-divider::after { background:var(--line2); }
.bot-avatar { background:#303640!important; color:#bbc6d7!important; border:0!important; font-size:11px!important; }
.bot-badge { height:18px; border:0; background:#303640; color:#aebbd0; font-size:9px; font-weight:600; }
.msg-actions button { background:#343943; border-color:var(--line2); color:var(--text); }
.empty-state { color:var(--muted2); font-size:14px; }
.empty-state b { color:var(--text); font-size:18px; }
.bottom-area { border:0; background:var(--panel); padding-top:2px; }
.composer { max-width:none; height:60px; margin:0 23px 21px; padding:7px; gap:8px; border:1px solid #393e48; border-radius:16px; background:#25282f; box-shadow:none; }
.composer:focus-within { border-color:var(--signal); box-shadow:none; }
.composer input { color:var(--text); font-size:calc(14px * var(--ui-font-scale,1)); }
.composer input::placeholder { color:var(--muted2); }
.composer-icon { width:38px; height:40px; border-radius:10px; background:transparent; color:var(--muted); }
.composer-icon:hover { background:#363b45; color:var(--text); }
.send-btn { width:40px; height:40px; border-radius:11px; color:var(--signal-ink); background:var(--signal); box-shadow:none; }
.send-btn:hover { filter:brightness(1.08); }
.typing-indicator { color:var(--muted); padding-inline:30px; }

/* The people panel is a secondary drawer, not another permanent divider. */
.members-panel { display:flex!important; position:fixed; z-index:60; top:12px; right:12px; bottom:12px; width:min(var(--people-drawer-width,320px),90vw); padding:0 17px 18px; border:1px solid var(--line2); border-radius:20px; background:var(--panel); box-shadow:-16px 0 60px #0005; transform:translateX(calc(100% + 24px)); transition:transform .18s ease; }
body.members-open .members-panel { transform:translateX(0); }
.mobile-backdrop { display:block; background:#090b10a0; }
.drawer-head { display:flex; align-items:center; justify-content:space-between; min-height:72px; border:0; }
.drawer-head b { font-size:20px; font-weight:650; letter-spacing:-.03em; }
.drawer-head button { display:grid; place-items:center; width:40px; height:40px; border:0; border-radius:12px; background:var(--raised); color:var(--text); cursor:pointer; }
.activity-card { padding:16px; border:0; border-radius:15px; background:var(--raised); }
.activity-head span,.members-head span { color:var(--muted); font-size:12px; font-weight:600; letter-spacing:0; }
.activity-head small,.members-head small { color:var(--muted2); font-size:11px; }
.voice-active { margin-top:15px; grid-template-columns:38px 1fr; }
.voice-active-icon { width:38px; height:38px; border:0; border-radius:12px; background:#343a45; color:var(--muted); }
.voice-active b { color:var(--text); font-size:14px; font-weight:600; }
.voice-active span { color:var(--muted2); font-size:12px; }
.activity-card button { height:40px; border:0; border-radius:11px; background:#373d48; color:var(--text); font-size:13px; }
.members-head { padding:22px 5px 9px; }
.member { min-height:56px; border-radius:12px; gap:10px; }
.member:hover { background:var(--raised); }
.member-info b { color:var(--text); font-size:14px; font-weight:600; }
.member-info small { color:var(--muted2); font-size:11px; }
.member .avatar { width:38px; height:38px; }
.quality-card { padding:16px 3px 0; border:0; border-radius:0; background:transparent; }
.quality-card span,.quality-card b,.quality-card small { font-size:11px; }
.quality-card small { color:var(--muted2); }
.quality-bars { display:none; }

/* Voice uses the same quiet space, with obvious controls. */
.call-view { background:var(--panel); }
.call-stage-head { height:72px; padding:0 26px; border:0; background:var(--panel)!important; }
.call-title { gap:12px; }
.call-icon { width:44px; height:44px; display:grid; place-items:center; border:0; border-radius:14px; color:#b8c3d4; background:#2c323c; }
.call-title small { color:var(--muted2); font-size:11px; }
.call-title strong { color:var(--text); font-size:22px; font-weight:650; }
.call-route-badge,.call-node,.mic-live-badge { border:0; background:var(--raised); color:var(--muted); font-size:11px; }
.mic-live-badge.live,.mic-live-badge.active { border:0; background:#303f3a; color:#bfd4c8; box-shadow:none; }
.call-leave-top { border:0; border-radius:10px; background:#38282f; color:#deb0b5; font-size:12px; padding:9px 12px; }
.stream-stage { margin:8px 24px 18px; min-height:240px; border:0; border-radius:18px; background:#16181d; }
.call-orb { width:94px; height:94px; margin-bottom:18px; border:0; border-radius:28px; background:#2b3039; box-shadow:none; }
.call-orb span { color:#bdc7d8; font-size:28px; }
.call-empty-state { gap:7px; color:var(--muted); }
.call-empty-state b { color:var(--text); font-size:22px; font-weight:600; }
.call-empty-state span { font-size:13px; }
.participants-head { padding:0 24px 10px; color:var(--muted); }
.participants-head span { font-size:12px; }
.participants-head small { display:none; }
.call-participants { padding:0 24px 18px; }
.call-participant { border:1px solid transparent; border-radius:14px; background:var(--raised); }
.call-participant.speaking { border-color:#718c7d; background:#293932; }
.call-participant-info b { color:var(--text); font-size:14px; }
.call-participant-info span { color:var(--muted); font-size:11px; }
.call-controls { background:var(--panel); border:0; gap:8px; padding:10px 20px 18px; }
.call-control { min-width:90px; height:48px; border:0; border-radius:12px; background:var(--raised); color:var(--text); }
.call-control span { font-size:11px; font-weight:500; }
.call-control:hover { background:#363c46; }
.call-control.active { border:0; background:#37453f; color:#c9dbd1; }
.call-control.danger { border:0; background:#4a3038; color:#ebbdc3; }
/* Social, profiles, and settings use the same calm surfaces. */
body.social-mode #app { grid-template-columns:minmax(0,1fr)!important; }
body.social-mode #app > main { grid-column:1!important; }
body.social-mode .sidebar,body.social-mode .members-panel { display:none!important; }
.social-view,.social-center { background:var(--ink); }
.social-sidebar,.social-profile-pane { border-color:var(--line); background:var(--panel); }
.social-title h2,.friends-toolbar h2 { color:var(--text); font-size:21px; letter-spacing:-.045em; }
.social-title .eyebrow,.friends-toolbar .eyebrow,.settings-section-head .eyebrow { color:var(--signal)!important; }
.social-tab { color:var(--muted); }
.social-tab:hover,.social-tab.active { background:#323439; color:var(--signal); }
.friends-toolbar,.dm-header { border-color:var(--line); background:#181a1f; }
.friend-search-box { border-color:var(--line2); background:#2a2c31; }
.friend-search-box input { color:var(--text); }
.friend-row:hover,.dm-conversation-row:hover { background:#2c2e33; }
.friend-search-hint,.social-profile-empty span { color:var(--muted2); }
.dm-bubble { border-color:var(--line); background:#27292e; }
.dm-message.mine .dm-bubble { border-color:#6a6c71; background:#33353a; }
.modal { background:#07090ecd; }
.modal-card,.settings-v2,.compact-dialog,.tool-popover { border:1px solid var(--line2); border-radius:12px; background:var(--panel); box-shadow:0 24px 80px #0009; }
.join-card { text-align:left; }
.auth-logo { width:56px; height:56px; margin:0 0 18px; border:1px solid #65676c; border-radius:12px; background:#323439; }
.join-card h1 { color:var(--text); font-size:27px; letter-spacing:-.05em; }
.join-card > p { color:var(--muted); font-size:12px; }
.auth-tabs { border-color:var(--line); background:#14161b; }
.auth-tabs button { color:var(--muted); font-size:12px; }
.auth-tabs button.active { background:#37393e; color:var(--signal); }
.modal-card label { color:var(--muted); font-size:12px; }
.modal-card input,.modal-card select { border-color:var(--line2); border-radius:7px; background:#13151a; color:var(--text); font-size:13px; }
.primary-btn { border-radius:7px; background:var(--signal); color:var(--signal-ink); }
.primary-btn:hover { background:#e0e2e7; }
.secondary-btn { border-radius:7px; background:#313338; color:var(--text); }
.settings-topbar { background:#1b1d22; border-bottom-color:var(--line); }
.settings-brand-mark { border-color:#6b6d72; background:#323439; }
.settings-brand h2 { color:var(--text); font-size:18px; }
.settings-brand p { display:none; }
.settings-close { border-color:var(--line); background:#2f3136; color:var(--text); }
.settings-nav { background:#181a1f; border-right-color:var(--line); }
.settings-tab { color:var(--muted); }
.settings-tab small { display:none; }
.settings-tab:hover { background:#303237; transform:none; }
.settings-tab.active { border-color:#5d5f64; background:#35373c; color:var(--signal); box-shadow:none; }
.settings-tab.active > .icon { color:var(--signal); }
.settings-content { background:var(--panel); }
.settings-section-head h3 { color:var(--text); font-size:23px; letter-spacing:-.045em; }
.settings-section-head p { display:none; }
.settings-panel[data-settings-panel="audio"] > .settings-info-card { display:none; }
.setting-toggle small { display:none; }
.settings-chip { border-color:var(--line2); background:#2f3136; color:var(--muted); }
.settings-info-card,.diagnostics div,.account-card,.admin-card,.update-card,.profile-avatar-card,.profile-form-card { border-color:var(--line); background:color-mix(in srgb,var(--panel) 80%,var(--ink)); }
.settings-v2 label { color:var(--muted); }
.settings-v2 select,.settings-v2 input:not([type=checkbox]):not([type=range]):not([type=color]) { border-color:var(--line2); background:#13151a; color:var(--text); }
.settings-v2 input[type=range],.settings-v2 input[type=checkbox] { accent-color:var(--signal); }
.setting-toggle { border-color:var(--line); background:#1e2025; }
.setting-toggle b { color:var(--text); }
.setting-toggle small { color:var(--muted2); }
.settings-v2 .secondary-btn { border-color:var(--line2); background:#33353a; color:var(--text); }
.settings-v2 .secondary-btn:hover { border-color:#898b90; background:#404247; }
.settings-v2 .primary-btn { background:var(--signal); color:var(--signal-ink); }
.bot-admin-toggle { border-color:var(--line); background:#1e2025; }
.bot-admin-toggle:hover { border-color:#6c6e73; background:#2e3035; }
.bot-admin-icon { border-color:#4e5055; background:#303237; color:var(--cyan); }
.settings-banner { border-color:var(--line2); background:#2f3136!important; }
.settings-banner::before { content:none; }
.settings-banner em { border-color:#5a5c61; background:#202227; color:var(--signal); }
.admin-card { padding:18px; margin-top:14px; border:1px solid var(--line); border-radius:9px; background:color-mix(in srgb,var(--panel) 80%,var(--ink)); }
.admin-card-head { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:14px; }
.admin-card-head > div > b { display:block; color:var(--text); font-size:15px; font-weight:700; }
.admin-card-head > div > span { display:none; }
.badge-admin-head > div > span { display:inline; }
.control-plane-grid { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; }
.control-plane-link { min-height:56px; padding:12px; gap:9px; border-color:var(--line2); background:#282a2f; color:var(--text); }
.control-plane-link:hover { border-color:#6c6e73; background:#33353a; }
.control-plane-link > .icon:first-child { color:var(--signal); width:19px; height:19px; }
.control-plane-link b { font-size:12px; }
.control-plane-link small { display:none; }
.admin-user-row { flex-wrap:wrap; gap:12px; padding:13px; border-color:var(--line); background:#25272c; }
.gamer-settings-card > summary { cursor:pointer; font-size:14px; font-weight:650; }
.gamer-settings-card[open] > summary { margin-bottom:18px; }
.admin-user-main { flex:1; min-width:190px; }
.admin-user-main b { font-size:12px; color:var(--text); }
.admin-user-main span { font-size:10px; color:var(--muted2); }
.admin-user-actions { align-items:start; }
.admin-user-actions select,.admin-user-actions button { min-height:33px; font-size:11px; }
.member-management > summary,.admin-audit > summary { cursor:pointer; font-size:12px; font-weight:650; color:var(--text); }
.member-management > summary { padding:8px 11px; border:1px solid var(--line2); border-radius:7px; background:#33353a; list-style:none; }
.member-management > summary::after { content:"\2304"; margin-left:8px; color:var(--muted); }
.member-management-menu { display:flex; flex-wrap:wrap; gap:6px; max-width:245px; padding-top:8px; }
.member-management-menu select { width:100%; }
.admin-audit .audit-log-list { margin-top:14px; }
.audit-row { border-color:var(--line); background:#25272c; }
.audit-row b { font-size:11px; color:var(--text); }
.audit-row span,.audit-row small { font-size:10px; color:var(--muted2); }
.badge-admin-card { margin-top:14px; }
.toast { border-color:var(--line2); background:#2c2e33; color:var(--text); font-size:12px; }


/* Theme controls and editor selection stay faithful to the live workspace. */
.composer,.stream-stage,.admin-card,.badge-admin-card,.settings-card,.global-search-panel,.rail-btn,.channel-btn,.hero-quick-actions button { border-radius:var(--radius,14px); }
.editor-frame .a47-editor-selected { outline:2px solid var(--signal)!important; outline-offset:-2px!important; }
.editor-frame .a47-editor-hover { outline:1px dashed var(--signal)!important; outline-offset:-1px!important; }
.editor-frame .a47-editor-drag-wrap { cursor:grab; }
.editor-frame .a47-editor-moving { opacity:.6!important; cursor:grabbing!important; }
.editor-frame .a47-editor-drop-before { box-shadow:inset 0 3px var(--signal)!important; }
.editor-frame .a47-editor-drop-after { box-shadow:inset 0 -3px var(--signal)!important; }
body.social-mode #app { grid-template-columns:var(--channel-dock-width,280px) minmax(0,1fr)!important; }
body.social-mode #app > main { grid-column:2!important; grid-row:1/3; }
body.social-mode .rail { align-content:start; grid-row:1/3!important; }
body.social-mode.channels-open .sidebar,body.social-mode.members-open .members-panel { display:flex!important; }
.social-view { border-radius:0; grid-template-columns:minmax(0,1fr); position:relative; }
.social-profile-pane { display:none; position:absolute; z-index:25; right:12px; top:12px; bottom:12px; width:min(320px,86vw); border:1px solid var(--line2)!important; border-radius:18px; box-shadow:0 16px 45px #0005; }
.social-view.profile-open .social-profile-pane { display:block; }
.social-profile-close { display:grid; place-items:center; }
.social-sidebar { position:fixed; left:12px; top:114px; bottom:12px; width:calc(var(--channel-dock-width,280px) - 24px); border:0; padding:16px 4px; background:var(--ink); }
.social-center { background:var(--panel); }
.social-title h2,.friends-toolbar h2 { font-weight:650; }
.social-title .eyebrow,.friends-toolbar .eyebrow { display:none; }
.friends-toolbar,.dm-header { background:var(--panel); border:0; }
.friend-search-box { height:44px; border:0; border-radius:12px; background:var(--raised); }
.friend-search-box input { font-size:14px; }
.friend-row,.dm-conversation-row { border-radius:12px; }
.social-tab { min-height:43px; border-radius:11px; }
.social-tab.active { color:var(--signal); background:color-mix(in srgb,var(--signal) 10%,var(--raised)); box-shadow:none; border-color:transparent; }
.social-tab span { font-size:13px; font-weight:500; }
.social-tab b { font-size:11px; color:var(--muted); background:var(--raised); }
.social-section-head span,.social-section-head small,.dm-list-empty { font-size:11px; }
.dm-conversation-copy b { font-size:13px; }
.dm-conversation-copy span { font-size:11px; }
.dm-conversation-copy time { font-size:10px; }
.friend-row-name b { font-size:14px; }
.social-profile-pane { border:0; background:var(--panel); }
.social-profile-empty { padding:24px; }
.social-profile-glyph { background:var(--raised); border:0; box-shadow:none; color:var(--muted); }
.social-profile-card { border:0; background:var(--panel); }
.social-profile-actions button,.friend-action,.dm-header-actions .secondary-btn { background:var(--raised); border:0; border-radius:10px; color:var(--text); }
.social-profile-avatar { border:0; box-shadow:none; background:var(--raised); }
.dm-message { padding:12px 20px; }
.dm-message-meta b { font-size:14px; }
.dm-bubble { font-size:15px; line-height:1.6; border:0; border-radius:14px; background:var(--raised); }
.dm-message.mine .dm-bubble { border:0; background:#303845; }
.settings-v2 { border:1px solid var(--line2); border-radius:22px; }
.settings-topbar { border:0; background:var(--panel); }
.settings-nav { border:0; padding:12px; background:var(--ink); }
.settings-tab { min-height:49px; border:0; border-radius:12px; }
.settings-tab b { font-size:13px; font-weight:600; }
.settings-tab.active { background:color-mix(in srgb,var(--signal) 10%,var(--raised)); color:var(--signal); }
.settings-content { padding:26px; }
.settings-content,.setting-row b { font-size:calc(14px * var(--ui-font-scale,1)); }
.settings-v2 label { font-size:13px; font-weight:500; }
.settings-section-head h3 { font-weight:650; }
.settings-info-card,.account-card,.admin-card,.update-card,.profile-avatar-card,.profile-form-card,.setting-toggle { border:0; border-radius:15px; background:var(--raised); }
.settings-v2 select,.settings-v2 input:not([type=checkbox]):not([type=range]):not([type=color]) { min-height:44px; border-radius:11px; font-size:14px; }
.settings-v2 .primary-btn,.settings-v2 .secondary-btn { min-height:42px; border:0; border-radius:11px; font-size:13px; }
.audio-recovery-actions { display:flex; flex-wrap:wrap; gap:8px; margin-top:18px; }
.audio-recovery-hint { color:var(--muted); font-size:12px; line-height:1.5; margin:8px 0 0; }
.settings-brand-mark,.auth-logo { box-shadow:none; }
.auth-logo { border:0; background:var(--raised); }
.auth-logo span { color:var(--text); text-shadow:none; }
.join-card { padding:34px; border:1px solid var(--line2); border-radius:24px; }
.join-card h1 { font-size:30px; font-weight:650; }
.join-card > p { font-size:14px; }
.auth-tabs { border:0; background:var(--ink); border-radius:12px; }
.auth-tabs button { font-size:14px; min-height:44px; border-radius:10px; }
.auth-tabs button.active { background:color-mix(in srgb,var(--signal) 10%,var(--raised)); color:var(--signal); }
.modal-card label { font-size:13px; }
.modal-card input,.modal-card select { min-height:46px; border-radius:11px; font-size:14px; background:var(--ink); }
.primary-btn,.secondary-btn { min-height:44px; border:0; border-radius:11px; font-size:14px; }
.primary-btn { background:var(--signal); color:var(--signal-ink); }
.primary-btn:hover { background:color-mix(in srgb,var(--signal) 85%,white); }
.context-menu,.direct-call-invite,.popover-head,.tool-popover,.channel-readonly-banner,.reply-composer-row,.upload-progress-row { background:var(--raised); border-color:var(--line2); color:var(--text); }
.context-menu button { min-height:39px; font-size:13px; border-radius:9px; }
.reply-preview,.message-reactions .reaction-btn { border-color:var(--line2); background:var(--raised); color:var(--muted); }
.message-reactions .reaction-btn.mine { border-color:#8b97aa; background:#303845; color:var(--text); }
.settings-chip.good,.settings-chip.update { color:var(--muted); background:var(--raised); border:0; }
.update-progress { background:var(--signal); }
.account-card small,.account-card button,.invite-result code { color:var(--text); }
.account-card button,.invite-result button { border:0; background:#3b414d; color:var(--text); }
.owner-tools { background:var(--raised); border:0; border-radius:14px; }
.admin-user-row { background:#1c1f25; border:0; border-radius:13px; }
.admin-user-main b { font-size:14px; }
.admin-user-main span { font-size:12px; }
.admin-user-actions select,.admin-user-actions button { min-height:38px; font-size:12px; }
.toast { padding:12px 16px; border-radius:13px; font-size:13px; }

@media(max-width:1000px) {
  html #app { grid-template-columns:minmax(0,1fr); grid-template-rows:minmax(0,1fr); }
  html #app > main { grid-column:1; grid-row:1; margin:8px; }
  .rail { display:none; }
  .sidebar { display:flex!important; position:fixed; z-index:60; top:10px; bottom:10px; left:10px; width:min(320px,calc(100vw - 30px)); padding:12px; border:1px solid var(--line2); border-radius:20px; background:var(--ink); transform:translateX(calc(-100% - 20px)); transition:transform .18s ease; box-shadow:16px 0 60px #0005; }
  body.channels-open .sidebar { transform:translateX(0); }
  .sidebar,.members-panel { bottom:76px; }
  .community-card { height:68px; flex-basis:68px; }
  .community-copy { top:9px; }
  .brand-drawer-image { display:block; position:absolute; left:4px; top:7px; width:44px; height:44px; object-fit:contain; }
  .community-copy { left:60px; max-width:calc(100% - 110px); }
  .community-copy strong { display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .drawer-close { display:grid; }
  #mobileChannelsBtn { display:inline-flex!important; }
  .topbar { padding-inline:16px; }
  .mobile-nav { display:flex; height:66px; padding:6px 12px max(6px,env(safe-area-inset-bottom)); border:0; background:var(--ink); }
  html #app { height:calc(100dvh - 66px); }
  .mobile-nav button { border-radius:12px; color:var(--muted2); }
  .mobile-nav button.active { background:color-mix(in srgb,var(--signal) 10%,var(--raised)); color:var(--signal); }
  .mobile-nav button span { font-size:11px; font-weight:500; }
  body.social-mode #app { grid-template-columns:1fr!important; }
  body.social-mode #app > main { grid-column:1!important; grid-row:1; }
  body.social-mode .rail { display:none; }
  .social-view { grid-template-columns:220px minmax(0,1fr); }
  .social-sidebar { position:static; width:auto; padding:16px 12px; background:var(--panel); }
}
@media(max-width:720px) {
  html #app > main { margin:0; border:0; border-radius:0; grid-template-rows:72px minmax(0,1fr) auto; }
  .topbar { height:72px; min-height:72px; padding-inline:10px; gap:5px; }
  .channel-head strong { font-size:18px; display:block; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
  .channel-head span { font-size:11px; max-width:140px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
  .header-actions { gap:3px; }
  .compact-search-btn.icon-action,.mobile-top-btn,.action.icon-action { width:38px; min-width:38px; height:40px; padding:0; justify-content:center; }
  #pinnedMessagesBtn { display:grid; }
  #heroJoinVoiceBtn { width:40px; min-width:40px; height:40px; padding:0; justify-content:center; }
  #heroJoinVoiceBtn span { display:none; }
  #showCallBtn,#showChatBtn { padding:0 9px; font-size:11px; }
  .community-hero { margin:0 12px 10px; padding:16px; }
  .hero-copy h1 { font-size:20px; }
  .hero-copy p { font-size:12px; max-width:180px; }
  .messages { padding:2px 10px 15px; }
  .msg { grid-template-columns:35px minmax(0,1fr); gap:10px; padding:12px 4px; }
  .msg .avatar { width:34px; height:34px; font-size:11px; }
  .msg p { font-size:calc(14px * var(--ui-font-scale,1)); }
  .msg-head b { font-size:calc(13px * var(--ui-font-scale,1)); }
  .msg-head time { font-size:10px; }
  .composer { height:58px; margin:0 10px 12px; padding:5px; gap:3px; border-radius:14px; }
  .composer-icon { width:32px; min-width:32px; height:40px; }
  .send-btn { width:40px; height:40px; }
  .call-stage-head { padding-inline:12px; }
  .call-title strong { font-size:18px; }
  .call-node,.call-route-badge { display:none; }
  .stream-stage { margin:9px 12px; }
  .call-controls { padding:10px; }
  .social-view { grid-template-columns:1fr; grid-template-rows:auto minmax(0,1fr); }
  .social-sidebar { position:static; width:auto; padding:10px 12px; }
  .social-tab span { font-size:12px; }
  .social-title { display:none; }
  .settings-v2 { width:100vw; height:100dvh; border:0; border-radius:0; }
  .settings-content { padding:20px 14px; }
  .settings-tab { min-height:55px; }
  .settings-tab b { font-size:11px; }
  .control-plane-grid { grid-template-columns:1fr; }
  .join-card { padding:26px; width:calc(100vw - 32px); }
}
@media(prefers-reduced-motion:reduce) { *,*::before,*::after { animation-duration:.01ms!important; transition-duration:.01ms!important; } }

/* Status appears without pushing the application outside the viewport. */
.connection-banner { position:fixed; z-index:110; bottom:90px; left:50%; transform:translateX(-50%); max-width:calc(100vw - 32px); display:flex; align-items:center; gap:9px; padding:12px 16px; border:1px solid var(--line2); border-radius:13px; background:#2d2930; color:#e4ced4; box-shadow:0 8px 30px #0005; font-size:13px; }
.node-card:has(.node-leave.hidden) { display:none; }
@media(max-width:720px) { #showCallBtn {display:none;} .channel-head {flex:1;min-width:0;} .header-actions {flex:0 0 auto;} }

html.editor-frame #connectionCard { display:grid; }

.join-card small { font-size:12px; color:var(--muted2); line-height:1.5; }

body:has(#joinModal.show) #app { visibility:hidden; }
#joinModal { background:var(--ink); }
