/* Account views: wrap long values without covering icons or copy actions. */
:root .device .profile-topbar,
:root.beike-legacy-webview .device .profile-topbar { height:auto; min-height:62px; padding-top:6px; padding-bottom:6px; box-sizing:border-box; }
:root .device .profile-topbar > div,
:root.beike-legacy-webview .device .profile-topbar > div { min-width:0; }
:root .device .profile-topbar strong,
:root.beike-legacy-webview .device .profile-topbar strong { white-space:normal; overflow:visible; line-height:1.3; overflow-wrap:break-word; }
:root .device .profile-identity-copy > strong,
:root.beike-legacy-webview .device .profile-identity-copy > strong { white-space:normal; overflow:visible; overflow-wrap:break-word; word-break:break-word; line-height:1.25; }
:root .device .profile-menu > button,
:root .device .profile-menu-line,
:root.beike-legacy-webview .device .profile-menu > button,
:root.beike-legacy-webview .device .profile-menu-line { box-sizing:border-box; min-width:0; height:auto; }
:root .device .profile-menu-copy,
:root.beike-legacy-webview .device .profile-menu-copy { min-width:0; flex:1 1 90px; line-height:1.4; overflow-wrap:break-word; }
:root .device .profile-menu-value,
:root.beike-legacy-webview .device .profile-menu-value { min-width:0; flex:0 1 48%; max-width:48%; white-space:normal; overflow:visible; overflow-wrap:break-word; word-break:break-word; line-height:1.4; }
:root .device .profile-menu-icon,
:root .device .profile-copy,
:root.beike-legacy-webview .device .profile-menu-icon,
:root.beike-legacy-webview .device .profile-copy { flex:none; }

/* Avatar controls and name editor: keep labels clear of icons and counters. */
:root .device .profile-photo-action,
:root.beike-legacy-webview .device .profile-photo-action { box-sizing:border-box; min-width:0; height:auto; min-height:72px; }
:root .device .profile-photo-action strong,
:root.beike-legacy-webview .device .profile-photo-action strong { min-width:0; line-height:1.4; overflow-wrap:break-word; }
:root .device .profile-name-field input,
:root.beike-legacy-webview .device .profile-name-field input { min-width:0; }
:root .device .profile-name-count,
:root.beike-legacy-webview .device .profile-name-count { flex:none; margin-left:8px; line-height:1.4; }
/* Chromium 81 does not implement aspect-ratio. Preserve square avatar targets. */
:root.beike-legacy-webview .device .profile-avatar-choice { box-sizing:border-box; width:100%; height:0; padding:0 0 calc(100% - 6px); }
:root.beike-legacy-webview .device .profile-avatar-choice img { position:absolute; top:0; left:0; width:100%; height:100%; object-fit:cover; border-radius:50%; }

/* Phone, email, password and PIN: the input can shrink beside its action. */
:root .device .profile-security-row > span:first-child,
:root .device .profile-flow-account,
:root .device .profile-flow-field,
:root.beike-legacy-webview .device .profile-security-row > span:first-child,
:root.beike-legacy-webview .device .profile-flow-account,
:root.beike-legacy-webview .device .profile-flow-field { min-width:0; }
:root .device .profile-security-row small,
:root .device .profile-flow-account strong,
:root .device .profile-flow-field small,
:root .device .wallet-pin-email-card strong,
:root.beike-legacy-webview .device .profile-security-row small,
:root.beike-legacy-webview .device .profile-flow-account strong,
:root.beike-legacy-webview .device .profile-flow-field small,
:root.beike-legacy-webview .device .wallet-pin-email-card strong { white-space:normal; overflow-wrap:break-word; word-break:break-word; line-height:1.5; }
:root .device .profile-flow-code-row input,
:root .device .profile-flow-input-wrap input,
:root .device .wallet-pin-code-row .wallet-pin-input,
:root.beike-legacy-webview .device .profile-flow-code-row input,
:root.beike-legacy-webview .device .profile-flow-input-wrap input,
:root.beike-legacy-webview .device .wallet-pin-code-row .wallet-pin-input { min-width:0; flex:1 1 0; }
:root .device .profile-flow-send,
:root .device .profile-flow-eye,
:root .device .wallet-pin-send-code,
:root.beike-legacy-webview .device .profile-flow-send,
:root.beike-legacy-webview .device .profile-flow-eye,
:root.beike-legacy-webview .device .wallet-pin-send-code { flex:none; min-height:44px; white-space:nowrap; }
:root.beike-no-flex-gap .device .wallet-pin-code-row .wallet-pin-send-code { margin-left:8px; }

/* VIP rules and membership retain tier art while long descriptions wrap. */
:root .device .profile-vip-benefit small,
:root .device .profile-vip-benefit strong,
:root.beike-legacy-webview .device .profile-vip-benefit small,
:root.beike-legacy-webview .device .profile-vip-benefit strong { max-width:100%; white-space:normal; overflow-wrap:break-word; line-height:1.35; }
:root .device .profile-vip-rules-header > div,
:root.beike-legacy-webview .device .profile-vip-rules-header > div { min-width:0; }
:root .device .profile-vip-rules-header h2,
:root.beike-legacy-webview .device .profile-vip-rules-header h2 { line-height:1.3; overflow-wrap:break-word; }
:root .device .profile-vip-rules-scroll,
:root.beike-legacy-webview .device .profile-vip-rules-scroll { flex:1 1 auto; min-height:0; overflow-y:auto; -webkit-overflow-scrolling:touch; }
:root .device .profile-vip-rules-table > div,
:root.beike-legacy-webview .device .profile-vip-rules-table > div { grid-template-columns:minmax(0,.7fr) minmax(0,.9fr) minmax(0,1.15fr) minmax(0,1fr); }
:root .device .profile-vip-rules-table > div > *,
:root.beike-legacy-webview .device .profile-vip-rules-table > div > * { min-width:0; white-space:normal; overflow-wrap:break-word; word-break:break-word; line-height:1.35; }

/* About, deletion and the dynamically generated sign-out confirmation. */
:root .device .profile-privacy-link,
:root.beike-legacy-webview .device .profile-privacy-link { box-sizing:border-box; height:auto; min-height:48px; padding-top:10px; padding-bottom:10px; line-height:1.4; }
:root .device .profile-live-delete-form textarea,
:root.beike-legacy-webview .device .profile-live-delete-form textarea { box-sizing:border-box; width:100%; max-width:100%; min-height:80px; line-height:1.45; }
:root .device .profile-live-delete-confirm,
:root.beike-legacy-webview .device .profile-live-delete-confirm { min-width:0; line-height:1.5; overflow-wrap:break-word; }
:root.beike-no-flex-gap .device .profile-live-delete-confirm input { margin-right:9px; }
:root .device .profile-live-signout-dialog .support-delete-card,
:root.beike-legacy-webview .device .profile-live-signout-dialog .support-delete-card { box-sizing:border-box; min-width:0; max-height:100%; overflow-y:auto; -webkit-overflow-scrolling:touch; }
:root .device .profile-live-signout-dialog .support-delete-actions button,
:root.beike-legacy-webview .device .profile-live-signout-dialog .support-delete-actions button { min-width:0; height:auto; min-height:44px; padding:9px; white-space:normal; line-height:1.35; }
:root.beike-no-flex-gap .device .profile-live-signout-dialog .support-delete-actions button + button { margin-left:8px; }

/* Authentication is outside the device frame. Grid minmax prevents long input rows from widening the viewport. */
:root .beike-auth-card { box-sizing:border-box; width:100%; max-width:420px; min-width:0; }
:root .beike-auth-form label,
:root .beike-auth-consent label { min-width:0; overflow-wrap:break-word; line-height:1.5; }
:root .beike-auth-code-row { grid-template-columns:minmax(0,1fr) auto; }
:root .beike-auth-code-row > label { min-width:0; }
:root .beike-auth-code-row input { box-sizing:border-box; min-width:0; max-width:100%; }
:root .beike-auth-code-send { min-height:44px; height:auto; white-space:nowrap; }
:root .beike-auth-error,
:root .beike-auth-footer { overflow-wrap:break-word; line-height:1.5; }
:root.beike-no-flex-gap .beike-auth-consent input { margin-right:10px; }

/* Keep short-screen confirmations scrollable without replacing keyboard or safe-area rules. */
:root .beike-photo-access { box-sizing:border-box; max-height:calc(100vh - 40px); max-height:calc(100dvh - 40px); overflow-y:auto; }
:root .beike-photo-access h2,
:root .beike-photo-access p { overflow-wrap:break-word; line-height:1.5; }
:root .photo-access-actions button { min-width:0; height:auto; min-height:46px; white-space:normal; }
:root .beike-privacy-header > h2 { min-width:0; line-height:1.3; overflow-wrap:break-word; }
:root .beike-privacy-close { flex:none; }
