/* Buchee: compact mobile header and messages action menu */
@media(max-width:740px){
 html[data-pati-view="home"] #app-root:not(.hidden)>.mobile-header{grid-template-columns:38px minmax(0,1fr) 110px!important;column-gap:3px!important;height:calc(66px + env(safe-area-inset-top,0px))!important;min-height:calc(66px + env(safe-area-inset-top,0px))!important}
 html[data-pati-view="home"] #app-root>.mobile-header>#pati-feed-menu-trigger{transform:translateY(4px)!important}
 html[data-pati-view="home"] #pati-feed-menu-trigger .brand-word{gap:3px!important}
 html[data-pati-view="home"] #pati-feed-menu-trigger .buchee-feed-wordmark{max-height:24px!important;width:auto!important;flex:1 1 auto!important}
 html[data-pati-view="home"] #pati-feed-menu-trigger .pati-origin-flag{display:none!important}
 html[data-pati-view="home"] #pati-feed-menu-trigger .buchee-feed-chevron{flex:0 0 13px;display:inline-flex;align-items:center;color:#5a5268}
 html[data-pati-view="home"] #app-root>.mobile-header>.pati-header-actions{width:110px!important;min-width:110px!important;max-width:110px!important}
 html[data-pati-view="home"] #app-root>.mobile-header>.pati-header-actions>#pati-header-coins{flex:0 0 67px!important;width:67px!important;max-width:67px!important;min-width:67px!important;height:43px!important;display:flex!important;flex-direction:column!important;gap:0!important;border-radius:12px!important;background:#f7f4fb!important;color:#362052!important}
 html[data-pati-view="home"] #app-root>.mobile-header #pati-header-coins .pati-balance-title{display:block!important;font-size:9px!important;line-height:13px!important;font-weight:600!important}
 html[data-pati-view="home"] #app-root>.mobile-header #pati-header-coins strong{display:block!important;font-size:13px!important;line-height:17px!important;font-weight:800!important;white-space:nowrap!important}
 html[data-pati-view="home"] #app-root>.mobile-header>.pati-header-actions>#pati-header-notifications{flex:0 0 40px!important;width:40px!important;max-width:40px!important;min-width:40px!important}
}
.pati-dm-top-actions.buchee-chat-actions{position:relative;display:flex;align-items:center;gap:8px}
.buchee-chat-actions .buchee-chat-menu-button{display:inline-flex;align-items:center;justify-content:center;width:42px;height:42px;border-radius:12px;background:#f4f0fa;border:1px solid #eee6f5;color:#392052;font-size:24px;cursor:pointer}
.buchee-chat-actions .buchee-chat-popover{position:absolute;top:calc(100% + 7px);right:0;z-index:300;min-width:184px;border:1px solid #eee8f3;border-radius:15px;padding:5px;background:#fff;box-shadow:0 12px 34px #22102b22}
.buchee-chat-actions .buchee-chat-popover[hidden]{display:none!important}
.buchee-chat-actions .buchee-chat-popover button{display:block;width:100%;border:0;background:transparent;padding:12px;border-radius:10px;text-align:left;color:#25202a;font-size:14px;font-weight:650;cursor:pointer}
.buchee-chat-actions .buchee-chat-popover button:hover{background:#f7f4fb}
@media(max-width:740px){.pati-dm-top-actions.buchee-chat-actions>span{font-size:11px;white-space:nowrap}.pati-dm-top-actions.buchee-chat-actions .buchee-chat-menu-button{flex:0 0 42px}}

.buchee-chat-actions > .pati-dm-new{display:none!important}

/* Keep one feed switch indicator: the native indicator stays, not the injected second one. */
#pati-feed-menu-trigger .buchee-feed-chevron{display:none!important}
@media(max-width:740px){
 html[data-pati-view="home"] #app-root:not(.hidden)>.mobile-header{grid-template-columns:38px minmax(0,1fr) 112px!important;column-gap:7px!important;padding-left:5px!important;padding-right:5px!important}
 html[data-pati-view="home"] #app-root>.mobile-header>#pati-feed-menu-trigger{min-width:0!important;max-width:100%!important;overflow:hidden!important;transform:translateY(3px)!important}
 html[data-pati-view="home"] #pati-feed-menu-trigger .brand-word{min-width:0!important;max-width:100%!important;overflow:hidden!important}
 html[data-pati-view="home"] #pati-feed-menu-trigger .buchee-feed-wordmark{min-width:0!important;max-width:100%!important;width:100%!important;object-fit:contain!important}
 html[data-pati-view="home"] #app-root>.mobile-header>#pati-header-share{margin:0!important;flex:0 0 38px!important;width:38px!important;max-width:38px!important}
 html[data-pati-view="home"] #app-root>.mobile-header>.pati-header-actions{width:112px!important;max-width:112px!important;min-width:112px!important}
 html[data-pati-view="home"] #app-root>.mobile-header #pati-header-coins strong{display:block!important;visibility:visible!important;opacity:1!important}
}
.pati-dm-top-actions.buchee-chat-actions .buchee-chat-menu-button{display:none!important}
.buchee-search-actions{position:relative;display:flex;justify-content:flex-end;align-items:center;flex:0 0 44px;margin-left:8px}
.pati-dm-searchbar:has(+ .buchee-search-actions){width:calc(100% - 54px)!important;flex:1 1 auto;min-width:0}
.buchee-search-actions .buchee-chat-menu-button{display:flex;align-items:center;justify-content:center;width:43px;height:43px;border:1px solid #ece6f4;border-radius:12px;background:#f6f2fa;font-size:26px;color:#332442;font-weight:700;cursor:pointer}
.buchee-search-actions .buchee-chat-popover{position:absolute;right:0;top:calc(100% + 7px);z-index:3200;min-width:186px;background:#fff;border:1px solid #eee6f2;border-radius:14px;box-shadow:0 12px 30px #261b3330;padding:5px}
.buchee-search-actions .buchee-chat-popover[hidden]{display:none!important}
.buchee-search-actions .buchee-chat-popover button{display:block;width:100%;padding:12px;border:0;border-radius:9px;background:transparent;text-align:left;font-size:14px;font-weight:650;color:#24202a}

/* Final iPhone message layout: one search field with inline ellipsis. */
#main-content .pati-dm-top-actions > [data-action="dm-new"],
#main-content .pati-dm-top-actions > [data-action="pati-group-create-open"]{display:none!important;visibility:hidden!important}
#main-content .buchee-search-shell{position:relative!important;display:block!important;width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important;padding:0!important}
#main-content .buchee-search-shell .pati-dm-searchbar{box-sizing:border-box!important;width:100%!important;max-width:100%!important;min-width:0!important;margin:0!important;padding-right:64px!important;display:flex!important}
#main-content .buchee-search-shell .pati-dm-searchbar input{min-width:0!important;width:100%!important;padding-right:0!important}
#main-content .buchee-search-shell .buchee-search-actions{position:absolute!important;top:50%!important;right:9px!important;transform:translateY(-50%)!important;width:42px!important;height:42px!important;margin:0!important;padding:0!important;display:flex!important;align-items:center!important;justify-content:center!important;z-index:20!important}
#main-content .buchee-search-shell .buchee-chat-menu-button{width:40px!important;height:40px!important;min-width:40px!important;max-width:40px!important;min-height:40px!important;padding:0!important;border:0!important;border-radius:11px!important;background:#ebe8f2!important;color:#2b2136!important;line-height:1!important}
#main-content .buchee-search-shell .buchee-chat-popover{position:absolute!important;right:0!important;top:calc(100% + 8px)!important;min-width:180px!important;transform:none!important}
#main-content .buchee-search-shell .buchee-chat-popover[hidden]{display:none!important}
@media(max-width:740px){#main-content .pati-dm-top-actions.buchee-chat-actions{min-height:0!important;height:auto!important}#main-content .pati-dm-top-actions.buchee-chat-actions > [data-action]{display:none!important}}

/* Buchee feed header v4 — icon directly after flag, numeric balance in the upper-right. */
@media(max-width:740px){
 html[data-pati-view="home"] #app-root:not(.hidden)>.mobile-header{grid-template-columns:38px minmax(0,1fr) 119px!important;column-gap:5px!important;padding-left:5px!important;padding-right:5px!important}
 html[data-pati-view="home"] #app-root>.mobile-header>#pati-feed-menu-trigger{position:relative!important;display:flex!important;align-items:center!important;min-width:0!important;width:100%!important;overflow:visible!important;padding:0!important}
 html[data-pati-view="home"] #pati-feed-menu-trigger>div{width:100%!important;min-width:0!important}
 html[data-pati-view="home"] #pati-feed-menu-trigger .brand-word{display:flex!important;align-items:center!important;gap:3px!important;min-width:0!important;width:100%!important;overflow:visible!important;white-space:nowrap!important}
 html[data-pati-view="home"] #pati-feed-menu-trigger .buchee-feed-wordmark{flex:0 1 auto!important;min-width:0!important;width:auto!important;max-width:calc(100% - 47px)!important;height:23px!important;max-height:23px!important;object-fit:contain!important;object-position:left center!important}
 html[data-pati-view="home"] #pati-feed-menu-trigger .pati-origin-flag{display:inline-flex!important;visibility:visible!important;position:static!important;flex:0 0 18px!important;width:18px!important;margin:0!important;font-size:12px!important;line-height:1!important}
 html[data-pati-view="home"] #pati-feed-menu-trigger .buchee-inline-chevron{position:static!important;flex:0 0 21px!important;display:inline-flex!important;align-items:center!important;justify-content:center!important;width:21px!important;height:25px!important;margin-left:2px!important;color:#17191d!important}
 html[data-pati-view="home"] #pati-feed-menu-trigger .buchee-inline-chevron svg{width:21px!important;height:21px!important;stroke:currentColor!important}
 html[data-pati-view="home"] #pati-feed-menu-trigger::before,
 html[data-pati-view="home"] #pati-feed-menu-trigger::after,
 html[data-pati-view="home"] #pati-feed-menu-trigger>div::after,
 html[data-pati-view="home"] #pati-feed-menu-trigger .brand-word::after{content:none!important;display:none!important}
 html[data-pati-view="home"] #app-root>.mobile-header>.pati-header-actions{width:119px!important;max-width:119px!important;min-width:119px!important;gap:2px!important}
 html[data-pati-view="home"] #app-root>.mobile-header>.pati-header-actions>#pati-header-coins{flex:0 0 75px!important;width:75px!important;min-width:75px!important;max-width:75px!important;display:flex!important;align-items:center!important;justify-content:center!important;flex-direction:column!important;height:45px!important;padding:3px!important;border-radius:13px!important;overflow:hidden!important}
 html[data-pati-view="home"] #app-root>.mobile-header #pati-header-coins>span:not(.pati-balance-title){display:none!important}
 html[data-pati-view="home"] #app-root>.mobile-header #pati-header-coins .pati-balance-title{display:block!important;visibility:visible!important;font-size:10px!important;line-height:15px!important}
 html[data-pati-view="home"] #app-root>.mobile-header #pati-header-coins strong{display:block!important;position:static!important;visibility:visible!important;opacity:1!important;font-size:13px!important;line-height:17px!important;max-width:100%!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important}
 html[data-pati-view="home"] #app-root>.mobile-header>.pati-header-actions>#pati-header-notifications{flex:0 0 40px!important;width:40px!important;max-width:40px!important;min-width:40px!important}
}
