/* IMO V9.1 — final overrides for the canonical /imo document. */
:root{--imo-v91-line:rgba(151,255,114,.22);--imo-v91-panel:rgba(3,38,16,.94)}

/* Keep the menu inside the phone. Older bundles expanded it across the viewport. */
body[data-view="chat"] #sheet.sheet.open{display:block!important;position:absolute!important;inset:0!important;z-index:2147482000!important}
body[data-view="chat"] #sheet .dim{position:absolute!important;inset:0!important;background:rgba(0,10,4,.48)!important;backdrop-filter:blur(3px)!important}
body[data-view="chat"] #sheet .sheet-card{position:absolute!important;inset:auto 10px 10px 10px!important;width:auto!important;height:auto!important;max-width:none!important;max-height:calc(100% - 78px)!important;margin:0!important;padding:17px 14px 13px!important;overflow:auto!important;border:1px solid var(--imo-v91-line)!important;border-radius:20px!important;background:linear-gradient(155deg,rgba(10,66,29,.99),rgba(1,24,10,.995))!important;box-shadow:0 18px 54px rgba(0,0,0,.46)!important}
body[data-view="chat"] #sheet .close{width:31px!important;height:31px!important;top:10px!important;right:10px!important;font-size:19px!important}
body[data-view="chat"] #sheet h2{margin:5px 38px 7px 0!important;font-size:17px!important;line-height:1.22!important}
body[data-view="chat"] #sheet :is(.sheet-persona,.sheet-desc){margin:0 0 7px!important;padding:8px 10px!important;border-radius:12px!important;font-size:10.5px!important;line-height:1.42!important}
body[data-view="chat"] #sheet .sheet-actions{display:grid!important;grid-template-columns:1fr auto!important;gap:6px!important;margin:7px 0!important}
body[data-view="chat"] #sheet :is(.sheet-ask,.sheet-close-soft){min-height:34px!important;padding:0 11px!important;font-size:10px!important}
body[data-view="chat"] #sheet .sheet-list{display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:6px!important;margin-top:7px!important}
body[data-view="chat"] #sheet .sheet-item{min-height:36px!important;padding:8px 9px!important;border-radius:11px!important;font-size:10px!important;line-height:1.3!important}

/* Information cards: text first, fewer decorative pixels. */
body[data-view="chat"] :is(.bubble,.card,.r9-card,.r96-card){border-radius:14px!important;box-shadow:none!important}
body[data-view="chat"] .feed :is(.card,.r9-card,.r96-card){padding:10px!important;margin-block:6px!important}
body[data-view="chat"] .feed :is(.card,.r9-card,.r96-card) :is(h2,h3,h4){margin-block:0 5px!important;font-size:12px!important;line-height:1.3!important}
body[data-view="chat"] .feed :is(.card,.r9-card,.r96-card) p{margin-block:3px 6px!important;font-size:10px!important;line-height:1.42!important}
body[data-view="chat"] .feed button{min-height:27px!important;padding:4px 8px!important;border-radius:999px!important;font-size:9px!important}

/* The personified presence stays visible, but no longer hides the answer. */
body[data-view="chat"] [id^="imoPresenceLayer"]::before{background:rgba(0,8,3,.10)!important;backdrop-filter:blur(.7px)!important}
body[data-view="chat"] [class^="imo-presence-card-"]{left:50%!important;top:42%!important;min-width:132px!important;width:146px!important;padding:8px!important;gap:4px!important;border-radius:18px!important;background:rgba(2,20,8,.68)!important;box-shadow:0 14px 38px rgba(0,0,0,.26)!important}
body[data-view="chat"] [class^="imo-presence-media-"]{width:94px!important;height:94px!important}
body[data-view="chat"] [class^="imo-presence-text-"]{max-width:132px!important;padding:5px 7px!important;font-size:9.5px!important;line-height:1.3!important;white-space:normal!important}

/* 0704q is the active presence bundle. Match its high-specificity rules exactly. */
html.imo-real-tour-0704q body[data-view="chat"].imo-presence-think-0704q #imoPresenceLayer0704q::before,
html.imo-real-tour-0704q body[data-view="chat"].imo-presence-speak-0704q #imoPresenceLayer0704q::before{background:rgba(0,8,3,.08)!important;backdrop-filter:blur(.45px)!important}
html.imo-real-tour-0704q body[data-view="chat"].imo-presence-think-0704q #imoPresenceLayer0704q .imo-presence-card-0704q,
html.imo-real-tour-0704q body[data-view="chat"].imo-presence-speak-0704q #imoPresenceLayer0704q .imo-presence-card-0704q{left:50%!important;top:41%!important;bottom:auto!important;width:138px!important;min-width:0!important;padding:7px!important;gap:3px!important;border-radius:17px!important;transform:translate(-50%,-50%) scale(1)!important;background:rgba(2,20,8,.64)!important;box-shadow:0 12px 32px rgba(0,0,0,.22)!important}
html.imo-real-tour-0704q body[data-view="chat"] #imoPresenceLayer0704q .imo-presence-media-0704q{width:88px!important;height:88px!important}
html.imo-real-tour-0704q body[data-view="chat"] #imoPresenceLayer0704q .imo-presence-text-0704q{max-width:124px!important;padding:4px 6px!important;font-size:9px!important;line-height:1.28!important;white-space:normal!important}

@media(max-width:380px){
  body[data-view="chat"] #sheet .sheet-list{grid-template-columns:1fr!important}
  body[data-view="chat"] [class^="imo-presence-card-"]{width:132px!important;min-width:120px!important}
  body[data-view="chat"] [class^="imo-presence-media-"]{width:82px!important;height:82px!important}
}

/* V9.2 mobile header: both actions remain on one compact row. */
@media(max-width:520px){
  body[data-view="chat"] .topbar{grid-template-columns:34px minmax(0,1fr) 68px!important;min-height:58px!important;padding:7px 7px 5px!important;column-gap:5px!important}
  body[data-view="chat"] .topbar>.menu-btn{width:32px!important;height:32px!important;min-width:32px!important;min-height:32px!important;font-size:15px!important}
  body[data-view="chat"] .top-title{min-width:0!important;padding-right:0!important;overflow:hidden!important}
  body[data-view="chat"] .top-title :is(h1,h2,strong){font-size:12px!important;line-height:1.12!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
  body[data-view="chat"] .top-title :is(p,small){font-size:8px!important;line-height:1.15!important;white-space:nowrap!important}
  body[data-view="chat"] .top-actions{position:absolute!important;z-index:80!important;right:7px!important;top:8px!important;width:auto!important;display:flex!important;flex-direction:row!important;align-items:center!important;gap:4px!important}
  body[data-view="chat"] .top-actions button,
  body[data-view="chat"] .top-actions :is(.sound-btn,.camera-btn,.icon-round){width:31px!important;height:31px!important;min-width:31px!important;min-height:31px!important;padding:0!important;border-radius:50%!important;font-size:13px!important;line-height:31px!important}
}
