/* RD13: scoped social, shared-chat content and guild hall; RD01 shell remains authoritative. */
body:not([data-mobile="true"]) #center:has(>#tab-social:not(.hidden)),body[data-mobile="true"][data-mp="game"] #center:has(>#tab-social:not(.hidden)){display:flex;flex-direction:column;min-height:0;overflow:hidden}
#tab-social:not(.hidden){display:flex;flex-direction:column;flex:1;min-width:0;min-height:0;height:100%;overflow:hidden;container:social / size;padding:10px;background:#0b151eee;color:#eee3ce;gap:8px}
#social-forms{flex:0 0 auto;min-width:0}#social-data{flex:1;min-height:0;min-width:0;overflow:hidden}
.social-page,.social-body,.social-guild{display:flex;flex-direction:column;gap:8px;height:100%;min-height:0;min-width:0;overflow:hidden}
.social-page *,.ghall *,.social-side *{box-sizing:border-box}
.social-heading h2,.social-guild h3,.social-card h3,.social-detail h3,.ghall h2,.ghall h3,.ghall h4,.social-person p{margin:0;color:#e9ce91}
.social-heading h2{font:26px/1.2 var(--font-heading,Georgia,serif);margin:0 0 8px}
.social-tabs{display:flex;gap:5px;flex:0 0 auto;min-width:0}.social-tabs>.btn{flex:1;min-width:0;white-space:normal;overflow-wrap:anywhere}
.social-page .btn,.social-heading .btn,.ghall .btn,.social-side .btn{min-width:44px;min-height:44px;border:1px solid #9a7843;white-space:normal;line-height:1.15;padding:7px 9px;display:inline-flex;align-items:center;justify-content:center;gap:5px;font-size:16px}
.social-page input,.social-page select,.social-page textarea,.social-side select,.ghall input{min-width:0;max-width:100%;min-height:44px;font-size:17px;margin:0;width:100%}
.social-roster{flex:1;min-height:0;min-width:0;display:grid;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr);gap:10px}
.social-list,.social-detail,.social-card{min-width:0;min-height:0;border:1px solid #8b713f;background:#101923dd;padding:10px;display:flex;flex-direction:column;gap:8px;overflow:hidden}
.social-list-rows{flex:1;min-height:0;display:flex;flex-direction:column;gap:6px;overflow:auto;overscroll-behavior:contain}
.social-roster .social-list-rows{overflow:hidden}
.social-member{display:flex;gap:9px;align-items:center;width:100%;min-width:0;min-height:60px;border:1px solid #6c6048;background:#14202b;color:#f2e5c9;text-align:left;padding:6px;cursor:pointer}
.social-member.selected{border-color:#edbf5d;background:linear-gradient(100deg,#65451890,#151e29);box-shadow:inset 0 0 10px #dcad3833}.social-member:focus-visible{outline:2px solid #61dfff;outline-offset:-3px}
.social-member-copy{display:flex;flex-direction:column;gap:2px;min-width:0;flex:1}.social-member-copy b{font-size:18px;overflow-wrap:anywhere}.social-member-copy small,.social-member-hp{font-size:14px;overflow-wrap:anywhere}
.social-status{font-size:14px;display:inline-flex;align-items:center;gap:6px}.social-status::before{content:"";width:8px;height:8px;border-radius:50%;background:#92979a;flex:0 0 auto}.social-status.online::before{background:#6ee734}.social-status.offline{color:#a8afb6}
.social-portrait.character-art{flex:0 0 52px;width:52px;height:60px;border:1px solid #c79a49;border-radius:50%;overflow:hidden;position:relative;background:#101923}.social-portrait.character-art>span{position:absolute;inset:0;background-image:var(--portrait-image);background-size:400% 200%;background-position:var(--portrait-x) var(--portrait-y)}
.social-portrait-large.character-art{flex-basis:96px;width:96px;height:108px}.social-role-mark{display:flex;align-items:center;justify-content:center;flex:0 0 48px;width:48px;height:56px;color:#dfb761;border:1px solid #a98545;border-radius:4px}.social-role-mark .foundation-icon{width:32px;height:32px}
.social-person{display:flex;align-items:center;gap:12px;min-width:0;flex:0 0 auto}.social-person>div{min-width:0}.social-person h3,.social-person b{font-size:22px;overflow-wrap:anywhere}.social-person p,.social-person small{display:block;margin:3px 0;overflow-wrap:anywhere}
.social-reader{min-height:0;min-width:0;flex:1;overflow:auto;overscroll-behavior:contain;overflow-wrap:anywhere;line-height:1.45}.social-reader p{margin:5px 0}.social-reader:focus-visible{outline:2px solid #59cbeb;outline-offset:-2px}
.social-actions{display:flex;flex-direction:column;gap:7px;flex:0 0 auto}.social-detail-back{display:none}.social-pager{display:flex;align-items:center;justify-content:space-between;gap:7px;flex:0 0 auto;min-width:0}.social-pager output{white-space:nowrap;font-size:15px}
.social-footer{flex:0 0 auto;display:flex;flex-direction:column;gap:7px;min-width:0}.social-form-row{display:flex;align-items:flex-end;gap:8px;min-width:0}.social-form-row>.social-field{flex:1}.social-field{display:flex;flex-direction:column;gap:4px;min-width:0;font-size:14px}.social-field textarea{resize:none;flex:1;min-height:66px}.social-form-panel{flex:1}.social-form-panel>.social-field:has(textarea){flex:1;min-height:0}.social-form-panel .social-actions{flex-direction:row}.social-create-fields{display:grid;grid-template-columns:2fr 1fr;gap:8px}.social-create-fields>.btn{grid-column:1/-1}.social-guild-create{flex:1}.social-ignore{flex:1}.social-ignore-row{display:flex;gap:10px;align-items:center;justify-content:space-between;padding:8px;border-bottom:1px solid #76613e}.social-ignore-row b{overflow-wrap:anywhere}
.social-guild-heading{flex:0 0 auto;min-width:0}.social-guild-heading h3{font-size:24px;overflow-wrap:anywhere}.social-guild-summary{font-size:14px;margin-top:3px}.social-subtabs>.btn{font-size:15px}.social-guild>.social-footer{display:flex;flex-direction:row;align-items:flex-end}.social-guild>.social-footer>.social-form-row{flex:1}.social-guild>.social-footer>.btn{max-width:180px}
.social-invite{display:flex;gap:8px;align-items:center;flex:0 0 auto;border:1px solid #b39446;padding:5px}.social-invite p{margin:0;flex:1;min-width:0;font-size:14px;overflow-wrap:anywhere}.social-invite .social-actions{flex-direction:row}.social-error{flex:0 0 auto;color:#ffbbbb;margin:0;font-size:14px}.social-pending{position:absolute;right:15px;top:5px;font-size:12px;pointer-events:none;color:#a6e5f3}.social-page{position:relative}.social-empty{margin:auto;padding:14px;text-align:center;overflow-wrap:anywhere}
/* Presence is one paged view, not an unbounded stack of the same MMO lists. */
.social-bank-metrics{display:block;font:12px/1.2 var(--font);color:#c9d8d9;margin-top:3px}
#zone-side:has(>.social-side){padding:6px;overflow:hidden}.social-side{display:flex;flex-direction:column;gap:5px;min-height:0;height:100%;max-height:100%;overflow:hidden}.social-side-toolbar{display:flex;gap:5px;flex:0 0 auto;min-width:0}.social-side-toolbar select{flex:1;width:0;min-width:60px;font-size:14px;padding:4px}.social-side-toolbar .social-pager{gap:2px}.social-side-toolbar .social-pager .btn{font-size:0;padding:0;width:44px}.social-side-toolbar .social-pager .btn:first-child::after{content:"‹";font-size:24px}.social-side-toolbar .social-pager .btn:last-child::after{content:"›";font-size:24px}.social-side-toolbar .social-pager output{font-size:12px}.social-side-content{min-height:0;flex:1;overflow:auto;overscroll-behavior:contain}.social-presence{display:flex;flex-direction:column;gap:5px;min-width:0}.social-presence .social-person{gap:7px}.social-presence .social-person b{font-size:16px}.social-presence .social-person small{font-size:12px}.social-side-actions{display:flex;flex-wrap:wrap;gap:4px}.social-side-actions>.btn{flex:1;font-size:13px}.social-side>.btn{font-size:13px}.social-side .social-portrait.character-art{width:44px;height:50px;flex-basis:44px}
/* Preserve the sole chat form and its IDs so core31 can retain recipient plus message. */
.chat[data-social-chat] #chat-form{flex-wrap:wrap}.chat[data-social-chat] .social-chat-recipient{display:flex;gap:6px;width:100%;flex:0 0 100%;align-items:flex-end;order:-1}.chat[data-social-chat] .social-chat-recipient[hidden]{display:none}.social-chat-recipient label{display:flex;flex:1;min-width:0;flex-direction:column;gap:2px;font-size:12px}.chat[data-social-chat] #chat-recipient{width:100%;min-width:0;min-height:44px;margin:0;font-size:16px}.social-chat-recipient>.btn{min-width:44px;min-height:44px;font-size:14px}.social-chat-unread{display:inline-flex;border-radius:10px;background:#d6af56;color:#101820;padding:0 4px;min-width:15px;justify-content:center;font-size:11px;line-height:16px;margin-left:4px}
/* A recipient is one extra row, never a reason to wrap the message or Send below the mobile bar. */
body[data-mobile="true"] .chat[data-social-chat] #chat-form{display:grid;grid-template-columns:32px minmax(0,1fr) auto;grid-auto-flow:row;gap:6px;align-items:center}
body[data-mobile="true"] .chat[data-social-chat] #chat-form>.foundation-icon{grid-column:1;grid-row:2}
body[data-mobile="true"] .chat[data-social-chat] #chat-form>#chat-input{grid-column:2;grid-row:2;width:100%;height:44px;min-height:44px;box-sizing:border-box}
body[data-mobile="true"] .chat[data-social-chat] #chat-form>button[type="submit"]{grid-column:3;grid-row:2;height:44px;min-height:44px;box-sizing:border-box}
body[data-mobile="true"] .chat[data-social-chat] #chat-form>.social-chat-recipient{grid-column:1/-1;grid-row:1;width:auto;min-width:0;order:0}
body[data-mobile="true"] .chat[data-social-chat] #chat-form:not(:has(.social-chat-recipient:not([hidden])))>:not(.social-chat-recipient){grid-row:1}
body[data-mobile="true"] .chat[data-social-chat] #chat-form .social-chat-recipient>.btn{height:44px;min-height:44px;box-sizing:border-box}
@media(max-height:500px){
body[data-mobile="true"] .chat[data-social-chat] #chat-form .social-chat-recipient label{position:relative}
body[data-mobile="true"] .chat[data-social-chat] #chat-form [data-chat-recipient-label]{position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden}
body[data-mobile="true"] .chat[data-social-chat] #chat-recipient{height:44px;min-height:44px;box-sizing:border-box}
}
@media(min-width:600px) and (max-height:500px){
body[data-mobile="true"][data-keyboard="true"] .chat[data-social-chat] #chat-form:has(.social-chat-recipient:not([hidden])){grid-template-columns:minmax(160px,.8fr) minmax(0,1.4fr) auto}
body[data-mobile="true"][data-keyboard="true"] .chat[data-social-chat] #chat-form:has(.social-chat-recipient:not([hidden]))>.social-chat-recipient{grid-column:1;grid-row:1}
body[data-mobile="true"][data-keyboard="true"] .chat[data-social-chat] #chat-form:has(.social-chat-recipient:not([hidden]))>#chat-input{grid-column:2;grid-row:1}
body[data-mobile="true"][data-keyboard="true"] .chat[data-social-chat] #chat-form:has(.social-chat-recipient:not([hidden]))>button[type="submit"]{grid-column:3;grid-row:1}
body[data-mobile="true"][data-keyboard="true"] .chat[data-social-chat] #chat-form:has(.social-chat-recipient:not([hidden]))>.foundation-icon{display:none}
}
/* Guildhall has its own definite height inside the existing town service container. */
.town-screen .city-legacy-service:has(>.ghall){overflow:hidden;display:flex;flex-direction:column}.ghall{height:100%;flex:1;min-height:0;min-width:0;display:flex;flex-direction:column;gap:8px;overflow:hidden;color:#eee3ce;container:guildhall / size}.gh-heading{display:flex;align-items:center;justify-content:space-between;gap:10px;flex:0 0 auto}.gh-heading h2{font-size:25px}.gh-summary{display:flex;justify-content:space-between;gap:8px;flex:0 0 auto;font-size:15px;overflow-wrap:anywhere}.gh-tabs .btn{font-size:16px;padding:5px}.gh-content{flex:1;min-height:0;min-width:0;overflow:hidden}.gh-overview{display:flex;flex-direction:column;height:100%;min-height:0;gap:8px}.gh-scene{height:26%;min-height:50px;max-height:150px;object-fit:cover;width:100%;image-rendering:auto}.gh-room-layout{height:100%;min-height:0;display:grid;grid-template-columns:minmax(160px,.8fr) minmax(0,1.4fr);gap:12px}.gh-room-list{display:flex;flex-direction:column;gap:7px;min-height:0;overflow:auto}.gh-room-list .btn{justify-content:flex-start;font-size:18px;flex:1}.gh-room-detail{min-height:0;display:flex;flex-direction:column;gap:10px;border:1px solid #957646;padding:14px;background:#101c27}.gh-room-heading{display:flex;gap:14px;align-items:center;flex:0 0 auto}.gh-room-heading h3{font-size:27px}.gh-room-symbol{font-size:50px;line-height:1}.gh-room-pager{display:none}.gh-room-detail>.btn{flex:0 0 auto}.gh-cost{display:flex;flex-wrap:wrap;gap:10px}.gh-mat{display:flex;align-items:center;gap:5px;max-width:100%;font-size:16px;overflow-wrap:anywhere}.gh-mat img{width:28px;height:28px;object-fit:contain}.gh-mat.ok{color:#b7df99}.gh-mat.miss{color:#ffa5a5}.gh-data{display:flex;flex-direction:column;height:100%;min-height:0;gap:8px}.gh-stock-rows{flex:1;min-height:0;overflow:auto}.gh-stock-row{padding:10px;border-bottom:1px solid #735f3d;display:flex;flex-direction:column;gap:8px}.gh-stock-label{display:flex;align-items:center;gap:9px;overflow-wrap:anywhere}.gh-stock-label img{width:40px;height:40px;object-fit:contain}
body[data-mobile="true"] #tab-social:not(.hidden){padding:6px;gap:5px}body[data-mobile="true"] .social-heading h2{font-size:20px;margin-bottom:4px}body[data-mobile="true"] .social-tabs>.btn{font-size:14px;padding:4px}body[data-mobile="true"] .social-roster{display:flex}body[data-mobile="true"] .social-roster>.social-list,body[data-mobile="true"] .social-roster>.social-detail{width:100%;flex:1}body[data-mobile="true"] .social-roster[data-detail="false"]>.social-detail,body[data-mobile="true"] .social-roster[data-detail="true"]>.social-list{display:none}body[data-mobile="true"] .social-detail-back{display:block}body[data-mobile="true"] .social-detail-back>.btn{min-height:44px}body[data-mobile="true"] .social-person h3{font-size:21px}body[data-mobile="true"] .social-portrait-large.character-art{width:64px;height:74px;flex-basis:64px}body[data-mobile="true"] .social-member-hp{max-width:90px}body[data-mobile="true"] .social-guild-heading h3{font-size:20px}body[data-mobile="true"] .social-guild-summary{font-size:12px}body[data-mobile="true"] .social-guild>.social-footer{flex-wrap:wrap}body[data-mobile="true"] .social-guild>.social-footer>.social-form-row{flex-basis:100%}body[data-mobile="true"] .social-guild>.social-footer>.btn{max-width:none;width:100%}body[data-mobile="true"] .social-footer small{font-size:12px}body[data-mobile="true"] .social-form-row>.btn{font-size:14px}body[data-mobile="true"] .social-invite{flex-wrap:wrap}body[data-mobile="true"] .social-invite p{flex-basis:100%}
body[data-mobile="true"] .gh-room-layout{display:flex}body[data-mobile="true"] .gh-room-list{display:none}body[data-mobile="true"] .gh-room-detail{flex:1;padding:8px;gap:8px}body[data-mobile="true"] .gh-room-pager{display:block}body[data-mobile="true"] .gh-room-heading h3{font-size:23px}body[data-mobile="true"] .gh-summary{font-size:13px;flex-wrap:wrap}body[data-mobile="true"] .gh-tabs .btn{font-size:13px}body[data-mobile="true"] .gh-mat{font-size:14px}body[data-mobile="true"] .gh-heading h2{font-size:21px}
@media(max-height:500px){body[data-mobile="true"] #tab-social:not(.hidden){display:grid;grid-template-columns:105px minmax(0,1fr);gap:6px}body[data-mobile="true"] #social-forms{min-height:0;overflow:auto}body[data-mobile="true"] .social-heading h2{display:none}body[data-mobile="true"] .social-heading>.social-tabs{flex-direction:column;gap:3px}body[data-mobile="true"] .social-heading>.social-tabs>.btn{flex:0 0 44px}body[data-mobile="true"] .social-guild{gap:4px}body[data-mobile="true"] .social-guild-heading{display:none}body[data-mobile="true"] .social-guild>.social-footer{flex-wrap:nowrap;gap:5px}body[data-mobile="true"] .social-guild>.social-footer>.social-form-row{flex:1;flex-basis:auto}body[data-mobile="true"] .social-guild>.social-footer>.btn{width:auto;max-width:140px}body[data-mobile="true"] .social-field>span{position:absolute;clip-path:inset(50%);width:1px;height:1px;overflow:hidden}body[data-mobile="true"] .social-footer small{display:none}body[data-mobile="true"] .social-footer{gap:3px}body[data-mobile="true"] .social-body>.social-footer{flex-direction:row;align-items:flex-end}body[data-mobile="true"] .social-body>.social-footer>.social-form-row{flex:1}body[data-mobile="true"] .social-body>.social-footer>.btn{max-width:140px}body[data-mobile="true"] .social-detail{position:relative;display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);grid-template-rows:auto minmax(0,1fr);padding:5px;gap:4px}body[data-mobile="true"] .social-detail .social-person{grid-column:1;grid-row:1;gap:5px;padding-right:42px}body[data-mobile="true"] .social-detail .social-reader{grid-column:1;grid-row:2;font-size:13px}body[data-mobile="true"] .social-detail .social-actions{grid-column:2;grid-row:1/3;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-content:start;gap:4px}body[data-mobile="true"] .social-detail .social-actions>.btn{font-size:13px}body[data-mobile="true"] .social-detail-back{position:absolute;top:4px;left:calc(44% - 44px)}body[data-mobile="true"] .social-detail-back .btn{width:44px;font-size:0;padding:0}body[data-mobile="true"] .social-detail-back .btn::after{content:"‹";font-size:24px}body[data-mobile="true"] .social-person h3{font-size:17px}body[data-mobile="true"] .social-person p,body[data-mobile="true"] .social-status{font-size:12px}body[data-mobile="true"] .social-portrait-large.character-art{width:38px;height:44px;flex-basis:38px}body[data-mobile="true"] .social-detail .social-role-mark{width:36px;height:44px;flex-basis:36px}body[data-mobile="true"] .social-member{min-height:44px}body[data-mobile="true"] .social-list{padding:5px;gap:3px}body[data-mobile="true"] .social-member .social-portrait{height:38px;flex-basis:34px;width:34px}body[data-mobile="true"] .social-member-copy{flex-direction:row;align-items:center;flex-wrap:wrap}body[data-mobile="true"] .social-member-copy b{font-size:16px}body[data-mobile="true"] .social-form-panel{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:4px;padding:6px}body[data-mobile="true"] .social-form-panel h3{grid-column:1;font-size:16px}body[data-mobile="true"] .social-form-panel>.social-field{grid-column:1;grid-row:2}body[data-mobile="true"] .social-form-panel>.social-actions,body[data-mobile="true"] .social-form-panel>.btn{grid-column:2;grid-row:1/3}body[data-mobile="true"] .social-form-panel>p{grid-column:1/-1;margin:0;font-size:12px}body[data-mobile="true"] .social-guild-create{display:grid;grid-template-columns:1fr 1fr}body[data-mobile="true"] .social-create-fields{gap:4px}body[data-mobile="true"] .social-create-fields>.btn{min-height:44px}
body[data-mobile="true"][data-mobile-players="true"] #right>.chat{display:none}body[data-mobile="true"][data-mobile-players="true"] #zone-side:has(>.social-side){flex:1;max-height:none}body[data-mobile="true"] .social-side-content .social-person{flex-direction:row}body[data-mobile="true"] .social-presence{display:grid;grid-template-columns:1fr 1fr;gap:4px}body[data-mobile="true"] .social-presence>.social-person{grid-column:1}body[data-mobile="true"] .social-presence>.social-side-actions{grid-column:2;grid-row:1/4}body[data-mobile="true"] .social-side>.btn{display:none}
}
@container guildhall (max-height:350px){.gh-summary{display:none}.ghall .gh-heading h2{font-size:18px}.ghall .gh-tabs{gap:3px}.ghall .gh-tabs .btn{font-size:13px}.gh-room-layout{display:flex}.gh-room-list{display:none}.gh-room-detail{display:grid!important;grid-template-columns:minmax(110px,.8fr) minmax(0,1.5fr) minmax(100px,.7fr);grid-template-rows:44px minmax(0,1fr);padding:5px!important;gap:4px!important}.gh-room-pager{display:block!important;grid-column:1;grid-row:1}.gh-room-pager .btn{font-size:0;min-width:44px;padding:0}.gh-room-pager .btn:first-child::after{content:"‹";font-size:24px}.gh-room-pager .btn:last-child::after{content:"›";font-size:24px}.gh-room-heading{grid-column:1;grid-row:2;gap:5px}.gh-room-heading h3{font-size:16px!important}.gh-room-symbol{font-size:24px}.gh-room-detail>.social-reader{grid-column:2;grid-row:1/3;font-size:13px}.gh-room-detail>.btn{grid-column:3;grid-row:1;align-self:start}.gh-mat{font-size:12px!important}.gh-mat img{width:18px;height:18px}.gh-overview{display:grid;grid-template-columns:minmax(0,1fr) minmax(100px,.6fr);grid-template-rows:minmax(0,1fr)}.gh-scene{display:none}.gh-overview>.social-reader{grid-column:1;height:100%}.gh-overview>.btn{grid-column:2;align-self:start}.gh-data{display:grid;grid-template-columns:minmax(0,1fr) 130px;gap:5px}.gh-data>.social-pager{align-self:end;gap:3px}.gh-data>.social-pager .btn{font-size:0;padding:0}.gh-data>.social-pager .btn:first-child::after{content:"‹";font-size:24px}.gh-data>.social-pager .btn:last-child::after{content:"›";font-size:24px}.gh-stock-row{padding:2px;gap:4px}.gh-stock-row .social-field>span{font-size:12px}.gh-stock-label img{width:24px;height:24px}.gh-stock-row p{margin:0;font-size:12px}.gh-stock-row .social-form-row{gap:3px}.gh-stock-row .social-form-row>.btn{font-size:13px}}
