/* R25 explicitly restores both native rails. Closed chat retains its full width. */
html[data-imo-black][data-imo-tools="open"] body #bpLayout #app .phone{grid-template-columns:82px minmax(0,1fr)!important;grid-template-rows:66px minmax(0,1fr) auto auto!important}
html[data-imo-black][data-imo-tools="open"] body #bpLayout #app #chat{grid-column:2!important;grid-row:2!important}
html[data-imo-black][data-imo-tools="open"] body #bpLayout #app #rightRail,
html[data-imo-black][data-imo-tools="open"] body #bpLayout #app #bottomNav{display:flex!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;transform:none!important}
html[data-imo-black][data-imo-tools="open"] body #bpLayout #app .bp-action-dock{display:grid!important;visibility:visible!important;opacity:1!important;pointer-events:auto!important;grid-row:4!important;grid-column:1/-1!important}
html[data-imo-black][data-imo-tools="closed"] body #bpLayout #app #rightRail,
html[data-imo-black][data-imo-tools="closed"] body #bpLayout #app #bottomNav,
html[data-imo-black][data-imo-tools="closed"] body #bpLayout #app .bp-action-dock{display:none!important;visibility:hidden!important;pointer-events:none!important}
html[data-imo-black] body.imo-r9-overlay-open #bpLayout #app #rightRail,
html[data-imo-black] body.imo-r9-overlay-open #bpLayout #app #bottomNav,
html[data-imo-black] body.imo-r9-overlay-open #bpLayout #app .bp-action-dock{visibility:hidden!important;pointer-events:none!important}
html[data-imo-black] body #app #chat #imo-rail-open-r25{position:absolute!important;left:0!important;top:auto!important;bottom:0!important;width:44px!important;height:44px!important;min-height:44px!important;margin:0!important;padding:0!important;display:grid!important;place-items:center!important;z-index:9!important;border:1px solid #8099c355!important;border-left:0!important;border-radius:0 16px 16px 0!important;background:#17243b!important;color:#c4d8ff!important;cursor:pointer;touch-action:manipulation;pointer-events:auto!important;visibility:visible!important;opacity:1!important}
html[data-imo-black] #imo-rail-open-r25 svg{width:20px;height:20px;pointer-events:none}
html[data-imo-black][data-imo-tools="open"] body #app #chat #imo-rail-open-r25{display:none!important}
html[data-imo-black][data-imo-tools="closed"] body #app #chat #feed{padding-bottom:56px!important}
html[data-imo-black] #imo-rail-open-r25:focus-visible{outline:2px solid #c4d8ff;outline-offset:-3px}
/* Keep open arrows out of the conversation's scrollable content. */
@media(max-width:899px){
 html[data-imo-black][data-imo-tools="open"] body #bpLayout #app .phone{grid-template-columns:58px minmax(0,1fr)!important;grid-template-rows:54px minmax(0,1fr) auto auto!important}
 html[data-imo-black][data-imo-tools="closed"] body #bpLayout #app .phone{grid-template-rows:54px minmax(0,1fr) auto!important}
 html[data-imo-black] body #bpLayout #app .topbar{height:54px!important;padding:5px 9px!important}
 html[data-imo-black] body #bpLayout #app .bp-chat-heading{gap:4px!important}
 html[data-imo-black] body #bpLayout #app .bp-character-button{width:32px!important;height:40px!important;flex-basis:32px!important;border:0!important;background:transparent!important}
 html[data-imo-black] body #bpLayout #app .bp-heading-text strong{font-size:15px!important}
 html[data-imo-black] body #bpLayout #app .bp-heading-text small{display:none!important}
 html[data-imo-black] body #bpLayout #app .bp-location-button,
 html[data-imo-black] body #bpLayout #app .bp-mobile-menu{width:40px!important;height:44px!important;flex-basis:40px!important;border-color:transparent!important;background:transparent!important}
 html[data-imo-black] body #bpLayout #app .bp-mobile-account{font-size:12px!important;padding:0 8px!important;border-radius:10px!important}
 html[data-imo-black] body #bpLayout #app .bp-icon{width:18px!important;height:18px!important}
 html[data-imo-black] body #bpLayout #app #rightRail{padding:48px 3px 4px!important;gap:3px!important}
 html[data-imo-black] body #bpLayout #app #rightRail>button{min-height:56px!important;padding:4px 2px!important;gap:3px!important;border-radius:10px!important}
 html[data-imo-black] body #bpLayout #app #rightRail .nav-icon,
 html[data-imo-black] body #bpLayout #app #bottomNav>button>span{width:26px!important;height:26px!important;border-radius:8px!important;box-shadow:none!important}
 html[data-imo-black] body #bpLayout #app #rightRail svg,
 html[data-imo-black] body #bpLayout #app #bottomNav>button svg{width:19px!important;height:19px!important}
 html[data-imo-black] body #bpLayout #app #rightRail .nav-label,
 html[data-imo-black] body #bpLayout #app #bottomNav>button>b{font-size:11px!important;line-height:1.2!important}
 html[data-imo-black] body #bpLayout #app .bp-action-dock{min-height:66px!important;padding:3px 3px calc(3px + env(safe-area-inset-bottom,0px))!important;grid-template-columns:44px 20px minmax(0,1fr) 20px!important;gap:1px!important}
 html[data-imo-black] body #bpLayout #app #bottomNav{min-height:60px!important;padding:0!important;gap:2px!important}
 html[data-imo-black] body #bpLayout #app #bottomNav>button{flex-basis:58px!important;width:58px!important;min-width:58px!important;min-height:56px!important;padding:3px 2px!important;gap:3px!important;border-radius:10px!important}
 html[data-imo-black] body #bpLayout #app .bp-dock-arrow{width:20px!important}
 html[data-imo-black] body #bpLayout #app #feed{padding:10px!important;font-size:14px!important}
 html[data-imo-black] body #bpLayout #app #feed .imo-r8-bubble,
 html[data-imo-black] body #bpLayout #app #feed .user{font-size:14px!important;line-height:1.5!important;padding:11px 13px!important;border-radius:16px!important}
 html[data-imo-black] body #bpLayout #app #feed .r20-place-row>summary{min-height:48px!important;padding:8px 10px!important;gap:8px!important;font-size:13px!important}
 html[data-imo-black] body #bpLayout #app #feed .r20-place-row>summary small{font-size:11px!important}
 html[data-imo-black] body #bpLayout #app #feed #bpWelcome h2{font-size:23px!important}
 html[data-imo-black] body #bpLayout #app #feed #bpWelcome>p{font-size:14px!important}
 html[data-imo-black] body[data-view="chat"] #bpLayout #app #composer{min-height:50px!important;height:50px!important;margin:4px 8px calc(4px + env(safe-area-inset-bottom,0px))!important;width:calc(100% - 16px)!important;padding:2px 4px!important;grid-template-columns:32px minmax(0,1fr) 32px 40px!important;gap:2px!important;border-radius:16px!important}
 html[data-imo-black] body[data-view="chat"] #bpLayout #app #composer button{min-height:44px!important;height:44px!important;min-width:0!important}
 html[data-imo-black] body[data-view="chat"] #bpLayout #app #composer #msg{height:44px!important;font-size:16px!important;padding:4px!important;cursor:text}
 html[data-imo-black] body[data-view="chat"] #bpLayout #app #composer .send{border-radius:12px!important}
}
/* Native dialog owns focus and the overlay. Height follows the visible keyboard viewport. */
html[data-imo-black] #imo-compose-r25{position:fixed;inset:calc(var(--r25-vtop,0px) + 8px) 0 auto;margin:0 auto;box-sizing:border-box;width:100%;max-width:620px;height:calc(var(--r25-vh,100dvh) - 8px);max-height:none;padding:0;overflow:hidden;border:1px solid #819bc144;border-bottom:0;border-radius:18px 18px 0 0;background:#101722;color:#edf2fb;font:400 16px/1.5 system-ui,sans-serif;box-shadow:0 -12px 50px #0006}
html[data-imo-black] #imo-compose-r25:not([open]){display:none}
html[data-imo-black] #imo-compose-r25[open]{display:flex;flex-direction:column}
html[data-imo-black] #imo-compose-r25::backdrop{background:#0509109c}
html[data-imo-black] #imo-compose-r25 header{display:flex;align-items:center;justify-content:space-between;gap:8px;flex:0 0 52px;padding:0 12px;border-bottom:1px solid #8ea5cf22}
html[data-imo-black] #imo-compose-r25 h2{margin:0;font-size:16px;font-weight:600}
html[data-imo-black] #imo-compose-r25 button{font:500 14px/1.3 system-ui,sans-serif;min-height:44px;padding:8px 14px;border:1px solid #8ea5cf33;border-radius:12px;color:#dbe7ff;background:#1c2940;cursor:pointer}
html[data-imo-black] #imo-compose-r25 textarea{display:block;flex:1;min-height:0;width:100%;box-sizing:border-box;margin:0;padding:16px;resize:none;border:0;border-radius:0;background:transparent;color:#edf2fb;font:400 16px/1.65 system-ui,sans-serif;outline-offset:-3px;overflow-y:auto;overscroll-behavior:contain;touch-action:pan-y}
html[data-imo-black] #imo-compose-r25 textarea::placeholder{color:#93a4bd}
html[data-imo-black] #imo-compose-r25 footer{display:flex;align-items:center;gap:12px;flex:0 0 auto;padding:8px 12px calc(8px + env(safe-area-inset-bottom,0px));border-top:1px solid #8ea5cf22}
html[data-imo-black] #imo-compose-r25 footer small{flex:1;font-size:12px;color:#a4b4cc}
html[data-imo-black] #imo-compose-r25 #imo-compose-send-r25{min-width:100px;background:#acc8ff;color:#101b30;border-color:#c4d8ff}
html[data-imo-black] #imo-compose-r25 #imo-compose-send-r25:disabled{opacity:.45;cursor:default}
html[data-imo-black] #imo-compose-r25 :focus-visible{outline:2px solid #bfd5ff}
