/* One common back control. Original actions and sound listeners are retained. */
body #screenToolbar:not([hidden]){display:flex!important;position:fixed!important;top:env(safe-area-inset-top,0px)!important;left:0!important;right:0!important;width:100%!important;height:56px!important;margin:0!important;padding:6px 12px!important;box-sizing:border-box!important;align-items:center;gap:12px;background:#fffdf8!important;border-bottom:1px solid #d6c4a1;z-index:10001!important}
body #screenBack,body #homeBack25{display:inline-flex!important;align-items:center;justify-content:center;min-height:44px!important;min-width:80px!important;padding:8px 12px!important;border:1px solid #b89b65!important;border-radius:8px!important;background:#fffdf8!important;color:#192e4c!important;font:600 15px/1.2 system-ui!important;box-shadow:none!important;text-decoration:none!important;cursor:pointer}
body #screenTitle{margin:0!important;font-size:17px!important;color:#1b2c45!important;line-height:1.3!important;text-shadow:none!important;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
body .return25-duplicate,body .e23-footer{display:none!important}
body:not([data-screen="home"]) main > section > :is(.back-to-menu,.tea-top-return,.reservation-back){display:none!important}
body #homeBack25{position:relative;z-index:3;margin:8px 12px}
body:is([data-screen^="elemental"],[data-screen="memberAccount"]) #top{padding-top:calc(64px + env(safe-area-inset-top,0px))!important}
body:is([data-screen^="elemental"],[data-screen="memberAccount"]) #siteSwitchDock{z-index:10002!important;top:calc(6px + env(safe-area-inset-top,0px))!important;right:10px!important;left:auto!important;max-width:210px!important;transform:none!important}
body:is([data-screen^="elemental"],[data-screen="memberAccount"]) #screenTitle{visibility:hidden}
body #elementalPrayer .prayer-header .board-back{display:none!important}
/* Restore an ornate, live portrait card using the existing transparent frame. */
html:root body #top #elementalMercenaryList{background:#fffaf2!important;border:0!important;box-shadow:none!important;padding:12px!important}
.mercenary25-title{margin:6px 0 22px;text-align:center;font:700 26px/1.4 serif;color:#19304e}
body #mercenaryCards{grid-template-columns:repeat(auto-fit,minmax(min(100%,280px),1fr))!important;gap:24px!important;max-width:760px;margin:auto}
html:root body #top #elementalMercenaryList .mercenary-profile-card{position:relative!important;display:flex!important;flex-direction:column;max-width:390px;width:100%;margin:auto;padding:18px!important;min-height:0!important;aspect-ratio:auto!important;border:0!important;border-radius:20px!important;background:linear-gradient(135deg,#173252,#0a1b32)!important;box-shadow:inset 0 0 0 3px #d6b35d,0 7px 18px #14253b44!important;overflow:hidden!important}
html:root body #top #elementalMercenaryList .mercenary-profile-card::after{display:block!important;content:''!important;position:absolute;inset:0;z-index:2;pointer-events:none;background:url('/assets/mercenary-rare-frame-20261003.png') center/100% 100% no-repeat!important}
html:root body #top #elementalMercenaryList .mercenary-profile-card > img,html:root body #top #elementalMercenaryList .mercenary-portrait-placeholder{height:auto!important;aspect-ratio:4/5;width:100%!important;object-fit:cover!important;object-position:center 30%;border-radius:10px 10px 0 0!important}
html:root body #top #elementalMercenaryList .mercenary-card-copy{position:relative!important;inset:auto!important;z-index:1;padding:14px 16px 20px!important;margin:0!important;border:0!important;border-radius:0 0 12px 12px!important;background:linear-gradient(#122a46,#091a32)!important;color:#fff1cb!important;text-align:center}
html:root body #top #elementalMercenaryList .mercenary-card-copy header{display:flex;flex-direction:column;align-items:center;gap:10px}
html:root body #top #elementalMercenaryList .mercenary-card-copy strong{color:#fff1cb!important;font:700 24px/1.4 serif!important;text-shadow:none!important}
html:root body #top #elementalMercenaryList .mercenary-card-copy header span{color:white!important;padding:5px 16px!important;border:1px solid #d4bc74!important;border-radius:30px;background:#3e586c!important}
html:root body #top #elementalMercenaryList [data-open=true] .mercenary-card-copy header span{background:linear-gradient(#45a168,#18613b)!important}
html:root body #top #elementalMercenaryList .mercenary-card-copy p{color:#ffedc3!important;margin:8px 0!important;font-size:14px;line-height:1.5!important}
html:root body #top #elementalMercenaryList .mercenary-card-copy small{display:block;margin:14px 0 0;padding:12px 8px;border:1px solid #d2b36c;border-radius:8px;color:#fff0c9!important;background:#203c5b;font-size:15px}
/* Fixed viewport; only queue commentary/actions or chat history can scroll. */
html:has(body.compact25){height:100%!important;overflow:hidden!important}
body.compact25{position:fixed!important;inset:0!important;width:100%!important;height:var(--viewport25,100dvh)!important;min-height:0!important;overflow:hidden!important;background:#fffdf8!important;margin:0!important;padding:0!important}
body.compact25 #top{position:fixed!important;inset:0!important;height:var(--viewport25,100dvh)!important;min-height:0!important;overflow:hidden!important;padding:0!important;margin:0!important;max-width:none!important;width:100%!important}
body.compact25 > :is(header,footer),body.compact25 #top > :not(#screenToolbar):not(#elementalMercenary):not(#elementalChat){display:none!important}
body.compact25 #top > :is(#elementalMercenary,#elementalChat):not([hidden]){display:flex!important;flex-direction:column!important;position:absolute!important;top:calc(56px + env(safe-area-inset-top,0px))!important;bottom:0!important;left:50%!important;right:auto!important;transform:translateX(-50%);width:100%!important;max-width:760px!important;height:calc(var(--viewport25,100dvh) - 56px - env(safe-area-inset-top,0px))!important;min-height:0!important;max-height:none!important;margin:0!important;padding:8px 12px max(8px,env(safe-area-inset-bottom,0px))!important;box-sizing:border-box!important;border:0!important;border-radius:0!important;box-shadow:none!important;overflow:hidden!important;background:#fffdf8!important;gap:6px!important;color:#1b2f4c!important}
html:root body #top #elementalMercenary #mercenaryNamePlate{flex:none!important;font:700 clamp(20px,5vw,28px)/1.3 serif!important;text-align:center!important;padding:9px!important;margin:0!important;min-height:0!important;height:auto!important;background:#fffdf8!important;color:#162c49!important;border:1px solid #bb9653!important;border-radius:8px!important;box-shadow:inset 0 0 0 3px #f4e7c9!important;text-shadow:none!important}
html:root body #top #elementalMercenary .mercenary-top{display:grid!important;grid-template-columns:minmax(0,1fr) 100px!important;gap:8px!important;flex:none!important;height:48px!important;min-height:0!important;margin:0!important}
html:root body #top #elementalMercenary .mercenary-led{padding:3px 8px!important;border:1px solid #b99b5e!important;border-radius:8px!important;background:#f7f4eb!important;color:#194c35!important}
html:root body #top #elementalMercenary .mercenary-led strong{font:700 18px/1.2 serif!important;color:#236f45!important;text-shadow:none!important}
html:root body #top #elementalMercenary #memberMercenaryToggle{min-height:32px!important;width:48px!important;padding:0!important;border-radius:30px!important;background:#7a8897!important;border:0!important}
html:root body #top #elementalMercenary #memberMercenaryToggle[aria-checked=true]{background:#1c4b7b!important}
html:root body #top #elementalMercenary .mercenary-venue{margin:0!important;padding:2px 5px!important;background:#fffdf8!important;border:1px solid #b8b3a8!important;font-size:10px!important;line-height:1!important;color:#20324b!important}
html:root body #top #elementalMercenary .venue-display{height:28px!important;margin:0!important}
html:root body #top #elementalMercenary #memberVenueNumber{font-size:19px!important;color:#20324b!important;text-shadow:none!important}
html:root body #top #elementalMercenary #memberVenue{padding:0!important;min-height:28px!important}
html:root body #top #elementalMercenary #memberQueue{display:grid!important;grid-template-rows:repeat(8,minmax(28px,1fr))!important;gap:5px!important;flex:1 1 0!important;min-height:0!important;max-height:none!important;height:auto!important;margin:0!important;overflow:hidden!important}
html:root body #top #elementalMercenary .queue-slot{display:grid!important;grid-template-columns:28px minmax(0,1fr) auto!important;align-items:center!important;gap:6px!important;min-height:0!important;height:100%!important;padding:3px 9px!important;border:1px solid #b9b5ab!important;border-radius:6px!important;background:#fff!important;color:#182d49!important;box-shadow:none!important}
html:root body #top #elementalMercenary .queue-slot strong{color:#182d49!important;font-size:14px!important;text-shadow:none!important}
html:root body #top #elementalMercenary .queue-index{font-size:20px!important;color:#182d49!important}
html:root body #top #elementalMercenary .queue-state{font-size:11px!important;color:#fff!important;background:#79828c!important;border-radius:20px;padding:3px 8px}
html:root body #top #elementalMercenary .queue-slot.is-current{background:linear-gradient(100deg,#ffe8ab,#fff7df)!important;border-color:#b38a35!important}
html:root body #top #elementalMercenary .queue-slot.is-current .queue-state{background:#b38022!important}
html:root body #top #elementalMercenary #memberAdSupport{flex:none!important;min-height:40px!important;height:40px!important;margin:0!important;padding:5px 8px!important;font-size:12px!important}
html:root body #top #elementalMercenary .mercenary-comment{flex:0 1 64px!important;min-height:32px!important;height:64px!important;padding:5px 8px!important;margin:0!important;border:1px solid #d8d0bd!important;background:#fff!important;overflow:auto!important;box-sizing:border-box!important}
html:root body #top #elementalMercenary .mercenary-comment :is(p,textarea){min-height:0!important;max-height:none!important;height:auto!important;padding:0!important;margin:0!important;border:0!important;box-shadow:none!important;font:14px/1.4 system-ui!important;background:none!important}
html:root body #top #elementalMercenary .mercenary-comment textarea{height:46px!important;width:100%!important;resize:none}
html:root body #top #elementalMercenary :is(#memberQueueAction,#memberQueueHelp):empty{display:none!important}
html:root body #top #elementalMercenary :is(#memberMercenaryFeedback,#memberAdStatus){flex:none;font-size:12px!important;line-height:1.3!important;margin:0!important;max-height:45px;overflow:auto}
html:root body #top #elementalMercenary #memberQueueAction:not(:empty){position:absolute!important;left:10px;right:10px;bottom:72px;z-index:8;display:flex!important;flex-wrap:wrap;justify-content:center;gap:6px;padding:12px;background:#fffdf6;border:1px solid #b99a58;border-radius:12px;box-shadow:0 0 0 100vmax #142b4b33}
/* White full-screen conversations: attachment media stays within its message. */
body.chat25 #top > #elementalChat:not([hidden]){max-width:none!important;background:white!important;padding:0!important;gap:0!important}
body.chat25 #siteSwitchDock{display:none!important}
body.chat25 #screenTitle{visibility:visible!important}
body.chat25 #screenToolbar{background:white!important;border-color:#e5e8ec}
html:root body #top #elementalChat .member-chat-body{display:flex!important;flex-direction:column!important;flex:1 1 0!important;min-height:0!important;overflow:hidden!important;width:100%;max-width:960px;margin:0 auto!important;gap:0!important;background:#fff!important}
html:root body #top #elementalChat .member-chat-body[hidden]{display:none!important}
html:root body #top #elementalChat .member-pane-heading{flex:none!important;height:38px!important;padding:0 12px!important;border-bottom:1px solid #eef0f3;display:flex;align-items:center;justify-content:flex-end}
html:root body #top #elementalChat .member-pane-heading h3{display:none!important}
html:root body #top #elementalChat #memberChatReload{min-height:32px!important;padding:4px 12px!important;font-size:12px!important;background:#f4f5f7!important;color:#27394e!important;border:1px solid #d4d9e1!important;box-shadow:none!important}
html:root body #top #elementalChat #memberMessages{flex:1 1 0!important;min-height:0!important;max-height:none!important;height:auto!important;overflow:auto!important;overscroll-behavior:contain;touch-action:pan-y;padding:12px!important;margin:0!important;background:#fff!important;border:0!important;border-radius:0!important;box-sizing:border-box!important}
html:root body #top #elementalChat .member-message{display:grid!important;grid-template-columns:34px minmax(0,1fr)!important;gap:9px!important;margin:0 0 16px!important;padding:0!important;background:#fff!important;color:#213047!important;border:0!important;box-shadow:none!important;border-radius:0!important;font:14px/1.5 system-ui!important}
html:root body #top #elementalChat .member-message > div{min-width:0!important}
html:root body #top #elementalChat .member-message p{margin:5px 0!important;white-space:pre-wrap;overflow-wrap:anywhere;color:#213047!important;line-height:1.5!important}
html:root body #top #elementalChat .member-avatar{width:34px!important;height:34px!important;border-radius:50%;object-fit:cover}
html:root body #top #elementalChat .member-message :is(img:not(.member-avatar),video){display:block!important;max-width:100%!important;width:auto!important;height:auto!important;max-height:240px!important;object-fit:contain!important;position:static!important;border-radius:9px!important;margin:8px 0!important}
html:root body #top #elementalChat .member-message header{color:#213047!important;font-size:13px!important;display:flex;flex-wrap:wrap;gap:6px}
html:root body #top #elementalChat .member-message time{color:#8792a2!important;font-size:11px}
html:root body #top #elementalChat :is(#memberChatHint,#memberChatFeedback){flex:none;font-size:12px!important;margin:0!important;padding:0 10px;max-height:45px;overflow:auto;line-height:1.3!important}
html:root body #top #elementalChat #memberMessageForm{flex:none!important;position:relative!important;inset:auto!important;display:grid!important;grid-template-columns:minmax(0,1fr) auto!important;gap:6px!important;padding:8px 10px max(8px,env(safe-area-inset-bottom))!important;margin:0!important;background:white!important;border-top:1px solid #dfe3e9}
html:root body #top #elementalChat .mention-compose{grid-column:1/-1;display:flex!important;gap:6px;margin:0!important;align-items:center}
html:root body #top #elementalChat .mention-compose label{font-size:0;display:flex;align-items:center}
html:root body #top #elementalChat .mention-compose select{height:34px!important;padding:3px 8px!important;font-size:13px!important;min-width:0;border-color:#d8dce2!important;background:#fff!important}
html:root body #top #elementalChat #memberMentionAdd{min-height:34px!important;padding:4px 10px!important;font-size:13px!important;background:#f4f5f7!important;color:#283b52!important;border:1px solid #d8dce2!important;box-shadow:none!important}
html:root body #top #elementalChat #memberMessageBody{grid-column:1;min-height:44px!important;height:44px!important;max-height:100px!important;resize:vertical;padding:10px!important;margin:0!important;background:#f5f6f8!important;border:1px solid #d9dee5!important;font:16px/1.4 system-ui!important;color:#1c2d43!important}
html:root body #top #elementalChat .member-compose-actions{grid-column:2;display:flex!important;gap:5px;align-items:center;margin:0!important;flex-wrap:nowrap!important}
html:root body #top #elementalChat .member-attach{position:relative!important;flex:none!important;width:44px!important;height:44px!important;padding:0!important;margin:0!important;overflow:hidden!important;font-size:0!important;border:1px solid #d5dce5!important;border-radius:8px;background:#fff!important}
html:root body #top #elementalChat .member-attach::before{content:'＋';display:grid;place-items:center;height:100%;font-size:25px;color:#263a55}
html:root body #top #elementalChat .member-attach input{position:absolute!important;inset:0!important;width:100%!important;height:100%!important;opacity:0;cursor:pointer}
html:root body #top #elementalChat .member-compose-actions button{min-height:44px!important;padding:8px 12px!important;background:#203f6a!important;border:0!important;box-shadow:none!important;color:white!important}
html:root body #top #elementalChat #memberAttachmentName{grid-column:1/-1;display:block;font-size:10px!important;color:#748092!important;line-height:1.3!important}
html:root body #top #elementalChat .member-reactions button{min-height:30px!important;padding:3px 7px!important;background:#eef2f8!important;color:#263c58!important;border:1px solid #d8e0eb!important;box-shadow:none!important}
@media(max-height:700px){html:root body #top #elementalMercenary .mercenary-comment{flex-basis:40px!important;height:40px!important}html:root body #top #elementalMercenary #mercenaryNamePlate{font-size:20px!important;padding:5px!important}html:root body #top #elementalMercenary #memberQueue{gap:3px!important}}
@media(max-width:360px){html:root body #top #elementalMercenary .queue-slot{padding:2px 5px!important}html:root body #top #elementalMercenary .queue-slot strong{font-size:12px!important}html:root body #top #elementalChat #memberMessageForm{padding-left:6px!important;padding-right:6px!important;gap:4px!important}}

html:root body #top #elementalMercenaryList .mercenary25-title{display:block!important;position:static!important;border:0!important;box-shadow:none!important;background:none!important;color:#18334f!important;margin:8px 0 20px!important;padding:0!important;text-shadow:none!important}
html:root body #top #elementalMercenaryList .mercenary-profile-card::before{display:none!important}
html:root body #top #elementalMercenary .queue-slot::before,html:root body #top #elementalMercenary .queue-slot::after{display:none!important}
html:root body #top #elementalMercenary .queue-index{border:0!important;border-radius:0!important;background:none!important;box-shadow:none!important;text-shadow:none!important;width:auto!important;height:auto!important;clip-path:none!important}
html:root body #top #elementalMercenary .queue-state{border:0!important;box-shadow:none!important;text-shadow:none!important}
html:root body #top #elementalChat .member-avatar img{display:block!important;width:34px!important;height:34px!important;max-height:34px!important;object-fit:cover!important;margin:0!important;border-radius:50%!important}
html:root body #top #elementalChat .member-chat-image{display:block!important;visibility:visible!important;width:auto!important;max-width:100%!important;height:auto!important;max-height:240px!important}
html:root body #top #elementalMercenaryList .mercenary25-title{-webkit-text-fill-color:#18334f!important;font-size:26px!important;line-height:1.4!important;height:auto!important}
html:root body #top #elementalMercenaryList .mercenary-card-copy{padding-bottom:100px!important}
html:root body #top #elementalMercenary #memberVenueNumber{-webkit-text-fill-color:#20324b!important}

/* Unified floating back control: no enclosing strip. */
html:root body #screenToolbar:not([hidden]),html:root body.chat25 #screenToolbar{background:transparent!important;background-image:none!important;border:0!important;box-shadow:none!important;border-radius:0!important;backdrop-filter:none!important;pointer-events:none!important}
html:root body #screenToolbar::before,html:root body #screenToolbar::after{display:none!important}
html:root body #screenBack{pointer-events:auto!important;position:relative!important;min-width:88px!important;min-height:44px!important;padding:8px 16px!important;border:1px solid #d5b674!important;border-radius:10px 4px 10px 4px!important;background:linear-gradient(135deg,#294967,#10243e)!important;color:#fff0c9!important;-webkit-text-fill-color:#fff0c9!important;box-shadow:inset 0 0 0 3px #12283d,inset 0 0 0 4px #c6a56670,0 2px 6px #071a2b40!important;font:600 15px/1.3 serif!important;letter-spacing:.08em;text-shadow:none!important;cursor:pointer}
html:root body #screenBack:hover{filter:brightness(1.12)}
html:root body #screenBack:active{transform:translateY(1px)}
html:root body #screenBack:focus-visible{outline:3px solid #daa94c!important;outline-offset:3px}
html:root body #screenTitle{pointer-events:none}
