/* Mobile-first messaging surface. Intentionally scoped away from farm screens. */
#friendsView{--friend-ink:#192c27;--friend-muted:#62716b;--friend-accent:#237852;--friend-soft:#edf5ef;--friend-line:#e9eeeb;--friend-surface:#fff;position:fixed;inset:0;top:var(--friends-top,0px);height:var(--friends-height,100dvh);z-index:45;margin:0;padding:0 0 calc(78px + env(safe-area-inset-bottom));background:#fff;box-sizing:border-box;overflow:hidden;color:var(--friend-ink);font-family:-apple-system,BlinkMacSystemFont,"PingFang SC","Microsoft YaHei",sans-serif;font-size:16px;line-height:1.5;text-align:left}
#friendsView *{box-sizing:border-box}#friendsView [hidden]{display:none!important}#friendsView .friends-shell{max-width:720px;height:100%;margin:auto;display:flex;flex-direction:column;background:var(--friend-surface);padding-top:env(safe-area-inset-top)}
#friendsView :is(h1,h2,h3,p){letter-spacing:normal}#friendsView h1{font-size:22px;line-height:1.4;font-weight:700;margin:0;color:var(--friend-ink)}#friendsView h2{font-size:19px;line-height:1.5;margin:0 0 12px;font-weight:650;color:var(--friend-ink)}#friendsView h3{font-size:16px;color:var(--friend-ink)}
#friendsView button{font:inherit;font-size:14px;font-weight:550;line-height:1.4;min-height:44px;min-width:44px;padding:10px 16px;display:inline-flex;align-items:center;justify-content:center;gap:8px;border:1px solid var(--friend-line);border-radius:12px;background:#f6f8f7;color:var(--friend-ink);box-shadow:none;cursor:pointer;transition:background-color 120ms,opacity 120ms;text-shadow:none;white-space:normal}
#friendsView button:active{background:#e3ece7}#friendsView button:disabled{opacity:.5;cursor:not-allowed}#friendsView .friend-primary,#friendsView .friend-primary-icon,#friendsView .friend-send-button{background:var(--friend-accent);border-color:var(--friend-accent);color:white}#friendsView .friend-primary:active{background:#185c3e}#friendsView :is(button,input,textarea):focus-visible{outline:3px solid #69ab89;outline-offset:3px}
#friendsView svg{width:22px;height:22px;flex-shrink:0;stroke-width:1.8}#friendsView .friend-icon-button{padding:10px;background:transparent;border:0;border-radius:50%}
#friendsDirectory{display:flex;flex-direction:column;min-height:0;height:100%}#friendsView .friends-heading{display:flex;align-items:center;gap:12px;padding:20px 20px 14px;flex-shrink:0}#friendsView .friends-heading>div{flex:1}#friendsView .friend-self{width:44px;height:44px;border:0;border-radius:50%;padding:10px;color:var(--friend-accent);background:var(--friend-soft)}#friendsView .friend-primary-icon{width:44px;height:44px;padding:10px;border-radius:50%}#friendsConnection{display:block;font-size:12px;color:var(--friend-muted);margin-top:1px}
#friendsView input:not([type=checkbox]):not([type=file]),#friendsView textarea{font:inherit;font-size:16px;color:var(--friend-ink);background:white;border:1px solid #dce5df;border-radius:12px;padding:12px;min-width:0;width:100%;min-height:46px;box-shadow:none;margin:0}#friendsView input::placeholder,#friendsView textarea::placeholder{color:#78837e}
#friendsView .friends-filter{display:flex;align-items:center;gap:8px;background:#f3f5f4;margin:0 20px 12px;border-radius:13px;padding:0 12px;color:var(--friend-muted);flex-shrink:0}#friendsView .friends-filter input{background:transparent;border:0;padding:11px 0;outline-offset:0;font-size:16px;min-height:44px}
#friendsView .friends-filter{flex-direction:row}#friendsView .friends-filter #friendsFilter{background:transparent;border:0;padding:11px 0;min-height:44px}
#friendsView .friends-tabs{display:flex;gap:28px;padding:0 20px;border-bottom:1px solid var(--friend-line);flex-shrink:0}#friendsView .friends-tabs button{position:relative;background:none;border:0;border-radius:0;padding:10px 0 14px;font-size:16px;color:var(--friend-muted);gap:6px}#friendsView .friends-tabs button[aria-pressed=true]{color:var(--friend-accent);font-weight:700;border-bottom:3px solid var(--friend-accent);padding-bottom:11px}
#friendsView .friends-page-scroll{overflow:auto;min-height:0;flex:1;overscroll-behavior:contain;padding-bottom:20px}#friendsView .friends-list-label{font-size:12px;color:var(--friend-muted);font-weight:500;padding:18px 20px 6px;letter-spacing:.4px}
#friendsView .friend-row{display:flex;align-items:center;gap:12px;min-height:80px;padding:14px 20px;border:0;border-bottom:1px solid var(--friend-line);border-radius:0;background:transparent;width:100%;text-align:left;justify-content:flex-start}#friendsView .friend-conversation:active{background:#f1f6f3}#friendsView .friend-conversation:disabled{opacity:.7}#friendsView .friend-avatar{width:48px;height:48px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:#eaf3ed;color:#367154;flex-shrink:0}#friendsView .friend-avatar.is-group{background:#eef0f9;color:#656ea5}#friendsView .friend-avatar svg{width:23px;height:23px}
#friendsView .friend-info{flex:1;min-width:0}#friendsView .friend-info strong{display:block;font-size:16px;line-height:1.45;font-weight:600;color:var(--friend-ink);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#friendsView .friend-info small{display:block;font-size:13px;color:var(--friend-muted);font-weight:400;margin-top:4px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}#friendsView .friend-meta{display:flex;flex-direction:column;align-items:flex-end;gap:8px;align-self:stretch;justify-content:center;flex-shrink:0}#friendsView .friend-meta time{font-size:11px;font-weight:400;color:var(--friend-muted)}
.friend-unread,.friends-badge,#friendsMessagesCount,#friendsRequestsCount{background:#c82f46;color:#fff;border-radius:99px;font-size:11px;font-weight:650;padding:2px 6px;min-width:18px;text-align:center;line-height:1.3}.farm-bottom-nav>[data-go=friendsView]{position:relative;grid-column:4;grid-row:1}.friends-badge{position:absolute;top:4px;left:58%}.friends-badge[hidden]{display:none!important}
#friendsView .friends-request-link{display:flex;width:calc(100% - 40px);gap:12px;margin:14px 20px 0;padding:12px;background:#f3f7f4;border:0;justify-content:flex-start;text-align:left}#friendsView .friends-request-link>span:nth-child(2){flex:1;font-size:14px}#friendsView .friends-request-link small{display:block;font-size:12px;font-weight:400;color:var(--friend-muted);margin-top:3px}#friendsView .friend-entry-icon{color:var(--friend-accent);display:inline-flex}#friendsView .friends-request-link>svg{width:16px}
#friendsView .friends-quick-actions{display:flex;flex-wrap:wrap;gap:10px;margin:16px 20px}#friendsView .friends-quick-actions button{flex:1}#friendsView .friends-empty{display:flex;align-items:center;flex-direction:column;text-align:center;padding:64px 24px 36px;color:var(--friend-muted)}#friendsView .friends-empty h2{margin:20px 0 8px;font-size:18px}#friendsView .friends-empty p{font-size:14px;line-height:1.7;margin:0 0 24px;max-width:280px}#friendsView .friends-empty-icon{display:inline-flex;justify-content:center;align-items:center;background:var(--friend-soft);color:#438364;border-radius:24px;width:76px;height:76px}#friendsView .friends-empty-icon svg{width:32px;height:32px}
#friendsView .friends-nearby-intro{padding:32px 24px 8px;text-align:center}#friendsView .friends-nearby-intro h2{margin-top:18px}#friendsView .friends-nearby-intro p{font-size:14px;line-height:1.8;color:var(--friend-muted)}#friendsView .friends-nearby-intro .friends-quick-actions{margin:20px 0}
#friendsView .friends-muted{font-size:13px;color:var(--friend-muted);line-height:1.8}#friendsView #friendsError,#friendsDialogFeedback{flex:none;margin:0;padding:10px 20px;color:#a1352d;background:#fff1ee;font-size:14px;white-space:pre-wrap;overflow-wrap:anywhere;max-height:110px;overflow:auto}
#friendsChat{display:flex;flex:1;flex-direction:column;min-height:0}#friendsView .friends-chat-head{display:flex;align-items:center;gap:8px;border-bottom:1px solid var(--friend-line);padding:12px 12px;flex-shrink:0}#friendsView .friends-chat-head .friend-avatar{width:38px;height:38px}#friendsView .friend-chat-person{flex:1;min-width:0}#friendsView .friend-chat-person strong{display:block;font-size:16px;white-space:nowrap;text-overflow:ellipsis;overflow:hidden}#friendsView .friend-chat-person small{font-size:12px;color:var(--friend-muted);display:block;margin-top:1px}#friendsView #friendsOlder{align-self:center;border:0;background:transparent;color:var(--friend-accent);font-size:12px;min-height:36px}
#friendsMessages{flex:1;min-height:0;overflow:auto;padding:8px 20px 24px;background:#fff;overscroll-behavior:contain}#friendsView .friend-day{text-align:center;font-size:11px;color:var(--friend-muted);margin:16px 0 22px}#friendsView .friend-message{display:flex;flex-direction:column;align-items:flex-start;gap:5px;margin:0 0 20px}#friendsView .friend-message.mine{align-items:flex-end}#friendsView .friend-message .bubble{max-width:84%;padding:11px 15px;background:#f0f2f1;color:var(--friend-ink);border-radius:18px 18px 18px 5px;white-space:pre-wrap;overflow-wrap:anywhere;font-size:16px;line-height:1.6}#friendsView .friend-message.mine .bubble{background:#e4f1e8;border-radius:18px 18px 5px 18px}#friendsView .friend-message time{font-size:11px;color:var(--friend-muted);padding:0 3px}#friendsView .friend-message-author{color:var(--friend-muted);font-size:12px;padding-left:4px}#friendsView .friend-message img{display:block;max-width:min(240px,100%);max-height:300px;object-fit:contain;border-radius:12px}
#friendsSendForm{display:flex;align-items:flex-end;gap:8px;padding:12px 12px max(12px,env(safe-area-inset-bottom));border-top:1px solid var(--friend-line);background:#fff;flex-shrink:0}#friendsView #friendsText{resize:none;min-height:44px;max-height:112px;padding:11px 14px;border:0;background:#f3f5f4;border-radius:22px;line-height:22px}#friendsView .friends-image-button{display:inline-flex;justify-content:center;align-items:center;position:relative;overflow:hidden;width:44px;height:44px;min-width:44px;border-radius:50%;color:var(--friend-muted);cursor:pointer;margin:0}#friendsView .friends-image-button input{position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;height:100%}#friendsView .friends-image-button:focus-within{outline:3px solid #69ab89}#friendsView .friend-send-button{padding:10px;border-radius:50%;width:44px;height:44px}#friendsPending{flex:none;font-size:13px;color:#875124;background:#fff8e9;padding:0 16px}#friendsPending:empty{display:none}#friendsView #friendsPending button{font-size:12px;margin:0 8px 8px 0}
#friendsDialog{position:fixed;margin:auto;inset:0;width:min(480px,calc(100vw - 28px));max-height:calc(100dvh - 40px);padding:0 20px 24px;overflow:auto;border:1px solid var(--friend-line);border-radius:24px;color:var(--friend-ink);background:#fff;box-shadow:0 16px 64px #10261b26;font-family:inherit}#friendsDialog::backdrop{background:#192b2359;backdrop-filter:blur(3px)}#friendsView .friends-dialog-head{position:sticky;top:0;z-index:1;display:flex;align-items:center;gap:8px;padding:18px 0 12px;background:#fff}#friendsView .friends-dialog-head h2{flex:1;margin:0;font-size:18px}#friendsView #friendsDialogFeedback{border-radius:10px;margin-bottom:12px;padding:10px 12px}#friendsView #friendsDialog .friend-row{padding:14px 0;flex-wrap:wrap}#friendsView #friendsDialog .friend-row-actions{display:flex;gap:8px;margin-left:auto}#friendsView #friendsDialog .friends-quick-actions{margin:0 0 24px}
#friendsView .friends-profile-card{display:flex;flex-direction:column;align-items:center;gap:12px;padding:16px 0 24px}#friendsView .friends-profile-card>.friend-avatar{height:64px;width:64px}#friendsView .friends-profile-card strong{font-size:14px;overflow-wrap:anywhere;text-align:center}#friendsView #friendsProfileForm,#friendsView #friendsGroupForm{display:grid;gap:16px}#friendsView #friendsProfileForm label,#friendsView #friendsGroupNameLabel{display:grid;gap:8px;font-size:14px;color:var(--friend-ink)}#friendsView #friendsProfileForm .friends-check{display:flex;align-items:center;gap:10px;min-height:44px}#friendsView input[type=checkbox]{width:20px;height:20px;flex:none;accent-color:var(--friend-accent);margin:0}#friendsView #friendsProfileForm p{font-size:13px;line-height:1.7;color:var(--friend-muted);margin:0}
#friendsView .friends-search label{display:block;font-size:14px;margin-bottom:12px}#friendsView .friends-search>div{display:flex;gap:8px}#friendsView .friends-search button{flex:none}#friendsView .friends-group-choice{display:flex;align-items:center;gap:12px;min-height:64px;border-bottom:1px solid var(--friend-line);cursor:pointer}#friendsView .friends-group-choice .friend-avatar{width:36px;height:36px}#friendsView #friendsGroupChoices{max-height:35dvh;overflow:auto}#friendsView .friend-danger{color:#b33b39}#friendsView [data-friend-dialog=settings]>button{display:flex;width:100%;margin:12px 0}#friendsView #friendsGroupMembers{max-height:40dvh;overflow:auto}
.friends-notice{position:fixed;top:max(16px,env(safe-area-inset-top));left:50%;transform:translateX(-50%);z-index:300;width:min(90vw,440px);padding:16px;border:1px solid #d5e5da;border-radius:18px;box-shadow:0 10px 30px #132b2730;background:#fff;color:#204b34;text-align:left;font:500 14px/1.6 -apple-system,BlinkMacSystemFont,"PingFang SC",sans-serif;cursor:pointer}
body.friends-active{overflow:hidden}body.friends-active .farm-bottom-nav{min-height:74px;height:calc(74px + env(safe-area-inset-bottom));padding:5px 10px calc(5px + env(safe-area-inset-bottom));border-radius:0;box-shadow:none;width:100%;max-width:720px}body.friends-active .farm-bottom-nav button{min-width:0;min-height:52px;padding:0}body.friends-active .farm-bottom-nav .farm-nav-icon{width:40px;height:32px;font-size:22px}body.friends-active .farm-bottom-nav .farm-nav-icon svg{width:22px;height:22px}body.friends-active .farm-bottom-nav .farm-nav-label{font-size:12px;line-height:20px}body.friends-active .farm-bottom-nav #globalBackButton{width:auto;min-width:0;min-height:52px;margin:0;padding:0}body.friends-active #globalBackButton .farm-nav-icon{width:42px;height:42px}body.friends-active .farm-bottom-nav #globalBackButton .farm-nav-label{font-size:12px}
body.friends-chat-open #friendsView{padding-bottom:0;z-index:60}body.friends-chat-open .farm-bottom-nav{display:none!important}
body.friends-active #appHeader,body.friends-active #farmBottomDrawerToggle,body.friends-active #aiWelcomeBanner,body.friends-chat-open #aiAssistantToggle{display:none!important}
body.friends-active #aiAssistantToggle{width:44px!important;height:52px!important;right:10px!important;bottom:88px!important;left:auto!important;top:auto!important}
body.customer-session .farm-bottom-nav>[data-go=friendsView]{display:flex!important;grid-column:3;grid-row:1}body.customer-session .farm-bottom-nav:has([data-go=friendsView]){display:grid!important;grid-template-columns:repeat(3,1fr)!important}body.customer-session .farm-bottom-nav>#globalBackButton{grid-column:2;grid-row:1}body.customer-session.friends-chat-open .farm-bottom-nav{display:none!important}
body.customer-session.customer-navigation-root #matingView{padding-bottom:100px!important}body.customer-session.customer-navigation-root .farm-bottom-nav>#globalBackButton{position:relative;width:76px;min-width:76px;min-height:62px;margin:0 auto;padding:3px 4px 2px;border:0;border-radius:16px;background:transparent;box-shadow:none}body.customer-session.customer-navigation-root #globalBackButton .farm-nav-label{color:#438665}
@media(min-width:721px){#friendsView{background:#f3f6f4}#friendsView .friends-shell{border-left:1px solid var(--friend-line);border-right:1px solid var(--friend-line)}}
#friendsView .friends-group-choice,#friendsView #friendsProfileForm .friends-check{flex-direction:row;text-align:left;justify-content:flex-start}
@media(max-width:480px){#friendsDialog{inset:auto 0 0;margin:0;width:100%;max-width:100%;max-height:calc(100dvh - 30px);border-radius:24px 24px 0 0;padding-bottom:max(24px,env(safe-area-inset-bottom))}#friendsView .friends-heading{padding-top:16px}#friendsView .friends-empty{padding-top:52px}}
@media(prefers-reduced-motion:reduce){#friendsView *{transition:none!important;animation:none!important}}
#friendsView .friend-avatar img{width:100%;height:100%;border-radius:50%;object-fit:cover;display:block}
#friendsView .friend-self.has-avatar{padding:0;overflow:hidden}
#friendsView .friend-self img{width:100%;height:100%;object-fit:cover;border-radius:50%;display:block}
#friendsView .friends-avatar-choose{display:flex;flex-direction:column;align-items:center;gap:10px;border:0;background:transparent;color:var(--friend-accent);font-size:13px;padding:4px 16px;cursor:pointer}
#friendsView .friends-avatar-choose:focus-visible{outline:2px solid var(--friend-accent);outline-offset:4px}
#friendsView .friends-avatar-choose:active{opacity:.75}
#friendsView .friends-avatar-image{position:relative;display:block}
#friendsView #friendsProfileAvatar{width:72px;height:72px}
#friendsView .friends-avatar-camera{position:absolute;right:-2px;bottom:0;display:flex;align-items:center;justify-content:center;width:26px;height:26px;border:2px solid white;border-radius:50%;background:var(--friend-accent);color:white}
#friendsView .friends-avatar-camera svg{width:14px;height:14px}
#friendsView #friendsAvatarStatus{font-size:12px;color:var(--friend-muted);text-align:center}
#friendsView #friendsAvatarStatus:empty{display:none}
