/* R3: phone is the base layout; wide windows progressively add the side panels.
   Scoped IDs also take precedence over the original application's global styles. */
html[data-imo-black] {
  min-width:0!important; width:100%!important; max-width:100%!important;
  overflow:hidden!important; --bp-text:#f3f5fa; --bp-muted:#b0b8c8;
}
html[data-imo-black] body {max-width:100%!important;min-height:0!important;inset:auto!important}
html[data-imo-black] body>.bp-top {display:none!important}
html[data-imo-black] body #bpLayout {
  display:block!important;grid-template-columns:minmax(0,1fr)!important;
  width:100%!important;max-width:1510px!important;min-width:0!important;
  height:var(--bp-height)!important;min-height:0!important;
  margin:0 auto!important;gap:0!important;
  padding:env(safe-area-inset-top,0px) env(safe-area-inset-right,0px) 0 env(safe-area-inset-left,0px)!important;
  overflow:hidden!important;place-items:stretch!important;
}
html[data-imo-black] body #bpLayout>.bp-side {display:none!important}
html[data-imo-black] body #bpLayout>#app {min-width:0!important;max-width:100%!important;overflow:hidden!important}
html[data-imo-black] body #bpLayout #app .phone {
  grid-template-columns:72px minmax(0,1fr)!important;
  grid-template-rows:66px minmax(0,1fr) auto auto!important;
  border-radius:0!important;border:0!important;
}
html[data-imo-black] body #app .topbar {height:66px!important;padding:10px 14px!important;min-width:0!important}
html[data-imo-black] .bp-chat-heading {min-width:0!important;gap:10px!important}
html[data-imo-black] .bp-heading-text small {font-size:12px!important;line-height:1.4!important}
html[data-imo-black] .bp-mobile-menu {display:grid!important;width:44px!important;height:44px!important;flex-shrink:0!important}
html[data-imo-black] .bp-heading-sound {display:none!important}
html[data-imo-black] body #app #chat {min-width:0!important;max-width:100%!important}
html[data-imo-black] body #app #feed {padding:18px 14px!important;min-width:0!important;scroll-padding-bottom:18px!important}
html[data-imo-black] body #app #composer {
  margin:7px 10px!important;width:calc(100% - 20px)!important;
  grid-template-columns:40px minmax(0,1fr) 44px!important;gap:4px!important;
  min-height:60px!important;padding:6px!important;border-radius:20px!important;
}
html[data-imo-black] body #app #composer .send,
html[data-imo-black] body #app #composer .plus {min-width:40px!important;min-height:44px!important}
html[data-imo-black] body #app #rightRail {
  padding:10px 4px!important;gap:7px!important;background:linear-gradient(180deg,#141921,#0d1017)!important;
  scroll-padding-block:10px!important;
}
html[data-imo-black] body #app #rightRail>button {
  padding:6px 2px!important;min-height:74px!important;gap:5px!important;
  border-color:transparent!important;background:transparent!important;border-radius:16px!important;
}
html[data-imo-black] body #app #rightRail .nav-label {font-size:12px!important;line-height:1.3!important;font-weight:500!important}
html[data-imo-black] body #app #rightRail .nav-icon,
html[data-imo-black] body #app #bottomNav>button>span {
  display:grid!important;place-items:center!important;width:34px!important;height:34px!important;
  flex:0 0 auto!important;border-radius:11px!important;
  border:1px solid #adbadb3b!important;
  background:linear-gradient(145deg,#3b4353,#1d2330 60%,#111620)!important;
  color:#e0e7f5!important;box-shadow:inset 0 1px 0 #f3f6ff2e,0 3px 8px #0004!important;
  font-size:0!important;
}
html[data-imo-black] body #app #rightRail svg,
html[data-imo-black] body #app #bottomNav>button svg {
  display:block!important;width:23px!important;height:23px!important;
  fill:none!important;stroke:currentColor!important;stroke-width:1.65!important;
  stroke-linecap:round!important;stroke-linejoin:round!important;
}
html[data-imo-black] body #app #rightRail>button.active,
html[data-imo-black] body #app #bottomNav>button.active,
html[data-imo-black] body #app #bottomNav>button.recent {
  background:#91b4ff14!important;color:#e8f0ff!important;border-color:#aac5ff38!important;
}
html[data-imo-black] body #app #rightRail>button.active .nav-icon,
html[data-imo-black] body #app #bottomNav>button.active>span {
  background:linear-gradient(145deg,#52678d,#273853)!important;border-color:#aecbff9c!important;
}
html[data-imo-black] body #app .bp-action-dock {
  height:auto!important;min-height:88px!important;
  grid-template-columns:24px minmax(0,1fr) 24px!important;
  padding:5px 4px calc(5px + env(safe-area-inset-bottom,0px))!important;gap:2px!important;
  background:linear-gradient(180deg,#151a25,#0d1119)!important;
}
html[data-imo-black] body #app #bottomNav {height:auto!important;min-height:78px!important;padding:1px 0 4px!important;gap:4px!important}
html[data-imo-black] body #app #bottomNav>button {
  flex:0 0 82px!important;width:82px!important;min-width:82px!important;
  height:auto!important;min-height:72px!important;padding:4px 3px!important;gap:4px!important;
  border-radius:15px!important;background:transparent!important;border-color:transparent!important;
}
html[data-imo-black] body #app #bottomNav>button>b {font-size:12px!important;line-height:1.25!important;font-weight:500!important}
html[data-imo-black] body #app .bp-dock-arrow {width:24px!important;min-height:44px!important;background:transparent!important}
html[data-imo-black] body #app #bottomNav [data-life-command="sos_help"]>span {color:#ffd5dc!important;border-color:#ff9daf55!important}
html[data-imo-black] body #app .bp-character-button {
  display:grid!important;place-items:center!important;flex:0 0 44px!important;
  width:44px!important;height:44px!important;min-height:44px!important;padding:0!important;
  border:1px solid #b5c7ee66!important;border-radius:15px!important;overflow:hidden!important;
  background:#e8eaf0!important;cursor:pointer!important;
}
html[data-imo-black] body #app .bp-character-button .bp-avatar {
  display:block!important;width:100%!important;height:100%!important;
  margin:0!important;border:0!important;border-radius:0!important;object-fit:cover!important;
}
html[data-imo-black] body #app #feed #bpWelcome {padding:2px 0 10px!important;max-width:520px!important;margin:0 auto!important}
html[data-imo-black] body #app #feed .bp-hello-row {display:flex!important;align-items:center!important;gap:12px!important;margin:0 0 16px!important}
html[data-imo-black] body #app #feed .bp-hello-row>div {min-width:0!important}
html[data-imo-black] body #app #feed .bp-hello-character {
  display:block!important;width:64px!important;height:76px!important;min-height:76px!important;
  flex:0 0 64px!important;padding:0!important;overflow:hidden!important;border:1px solid #a8bfef80!important;
  border-radius:22px!important;background:#e8eaf0!important;
  box-shadow:0 8px 28px #527cd82b,inset 0 1px 0 #fff6!important;
  cursor:pointer!important;animation:bp-hello-enter .6s ease-out both;
}
html[data-imo-black] body #app #feed .bp-hello-character img {
  display:block!important;width:100%!important;height:100%!important;object-fit:cover!important;
  animation:bp-hello-nod .7s .15s ease-in-out both;
}
html[data-imo-black] body #app #feed .bp-hello-label {display:block!important;font-size:14px!important;line-height:1.4!important;color:#c1cbe0!important;margin:0 0 6px!important}
html[data-imo-black] body #app #feed #bpWelcome h2 {font-size:24px!important;line-height:1.12!important;margin:0!important;letter-spacing:-.04em!important}
html[data-imo-black] body #app #feed #bpWelcome>p {font-size:16px!important;line-height:1.5!important;margin:0 0 18px!important;color:#b4bfd4!important}
html[data-imo-black] body #app #feed .bp-suggestions {grid-template-columns:minmax(0,1fr)!important;gap:8px!important}
html[data-imo-black] body #app #feed .bp-suggestion {
  align-items:center!important;min-height:48px!important;padding:10px!important;font-size:14px!important;gap:10px!important;
  border-radius:14px!important;background:linear-gradient(130deg,#262d3f88,#14192388)!important;
}
html[data-imo-black] .bp-menu-language {display:flex;align-items:center;justify-content:space-between;gap:12px;margin:0 0 20px;font-size:16px}
html[data-imo-black] .bp-menu-language select {min-height:44px;font-size:16px}
html[data-imo-black] .bp-dialog .bp-tool {min-height:48px}
html[data-imo-black] .bp-dialog-body {scrollbar-width:thin}
html[data-imo-black] .bp-toast {bottom:calc(180px + env(safe-area-inset-bottom,0px));font-size:14px}
@keyframes bp-hello-enter {from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
@keyframes bp-hello-nod {0%,100%{transform:rotate(0)}40%{transform:rotate(-4deg)}70%{transform:rotate(3deg)}}
@media(min-width:420px){
  html[data-imo-black] body #app #feed .bp-suggestions {grid-template-columns:repeat(2,minmax(0,1fr))!important}
  html[data-imo-black] body #app #feed .bp-suggestion {min-height:72px!important;align-items:flex-start!important}
}
@media(min-width:900px){
  html[data-imo-black] body>.bp-top {display:flex!important;height:70px!important}
  html[data-imo-black] body #bpLayout {display:grid!important;grid-template-columns:220px minmax(0,1fr)!important;height:calc(var(--bp-height) - 70px)!important;padding:0 20px 18px!important;gap:20px!important}
  html[data-imo-black] body #bpLayout>.bp-left {display:block!important}
  html[data-imo-black] body #bpLayout #app .phone {grid-template-columns:82px minmax(0,1fr)!important;border:1px solid #7c8caa66!important;border-radius:26px!important}
  html[data-imo-black] .bp-mobile-menu {display:none!important}
  html[data-imo-black] .bp-heading-sound {display:grid!important}
  html[data-imo-black] body #app #feed {padding:28px 24px!important}
  html[data-imo-black] body #app #feed #bpWelcome {padding:24px 0!important}
  html[data-imo-black] body #app #feed #bpWelcome h2 {font-size:32px!important}
  html[data-imo-black] body #app #feed .bp-hello-character {width:88px!important;height:104px!important;flex-basis:88px!important;border-radius:28px!important}
  html[data-imo-black] body #app #feed .bp-hello-label {font-size:16px!important}
  html[data-imo-black] body #app #feed .bp-hello-row {gap:18px!important;margin-bottom:20px!important}
}
@media(min-width:1200px){
  html[data-imo-black] body #bpLayout {grid-template-columns:minmax(220px,260px) minmax(0,1fr) minmax(200px,246px)!important}
  html[data-imo-black] body #bpLayout>.bp-right {display:block!important}
}
@media(max-height:500px){
  html[data-imo-black] body #bpLayout #app .phone {grid-template-rows:54px minmax(0,1fr) auto auto!important}
  html[data-imo-black] body #app .topbar {height:54px!important;padding-block:5px!important}
  html[data-imo-black] body #app #feed .bp-hello-character {width:44px!important;height:52px!important;min-height:52px!important;flex-basis:44px!important;border-radius:16px!important}
  html[data-imo-black] body #app #feed .bp-hello-row {margin-bottom:10px!important}
  html[data-imo-black] body #app #feed #bpWelcome {padding-top:0!important}
}
@media(prefers-reduced-motion:reduce){
  html[data-imo-black] body #app #feed .bp-hello-character,
  html[data-imo-black] body #app #feed .bp-hello-character img {animation:none!important}
}
