.social-links,.social-actions{display:flex;align-items:center;gap:6px;flex-wrap:wrap}
.social-links button .icon{width:1.05em;vertical-align:middle}
.social-unread{position:absolute;right:2px;top:1px;background:#884528;color:white;border-radius:8px;padding:0 4px;font-size:10px;font-weight:700}
[data-social-open="chat"]{position:relative}
#social-panel[hidden]{display:none}
#social-panel{
  --paper:#f6f1e5;--ink:#213b30;--line:#d8ceba;
  position:fixed;z-index:22;left:calc(clamp(70px,5.3vw,92px) + 12px);bottom:clamp(88px,12vh,120px);
  width:clamp(360px,30vw,408px);height:min(640px,calc(100dvh - 195px));box-sizing:border-box;
  display:flex;flex-direction:column;overflow:hidden;isolation:isolate;color:var(--ink);background:var(--paper);
  border:1px solid #7b8067;border-radius:8px;box-shadow:0 8px 30px #0f241e4d;
  font-size:15px;line-height:1.5;overscroll-behavior:contain;text-align:start
}
body:has(.game-shell[data-rail="open"]) #social-panel{left:166px}
#social-panel *{box-sizing:border-box}
#social-panel [hidden]{display:none!important}
#social-panel :is(button,textarea,input,select){font:inherit}
#social-panel :is(button,textarea,input,select):focus-visible{outline:3px solid #b78535;outline-offset:1px}
#social-panel button{border-radius:4px;cursor:pointer;min-height:36px;white-space:normal}
#social-panel .soft{color:#254335;background:#faf6ed;border:1px solid #bdb59e;padding:5px 10px}
#social-panel .primary{color:#fff9e9;background:#315a47;border:1px solid #30513f;padding:6px 13px;font-weight:700}
#social-panel button:disabled{opacity:.65;cursor:default}
#social-panel :is(input,select,textarea){display:block;width:100%;min-width:0;padding:6px 9px;background:#fffdf7;border:1px solid #b4ad97;border-radius:4px;color:var(--ink)}
.social-head{display:flex;justify-content:space-between;align-items:center;gap:10px;background:#254838;color:#fff7dd;border-bottom:2px solid #b79a62;padding:10px 14px;flex:none}
.social-head>div{display:flex;align-items:center;gap:8px}.social-head .icon{width:21px;height:21px;color:#e0c78a}
#social-panel .social-head h2{margin:0;color:inherit;font-size:20px;letter-spacing:-.03em}
#social-panel .social-head .soft{color:#f3e9cc;border-color:#859679;background:#315742;font-size:13px;min-height:32px}
.social-tabs{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));background:#e8e2d2;border-bottom:1px solid var(--line);flex:none}
#social-panel .social-tabs button{border:0;border-bottom:3px solid transparent;border-radius:0;background:transparent;font-size:13px;color:#536356;font-weight:600;padding:8px 1px;white-space:nowrap}
#social-panel .social-tabs button[aria-current="page"]{border-color:#526f4a;color:#203f2d;background:#f7f3e9}
.social-channel,.social-inline{display:flex;gap:8px;align-items:flex-end}
.social-channel{padding:10px 14px;border-bottom:1px solid var(--line);margin:0;flex:none}
#social-panel label{display:block;margin:0;font-size:13px;font-weight:650;color:#405443}
.social-channel label,.social-inline label{flex:1;min-width:0}
.social-compose{padding:10px 14px 12px;margin:0;flex:none;border-top:1px solid var(--line);background:#eae6d8}
.social-compose>div:not(.social-pending-card){display:flex;gap:7px;align-items:stretch}
.social-compose textarea{resize:vertical;max-height:100px;min-height:44px;line-height:1.4}
.social-compose .primary{flex:none}.social-compose label{padding-bottom:3px}
.social-stream,.social-page{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain;scrollbar-gutter:stable;overflow-wrap:anywhere}
.social-stream{padding:10px 14px 16px;background:#f7f4eb}
.social-page{padding:12px 14px 16px}
.social-message{margin:7px 0 12px;display:flex;align-items:flex-start;flex-direction:column}
.social-message[data-mine="true"]{align-items:flex-end}
.social-message header{display:flex;align-items:baseline;gap:9px;font-size:13px}
.social-message time,.social-list time,.social-request>p,.social-facts{font-size:12px;color:#526354}
.social-message p{margin:3px 0 0;padding:6px 10px;max-width:94%;white-space:pre-wrap;border:1px solid var(--line);border-radius:2px 8px 8px;background:#fffdf5;color:#253b30}
.social-message[data-mine="true"] p{background:#e1eada;border-color:#b7c6a9;border-radius:8px 2px 8px 8px}
.social-shared-card,.social-invitation{background:#f1ecdd;border:1px solid #c8bd9d;padding:9px 12px;border-radius:5px}
.social-shared-card{display:flex;gap:8px;margin-top:4px;width:min(100%,270px);align-items:flex-start}
.social-shared-card .icon{width:18px;height:18px;flex:none;margin-top:3px}
.social-shared-card>div,.social-invitation{display:grid;gap:4px;justify-items:start}
.social-shared-card .phase-track{display:block;width:100%;min-width:140px}
.social-help-row p{word-break:keep-all}
.social-pending-card{display:flex;align-items:center;gap:7px;font-size:14px}
.social-section{padding:0 0 14px;margin:0 0 13px;border-bottom:1px solid var(--line)}
#social-panel .social-section :is(h3,h4){margin:0 0 5px;line-height:1.45;color:var(--ink)}
#social-panel .social-section h3{font-size:16px}
.social-section :is(ul,p,form){margin:5px 0}.social-section form{display:grid;gap:7px}
.social-section form.social-inline{display:flex}
.social-section summary{font-weight:700;cursor:pointer;min-height:38px}
.social-list{padding:0;list-style:none}
.social-list>li{display:flex;flex-wrap:wrap;align-items:center;gap:6px;padding:6px 0}
.social-request{padding:10px 0;border-bottom:1px dashed var(--line)}.social-request:last-child{border:0}
.social-request dl{display:flex;gap:8px;margin:8px 0}.social-request dl div{background:#e5e8db;padding:4px 9px;border-radius:4px}.social-request dt{font-size:12px}.social-request dd{margin:0;font-weight:700}
.social-invitation{margin:8px 0}.social-invitation code{user-select:all}
.social-status{padding:0 12px;font-size:13px;background:#e9e5da;color:#35493c;flex:none}.social-status:not(:empty){padding-block:4px}
.social-empty,.social-loading{padding:7px 0;color:#576659;margin:0}
.social-loading{margin:10px}
#social-panel .social-new{align-self:center;min-height:30px;margin:0 0 3px}
@media(max-width: 900px){
  .bottom-nav:has([data-social-open]){display:grid;grid-template-columns:repeat(6,minmax(0,1fr))}
}
@media(max-width: 760px){
  #social-panel,body:has(.game-shell[data-rail="open"]) #social-panel{inset:var(--social-top,0px) 0 auto;bottom:auto;width:100%;height:var(--visible-height,100dvh);border:0;border-radius:0;padding:env(safe-area-inset-top) max(0px,env(safe-area-inset-right)) env(safe-area-inset-bottom) max(0px,env(safe-area-inset-left));font-size:15px}
  body.social-visible{overflow:hidden}
  #social-panel :is(textarea,input,select){font-size:16px}
  #social-panel button{min-height:41px}
  .social-page{padding:12px}.social-head{padding:11px 13px}
}
